tlsprom

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package tlsprom provides Prometheus instrumentation for TLS configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

Metrics is a collection of TLS config metrics.

func NewMetrics

func NewMetrics(options ...Option) (*Metrics, error)

NewMetrics returns new Metrics with the given options.

func (*Metrics) Collect

func (m *Metrics) Collect(ch chan<- prometheus.Metric)

Collect sends each collected metric via the provided channel and returns once the last metric has been sent.

func (*Metrics) Describe

func (m *Metrics) Describe(ch chan<- *prometheus.Desc)

Describe sends the super-set of all possible descriptors of metrics to the provided channel and returns once the last descriptor has been sent.

func (*Metrics) Update

func (m *Metrics) Update(cfg *tls.Config, err error)

Update updates the metrics with the new TLS config or error.

type Option

type Option interface {
	// contains filtered or unexported methods
}

An Option applies optional configuration.

func WithClient

func WithClient() Option

WithClient returns an Option that sets the subsystem to "client" and the key usage to ClientAuth.

func WithGRPC

func WithGRPC() Option

WithGRPC returns an Option that sets the namespace to "grpc".

func WithHTTP

func WithHTTP() Option

WithHTTP returns an Option that sets the namespace to "http".

func WithKeyUsages

func WithKeyUsages(usages ...x509.ExtKeyUsage) Option

WithKeyUsages returns an Option that specifies the key usages for certificate verification.

func WithLogger added in v0.3.0

func WithLogger(log logr.Logger) Option

WithLogger returns an Option that sets the logger for errors.

func WithNamespace

func WithNamespace(namespace string) Option

WithNamespace returns an Option that sets the namespace of metrics.

func WithServer

func WithServer() Option

WithServer returns an Option that sets the subsystem to "server" and the key usage to ServerAuth.

func WithSubsystem

func WithSubsystem(subsystem string) Option

WithSubsystem returns an Option that sets the subsystem of metrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL