From ebc355a4656bab5aa08249a638e3c06fd48c1403 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Fri, 3 Jul 2026 19:10:56 +0100 Subject: [PATCH] feat(telemetry): tag traces with deployment tier at the collector Add a resource/tier processor so each collector stamps the deployment tier onto the signals it forwards, enabling a single Grafana stack to hold data from many collectors and filter by tier: - deployment.environment (upsert): the collector is authoritative for its environment (local/ci/test/prod). - xrpl.network.type (insert): the xrpld node already stamps its own chain, so the collector only fills this when absent, never overwriting a node's real network. Wired into the traces pipeline (the only pipeline on this branch); later phases extend it to metrics and logs as those pipelines appear. Co-Authored-By: Claude Opus 4.8 --- docker/telemetry/otel-collector-config.yaml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docker/telemetry/otel-collector-config.yaml b/docker/telemetry/otel-collector-config.yaml index 104f03dd7c..bb1b81e737 100644 --- a/docker/telemetry/otel-collector-config.yaml +++ b/docker/telemetry/otel-collector-config.yaml @@ -17,6 +17,25 @@ processors: batch: timeout: 1s send_batch_size: 100 + # Deployment-tier tagging. Each collector serves ONE environment and ONE + # network, so it stamps both onto every signal it forwards. This lets a + # single Grafana stack hold data from many collectors and filter by tier. + # - deployment.environment: the collector IS the environment (local, ci, + # test, prod), so it is authoritative -> upsert (overwrite). + # - xrpl.network.type: the xrpld node knows its own chain and already + # stamps this, so the collector only fills it when absent -> insert. + # This keeps a node's real network (e.g. a local node on mainnet) + # from being overwritten by a collector's default. + # Replace the placeholder values per collector; see docker/telemetry + # tier examples. + resource/tier: + attributes: + - key: deployment.environment + value: local + action: upsert + - key: xrpl.network.type + value: mainnet + action: insert exporters: debug: @@ -35,5 +54,5 @@ service: pipelines: traces: receivers: [otlp] - processors: [batch] + processors: [resource/tier, batch] exporters: [debug, otlp/tempo]