-
Notifications
You must be signed in to change notification settings - Fork 893
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
Define HTTP attributes that MUST be provided at span creation time #1916
Define HTTP attributes that MUST be provided at span creation time #1916
Conversation
Please don't open new, mostly unrelated issues in the PR description 😃 |
Your change currently fails the semantic convention check. I see two possibilities:
|
I agree to the semantic content of this PR, but it needs to be changed to pass the semantic convention check. |
bde6c05
to
2671561
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the checks, everything else LGTM
2671561
to
e33430c
Compare
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change sneaks MUST in the text
This doesn't look like "sneaking" to me, it's just a grammar question. @yurishkuro are you suggesting to change "following attributes MUST be provided at span creation time (when provided at all)" to something like: "If they will be provided during the lifetime of a span, the following attributes MUST be provided at span creation time." ? |
@jmacd the PR title says "should be provided", but the text says MUST, that's why I called it "sneaking in". I would not object to SHOULD, I do object to MUST, I think it is an unreasonable requirement. |
"If condition is met, something MUST be." sounds equivalent to SHOULD, it's just more specific. Right? |
If we want to optimize the sampling API, we should take it up in #620 and let this PR proceed. A lazy-attribute mechanism is how I'd do this, e.g.,
#620 is saying we should be able to refactor the Sampler API to allow the Sampler to include this "shouldSample(name)" logic and selectively evaluate any of the lazy span attributes in order to make its decision. Most call-sites would be able to use the lazy attribute and avoid a call to |
So either they don't care about following the spec (MUST wouldn't change that), or they have reasons (MUST would break them without a path forward). |
my assumptions about reasons (and I own Azure SDK http instrumentation, so know a bit about it):
Let me give you another reason for MUST (a bit beyond sampling): calculating metrics without a new instrumentation code. Is it worth a |
Sorry, but I still haven't seen a convincing argument why this needs to be a requirement. I cannot overcome the fact that the only reason you want to require these fields is to do sampling, and not every conceivable form of sampling, but a very specific form that most people do not actually use today. And even if we start talking about attribute-based sampling, there can be plenty of other attributes could be way more valuable in sampling decisions than these http attributes, so why require these specific ones? This simply does not pass the bar for me for a narrow use case to be elevated to a requirement. I think you'd get as much mileage from SHOULD as from MUST.
Of the three RED metrics, error and duration cannot be calculated until span is finished, so it doesn't matter when span attributes are set. |
I don't care much about this change, I want to have clear rules for implementations to follow.
I'm trying to move HTTP spec forward, not sampling story. I want to have a good, consistent e2e story for users. Lack of clarity in this spec causes inconsistencies in instrumentations and broken experience for users - MUST is a way to provide clarity.
For metrics, we don't even have to start a real span if it's sampled out - we can have a lightweight one that only supports a few required attributes, provided at start time and measures duration. But you're right that all required attributes indeed can be provided after start for it to work. |
Please be careful with such sweeping statements. In my pond the situation is the opposite: nobody cares about probabilistic sampling but a lot of people want attribute-based sampling (or Views, as you called them in another issue). |
For better or worse, the sample method accepts It seems to be the same as the
This comment specifically seems to point out the dangers - we can't provide a consistent experience to users if one language SIG happens to deem the performance implication too high and doesn't implement these at sampling time while other languages do. |
Do you think we can merge this? Then we could also finish up the build-tools stuff (merging open-telemetry/build-tools#70 without changing to SHOULD and cutting a new release that also contains the event name stuff from open-telemetry/build-tools#67) |
@Oberon00 yes, I believe so, thanks! and then I'll follow up on open-telemetry/build-tools#70 |
Discussed MUST vs SHOULD over Tuesday Instrumentation SIG meeting (10/5/21) , and came to the agreement to start with MUST, the summary:
|
6cace67
to
f34abb0
Compare
@yurishkuro @open-telemetry/technical-committee we discussed this in the spec meeting, and decide to file an issue (to track if this is the right decision or not) that needs to be resolved before the stability of this document, and proceed with the current proposal. |
Merging as further details will be decided as part of #2011, as discussed in the previous Spec SIG call. |
Changes
This change clarifies which HTTP attributes should be provided before making sampling decision: all attributes that are required and available before span starts.
Optional attributes are not provided at start time to avoid the overhead of calculating and adding them
Note it actually goes against current spec recommendation (see #620 for discussion):
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span-creation
Related issues #1747