Skip to content

Draft: wire dashboard to per-track metrics (#533) - #539

Draft
gmarzot wants to merge 3 commits into
mainfrom
feature/track-metrics-533
Draft

Draft: wire dashboard to per-track metrics (#533)#539
gmarzot wants to merge 3 commits into
mainfrom
feature/track-metrics-533

Conversation

@gmarzot

@gmarzot gmarzot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Blocked on #533. Prepared so the dashboard can move onto real per-track data as soon as it lands.

In this branch: a moqx-track scrape job. Every query parameter on /metrics/track is optional, so a single target covers all namespaces; limit is set to the 1000 ceiling.

To follow once #533 merges, replacing placeholders in the tracks table:

column source
Subs moqx_track_subscribers
Peak max_over_time(moqx_track_subscribers[$__range])
Bitrate rate(moqx_track_bytes_received_total[1m]) * 8
Data Tx moqx_track_bytes_sent_total
Status time() - moqx_track_last_object_timestamp_seconds

This also retires the /state json-exporter path for per-track data, whose entries are transient and undercount under load (#501).

Type/Codec/Resolution/FPS stay : they are catalog attributes, not metrics.

Notes carried from #533's shape

  • Series exist only for live tracks and restart from zero if a track returns, so counters want rate()/increase() rather than deltas across a lifetime.
  • Label values are encoded (moq-test/interop -> moq.2dtest-interop), so tables show the encoded form unless decoded for display.
  • Past 1000 live tracks the scrape must split by namespace prefix; /state.namespace_tree can generate that target list into a file_sd file. Noted in docker/prometheus/README.md.
  • Untested: the endpoint does not exist yet.

This change is Reviewable

Namespace is a required parameter and there is no enumeration endpoint, so
namespaces are targets relabelled into the query. The static list should be
generated from /state.namespace_tree into a file_sd file; noted in the README.

Needs #533.
@gmarzot gmarzot self-assigned this Aug 3, 2026
gmarzot added 2 commits August 9, 2026 09:52
Rework of #533 made every query parameter optional, so one
target covers all namespaces instead of a per-namespace list. Namespace
splitting is only needed past the endpoint's limit ceiling; noted in the
README along with the label encoding and the live-tracks-only lifetime.
/metrics/track takes one namespace per request and rejects a match wider
than its limit, so an unscoped scrape fails once the relay's total track
count passes the limit and takes every namespace with it. Scoping per
namespace keeps working until a single namespace passes it.

Namespaces change as events start and end, so ns-targets walks the relay's
namespace tree and writes the file_sd target list; Prometheus rereads it
without a restart. Encoding matches the endpoint's safe form.
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.

1 participant