[bug] Attribute Limits (SdkLimitOptions) cannot be changed programmatically #6208
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
Package
OpenTelemetry
Package Version
Runtime Version
net462, net48
Description
According to the specification:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute-limits
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 variablesOTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT
,OTEL_ATTRIBUTE_COUNT_LIMIT
& their signal-specific equivalents.SdkLimitOptions is internal:
opentelemetry-dotnet/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/SdkLimitOptions.cs
Line 8 in f63f8d9
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
The text was updated successfully, but these errors were encountered: