garm/metrics/github.go
Mario Constanti b36b5137b6 feat: count github api calls
introduce metrics counter for github api calls

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
2024-02-21 14:22:45 +01:00

19 lines
637 B
Go

package metrics
import "github.com/prometheus/client_golang/prometheus"
var (
GithubOperationCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: metricsNamespace,
Subsystem: metricsGithubSubsystem,
Name: "operation_total",
Help: "Total number of github operation attempts",
}, []string{"operation", "scope"})
GithubOperationFailedCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: metricsNamespace,
Subsystem: metricsGithubSubsystem,
Name: "operation_failed_total",
Help: "Total number of failed github operation attempts",
}, []string{"operation", "scope"})
)