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 ¶
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.
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 WithErrorLogger ¶
func WithErrorLogger(logger ErrorLogger) Option
WithErrorLogger returns an Option that sets the logger for errors.
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 WithNamespace ¶
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 ¶
WithSubsystem returns an Option that sets the subsystem of metrics.