Skip to content

fix: export Resource attributes for metrics and traces - #63

Open
bachgarash wants to merge 1 commit into
open-telemetry:mainfrom
bachgarash:fix/export-resource-attributes
Open

fix: export Resource attributes for metrics and traces#63
bachgarash wants to merge 1 commit into
open-telemetry:mainfrom
bachgarash:fix/export-resource-attributes

Conversation

@bachgarash

@bachgarash bachgarash commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

The SDK parsed OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES and built a resource on both TracerProvider and MeterProvider, but neither the trace nor the metrics OTLP exporter attached it to the exported payload. Spans and metrics reached the collector with no resource, so backends could not identify the emitting service, traces appears in Jaeger under missing-service-name.

Carry the provider's resource on the exported data the way logs already do.

Also, extract resourceToProtobuf in the metrics exporter so the conversion can be tested without performing an HTTP export, matching the existing separation between spansToOTLPRequest and exportSpans on the trace side.

Fixes #62

after the fix

Screenshot From 2026-08-12 22-05-40

The SDK parsed OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES and built a
resource on both TracerProvider and MeterProvider, but neither the trace nor
the metrics OTLP exporter attached it to the exported payload. Spans and
metrics reached the collector with no resource, so backends could not
identify the emitting service: traces appears in Jaeger under
missing-service-name and target_info could not be produced for metrics.

Carry the provider's resource on the exported data the way logs already
do.

Also, extract resourceToProtobuf in the metrics exporter so the conversion can be
tested without performing an HTTP export, matching the existing separation
between spansToOTLPRequest and exportSpans on the trace side.

Fixes open-telemetry#62
@bachgarash
bachgarash requested a review from a team as a code owner August 12, 2026 19:04

@agagniere agagniere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

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.

Traces and metrics are exported without a Resource, so service.name is lost

2 participants