Skip to content
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

adds clues.Inherit for client propagation #83

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

ryanfkeepers
Copy link
Contributor

Since clues is designed around strict context-bound propagation of values, it runs across some hiccups which other packages tend to solve with global instances. Namely, patterns where a main func initializes clients (such as otel) but processes requests with a separate context, as is traditional with http servers.

The Inherit(from, to) func gives callers a plug which they can use to propagate clients from their initialized context into individual request-bound contexts, which can be utilized in a http handler middleware.

@ryanfkeepers ryanfkeepers added the enhancement New feature or request label Nov 27, 2024
@ryanfkeepers ryanfkeepers self-assigned this Nov 27, 2024
Base automatically changed from otel-metrics-2 to main December 4, 2024 16:38
Since clues is designed around strict context-bound propagation of
values, it runs across some hiccups which other packages tend to solve
with global instances.  Namely, patterns where a main func initializes
clients (such as otel) but processes requests with a separate context,
as is traditional with http servers.

The Inherit(from, to) func gives callers a plug which they
can use to propagate clients from their initialized context into
individual request-bound contexts, which can be utilized in a http
handler middleware.
@ryanfkeepers ryanfkeepers merged commit 3817933 into main Dec 4, 2024
1 check passed
@ryanfkeepers ryanfkeepers deleted the inherit-clients branch December 4, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants