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

Enable passing OTEL trace context to client's query methods #303

Open
martijnthe opened this issue Feb 17, 2024 · 0 comments
Open

Enable passing OTEL trace context to client's query methods #303

martijnthe opened this issue Feb 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@martijnthe
Copy link
Contributor

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

As per the ClickHouse docs:

ClickHouse accepts trace context HTTP headers, as described by the W3C recommendation.

At the moment, there is no clean way to pass Open Telemetry trace context when calling a client's query methods.
I realize the feature is "experimental", but the format of the header and OTEL itself can be deemed as stable. Therefore it's unlikely to change at the client layer and probably fine to already implement (but of course up to the maintainers to decide).

Describe the solution you'd like

I'd like to be able to pass a trace_context: TraceContext query arg to each of the query methods, which would set the trace context headers/metadata when making the request to the server.

The TraceContext object would contain a subset of the fields from OTEL's SpanContext -- only the fields that need to be included in the header.

Describe alternatives you've considered

One can implement this functionality by subclassing the client class of course, but it would be nice if it's built-in.

Additional context

@martijnthe martijnthe added the enhancement New feature or request label Feb 17, 2024
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

No branches or pull requests

1 participant