|
2 | 2 |
|
3 | 3 | ## Per-track metrics (`moqx-track`) |
4 | 4 |
|
5 | | -`/metrics/track` requires a `namespace` parameter, so every namespace to be |
6 | | -graphed is a scrape target that relabelling turns into the query parameter. |
7 | | -Namespace values use the moq-transport encoded form — tuple elements joined by |
8 | | -`-`, other bytes as `.<hex>`: |
9 | | - |
10 | | - moq-test/interop -> moq.2dtest-interop |
11 | | - conf.example.com / room 1 -> conf.2eexample.2ecom-room.201 |
| 5 | +`/metrics/track` takes optional `service`, `namespace`, `track` and `limit` |
| 6 | +parameters; with none of them it reports every live track, so a single scrape |
| 7 | +covers the relay. |
12 | 8 |
|
13 | | -`limit` is a guard rather than a selector: a namespace holding more tracks than |
14 | | -the limit returns 400, so an over-wide scrape fails visibly instead of graphing |
15 | | -a series set that reshuffles between scrapes. Ceiling is |
16 | | -`admin.track_metrics_max_limit` (1000). |
| 9 | +`limit` is a guard rather than a selector: more live tracks than the limit |
| 10 | +returns 400, so an over-wide scrape fails visibly instead of graphing a series |
| 11 | +set that reshuffles between scrapes. Ceiling is |
| 12 | +`admin.track_metrics_endpoint_max_limit` (1000). |
17 | 13 |
|
18 | | -### Generating the target list |
19 | | - |
20 | | -The static list needs maintaining by hand. `/state.namespace_tree` already |
21 | | -enumerates live namespaces, so the intended replacement is a small generator |
22 | | -that walks the tree, encodes each namespace, and writes a `file_sd` target |
23 | | -file; Prometheus reloads target files without a restart. |
| 14 | +Past that ceiling the scrape splits by namespace prefix, one job per prefix, |
| 15 | +with `/state.namespace_tree` generating the target list into a `file_sd` file: |
24 | 16 |
|
25 | 17 | file_sd_configs: |
26 | 18 | - files: ['/etc/prometheus/targets/namespaces.json'] |
27 | 19 | refresh_interval: 30s |
28 | 20 |
|
29 | | -Namespaces churn as events start and end, and a relay may hold more than the |
30 | | -per-scrape ceiling, so this becomes necessary rather than convenient once the |
31 | | -relay carries production traffic. |
| 21 | +Label values use the moq-transport encoded form — tuple elements joined by |
| 22 | +`-`, other bytes as `.<hex>`: |
| 23 | + |
| 24 | + moq-test/interop -> moq.2dtest-interop |
| 25 | + conf.example.com / room 1 -> conf.2eexample.2ecom-room.201 |
| 26 | + |
| 27 | +Series exist only for live tracks: they disappear when a track ends and restart |
| 28 | +from zero if it returns, so counters need `increase()`/`rate()` rather than |
| 29 | +raw deltas across a track's lifetime. |
| 30 | + |
| 31 | +Counting is installed only when `admin.track_metrics_enabled` is true (default); |
| 32 | +with it false the endpoint returns 503. |
0 commit comments