Configuration of General Attribute Limits
Background:
The configuration schema includes a general attribute_limits element at the same level as the signal providers. This element defines limits for attribute count and length that should be used by the tracer and logger provider if their limits elements are not configured.
attribute_limits:
$ref: "#/$defs/AttributeLimits"
description: |
Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits.
The YAML parser supports attribute_limits, but the SdkBuilder currently does not pass them into the builders for the Tracer and Logger providers. As a result these values are ignored.
See:
|
OTEL_INTERNAL_LOG_WARN("attribute_limits not supported, ignoring"); |
The spec requires the following limit behavior:
If both a general and a model-specific limit are implemented, then the SDK MUST first attempt to use the model-specific limit, if it isn’t set, then the SDK MUST attempt to use the general limit. If neither are defined, then the SDK MUST try to use the model-specific limit default value, followed by the global limit default value.
Scope:
- Update the SdkBuilder to pass the configured
attribute_limits to the CreateTracerProvider and CreateLoggerProvider methods.
- Update these provider creation methods to set the values from
attribute_limits if configured to the SpanLimits and LogRecordLimits structs to meet the spec requirement for limit configuration above.
- Add unit tests to cover the
attribute_limits configuration behavior and override from configured SpanLimits and LogRecordLimits.
See also:
Configuration of General Attribute Limits
Background:
The configuration schema includes a general
attribute_limitselement at the same level as the signal providers. This element defines limits for attribute count and length that should be used by the tracer and logger provider if theirlimitselements are not configured.The YAML parser supports
attribute_limits, but theSdkBuildercurrently does not pass them into the builders for the Tracer and Logger providers. As a result these values are ignored.See:
opentelemetry-cpp/sdk/src/configuration/sdk_builder.cc
Line 2641 in b603742
The spec requires the following limit behavior:
Scope:
attribute_limitsto theCreateTracerProviderandCreateLoggerProvidermethods.attribute_limitsif configured to theSpanLimitsandLogRecordLimitsstructs to meet the spec requirement for limit configuration above.attribute_limitsconfiguration behavior and override from configuredSpanLimitsandLogRecordLimits.See also: