-
Notifications
You must be signed in to change notification settings - Fork 103
[Feature Request] Make Temporal logger adapter accomodate to OpenTelemetry #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
#838 I've write a draft solution for this problem |
Thanks for the issue! We cannot incompatibly change default logging for all users because of OpenTelemetry-only limitations. Also per https://opentelemetry.io/docs/languages/python/, OTel logging is still in development. Once it does stabilize, we can definitely look into opt-in options for either splatting the details as done in the PR, or adding something to Digging through the OTel source, it seems attributes can have nested dicts. It links to https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-attributes which says the attribute values can be |
Thank you for the response. I wasn't aware of the opentelemetry-specification. The error is actually a warning generated by the The library verifies if an attribute type is among the Could we potentially implement a workaround to address this, like adding an option to flatten the logger's extra field? |
I am concerned about flattening Temporal-specific values just for OTel purposes. To do this right, we'd really need to prefix I think a better approach may be to encourage custom adapters. You could set |
Okay, I found a workaround. Posting in case it helps others who encounter this issue. First, set global activity.logger.activity_info_on_extra = False
workflow.logger.workflow_info_on_extra = False Then, in every
This should bypass the python oTel library warning while retaining activity trace logs. |
👍
An alternative is to replace those loggers with your own extension of The concern here for us adding this option as-is is that we need to qualify all keys with |
Uh oh!
There was an error while loading. Please reload this page.
Problem
Temporal's activity/workflow logger adapter uses a Dict for its "extra" field, violating the OpenTelemetry format that requires basic data types (bool, str, bytes, int, float).
Solution
#838
The text was updated successfully, but these errors were encountered: