mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
dd4d4a8a96
* Refactor UnitHook to block the scan if finished metrics aren't handled * Log once when back-pressure is detected * Add hook channel size metric * Use plural "metrics" for consistency * Replace LRU cache with map
24 lines
736 B
Go
24 lines
736 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)
|
|
|
|
hooksChannelSize = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
Namespace: common.MetricsNamespace,
|
|
Subsystem: common.MetricsSubsystem,
|
|
Name: "hooks_channel_size",
|
|
Help: "Total number of metrics waiting in the finished channel.",
|
|
}, nil)
|
|
)
|