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

Sampling relevant attributes: MUST vs SHOULD #422

Closed
trask opened this issue Oct 17, 2023 · 5 comments · Fixed by open-telemetry/build-tools#230 or #486
Closed

Sampling relevant attributes: MUST vs SHOULD #422

trask opened this issue Oct 17, 2023 · 5 comments · Fixed by open-telemetry/build-tools#230 or #486
Assignees

Comments

@trask
Copy link
Member

trask commented Oct 17, 2023

Related to open-telemetry/opentelemetry-dotnet#319

Currently the HTTP semantic convention says:

Following attributes MUST be provided at span creation time (when provided at all), so they can be considered for sampling decisions:

We have an example where this is not possible: open-telemetry/opentelemetry-dotnet-contrib#2012

This may get resolved in .NET 9 (~1 year from now), but I think it's worth discussing MUST vs SHOULD for sampling relevant attributes.

@trask
Copy link
Member Author

trask commented Oct 27, 2023

Discussed in 10/23 semconv meeting and decided to stay with MUST because without providing these attributes at span start sampling experience is degraded and sampling is important

@trask trask closed this as completed Oct 27, 2023
@trask
Copy link
Member Author

trask commented Oct 31, 2023

Reconsidering based on #467 (comment)

The current wording:

Following attributes MUST be provided at span creation time (when provided at all)

seems to imply that if a user enhanced an HTTP span (e.g. via some callback) with one of these "sampling relevant" attributes, then they would be violating the HTTP semantic conventions.

Changing MUST to SHOULD seems to be the simplest way to address this (though there are likely other ways).

I also think changing from SHOULD to MUST in the future would be less impactful compared to changing from MUST to SHOULD, so I think SHOULD is the more conservative choice here.

@lmolkova
Copy link
Contributor

lmolkova commented Oct 31, 2023

I'm okay changing from MUST to SHOULD, but the way I read the full sentence "Following attributes MUST be provided at span creation time (when provided at all), so they can be considered for sampling decisions:" is:

  • you have to provide attributes before the span starts to be able to access them at sampling time.
  • instrumentation library MUST collect them before the span starts
  • instrumentation library that provides a callback to collect sampling relevant attributes MUST do it before starting a span

If these intentions are not clear, let's improve them (and change MUST to SHOULD if it feels better)

@trask
Copy link
Member Author

trask commented Oct 31, 2023

Discussed with @lmolkova and we agreed that it's good to change sampling relevant attributes from MUST to SHOULD.

@trask
Copy link
Member Author

trask commented Nov 2, 2023

re-opening until we apply the change in this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
3 participants