Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package metrics contains global structures related to metrics collection cert-manager exposes the following metrics: certificate_expiration_timestamp_seconds{name, namespace} certificate_ready_status{name, namespace, condition}

Index

Constants

This section is empty.

Variables

View Source
var ACMEClientRequestCount = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "acme_client_request_count",
		Help:      "The number of requests made by the ACME client.",
		Subsystem: "http",
	},
	[]string{"scheme", "host", "path", "method", "status"},
)

ACMEClientRequestCount is a Prometheus summary to collect the number of requests made to each endpoint with the ACME client.

View Source
var ACMEClientRequestDurationSeconds = prometheus.NewSummaryVec(
	prometheus.SummaryOpts{
		Namespace:  namespace,
		Name:       "acme_client_request_duration_seconds",
		Help:       "The HTTP request latencies in seconds for the ACME client.",
		Subsystem:  "http",
		Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
	},
	[]string{"scheme", "host", "path", "method", "status"},
)

ACMEClientRequestDurationSeconds is a Prometheus summary to collect request times for the ACME client.

View Source
var CertificateExpiryTimeSeconds = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "certificate_expiration_timestamp_seconds",
		Help:      "The date after which the certificate expires. Expressed as a Unix Epoch Time.",
	},
	[]string{"name", "namespace"},
)
View Source
var CertificateReadyStatus = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "certificate_ready_status",
		Help:      "The ready status of the certificate.",
	},
	[]string{"name", "namespace", "condition"},
)
View Source
var ControllerSyncCallCount = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "controller_sync_call_count",
		Help:      "The number of sync() calls made by a controller.",
	},
	[]string{"controller"},
)
View Source
var Default = New(logf.NewContext(context.Background(), logf.Log.WithName("metrics")))

Default set of metrics

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	http.Server

	CertificateExpiryTimeSeconds     *prometheus.GaugeVec
	CertificateReadyStatus           *prometheus.GaugeVec
	ACMEClientRequestDurationSeconds *prometheus.SummaryVec
	ACMEClientRequestCount           *prometheus.CounterVec
	ControllerSyncCallCount          *prometheus.CounterVec
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context) *Metrics

func (*Metrics) IncrementSyncCallCount added in v0.9.0

func (m *Metrics) IncrementSyncCallCount(controllerName string)

func (*Metrics) SetActiveCertificates added in v0.9.0

func (m *Metrics) SetActiveCertificates(cl cmlisters.CertificateLister)

func (*Metrics) Start

func (m *Metrics) Start(stopCh <-chan struct{})

func (*Metrics) UpdateCertificateExpiry

func (m *Metrics) UpdateCertificateExpiry(crt *v1alpha2.Certificate, secretLister corelisters.SecretLister)

UpdateCertificateExpiry updates the expiry time of a certificate

func (*Metrics) UpdateCertificateStatus added in v0.9.0

func (m *Metrics) UpdateCertificateStatus(crt *v1alpha2.Certificate)

Jump to

Keyboard shortcuts

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