Skip to content

traffic dashboard: serve interface-traffic panels from gNMI end-to-end, stop using the InfluxDB fact table #700

Description

@thijsvanemmerik

Problem

The traffic dashboard panels (data.doublezero.xyz) still depend on InfluxDB. On lower / zoomed-in timeframes (sub-5-minute buckets) they query the InfluxDB-derived fact_dz_device_interface_counters, which trails real time by ~1 hour, so those views show a trailing ~1h empty gap on every device. Now that every device emits gNMI, the panels should be served from gNMI end to end and stop using InfluxDB.

Evidence

Freshness by table (mainnet-beta, 2026-07-18):

Table Fed by Lag
telemetry_<env>.interface_state (raw gNMI) gNMI tunnel ~0 min (real-time)
device_interface_rollup_5m gNMI (interface_state) ~3 min
fact_dz_device_interface_counters InfluxDB-derived ~64 min
  • Panel routing in api/handlers/traffic_dashboard.go (isRawBucket / trafficTimeFilter): sub-5m buckets use the raw InfluxDB fact table; >= 5m buckets use the gNMI rollup. So zoomed views fall onto InfluxDB and inherit its ~1h lag.
  • gNMI coverage is complete: 97/97 current mainnet devices present in interface_state (24h), and zero current devices are InfluxDB-only (checked dz_devices_current against both sources). The InfluxDB fallback is no longer exercised.

What to do

  1. Sub-5m / raw traffic path: read the gNMI interface_state table (real-time, ~30s samples, finer than 5m) with on-the-fly per-sample deltas, mirroring ComputeDeviceInterfaceRollupFromGNMI in indexer/pkg/rollup/activities.go, instead of fact_dz_device_interface_counters.
  2. Rollup path: the gNMI-over-InfluxDB coalesce (coalesceDeviceInterfaceBuckets) already prefers gNMI; drop the InfluxDB fallback (or leave it inert) once coverage is confirmed.
  3. Remove InfluxDB from the traffic panel query path entirely, so every zoom level is real-time gNMI.
  4. Guard: before removing the fallback, add/confirm a check that every activated device has gNMI coverage (per-device coverage check, infra #1464), so a future gNMI-less device is caught rather than silently blank.

Scope note

fact_dz_device_interface_counters (InfluxDB-derived) has other consumers beyond these panels (traffic / topology / incidents / users handlers). This issue scopes to the traffic panels being served from gNMI. Migrating the remaining consumers and fully decommissioning the InfluxDB ingestion + backfill is a larger follow-up worth tracking separately.

Outcome

All interface-traffic panels served from gNMI (interface_state for sub-5m, device_interface_rollup_5m for >= 5m), real-time at every zoom level, with no InfluxDB in the panel path.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions