tlsprom

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: MIT Imports: 5 Imported by: 0

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 ErrorLogger

type ErrorLogger interface {
	Errorf(format string, args ...interface{})
}

An ErrorLogger logs errors.

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 added in v0.0.2

func WithClient() Option

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

func WithErrorLogger

func WithErrorLogger(logger ErrorLogger) Option

WithErrorLogger returns an Option that sets the logger for errors.

func WithGRPC added in v0.0.2

func WithGRPC() Option

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

func WithHTTP added in v0.0.2

func WithHTTP() Option

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

func WithKeyUsages added in v0.0.2

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

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

func WithNamespace added in v0.0.2

func WithNamespace(namespace string) Option

WithNamespace returns an Option that sets the namespace of metrics.

func WithServer added in v0.0.2

func WithServer() Option

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

func WithSubsystem added in v0.0.2

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