You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
publicstaticvoiddoWork(Requestrequest) {
try (Scopess =
tracer
.spanBuilder("MyChildWorkSpan")
.setRecordEvents(true)
.setSampler(Samplers.alwaysSample())
.startScopedSpan()) {
// This I can write myselfvarremoteParent = parseRemoteParentFromIncomingHeaders(request.headers);
// vvvvvvv Setting the parent like this is not possible today vvvvvvvtracer.getCurrentSpan().setParent(remoteParent);
// ^^^^^^^ Setting the parent like this is not possible today ^^^^^^^doImportantThings();
}
}
The reason is that I'm working on an annotations based tracing library.
... but the span is already active by the time I start parsing the incoming propagation headers, so even if I manage to figure out a remote parent I have no way of telling OpenCensus about that.
The implementation of consumePropagationHeaders() would look something like this (but with error handling...):
publicstaticvoidconsumePropagationHeaders(Map<String, String> headers) {
SpanparentFromHeaders = spanFromHeaders(headers);
tracer.getCurrentSpan().setParent(parentFromHeaders); // <-- This does not exist today
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi!
I would like to do this. Code modded from here:
The reason is that I'm working on an annotations based tracing library.
Annotations work fine for internal spans...
Using an annotation processor and some code generation, that will create a span and execute
doStuff()
inside of it. Tested it, works fine.However, for incoming requests I would like to do this:
... but the span is already active by the time I start parsing the incoming propagation headers, so even if I manage to figure out a remote parent I have no way of telling OpenCensus about that.
The implementation of
consumePropagationHeaders()
would look something like this (but with error handling...):The text was updated successfully, but these errors were encountered: