Skip to content

Conversation

@verdie-g
Copy link
Contributor

Setting tags/events on a trace that is not sampled (!IsAllDataRequested) is a waste of CPU since the trace won't be exported.

From the doc: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-instrumentation-walkthroughs

If you're instrumenting functions with high-performance requirements, Activity.IsAllDataRequested is a hint that indicates whether any of the code listening to Activities intends to read auxiliary information such as Tags. If no listener will read it, then there is no need for the instrumented code to spend CPU cycles populating it.

Setting tags/events on a trace that is not sampled (!IsAllDataRequested)
is a wate of CPU since the trace won't be exported.

From the doc: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-instrumentation-walkthroughs
> If you're instrumenting functions with high-performance requirements,
> Activity.IsAllDataRequested is a hint that indicates whether any of
> the code listening to Activities intends to read auxiliary information
> such as Tags. If no listener will read it, then there is no need for
> the instrumented code to spend CPU cycles populating it.
@CLAassistant
Copy link

CLAassistant commented Aug 18, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants