Skip to content

Commit

Permalink
use subsystem arg for consistent naming policy
Browse files Browse the repository at this point in the history
Signed-off-by: egmc <[email protected]>
  • Loading branch information
egmc committed Jan 11, 2024
1 parent 680cf81 commit 625cf11
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions systemd/resolved/resolved.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import (
"github.com/prometheus/client_golang/prometheus"
)

const namespace = "systemd_resolved"
const (
namespace = "systemd"
subsystem = "resolved"
)

type Collector struct {
ctx context.Context
Expand All @@ -31,47 +34,47 @@ type Collector struct {

var (
resolvedCurrentTransactions = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "current_transactions"),
prometheus.BuildFQName(namespace, subsystem, "current_transactions"),
"Resolved Current Transactions",
nil, nil,
)
resolvedTotalTransactions = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "transactions_total"),
prometheus.BuildFQName(namespace, subsystem, "transactions_total"),
"Resolved Total Transactions",
nil, nil,
)
resolvedCurrentCacheSize = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "current_cache_size"),
prometheus.BuildFQName(namespace, subsystem, "current_cache_size"),
"Resolved Current Cache Size",
nil, nil,
)
resolvedTotalCacheHits = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "cache_hits_total"),
prometheus.BuildFQName(namespace, subsystem, "cache_hits_total"),
"Resolved Total Cache Hits",
nil, nil,
)
resolvedTotalCacheMisses = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "cache_misses_total"),
prometheus.BuildFQName(namespace, subsystem, "cache_misses_total"),
"Resolved Total Cache Misses",
nil, nil,
)
resolvedTotalSecure = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "dnssec_secure_total"),
prometheus.BuildFQName(namespace, subsystem, "dnssec_secure_total"),
"Resolved Total number of DNSSEC Verdicts Secure",
nil, nil,
)
resolvedTotalInsecure = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "dnssec_insecure_total"),
prometheus.BuildFQName(namespace, subsystem, "dnssec_insecure_total"),
"Resolved Total number of DNSSEC Verdicts Insecure",
nil, nil,
)
resolvedTotalBogus = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "dnssec_bogus_total"),
prometheus.BuildFQName(namespace, subsystem, "dnssec_bogus_total"),
"Resolved Total number of DNSSEC Verdicts Boguss",
nil, nil,
)
resolvedTotalIndeterminate = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "dnssec_indeterminate_total"),
prometheus.BuildFQName(namespace, subsystem, "dnssec_indeterminate_total"),
"Resolved Total number of DNSSEC Verdicts Indeterminat",
nil, nil,
)
Expand Down

0 comments on commit 625cf11

Please sign in to comment.