Skip to content

Ability to extract current otel context from grpc context #11965

Open
@svametcalf

Description

@svametcalf

Is your feature request related to a problem? Please describe.

We are currently using grpc and the reactive-grpc generators in Spring. To make the tracing infrastructure all gel together, we are needing to provide a bridge between the gRPC context and Reactor Context, so that other Spring libraries can correlate started spans.

Currently, there is not a way to access the otel context value that has been stored in the gRPC context, because the gRPC Context uses reference equality for access and the key instances that have been used for storage are private.

Describe the solution you'd like

We would need a public Context.Key somewhere, so that the current otel context could be accessed. For example:

ContextStorageBridge.OTEL_CONTEXT.get(Context.current())  // this could be anywhere, it just needs to be `public`

This way, we can pass this context value to the Reactor pipeline

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions