opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Logs SDK: Logging Handler bridge populates unstable `code` attributes

Open lmolkova opened this issue 1 year ago • 2 comments

https://github.com/open-telemetry/opentelemetry-python/blob/59d67549765d52bbcdba5d3d5f4563c993aee824/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/init.py#L482-L484

There is no formal conventions defining if logs SDK/bridges should populate code attributes. Also, those attributes are not stable (yet).

The recommendation is to

  • remove or put them behind experimental feature-flag
  • stop using deprecated SpanAttributes and use https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/code_attributes.py to make the status obvious via the import path

Part of https://github.com/open-telemetry/community/issues/1751

lmolkova avatar Nov 23 '24 20:11 lmolkova

Code attributes have become stable and we'll switch to the stable version for the next release. Also we removed usage of SpanAttributes. @lmolkova is it fine to close for you?

xrmx avatar Apr 30 '25 08:04 xrmx

Thanks @xrmx ! It's awesome, the only concern I have is that they should be opt-in. I.e. I think there are no logs conventions that mention them as recommended/required. Added a comment on a related https://github.com/open-telemetry/semantic-conventions/issues/1981

lmolkova avatar Apr 30 '25 15:04 lmolkova