Skip to content

per-track metrics: scrape stack, relay-visible dashboard, public variant - #539

Open
gmarzot wants to merge 4 commits into
mainfrom
feature/track-metrics-533
Open

per-track metrics: scrape stack, relay-visible dashboard, public variant#539
gmarzot wants to merge 4 commits into
mainfrom
feature/track-metrics-533

Conversation

@gmarzot

@gmarzot gmarzot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Wires the dashboard to the per-track series from #533.

  • Scrape stack: ns-targets sidecar generates one file_sd target per live namespace (/metrics/track takes one namespace per request); scrapes pass omit_metadata; json-exporter's /state per-track series retired; track_metrics_enabled on in the docker config.
  • Overview dashboard: catalog-owned columns removed (no content peeking). Namespace/track selectors scope the tracks table and chart. Real per-track bitrate/data-tx, status pills from last-object age (LIVE/IDLE/DONE), CDN-efficiency gauge, relay uptime from /info. Fetches/latency/drops/cache-hit columns are placeholders for per-track verb counters (subscribes, fetches) #593fetch cache hit/miss counters #596; QoS reports NORMAL until those land.
  • Public variant (moqx-public): public dashboards can't interpolate template variables, so the public view is a separate variable-free dashboard — top-20 tracks grouped per namespace via nested tables.
  • Fix: dashboard export archives moved out of the provisioning tree (duplicate uids silently lock the provisioner out of all DB writes).

This change is Reviewable

@gmarzot gmarzot self-assigned this Aug 3, 2026
@gmarzot
gmarzot marked this pull request as ready for review August 10, 2026 15:31
@gmarzot
gmarzot force-pushed the feature/track-metrics-533 branch from 12e0746 to 284a044 Compare August 10, 2026 15:31
@gmarzot
gmarzot requested a review from afrind August 10, 2026 15:32
@gmarzot gmarzot changed the title Draft: wire dashboard to per-track metrics (#533) wire dashboard to per-track metrics (#533) Aug 10, 2026
@gmarzot

gmarzot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

waiting got PR#533 to merge

@afrind afrind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afrind reviewed 7 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on gmarzot).


docker/config.docker.yaml line 62 at r1 (raw file):

admin:
  port: ${MOQX_ADMIN_PORT}
  track_metrics_enabled: true

Does this impact perf test?


docker/prometheus/namespace-targets.py line 71 at r1 (raw file):

def write(path, entries):
    payload = [
        {"targets": [safe_namespace(ns)], "labels": {"moqx_namespace": "/".join(ns)}}

joining on / ? the endpoint assumes - (and -- to demarcate track name)


docker/prometheus/prometheus.yml line 76 at r1 (raw file):

        replacement: json-exporter:7979

  # Per-track counters from the relay (openmoq/moqx#533). One namespace per

Don't know that referring to pr numbers is useful long term docs

@gmarzot
gmarzot force-pushed the feature/track-metrics-533 branch from 37ec9ab to d4dad93 Compare August 14, 2026 14:29

@afrind afrind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afrind reviewed 6 files and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on gmarzot).

@gmarzot

gmarzot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

docker/config.docker.yaml line 62 at r1 (raw file):

Previously, afrind wrote…

Does this impact perf test?

no.. different harness

@gmarzot

gmarzot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

docker/prometheus/namespace-targets.py line 71 at r1 (raw file):

Previously, afrind wrote…

joining on / ? the endpoint assumes - (and -- to demarcate track name)

for display only .. real safenames will be used where required

@gmarzot gmarzot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmarzot reviewed 8 files and all commit messages, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on gmarzot).

@gmarzot
gmarzot force-pushed the feature/track-metrics-533 branch from 1f62fcc to 87a1f71 Compare August 19, 2026 22:48
@gmarzot gmarzot changed the title wire dashboard to per-track metrics (#533) per-track metrics: scrape stack, relay-visible dashboard, public variant Aug 20, 2026
@gmarzot
gmarzot force-pushed the feature/track-metrics-533 branch from 4945617 to e82cba9 Compare August 20, 2026 00:53
/metrics/track takes one namespace per request, so an ns-targets sidecar
walks the relay's namespace tree and writes one file_sd target per live
namespace. Scrapes pass omit_metadata (HELP/TYPE lines are static; older
relays ignore the param). json-exporter drops its /state per-track series
in favor of the relay's own. track_metrics_enabled goes on in the docker
config.
The relay must not peek at publisher content: catalog columns (type, codec,
resolution, fps, QoE) are gone. Tracks scope to a namespace selector (a
relay carries too many to list), with an optional track filter; namespace
rows link into the scoped view. Real columns from the track counters:
bitrate, data-tx (per track and per namespace), status pills from
last-object age (LIVE/IDLE/DONE — a silent track with subscribers is IDLE;
DONE means it left the relay). Placeholders (fetches, latency, drops,
cache-hit) await the per-track QoS counters; QoS reports NORMAL until a
real heuristic exists. CDN efficiency gauge = 1 - ingress/egress payload
rates. Banner uptime comes from the relay's /info instead of host boot
time. Pill colors key off the displayed text (Grafana pill cells look up
mappings by display value).
Public dashboards do not interpolate template variables, so the
interactive overview cannot be published. The public variant shows a
global top-20 tracks table grouped per namespace (nested tables — no
variables needed) and a top-10 chart with namespace/track legends.

The public viewer also never runs the frontend prometheus datasource, so
format=table never happens there: the tables build their columns with
labelsToFields + merge transformations instead of joinByField, and the
chart names series via a displayName field default.
Archived copies keep the live uid; the provisioner loads *.json
recursively and duplicate uids lock it out of all database writes.
@gmarzot
gmarzot force-pushed the feature/track-metrics-533 branch from e82cba9 to aac894d Compare August 20, 2026 01:19
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.

2 participants