open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.67k stars 569 forks source link

logs: Log a warning when an attribute is discarded due to limits #3935

Closed emdneto closed 2 weeks ago

emdneto commented 1 month ago

Before opening a feature request against this repo, consider whether the feature should/could be implemented in the other OpenTelemetry client libraries. If so, please open an issue on opentelemetry-specification first.

Is your feature request related to a problem? If so, provide a concise description of the problem.

Describe the solution you'd like What do you want to happen instead? What is the expected behavior?

There SHOULD be a message printed in the SDK's log to indicate to the user that an attribute was discarded due to such a limit. To prevent excessive logging, the message MUST be printed at most once per LogRecord (i.e., not per discarded attribute).

Describe alternatives you've considered Which alternative solutions or features have you considered?

Additional context Add any other context about the feature request here. LogRecordLimits

emdneto commented 1 month ago

go implementation: https://github.com/open-telemetry/opentelemetry-go/pull/5376