metrics

package
v1.0.259 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CounterType   pkg.MetricType = "counter"
	GaugeType     pkg.MetricType = "gauge"
	HistogramType pkg.MetricType = "histogram"

	CustomGauges     map[string]*prometheus.GaugeVec
	CustomCounters   map[string]*prometheus.CounterVec
	CustomHistograms map[string]*prometheus.HistogramVec

	OpsCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "canary_check_count",
			Help: "The total number of checks",
		},
		[]string{"type", "endpoint", "canary_name", "canary_namespace", "owner", "severity", "key", "name"},
	)

	CanaryCheckInfo = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "canary_check_info",
			Help: "Information about the canary check",
		},
		[]string{"type", "endpoint", "canary_name", "canary_namespace", "owner", "severity", "key", "name"},
	)

	OpsSuccessCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "canary_check_success_count",
			Help: "The total number of successful checks",
		},
		[]string{"type", "endpoint", "canary_name", "canary_namespace", "owner", "severity", "key", "name"},
	)

	OpsFailedCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "canary_check_failed_count",
			Help: "The total number of failed checks",
		},
		[]string{"type", "endpoint", "canary_name", "canary_namespace", "owner", "severity", "key", "name"},
	)

	RequestLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "canary_check_duration",
			Help:    "A histogram of the response latency in milliseconds.",
			Buckets: []float64{5, 10, 25, 50, 200, 500, 1000, 3000, 10000, 30000},
		},
		[]string{"type", "endpoint", "canary_name", "canary_namespace", "owner", "severity", "key", "name"},
	)

	Gauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "canary_check",
			Help: "A gauge representing the canaries success (0) or failure (1)",
		},
		[]string{"key", "type", "canary_name", "canary_namespace", "name"},
	)

	GenericGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "canary_check_gauge",
			Help: "A gauge representing duration",
		},
		[]string{"type", "canary_name", "metric", "canary_namespace", "owner", "severity", "key", "name"},
	)

	GenericCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "canary_check_counter",
			Help: "A gauge representing counters",
		},
		[]string{"type", "canary_name", "metric", "value", "canary_namespace", "owner", "severity", "key", "name"},
	)

	GenericHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "canary_check_histogram",
			Help:    "A histogram representing durations",
			Buckets: []float64{5, 10, 25, 50, 200, 500, 1000, 2500, 5000, 10000, 20000},
		},
		[]string{"type", "canary_name", "metric", "canary_namespace", "owner", "severity", "key", "name"},
	)
)

Functions

func FillLatencies added in v0.37.0

func FillLatencies(checkKey string, duration string, latency *types.Latency) error

func FillUptime added in v0.37.0

func FillUptime(checkKey, duration string, uptime *types.Uptime) error

func GetMetrics added in v0.11.4

func GetMetrics(key string) (uptime types.Uptime, latency types.Latency)

func Record

func Record(ctx context.Context, canary v1.Canary, result *pkg.CheckResult) (_uptime types.Uptime, _latency types.Latency)

func RemoveCheck added in v0.11.4

func RemoveCheck(checks v1.Canary)

func RemoveCheckByKey added in v0.38.11

func RemoveCheckByKey(key string)

func UnregisterGauge added in v0.38.168

func UnregisterGauge(ctx context.Context, checkIDs []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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