package
0.0.0-20240926082949-8d5c7bc77ec5
Repository: https://github.com/openshift/configuration-anomaly-detection.git
Documentation: pkg.go.dev

# README

Metrics

This package provides metric instrumentation.

You can test metrics locally by spawning a aggregation pushgateway container and pushing metrics there.

# Spawn local gateway
podman run --name cad-pushgw -e PAG_APILISTEN=:9091 -e PAG_LIFECYCLELISTEN=:9092 -p 9091:9091 -p 9092:9092 -d ghcr.io/zapier/prom-aggregation-gateway:v0.7.0
# Verify you can reach the gateway (expect empty answer until you pushed metrics)
curl http://localhost:9091/metrics 
# Point cad to the gateway
export CAD_PROMETHEUS_PUSHGATEWAY="localhost:9091"
# Run cad locally (it is not relevant for cad to succeed to test the metrics)
./cadctl investigate --payload-path payload.json
# Verify your metrics got pushed and are available on the gateway
curl http://localhost:9091/metrics

# Functions

Inc takes a counterVec and a set of label values and increases by one.
Push collects and pushes metrics to the configured pushgateway.

# Variables

Alerts is a metric counting all alerts CAD received.
LimitedSupportSet is a counter for limited support reasons set by cad.
ServicelogPrepared is a counter for investigation ending in a prepared servicelog.
ServicelogSent is a counter for investigation ending in a sent servicelog.