open-telemetry / open-telemetry/opentelemetry-python

Logging stability review: [minor] LogRecord attribute limits not configurable via `LoggerProvider`

Open
#5,357 2 comments 0 reactions 0 assignees View on GitHub

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 no limits/log_record_limits parameter.
  • Missing: programmatic configuration on LoggerProvider, unlike TracerProvider(span_limits=...). Cross-signal inconsistency.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.