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

Flask routes cannot be tagged as context propagation boundaries #477

Closed
lizthegrey opened this issue Mar 12, 2020 · 8 comments
Closed

Flask routes cannot be tagged as context propagation boundaries #477

lizthegrey opened this issue Mar 12, 2020 · 8 comments

Comments

@lizthegrey
Copy link
Member

Is your feature request related to a problem?
We run the OTel demo app inside Glitch, which sends its own propagation headers for its own instrumentation. We explicitly want to distrust requests that come from Glitch rather than being sent trusted app to trusted app.

This issue would apply to anyone that doesn't sanitize their headers at the loadbalancer to remove context headers to their public endpoints.

Describe the solution you'd like
https://github.com/open-telemetry/opentelemetry-go/blob/master/plugin/othttp/handler.go#L73

@Oberon00
Copy link
Member

What do you mean by "context propagation boundaries"? How would OpenTelemetry be able to help you in "distrusting"? I can only speculate that you are talking about the IsRemote property of the SpanContext, but please clarify this issue.

@lizthegrey
Copy link
Member Author

lizthegrey commented Mar 12, 2020

If I get an HTTP request from somewhere I distrust, I shouldn't carry around its baggage or set its span id to my parent when instrumenting my handler, because I am my own service that shouldn't accept arbitrary client data.

the issue isn't isRemote or not, you can have trusted isRemote callers where context prop is appropriate, but there are also situations where context prop is not appropriate. you're right that isRemote=false usually means "trust this caller".

@Oberon00
Copy link
Member

Wasn't the idea behind the W3C tracecontext that you could trace through systems that don't know anything of each other? Maybe related: open-telemetry/opentelemetry-specification#366

@lizthegrey
Copy link
Member Author

"local root span" sounds right, yeah. I'm good with that approach.

@Oberon00
Copy link
Member

Oberon00 commented Mar 12, 2020

I'm still not sure what the approach would be here / what the actual feature request is. Would implementing a "is local root" property solve your use case?

@lizthegrey
Copy link
Member Author

Avoid having Jaeger and Honeycomb & pretty much every other analysis tool say "hey, you're missing the root span" // "hey, I'm missing a parent span of a span you've sent me"

@Oberon00
Copy link
Member

Ah, I see. Personally I think this is a design problem of the W3C traceparent header, because the parent span ID part is mostly useless if you actually use the W3C header for its intended purpose to trace across different vendors. We might want to add a support for propagating the span ID as a custom key in the tracestate, see open-telemetry/opentelemetry-specification#366 (comment)

srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
* feat(traceparent): setting parent span from server

* chore: exposing the parse functionality

* chore: refactored to use existing functionality

* chore: adding jsdoc to exported function

* chore: updating readme with example for traceparent

* chore: moving the traceparent to meta instead of window

* chore: updating the jsdoc

* chore: updating the copy as suggested
@lzchen
Copy link
Contributor

lzchen commented Dec 18, 2020

Closing this for now. Will reopen if there's development in the specs.

@lzchen lzchen closed this as completed Dec 18, 2020
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

No branches or pull requests

4 participants