GoogleCloudPlatform / GoogleCloudPlatform/opentelemetry-operations-python
Handle logs with complex attributes (not body)
- Dominant language
- Python
- Stars
- 83
- Forks
- 46
- Avg merge
- 11h 40m
- Merged PRs (30d)
- 2
Description
From https://github.com/open-telemetry/semantic-conventions/issues/1651 OTel is moving toward just using OTel LogEntry.attributes and not using the body.
- The GenAI semantic conventions are already following this, since everything goes in attributes https://github.com/open-telemetry/semantic-conventions/blob/v1.37.0/docs/gen-ai/gen-ai-events.md#event-eventgen_aiclientinferenceoperationdetails
- OTel python's LogHandler puts the extra param from `logging.info(..., extra={...})` (structured log message) into attributes ([code](https://github.com/open-telemetry/opentelemetry-python/blob/5c8269c2d33617cca26c63e8627aec89e0d79b17/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py#L576-L578), and [test case](https://github.com/open-telemetry/opentelemetry-python/blob/5c8269c2d33617cca26c63e8627aec89e0d79b17/opentelemetry-sdk/tests/logs/test_handler.py#L127-L133)).
This doesn't work well for Cloud Logging because labels only support string values and are expected to be small. We still need some way to export this data though.
Contributor guide
Assessment
This issue has not been assessed yet.