diff --git a/docker/telemetry/alloy/config.alloy b/docker/telemetry/alloy/config.alloy index feb5dd33fe..f56a947426 100644 --- a/docker/telemetry/alloy/config.alloy +++ b/docker/telemetry/alloy/config.alloy @@ -151,15 +151,6 @@ otelcol.processor.transform "tier" { `delete_key(attributes, "telemetry.sdk.language")`, `delete_key(attributes, "telemetry.sdk.name")`, `delete_key(attributes, "telemetry.sdk.version")`, - // Grouped legend labels must be built here too, not only in - // metric_statements: span-derived RED metrics (span_calls_total, - // span_duration_*) are produced by the spanmetrics connector from these - // TRACES and go straight to the batch processor, bypassing the metric - // resource statements. Building the labels on the span resource keeps - // span-based dashboard panels' legends consistent with native metrics. - `set(attributes["resource_group"], Concat(["[", attributes["service.instance.id"], "]"], "")) where attributes["service.instance.id"] != nil and attributes["service.instance.id"] != ""`, - `set(attributes["resource_group"], Concat(["[", attributes["service.instance.id"], ", ", attributes["xrpl.network.type"], "]"], "")) where attributes["service.instance.id"] != nil and attributes["service.instance.id"] != "" and attributes["xrpl.network.type"] != nil and attributes["xrpl.network.type"] != ""`, - `set(attributes["iac_group"], Concat(["[", Concat([attributes["xrpl.branch"], attributes["xrpl.node.role"], attributes["xrpl.work.item"]], ", "), "]"], "")) where attributes["xrpl.branch"] != nil and attributes["xrpl.branch"] != "" and attributes["xrpl.node.role"] != nil and attributes["xrpl.node.role"] != "" and attributes["xrpl.work.item"] != nil and attributes["xrpl.work.item"] != ""`, ] } @@ -172,21 +163,6 @@ otelcol.processor.transform "tier" { `delete_key(attributes, "telemetry.sdk.language")`, `delete_key(attributes, "telemetry.sdk.name")`, `delete_key(attributes, "telemetry.sdk.version")`, - // Grouped legend labels for the Grafana dashboards (kept in sync with the - // reference collector's transform/legendgroups). The Cloud gateway - // promotes these resource attributes to Prometheus labels server-side. - // Brackets and ", " separators are baked into the VALUE (e.g. - // "[node, mainnet]") so the dashboard Display name needs no literal - // brackets and an absent group renders as nothing. - // * resource_group: "[node]" or "[node, network]". - // * iac_group: "[branch, role, work-item]". A generic node like this one - // does not set those attrs, so the guard leaves iac_group unset; it is - // built only on perf-comparison nodes. The guard checks != "" as well - // as != nil because OTTL Concat emits ""/a stray separator for an - // absent or empty element. - `set(attributes["resource_group"], Concat(["[", attributes["service.instance.id"], "]"], "")) where attributes["service.instance.id"] != nil and attributes["service.instance.id"] != ""`, - `set(attributes["resource_group"], Concat(["[", attributes["service.instance.id"], ", ", attributes["xrpl.network.type"], "]"], "")) where attributes["service.instance.id"] != nil and attributes["service.instance.id"] != "" and attributes["xrpl.network.type"] != nil and attributes["xrpl.network.type"] != ""`, - `set(attributes["iac_group"], Concat(["[", Concat([attributes["xrpl.branch"], attributes["xrpl.node.role"], attributes["xrpl.work.item"]], ", "), "]"], "")) where attributes["xrpl.branch"] != nil and attributes["xrpl.branch"] != "" and attributes["xrpl.node.role"] != nil and attributes["xrpl.node.role"] != "" and attributes["xrpl.work.item"] != nil and attributes["xrpl.work.item"] != ""`, ] } diff --git a/docker/telemetry/otel-collector-config.grafanacloud.yaml b/docker/telemetry/otel-collector-config.grafanacloud.yaml index 1f9740d8ff..50efeb5d57 100644 --- a/docker/telemetry/otel-collector-config.grafanacloud.yaml +++ b/docker/telemetry/otel-collector-config.grafanacloud.yaml @@ -123,34 +123,6 @@ processors: - set(attributes["service_instance_id"], resource.attributes["service.instance.id"]) - set(attributes["deployment_environment"], resource.attributes["deployment.environment"]) - set(attributes["xrpl_network_type"], resource.attributes["xrpl.network.type"]) - # Copy the grouped legend labels built by transform/legendgroups onto - # datapoint attributes too (same reason as the tier attrs above: Cloud - # OTLP ingest does not promote resource attributes to labels). Guarded - # so a group absent on the resource is not created as an empty label. - - set(attributes["resource_group"], resource.attributes["resource_group"]) where resource.attributes["resource_group"] != nil - - set(attributes["iac_group"], resource.attributes["iac_group"]) where resource.attributes["iac_group"] != nil - # Build grouped legend labels from the tier / perf-iac resource attributes so - # dashboards reference one pre-built label per group. On the local scrape these - # are promoted to labels by resource_to_telemetry_conversion; on the Cloud path - # transform/cloudlabels (above) copies them onto datapoint attributes. - # The BRACKETS and comma separators are baked into the label VALUE here (e.g. - # "[node, mainnet]") rather than added in the dashboard Display name: a template - # like "... [${__field.labels.iac_group}]" renders an empty "[]" when the label - # is absent, and Grafana's renameByRegex runs pre-interpolation so it cannot - # strip it. Baking brackets into the value means an absent group is just an - # absent label -> the Display name renders nothing for it. - # - iac_group: "[branch, role, work-item]", built only on perf runs. - # - resource_group: "[node]" or "[node, network]". - # Guards check != nil and != "" because OTTL Concat renders "" for an - # absent attribute and the perf-iac collector stamps these with an empty-string - # default outside a comparison run. - transform/legendgroups: - metric_statements: - - context: resource - statements: - - set(attributes["iac_group"], Concat(["[", Concat([attributes["xrpl.branch"], attributes["xrpl.node.role"], attributes["xrpl.work.item"]], ", "), "]"], "")) where attributes["xrpl.branch"] != nil and attributes["xrpl.branch"] != "" and attributes["xrpl.node.role"] != nil and attributes["xrpl.node.role"] != "" and attributes["xrpl.work.item"] != nil and attributes["xrpl.work.item"] != "" - - set(attributes["resource_group"], Concat(["[", attributes["service.instance.id"], "]"], "")) where attributes["service.instance.id"] != nil and attributes["service.instance.id"] != "" - - set(attributes["resource_group"], Concat(["[", attributes["service.instance.id"], ", ", attributes["xrpl.network.type"], "]"], "")) where attributes["service.instance.id"] != nil and attributes["service.instance.id"] != "" and attributes["xrpl.network.type"] != nil and attributes["xrpl.network.type"] != "" connectors: spanmetrics: @@ -252,19 +224,12 @@ service: # the transform both writing a service_instance_id label on the same series. metrics/local: receivers: [otlp, spanmetrics] - processors: - [resource/tier, resource/stripsdk, transform/legendgroups, batch] + processors: [resource/tier, resource/stripsdk, batch] exporters: [prometheus] metrics/cloud: receivers: [otlp, spanmetrics] processors: - [ - resource/tier, - resource/stripsdk, - transform/legendgroups, - transform/cloudlabels, - batch, - ] + [resource/tier, resource/stripsdk, transform/cloudlabels, batch] exporters: [otlphttp/grafanacloud] logs: receivers: [filelog]