Skip to content

Commit 4188b91

Browse files
nikw9944claude
andcommitted
telemetry: rename device_pubkey label to geoprobe_pubkey
The constant label identifies the geoprobe device, not a generic device. Rename for clarity and fix gofmt alignment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9831f4c commit 4188b91

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

controlplane/telemetry/internal/geoprobe/metrics.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ const (
2323
MetricNameIcmpMeasurementCycleDuration = "doublezero_geoprobe_icmp_measurement_cycle_duration_seconds"
2424

2525
// Labels.
26-
LabelSource = "source"
27-
LabelDevicePubkey = "device_pubkey"
28-
LabelVersion = "version"
29-
LabelCommit = "commit"
30-
LabelDate = "date"
31-
LabelErrorType = "error_type"
32-
LabelReason = "reason"
26+
LabelSource = "source"
27+
LabelGeoProbePubkey = "geoprobe_pubkey"
28+
LabelVersion = "version"
29+
LabelCommit = "commit"
30+
LabelDate = "date"
31+
LabelErrorType = "error_type"
32+
LabelReason = "reason"
3333

3434
// Error types.
3535
ErrorTypeMeasurementCycle = "measurement_cycle"
@@ -70,11 +70,11 @@ type Metrics struct {
7070
}
7171

7272
// NewMetrics creates and registers all geoprobe Prometheus collectors.
73-
// The source and devicePubkey values are applied as constant labels on every metric.
74-
func NewMetrics(source, devicePubkey string, reg prometheus.Registerer) *Metrics {
73+
// The source and geoProbePubkey values are applied as constant labels on every metric.
74+
func NewMetrics(source, geoProbePubkey string, reg prometheus.Registerer) *Metrics {
7575
constLabels := prometheus.Labels{
76-
LabelSource: source,
77-
LabelDevicePubkey: devicePubkey,
76+
LabelSource: source,
77+
LabelGeoProbePubkey: geoProbePubkey,
7878
}
7979

8080
m := &Metrics{

controlplane/telemetry/internal/geoprobe/metrics_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestNewMetrics_ConstantLabels(t *testing.T) {
6767
found = true
6868
metric := mf.GetMetric()[0]
6969
assertLabel(t, metric, LabelSource, SourceGeoProbeAgent)
70-
assertLabel(t, metric, LabelDevicePubkey, "DevPK456")
70+
assertLabel(t, metric, LabelGeoProbePubkey, "DevPK456")
7171
assertLabel(t, metric, LabelErrorType, ErrorTypeMeasurementCycle)
7272
}
7373
}

0 commit comments

Comments
 (0)