Skip to content

[Bug]: opentelemetry-proto discards InstrumentationScope attributes for logsΒ #3276

@sido378

Description

@sido378

What happened?

When using the SdkLoggerProvider::logger_with_scope API to use an InstrumentationScope with attributes, these attributes are discarded when building the log export body via OtlpHttpClient::build_logs_export_body

More precisely, group_logs_by_resource_and_scope call of opentelemetry_proto::transform::common::tonic::InstrumentationScope::from is called with Some in the second position of the tuple, which causes InstrumentationScope::from to use an empty vector for it's attributes.

This differs for example from the behaviour of group_spans_by_resource_and_scope which uses None when creating the InstrumentationScope, causing scope attributes to be retained as expected.

OpenTelemetry API Version (i.e version of opentelemetry crate)

0.31.0

OpenTelemetry SDK Version (i.e version of opentelemetry_sdk crate)

0.31.0

What Exporter(s) are you seeing the problem on?

OTLP

Relevant log output

Tip

React with πŸ‘ to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriage:todoNeeds to be traiged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions