metrics

package
v2.0.0-...-f3fe0fa Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SidecarSyncErrors is incremented each time any part of the sidecar sync loop fails.
	SidecarSyncErrors = prometheus.NewCounter(prometheus.CounterOpts{
		Name: metricName("sidecar_sync_errors"),
		Help: "errors while any stage of sidecar sync mode",
	})
	// SidecarVaultTokenErrors is incremented each time the sidecar sync loop either fails to
	// find a vault token, or there is an error validating it.
	SidecarVaultTokenErrors = prometheus.NewCounter(prometheus.CounterOpts{
		Name: metricName("sidecar_vault_token_errors"),
		Help: "errors while fetching and validating vault token stage of sidecar sync",
	})
	// SidecarSecretErrors is incremented each time the sidecar sync loop fails to sync any of
	// its secrets (i.e. secret, aws, ssh, etc...).
	SidecarSecretErrors = prometheus.NewCounter(prometheus.CounterOpts{
		Name: metricName("sidecar_secret_errors"),
		Help: "errors while renewing secrets",
	})
)

Functions

func MetricsHandler

func MetricsHandler(addr string, term chan os.Signal)

MetricsHandler instruments a prometheus metrics handler on "/metrics" and begins listening on the specified address.

Types

type MetricName

type MetricName string
const BriefcaseReset MetricName = "BriefcaseReset"
const SecretUpdates MetricName = "SecretUpdates"
const VaultTokenRefreshed MetricName = "VaultTokenRefreshed"
const VaultTokenWritten MetricName = "VaultTokenWritten"

type Metrics

type Metrics struct {
	SidecarSyncErrors       prometheus.Counter
	SidecarVaultTokenErrors prometheus.Counter
	SidecarSecretErrors     prometheus.Counter
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics() *Metrics

NewMetrics constructs a new metrics object.

func (*Metrics) Counter

func (m *Metrics) Counter(name MetricName) int

func (*Metrics) Decrement

func (m *Metrics) Decrement(name MetricName)

func (*Metrics) Increment

func (m *Metrics) Increment(name MetricName)

func (*Metrics) IncrementBy

func (m *Metrics) IncrementBy(name MetricName, val int)

Jump to

Keyboard shortcuts

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