Merge branch 'pratik/otel-phase5-docs-deployment' into pratik/otel-phase6-statsd

Forward-merge the Rule D __name__ builtin fix (and prior naming-check work).
This commit is contained in:
Pratik Mankawde
2026-06-11 18:34:48 +01:00
2 changed files with 9 additions and 0 deletions

View File

@@ -699,6 +699,7 @@ def run_rule_d_dashboards(root: Path, l1_keys: Set[str], report: Report) -> None
report.skip("D", "no L1 key set to validate against")
return
builtins = {
"__name__", # Prometheus reserved label for the metric name itself
"le",
"exported_instance",
"span_name",

View File

@@ -502,6 +502,14 @@ class RuleDDashboards(unittest.TestCase):
[],
)
def test_prometheus_name_label_not_flagged(self):
# `__name__` is the Prometheus reserved metric-name label; the renamed
# system-*.json dashboards use `sum by (le, __name__)`.
self.assertEqual(
self._run('"expr": "sum by (le, __name__) (rate(x[5m]))"', set()),
[],
)
def test_l1_label_passes(self):
self.assertEqual(self._run('"q": "{command=\\"x\\"}"', {"command"}), [])