open-telemetry / open-telemetry/opentelemetry-python
Logging stability review: [minor] LogRecord attribute limits not configurable via `LoggerProvider`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
Spec: Logs SDK § LogRecord Limits
If the SDK implements attribute limits it MUST provide a way to change these limits, via a configuration to the
LoggerProvider[...]
- Required (MUST): if attribute limits are implemented, expose a way to change them via configuration to the
LoggerProvider. - Current:
LogRecordLimits(max_attributes,max_attribute_length) is implemented and enforced, but only configurable through env vars (OTEL_ATTRIBUTE_COUNT_LIMIT,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) or defaults.LoggerProvider.__init__has nolimits/log_record_limitsparameter. - Missing: programmatic configuration on
LoggerProvider, unlikeTracerProvider(span_limits=...). Cross-signal inconsistency.
Part of https://github.com/open-telemetry/community/issues/1751
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at LoggerProvider.init and read the existing LogRecordLimits handling, then compare it with TracerProvider(span_limits=...). Confirm how OTEL_ATTRIBUTE_COUNT_LIMIT and OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT currently supply defaults. Done means LoggerProvider accepts programmatic log-record limits while preserving the existing environment-variable and default behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100