Skip to content

Multiple baggage headers do not work for gRPC #4066

@ncabanis

Description

@ncabanis

Describe the bug
The specification allows to add multiple baggage headers to a request. The otel-agent regards only the last one.

Steps to reproduce
Doing a gRPC request with multiple keys in one header does work:

grpcurl 
    -plaintext -d '{ "message": "something" }' 
    -H "baggage: first=A, second=B"
    localhost:8080 echo.EchoService.ping

Calling headers.get(baggageKey) results here in "first=A; second=B".

Doing a gRPC request with multiple keys over multiple headers does not work:

grpcurl 
    -plaintext -d '{ "message": "something" }' 
    -H "baggage: first=A" 
    -H "baggage: second=B"
    localhost:8080 echo.EchoService.ping

Calling headers.get(baggageKey) results here in "second=B".
Correct would be to call headers.getAll(baggageKey) which returns ["first=A", "second=B"].

What did you expect to see?
All baggage keys should be available via Baggage.current().

What did you see instead?
Only the last headers value.

What version are you using?
v1.2.0, v1.3.0, v1.5.3

Environment
gRPC 1.40.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions