Files
trufflehog/pkg/sources/gitlab/metrics.go
Cody Rose b745cfd495 Enrich Gitlab enumeration logging (#2678)
This PR modifies the GitLab source:

* emits a new "groups enumerated" metric
* logs more information about group enumeration
* emits the repo enumeration metric inside getAllProjectRepos, which means it will work when units are flipped on
* emits the repo enumeration metric more granularly
2024-04-08 10:47:05 -04:00

35 lines
1.0 KiB
Go

package gitlab
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
)
var (
gitlabGroupsEnumerated = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: common.MetricsNamespace,
Subsystem: common.MetricsSubsystem,
Name: "gitlab_groups_enumerated",
Help: "Total number of GitLab groups enumerated.",
},
[]string{"source_name"})
gitlabReposEnumerated = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: common.MetricsNamespace,
Subsystem: common.MetricsSubsystem,
Name: "gitlab_repos_enumerated",
Help: "Total number of Gitlab repositories enumerated.",
},
[]string{"source_name"})
gitlabReposScanned = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: common.MetricsNamespace,
Subsystem: common.MetricsSubsystem,
Name: "gitlab_repos_scanned",
Help: "Total number of Gitlab repositories scanned.",
},
[]string{"source_name"})
)