-
^ |
Beta Was this translation helpful? Give feedback.
Answered by
gajus
Aug 3, 2023
Replies: 1 comment 1 reply
-
Here is an example of a simple interceptor that adds import { context, defaultTextMapSetter } from '@opentelemetry/api';
import { W3CTraceContextPropagator } from '@opentelemetry/core';
// ...
interceptors.push({
transformQuery: (queryContext, query) => {
const propagator = new W3CTraceContextPropagator();
const comments = {};
propagator.inject(context.active(), comments, defaultTextMapSetter);
if ('traceparent' in comments) {
return {
...query,
sql: `${query.sql} /* traceparent='${comments.traceparent}' */`,
};
}
return query;
},
}); Related question https://stackoverflow.com/questions/76831794/how-get-the-traceparent-in-opentelemetry |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
gajus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is an example of a simple interceptor that adds
traceparent
to queries:Related question https://stackoverflow.com/questions/76831794/how-get-…