Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Attribute Limits (SdkLimitOptions) cannot be changed programmatically #6208

Open
jordankay13 opened this issue Mar 26, 2025 · 0 comments
Labels
bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package

Comments

@jordankay13
Copy link

jordankay13 commented Mar 26, 2025

Package

OpenTelemetry

Package Version

Package Name Version
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.11.2

Runtime Version

net462, net48

Description

According to the specification:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute-limits

If the SDK implements the limits above, it MUST provide a way to change these limits programmatically. Names of the configuration options SHOULD be the same as in the list below.

Environment variables could be argued as "programmable" but I would argue this should be understood as "we can set it from the application code", and not "we can set it from our infrastructure-as-code code".

The only way to affect this limit in the current OpenTelemetry.Exporter.OpenTelemetryProtocol is to set the environment variables OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_ATTRIBUTE_COUNT_LIMIT & their signal-specific equivalents.

SdkLimitOptions is internal:

The only OtlpTraceExporter that accepts SdkLimitOptions is also internal:
https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporter.cs#L47

I can't find any public method to adjust the SdkLimitOptions.

Steps to Reproduce

SdkLimitOptions is internal and cannot be accessed.
No public method exists to update SpanAttributeCountLimit (or the other properties).

Expected Result

I expect to be able to change the properties of SdkLimitOptions from application code

Actual Result

I have not been able to find a way, other than through environment variables, to set this limit.

Additional Context

No response

@jordankay13 jordankay13 added bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member labels Mar 26, 2025
@github-actions github-actions bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Mar 26, 2025
@TimothyMothra TimothyMothra added pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package and removed pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package labels Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage New issues which have not been classified or triaged by a community member pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package
Projects
None yet
Development

No branches or pull requests

2 participants