-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Problem Statement
I discussed this with @mariomac @MrAlias and a few others at KubeCon.
There are two steps to propagating context with an outgoing request:
- Determine which parent context (if any) needs to be added to the request
- Modify the outgoing request to inject headers/metadata containing the parent context.
Both https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/blob/main/devdocs/features.md and https://opentelemetry.io/docs/zero-code/obi/distributed-traces/#context-propagation-at-network-level do a good job covering step (2), but i'm not aware of any documentation describing step (1).
Without digging, it is easy for users to come to the conclusion that it works for all HTTP requests, which isn't correct. From skeptical people in the industry, i've also seen this perspective: "OBI must just be using thread id to correlate! That won't work for real applications!". In reality, we use heuristics that have limitations, but they are fairly sophisticated and (I hope?) work well for most common apps and frameworks.
Proposed Solution
Document how (1) works
From my very basic digging (please don't assume this is correct):
OBI uses heuristics to correlate incoming and outgoing requests:
- For all languages, OBI will recursively look for parent threads to see if a parent thread is associated with an incoming request.
- For languages that have a lightweight thread concept, like goroutines in Go. OBI recursively looks for parent lightweight threads.
The limitations of this (from what I can tell) are that anything that does any "thread pooling", and passes data between threads, rather than forking to children won't have context correlated by OBI.
Document frameworks that OBI works with
It would be even more helpful to document the language client/server frameworks that work with the approach we've taken. This is definitely more work to keep up-to-date, but would be very helpful to users, and would help convince more skeptical types that this isn't a toy feature. A big table or something would be a good place to start.