fix(telemetry): drop redundant OTTL copy of service.name for cloud labels

Grafana Cloud's OTLP ingest already promotes the `service.name` resource
attribute to a `service_name` metric label. The `transform/cloudlabels`
processor was ALSO setting `service_name` as a datapoint attribute,
which Mimir treats as a duplicate label and concatenates as
`service_name="xrpld;xrpld"` on every series. Dashboards filtering on
`service_name=xrpld` then returned no data.

Remove the redundant `set(attributes["service_name"], ...)` line and
add a comment documenting the doubling. `service.instance.id` does not
exhibit the same behaviour, so that copy is retained for the $node
filter to keep resolving.

Reintroduces the pre-e76eed5296 shape (which was correct on this label)
without reverting that commit's other cloud-label fixes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-07-09 17:06:07 +01:00
parent 432a98160a
commit a1d7b18ce1

View File

@@ -98,11 +98,16 @@ processors:
# is Prometheus-exporter-only). Copy them onto datapoint labels so the
# dashboards' $node / $deployment_environment / $xrpl_network_type filters
# resolve on Cloud exactly as they do locally.
#
# NOTE: service.name is intentionally NOT copied here. Cloud's OTLP ingest
# already promotes service.name to the `service_name` label, and adding a
# datapoint attribute with the same name causes Mimir to concatenate both
# values as `xrpld;xrpld`. service.instance.id does not exhibit the same
# doubling, so the copy for $node is kept.
transform/cloudlabels:
metric_statements:
- context: datapoint
statements:
- set(attributes["service_name"], resource.attributes["service.name"])
- 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"])