mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-24 23:50:22 +00:00
Add check_otel_naming.py and wire it into on-pr.yml so every PR validates that span-attribute names stay consistent across the code, collector, Tempo, dashboards, and docs. - The valid key set is derived dynamically from the *SpanNames.h constants and the resource attributes the code registers in Telemetry.cpp — no hardcoded allowlist to drift. - Each rule is presence-gated: it runs only when the file it needs is in the tree, so the check is correct whether telemetry changes land in one PR or several (the collector/Tempo/dashboard/runbook layers arrive in later phases). - Rule A flags dotted span-attribute keys; Rule F flags string-literal attribute keys and span-name arguments (values may be runtime data). - stdlib-only, mirroring the levelization check (bare `python`, no pip step). - Telemetry.h / SpanGuard.h @code examples now use *SpanNames.h constants so the strict literal check passes. - CONTRIBUTING.md documents the check and how to run it locally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
1020 B
YAML
29 lines
1020 B
YAML
# This workflow checks that OpenTelemetry span-attribute names stay consistent
|
|
# across the code (*SpanNames.h), collector, Tempo, dashboards, and docs.
|
|
# See .github/scripts/otel-naming/check_otel_naming.py and the
|
|
# "Telemetry span attribute naming" section in CONTRIBUTING.md.
|
|
name: Check OTel naming
|
|
|
|
# This workflow can only be triggered by other workflows.
|
|
on: workflow_call
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-otel-naming
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
otel-naming:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
- name: Check OTel naming
|
|
# The script is stdlib-only and reads only files already in the tree;
|
|
# it enforces each rule only when the layer it needs is present, so it
|
|
# works whether telemetry changes land in one PR or several.
|
|
run: python .github/scripts/otel-naming/check_otel_naming.py
|