Trace SDK: support span limits #481
Labels
help wanted
Extra attention is needed
sdk module
Features and improvements to the sdk module
tracing
Improvements to tracing module
The purpose is to keep the number of a) Attributes, b) Links, and c) Events under the configured limit.
Aside from dropping the overflowing ones, we should also track how many have been dropped.
1) Design
SpanLimits
andSpanLimits.Builder
There is a draft implementation which can be helpful.
Tests should include the discipline's
HashTest
. The example - RetryPolicySuite.2) Design a generic collection container with fixed bounds
OpenTelemetry Java, for example, keeps track of dropped attributes right into the span's (or event's or link's) state.
The example, and the simplified version:
To keep track of dropped attributes, links, or events, we can use the generic container:
We may bikeshed the name 🙂 e.g: Bounded, Fixed, Limited, etc.
3) Use
Bounded
container in the SDK implementation:For example - https://github.com/typelevel/otel4s/pull/325/files#diff-b00a1cedc0fb0cc94255f20aea84be95187a261e07f8ad033de3375f70d43f8cR151-R160.
4) Add the number of dropped elements to the proto encoders
The SpansProtoEncoder. The proto models already have the properties and we need to populate them.
The change would be similar to:
5) Implement
SpanLimitsAutoConfigure
We need this to autoconfigure the
SpanLimits
using configuration properties.The example - TelemetryResourceAutoConfigure.
The configuration options - https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#span-limits.
The text was updated successfully, but these errors were encountered: