metrics

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package metrics defines the Prometheus metrics in use.

Index

Constants

This section is empty.

Variables

View Source
var (

	// SpecWatchCount counts the number of specs being watched.
	SpecWatchCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "watched_total",
			Help:      "Number of specs being watched",
		},
		[]string{"spec_path", "svcmgr", "action", "ca"},
	)

	// SpecRefreshCount counts the number of PKI regeneration taken by a spec
	SpecRefreshCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "refresh_count",
			Help:      "Number of times a spec has determined PKI must be refreshed",
		},
		[]string{"spec_path"},
	)

	// SpecCheckCount counts the number of PKI regeneration taken by a spec
	SpecCheckCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "check_count",
			Help:      "Number of times a spec PKI was checked",
		},
		[]string{"spec_path"},
	)

	// SpecLoadCount counts the number of times a spec was loaded from disk
	SpecLoadCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "load_count",
			Help:      "Number of times a spec was loaded from disk",
		},
		[]string{"spec_path"},
	)

	// SpecLoadFailureCount counts the number of times a spec couldn't be loaded from disk
	SpecLoadFailureCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "load_failure_count",
			Help:      "Number of times a spec was loaded from disk but failed to be parsed",
		},
		[]string{"spec_path"},
	)
	// SpecExpires contains the time of the next certificate
	// expiry.
	SpecExpires = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "expire_timestamp",
			Help:      "The unix time for when the given spec and PKI type expires",
		},
		[]string{"spec_path", "type"},
	)

	// SpecExpiresBeforeThreshold exports how much lead time we give for trying to renew a cert
	// before it expires.
	SpecExpiresBeforeThreshold = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "expire_before_duration_seconds",
			Help:      "When a spec is within this number of seconds of an expiry, renewal begins",
		},
		[]string{"spec_path"},
	)

	// SpecWriteCount contains the number of times the PKI on disk was written
	SpecWriteCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "write_count",
			Help:      "The number of times PKI on disk has been rewritten",
		},
		[]string{"spec_path"},
	)

	// SpecWriteFailureCount contains the number of times the PKI on disk failed to be written
	SpecWriteFailureCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "write_failure_count",
			Help:      "The number of times PKI on disk failed to be rewritten",
		},
		[]string{"spec_path"},
	)

	// SpecRequestFailureCount counts the number of times a spec failed to request a certificate from upstream.
	SpecRequestFailureCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Subsystem: "spec",
			Name:      "request_failure_count",
			Help:      "Number of failed requests to CA authority for new PKI material",
		},
		[]string{"spec_path"},
	)

	// ManagerInterval is set to the interval at which a cert manager wakes up and does its checks
	ManagerInterval = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: metricsNamespace,
			Name:      "manager_interval_seconds",
			Help:      "the time interval that manager wakes up and does checks",
		},
		[]string{"directory"},
	)

	// ActionAttemptedCount counts actions taken by a spec
	ActionAttemptedCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: metricsNamespace,
			Name:      "action_attempted_count",
			Help:      "Number of times a spec has taken action",
		},
		[]string{"spec_path", "change_type"},
	)

	// ActionFailedCount counts failed actions taken by a spec
	ActionFailedCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: metricsNamespace,
			Name:      "action_failed_count",
			Help:      "Number of failed action runs for a spec",
		},
		[]string{"spec_path", "change_type"},
	)
)

Functions

func Start

func Start(addr, port string)

Start initialises the Prometheus endpoint if metrics have been configured.

Types

This section is empty.

Jump to

Keyboard shortcuts

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