From 48747bab4cc085a5ef4df25b6682a20441278153 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Mon, 20 Jul 2026 17:49:44 +0100 Subject: [PATCH] ci(telemetry): recognize perf-iac identity labels in otel-naming Rule D xrpl_branch and xrpl_node_role are collector/infra-injected resource labels used by perf-iac dashboards to identify the build under test and its role in the perf cluster. They have no L1 span-attribute source or L6 native-metric-label source (like the existing job/instance/job_type builtins), so Rule D flagged them across every perf-iac dashboard. Register them in the builtins set, matching the existing pattern for infra-level dashboard labels. Add test coverage. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/scripts/otel-naming/check_otel_naming.py | 2 ++ .github/scripts/otel-naming/test_check_otel_naming.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.github/scripts/otel-naming/check_otel_naming.py b/.github/scripts/otel-naming/check_otel_naming.py index 41e8748075..a5ed07c0e4 100644 --- a/.github/scripts/otel-naming/check_otel_naming.py +++ b/.github/scripts/otel-naming/check_otel_naming.py @@ -822,6 +822,8 @@ def run_rule_d_dashboards( "service_instance_id", "job", "instance", + "xrpl_branch", # perf-iac identity label: git ref of the build under test + "xrpl_node_role", # perf-iac identity label: validator/peer role in the perf cluster } # A dashboard label is valid if it is a span attribute (L1), a native-metric # label (L6), or a Prometheus/Grafana builtin. diff --git a/.github/scripts/otel-naming/test_check_otel_naming.py b/.github/scripts/otel-naming/test_check_otel_naming.py index cf042b877b..e22c31c54e 100644 --- a/.github/scripts/otel-naming/test_check_otel_naming.py +++ b/.github/scripts/otel-naming/test_check_otel_naming.py @@ -744,6 +744,12 @@ class RuleDDashboards(unittest.TestCase): [], ) + def test_perf_iac_identity_labels_not_flagged(self): + self.assertEqual( + self._run('"expr": "sum by (xrpl_branch, xrpl_node_role) (x)"', set()), + [], + ) + 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__)`.