dapr / dapr/go-sdk

Add Baggage Support

Open
#718 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
479
Forks
187
PR merge metrics
No merged PRs in 30d

Description

The Dapr runtime has recently [added support for baggage propagation](https://github.com/dapr/dapr/pull/8649). [Here is the docs PR for reference as well](https://github.com/dapr/docs/pull/4609). Baggage is a mechanism to propagate key-value pairs across service boundaries, which is useful for passing contextual information through distributed traces.

We should add a new function that users can use to add baggage propagation support, working for **both** gRPC and HTTP. This would enable users to provide baggage without having to import OpenTelemetry themselves.

consumer code _example_:
```
ctx = client.WithBaggage(ctx, map[string]string{
"user-id": "12345",
"tenant": "acme",
})

client.InvokeMethod(ctx, ...)
```

We should have tests for both gRPC + HTTP for this functionality.

Contributor guide

Open the contributing guide

Research direction

Start by locating the client invocation paths for gRPC and HTTP and reviewing how context propagation is currently tested. Add the public baggage helper described in the issue, then add coverage for baggage propagation through both transports; done means users can pass the example map without importing OpenTelemetry.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, grpc
Domain
api, distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.