trufflehog/pkg/sources/metrics.go
Miccah 2d96b89554
Add prometheus metrics to measure hook execution time (#2312)
* Add prometheus metrics to measure hook execution time

* Move metrics to separate file and reduce buckets
2024-01-22 11:47:45 -08:00

17 lines
479 B
Go

package sources
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
)
var (
hooksExecTime = promauto.NewHistogramVec(prometheus.HistogramOpts{
Namespace: common.MetricsNamespace,
Subsystem: common.MetricsSubsystem,
Name: "hooks_exec_time_ms",
Help: "Time spent executing hooks (ms)",
Buckets: []float64{5, 50, 500, 1000},
}, nil)
)