Skip to content

Export identity labels with resource_constant_labels - #667

Open
humoflife wants to merge 1 commit into
modelplaneai:mainfrom
humoflife:resource-constant-labels
Open

humoflife wants to merge 1 commit into
modelplaneai:mainfrom
humoflife:resource-constant-labels

Conversation

@humoflife

Copy link
Copy Markdown
Contributor

Description of your changes

compose-serving-stack sets resource_to_telemetry_conversion on prometheus and prometheus_remote_write sinks so their series keep the cluster, deployment, engine and role they belong to. Collector 0.161.0 deprecates that setting and logs a warning for it at startup.

This switches the default to its replacement, resource_constant_labels, with included set to _IDENTITY. transform/identity leaves only those attributes on the resource, so the exporters convert the same attributes as before. A sink that sets either setting itself gets no default, because an exporter refuses a config with both (config.go).

The issue asked for a real export to check against. I ran otel/opentelemetry-collector-contrib:0.161.0 with sinks rendered by collector.exporters, exporting to a Prometheus 3.5.0 remote-write receiver and through the prometheus exporter, once with the old setting and once with the new default. Both produced the same labels on both exporters (cluster, deployment, engine, role, job, instance, service_name, service_instance_id); only the old one logged the deprecation warning. A config with both settings failed to start with cannot configure both resource_to_telemetry_conversion and resource_constant_labels.

Fixes #489

I have:

  • Read and followed Modelplane's contribution process.
  • Run nix flake check (or ./nix.sh flake check) and made sure it passes.
  • Added or updated tests covering any composition function changes.
  • Signed off every commit with git commit -s.

🤖 Generated with Claude Code

compose-serving-stack sets resource_to_telemetry_conversion on prometheus
and prometheus_remote_write sinks, so their series keep the cluster,
deployment, engine and role they belong to. Collector 0.161.0 deprecates
that setting and warns about it at startup.

Its replacement, resource_constant_labels, takes an allowlist. This sets
it to the identity attributes, the only ones transform/identity leaves on
the resource, so the exporters convert the same attributes as before. A
sink that sets either setting itself gets no default, because an exporter
refuses a config that sets both.

Fixes modelplaneai#489.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: humoflife <markus.schweig@upbound.io>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Docs preview: https://modelplane-docs-pr-667.vercel.app (ready once the site's Content workflow finishes)

@negz

negz commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

/review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the collector off resource_to_telemetry_conversion

2 participants