Skip to content

feat: add channel frequency labels to metrics#228

Merged
itsDNNS merged 1 commit intomainfrom
feat/227-channel-frequency-metrics
Mar 14, 2026
Merged

feat: add channel frequency labels to metrics#228
itsDNNS merged 1 commit intomainfrom
feat/227-channel-frequency-metrics

Conversation

@itsDNNS
Copy link
Owner

@itsDNNS itsDNNS commented Mar 14, 2026

Summary

  • add frequency labels to channel-level Prometheus metrics
  • normalize channel frequencies to a stable MHz label format where possible
  • extend Prometheus tests to cover downstream and upstream frequency labels

Problem

Issue #227 requests the actual channel frequency on the metrics endpoint so downstream analysis can correlate metrics without relying on channel_id alone.

Current metrics only expose channel_id, for example:
docsight_upstream_modulation{channel_id="2"} 64

Fix

All channel-level Prometheus metric families now emit a shared label set:

  • channel_id
  • frequency when the channel exposes one

Frequency values are normalized for label stability:

  • raw Hz-like values such as 30000000 become 30
  • values like 44 MHz become 44
  • non-numeric values fall back to the original text

Verification

  • pytest -q tests/test_prometheus.py
  • result: 54 passed

Closes #227.

@itsDNNS
Copy link
Owner Author

itsDNNS commented Mar 14, 2026

Note: frequency is emitted only when the channel exposes one. This keeps the metrics backward-compatible, but dashboards grouping by frequency should account for channels where that label may be absent.

@itsDNNS itsDNNS merged commit 48e2a85 into main Mar 14, 2026
2 checks passed
@itsDNNS itsDNNS deleted the feat/227-channel-frequency-metrics branch March 14, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add channel frequency of the channel id to the metrics endpoint

1 participant