Summary
The standalone geoprobe-agent binary (controlplane/telemetry/cmd/geoprobe-agent/main.go) instruments Prometheus metrics directly in its main.go, using package-level vars from controlplane/telemetry/internal/metrics/geolocation_metrics.go with the doublezero_device_geoprobe_agent_* prefix.
Issue #2942 added a new Metrics struct at the geoprobe package level (controlplane/telemetry/internal/geoprobe/metrics.go) with source and device_pubkey constant labels, using the doublezero_geoprobe_* prefix. This struct is used by the telemetry agent's embedded geoprobe coordinator and discovery.
The standalone geoprobe-agent should be migrated to use the same package-level Metrics struct (with source=geoprobe-agent), so that:
- Both agents emit metrics with a consistent naming scheme (
doublezero_geoprobe_*)
- Both agents include
source and device_pubkey labels for disambiguation
- The old
doublezero_device_geoprobe_agent_* metrics in geolocation_metrics.go can be removed
Tasks
Context
Summary
The standalone
geoprobe-agentbinary (controlplane/telemetry/cmd/geoprobe-agent/main.go) instruments Prometheus metrics directly in itsmain.go, using package-level vars fromcontrolplane/telemetry/internal/metrics/geolocation_metrics.gowith thedoublezero_device_geoprobe_agent_*prefix.Issue #2942 added a new
Metricsstruct at the geoprobe package level (controlplane/telemetry/internal/geoprobe/metrics.go) withsourceanddevice_pubkeyconstant labels, using thedoublezero_geoprobe_*prefix. This struct is used by the telemetry agent's embedded geoprobe coordinator and discovery.The standalone
geoprobe-agentshould be migrated to use the same package-levelMetricsstruct (withsource=geoprobe-agent), so that:doublezero_geoprobe_*)sourceanddevice_pubkeylabels for disambiguationdoublezero_device_geoprobe_agent_*metrics ingeolocation_metrics.gocan be removedTasks
geoprobe-agentmain.goto create ageoprobe.NewMetrics(geoprobe.SourceGeoProbeAgent, devicePubkey)instancemetrics.GeoProbe*vars with the newMetricsstruct fieldsgeolocation_metrics.gothat are not yet represented in theMetricsstruct (e.g.,offsets_received,offsets_rejected,parents_discovered,build_info)geolocation_metrics.gofile once migration is completeContext