Open casualjim opened 1 year ago
It appears that the resource is never added to the attributes in the exporter. Adding
.chain(
span_data
.resource
.as_ref()
.iter()
.map(|(k, v)| KeyValue::new(k.clone(), v.clone())),
)
here fixes the issue.
I took a look at the codebase and this seems to be a consistent omission, is there a reason for that?
The spec does not cover what to do with Resource for Zipkin. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk_exporters/zipkin.md
In general, Resource should not be automatically added as Span Attributes - some exporters may chose to do that, depending on their backends.
Were you expecting that all Resource attributes are added as Span attributes? If yes, Zipkin exporter could add a feature to do that if use opts-in to such a feature. (I dont think the Collector's Zipkin Exporter is doing this either..https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/zipkinexporter/factory.go)
They do add them everywhere: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/translator/zipkin/zipkinv2/from_translator.go#L60-L61
Got it. (Note that it is not a stable component, and that is not the spec).
What I said is still true - Resource should not automatically be added as Span attributes by default.
It appears a similar conversation is happening in the spec https://github.com/open-telemetry/opentelemetry-specification/issues/1196
I have 2 identical configurations, 1 in golang and 1 in rust.
In golang when I specify attributes in resource I see them appear in zipkin but for the rust version those attributes are missing. From just looking at the code that should not be the case.
Rust config:
Golang: