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

New spanids should always be created for server spans. #367

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions specification/data-http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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).

Copy link
Member Author

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.

Copy link
Member

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.


## HTTP client-server example

As an example, if a browser request for `https://example.com:8080/webshop/articles/4?s=1` is invoked from a host with IP 192.0.2.4, we may have the following Span on the client side:
Expand Down