Skip to content

geoprobe: consolidate geoprobe-agent metrics into package-level metrics #3432

@nikw9944

Description

@nikw9944

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:

  1. Both agents emit metrics with a consistent naming scheme (doublezero_geoprobe_*)
  2. Both agents include source and device_pubkey labels for disambiguation
  3. The old doublezero_device_geoprobe_agent_* metrics in geolocation_metrics.go can be removed

Tasks

  • Update geoprobe-agent main.go to create a geoprobe.NewMetrics(geoprobe.SourceGeoProbeAgent, devicePubkey) instance
  • Replace all references to metrics.GeoProbe* vars with the new Metrics struct fields
  • Add any metrics from geolocation_metrics.go that are not yet represented in the Metrics struct (e.g., offsets_received, offsets_rejected, parents_discovered, build_info)
  • Remove the old geolocation_metrics.go file once migration is complete
  • Update or add tests

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions