GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — gRPC server instrumentations (grpc-1.5, armeria-grpc) don't make extracted W3C baggage current in the handler · Issue #12654 · DataDog/dd-trace-java Open Labels comp: context propagationTrace context propagationinst: grpcgRPC instrumentationtype: feature request DescriptionTracer Version(s)1.56.0, 1.66.0 (observed); master at 02d50d2 (code reading) Java Version(s)17.0.13 JVM VendorEclipse Adoptium / Temurin Bug ReportgRPC server instrumentations (
The Root cause. Both
Call sites:
HTTP servers don't have this problem. They were moved to full-context extraction in #8820: Observed (dd-java-agent 1.56.0 and 1.66.0; Armeria 1.33.4 and 1.41.0). An agent-less client sends
The result was the same with the OTel bridge unset, apart from the Other callers of the deprecated helper (master at 02d50d2, non-test code). I found these by reading the code and have not reproduced them. They look like they have the same shape: extract, keep only the span context, then activate a span-only context.
I've seen #11286 and the note there that W3C baggage was initially scoped to HTTP. gRPC carries Expected BehaviorWhen a gRPC server span is started from extracted headers, the rest of the extracted context (W3C baggage) is current for the whole call, as it is for HTTP servers. In particular:
Reproduction CodeMinimal Spock test against class GrpcServerBaggageTest extends InstrumentationSpecification { def "inbound baggage is current in unary handler"() { setup: Map<String, String> seen = null def greeter = new GreeterGrpc.GreeterImplBase() { @Override void sayHello(Helloworld.Request req, StreamObserver<Helloworld.Response> obs) { seen = Baggage.fromContext(Context.current())?.asMap() obs.onNext(Helloworld.Response.newBuilder().setMessage("hi").build()) obs.onCompleted() } } def name = InProcessServerBuilder.generateName() def server = InProcessServerBuilder.forName(name).addService(greeter).directExecutor().build().start() def md = new Metadata() md.put(Metadata.Key.of("baggage", Metadata.ASCII_STRING_MARSHALLER), "user.id=abc123") def channel = InProcessChannelBuilder.forName(name) .intercept(MetadataUtils.newAttachHeadersInterceptor(md)).directExecutor().build() when: GreeterGrpc.newBlockingStub(channel).sayHello(Helloworld.Request.newBuilder().setName("x").build()) then: seen == ["user.id": "abc123"] // on master: seen == null (a span is current, baggage is not) cleanup: channel.shutdownNow(); server.shutdownNow() } } Activity
MetadataMetadataAssigneesLabelscomp: context propagationTrace context propagationinst: grpcgRPC instrumentationtype: feature request TypeProjectsMilestoneRelationshipsDevelopmentIssue actions | |||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |