open-telemetry / oteps

OpenTelemetry Enhancement Proposals
https://opentelemetry.io
Apache License 2.0
326 stars 157 forks source link

Proposal: The OpenTelemetry Spec should allow SDKs to export all the spans regardless of their sampled flag #221

Open wdengw opened 1 year ago

wdengw commented 1 year ago

To minimize telemetry processing overhead in the hosting application, let OpenTelemetry sidecar to handle telemetry data processing as much as possible is a very attractive solution, for example, to gather span metrics (statistics), and to extract other summary information from spans per trace (request), etc.

To enable that, SDK needs the capability to export all spans to agent regardless of their sampled flag and carries the sampled flag with the sampling decision made by SDK sample. By doing these, Agent has the opportunity to see all the span data and to decide whether to persist the spans in storage based on the carried in sampled flag at the end.

See related Spec issue filed: https://github.com/open-telemetry/opentelemetry-specification/issues/2986