-
Notifications
You must be signed in to change notification settings - Fork 887
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
New spanids should always be created for server spans. #367
New spanids should always be created for server spans. #367
Conversation
Fixes open-telemetry#359. Standardizing the behavior of the creation of server span ids helps ensure server behavior will be the same regardless of the language used. In practice, the negative consequences of SpanID being different for client and server in storage systems that expect it are minimal, at worst appearing as separate spans.
@@ -196,6 +196,10 @@ For example, `http.server_name` has shown great value in practice, as bogus HTTP | |||
|
|||
It is strongly recommended to set `http.server_name` to allow associating requests with some logical server entity. | |||
|
|||
### New span ids should be generated for server spans | |||
|
|||
Some span propagation specifications such as B3 dictate that the client and server spans share a span id. OpenTelemetry SDKs should create new span ids for all server spans, regardless of format. |
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.
As this will primarily affect users of Zipkin backend, we should get opinions from its maintainers. A more compatible approach would be along the lines of "SDKs should support an opt-in configuration to allow sharing of client and server span IDs. When not opted-in, the SDK should create a new span ID when creating a child of a remote parent".
Also notice "a child of a remote parent" wording, which is more general than "server spans".
cc @adriancole (not sure how to mention all maintainers)
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.
Thank you! I wasn't sure about the right way to get them involved. Thanks.
Good not on the wording, will fix depending on how that conversation goes.
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.
I think Zipkin added support to the backend to support different Span id between client and server.
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.
Agreed with @yurishkuro.
As a precursor to enabling Zipkin, we may need to allow spans to be created with either a user-provided SpanContext
or a split trace ID / span ID (i.e., set the trace ID as normal but use a provided span ID, or vice versa).
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.
I think it's fine to change this to require (or "should") and opt-in configuration. I feel like it would be best to get weigh-in from a zipkin maintainer, but if I don't hear back in a day or so I'll change my PR.
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.
@yurishkuro @toumorokoshi @iredelmeier I think here we should follow what the w3c standard says which is to create a new spanID.
I would not add a requirement right now to the SDK to support the opt-in mode unless someone asks for it, as I mentioned already Zipkin made the change to support a different span ID for the server more than 1y ago, so I am not sure we need to support that behavior at this point.
I think as it currently stands, there is no technically no need for this PR. Reading the spec, it clearly says:
(https://github.com/open-telemetry/opentelemetry-specification/blob/e6cd52d034c981ca4fcf896ccd7464e783589c0f/specification/api-tracing.md#span, bold added by me) And then it goes on to state ways how spans are created. If we wanted to share span IDs, given the uniqueness-requirement, I think we would not be "creating new spans with a shared span ID" but rather "adopting/continuing an existing (remote) span specified by a span context". |
Thanks, I had trouble finding that section! Reading through it, I understand there is an implicit requirement for SpanID to be unique by virtue of a SpanContext, that uniquely represents a Span, but I think it would be preferable to explicitly call this out. Especially since it's an implementation detail that differs between propagation formats. How about I revise my PR and add a qualifying line there? |
@toumorokoshi just reviewing this now, sorry for the delay. My suggestion is that this is actually an implementation detail - if an SDK is configured to run in B3/Zipkin mode, it could choose to reuse the client SpanID and set the ParentSpanID according to the rules laid out in the B3 protocol. If that configuration is incorrect for particular system, then that system should not be configured to use B3 in this manner. Instead it should use a different protocol, or use the alternate protocol suggested in B3 here: https://github.com/openzipkin/b3-propagation#why-is-parentspanid-propagated Does that make sense? I'm not sure the spec needs to mandate how this works. |
BTW, this guidance could get rolled into this PR: #380 |
This PR states that we support the W3C specification, and is probably unnecessary. Can we close this without merging? |
I'll close this, for a couple good reasons:
|
calls unattended by zipkin users are unlikely to consider impact to zipkin
users, who are a significant population.
decisions can continue to be made without them, but I wouldnt pretend the
calls are a proxy to that population.
…On Sat, Feb 1, 2020, 4:59 AM Yusuke Tsutsumi ***@***.***> wrote:
I'll close this, for a couple good reasons:
1. as everyone has mentioned the w3c spec calls for creating a new
spanid serverside, and potentially zipkin may adjust on their side.
2. I personally have no value for this feature, so probably not the
right person to try to follow up on this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#367?email_source=notifications&email_token=AAAPVV25DKFHZLBEL4Q6JLLRASGLRA5CNFSM4JTIUH72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKP7RLY#issuecomment-580909231>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAPVVZG2Q7VQXF27EDFM3LRASGLRANCNFSM4JTIUH7Q>
.
|
Fixes #359. Standardizing the behavior of the creation of server span
ids helps ensure server behavior on several areas including exporters, samplers, and backend ingestion systems will be the same regardless of the language used.
In practice, the negative consequences of SpanID being different for
client and server in storage systems that expect it are minimal,
at worst appearing as separate spans.