You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LoggerProvider must accept a LogRecordLimits/limits parameter (like TracerProvider's SpanLimits) and thread it into log-record creation, so log limits can be set programmatically (Linear OSS-21, finding L2).
Validation: opentelemetry-sdk logs suite 115 passed; scope sdk + changelog.
Reviewer notes: (1) touches the same file as OSS-22/PR oss_22_logger_enabled #26 (sdk _logs/_internal/__init__.py) — merge sequentially. (2) The configuration-package path that "warns and drops" log limits was intentionally NOT touched (out of scope); it can now consume this hook — this is the programmatic side of the limitation flagged on OSS-26/PR oss_26_declarative_config_env_substitution #36.
📣 Public-facing draft — to be opened upstream in open-telemetry/opentelemetry-python. No internal references; copy verbatim.
Title:LoggerProvider does not accept programmatic LogRecordLimits (unlike TracerProvider/SpanLimits)
SpanLimits can be configured programmatically via TracerProvider(span_limits=...). The logs SDK has an equivalent LogRecordLimits type (opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py) and applies it in ReadWriteLogRecord.__post_init__, but LoggerProvider.__init__ has no limits parameter. As a result ReadWriteLogRecord._from_api_log_record never passes a limits value, so emitted log records always use the default LogRecordLimits, and limits can only be influenced via environment variables — there is no programmatic path.
Spec: specification/logs/sdk.md — "LogRecord Limits" (the SDK must allow configuring attribute count / value-length limits on the LoggerProvider). Java reference: SdkLoggerProviderBuilder.setLogLimits(...) with the LogLimits type.
Proposed fix
Add a keyword-only limits: LogRecordLimits | None parameter to LoggerProvider.__init__, store it, pass it to each Logger, and thread it into _from_api_log_record so it is applied when constructing log records. Default (no argument) behavior remains unchanged (falls back to env vars / defaults).
Activity
ocelotl commentedon Jul 22, 2026
🔒 Internal (dash0) — not for upstream.
oss_21_logger_provider_log_record_limits88b7449a7· PR: oss_21_logger_provider_log_record_limits #42_logs/_internal/__init__.py) — merge sequentially. (2) The configuration-package path that "warns and drops" log limits was intentionally NOT touched (out of scope); it can now consume this hook — this is the programmatic side of the limitation flagged on OSS-26/PR oss_26_declarative_config_env_substitution #36.ocelotl commentedon Jul 22, 2026
📣 Public-facing draft — to be opened upstream in
open-telemetry/opentelemetry-python. No internal references; copy verbatim.Title:
LoggerProviderdoes not accept programmaticLogRecordLimits(unlikeTracerProvider/SpanLimits)SpanLimitscan be configured programmatically viaTracerProvider(span_limits=...). The logs SDK has an equivalentLogRecordLimitstype (opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py) and applies it inReadWriteLogRecord.__post_init__, butLoggerProvider.__init__has nolimitsparameter. As a resultReadWriteLogRecord._from_api_log_recordnever passes alimitsvalue, so emitted log records always use the defaultLogRecordLimits, and limits can only be influenced via environment variables — there is no programmatic path.Spec:
specification/logs/sdk.md— "LogRecord Limits" (the SDK must allow configuring attribute count / value-length limits on the LoggerProvider). Java reference:SdkLoggerProviderBuilder.setLogLimits(...)with theLogLimitstype.Proposed fix
Add a keyword-only
limits: LogRecordLimits | Noneparameter toLoggerProvider.__init__, store it, pass it to eachLogger, and thread it into_from_api_log_recordso it is applied when constructing log records. Default (no argument) behavior remains unchanged (falls back to env vars / defaults).