-
Notifications
You must be signed in to change notification settings - Fork 923
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
Allow using the same value for RequestId
and Brave span ID
#2972
Comments
For the client side, we could provide a RequestIdGenerator that looks for
a certain decorator that implements a certain interface (e.g. BraveClient
implements RequestIdGenerator) in the decorator chain and delegate the ID
generation to it.
This assumes that Brave allows us to 1) access its ID generator and 2)
specify a previously generated ID to a span instead of always
auto-generating.
|
Is this the workshop I went to a while ago? Can't remember the |
Yeah.
Aye, that was a mistake. Let me update the original post. 😅 |
hmm request IDs are usually request (aka trace) scoped right? so it would not be about parent ID rather incoming trace ID except edge case where something intentionally broke it. Main thing might be ordering.. ex if you have the trace context prior then you can simply access the trace ID there and copy it. aside, but request-ids usually are not the same as trace ID and exposing them has some impact, though most may not care. openzipkin/b3-propagation#4 there are some interesting notes about messaging and request ids that aren't 100% same here, but interesting background as it discusses ids that are not uniform for the entire "request" https://github.com/openzipkin/brave/blob/master/instrumentation/messaging/RATIONALE.md#message-id |
I think we are going to use span ID as the If we introduce |
RequestId
from request headersRequestId
and Brave span ID
Changed the title of the issue since the original one was incorrect. |
I feel calling something request ID in this way is confusingly different than how others say request ID in HTTP and RPC contexts, so don't really think this feature should exist. |
Don't an Armeria |
(I think I confused many people in this page by starting it incorrectly. This issue is not about using trace ID as Armeria's |
request ID is commonly used like a trace ID, so it doesn't change as it propagates downwards. I think that the original discussion was about request headers made me concerned about making a header like "requestId: abcd" and have that vary hop to hop |
RequestContextId has a nice side effect that it avoids this problem of assuming this is the same as a request Id propagated in headers.. if it is in fact not :D |
if we are solving to have IDs match, which seems a noble goal, one way is to allow the span to allocate sooner so that it can be used for the context ID. we overwrite timestamps anyway. This avoids us having to solve pretty significant edge cases around propagation context forking (ex you can have partial incoming context and if statements around ID are easier to solve if we know even if an ID would be allocated) |
Creating a new span currently involves non-trivial steps like creating a request adapter and updating request headers, which
|
the apis to continue a span allow you to create a span first. it does not require you to update headers. this is simplified here into the same lines as there was no reason to do otherwise. |
ex on the client side there's this hook https://github.com/openzipkin/brave/blob/master/instrumentation/http/src/main/java/brave/http/HttpClientHandler.java#L143 if you are already propagating doing the trace context earlier also allows the logs to be aligned, rather than partially so. Also, it is very odd to indicate only a span ID, much less a request-scoped ID generator. This hints at an ordering problem I think we should consider resolving instead of digging a hole |
At the Armeria workshop Tokyo, we talked about using a certain request header value (or a
RequestContext
property) as aRequestId
, which will be useful when a user is using distributed tracing already.We could provide a
RequestIdGenerator
that looks for a certain decorator that implements a certain interface (e.g.BraveClient implements RequestIdGenerator
) in the decorator chain and delegate the ID generation to it. This assumes that Brave allows us to 1) access its ID generator and 2) specify a previously generated ID to a span instead of always auto-generating.Would this make sense? /cc @anuraaga @adriancole
The text was updated successfully, but these errors were encountered: