Skip to content

Commit

Permalink
Move metrics to separate file and reduce buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina committed Jan 20, 2024
1 parent f1e5d03 commit 2bdb11e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
14 changes: 0 additions & 14 deletions pkg/sources/job_progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ import (
"fmt"
"sync"
"time"

"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, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000},
}, nil)
)

type JobProgressHook interface {
Expand Down
17 changes: 17 additions & 0 deletions pkg/sources/metrics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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)
)

0 comments on commit 2bdb11e

Please sign in to comment.