Skip to content

[CONFIGURATION] General attribute limits #4467

Description

@dbarker

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedGood for taking. Extra help will be provided by maintainersspec-complianceNot compliant to OpenTelemetry specstriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions