You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can reproduce this with a simple instrumentation-pg implementation.
constpgInstrumentation=newPgInstrumentation({requestHook: (span: Span,requestInfo: PgRequestHookInformation)=>{// This will appear on query spans, but not connection spans.span.setAttribute('library','pg');},});
...
registerInstrumentations({tracerProvider: provider,instrumentations: [pgInstrumentation,],});
What did you expect to see?
requestHook to be called for all pg spans
What did you see instead?
requestHook is called for pg queries but not connection events
The text was updated successfully, but these errors were encountered:
I'd be happy to send a PR for this. Just let me know how you'd want it to work? The request hook for connection events needs to have different args, since the usual request hook knows the query that the client is running, whereas for connection events there isn't a query.
So we could either make the query part optional, like this:
The latter preserves backcompat and is probably more in line with what a typical user would want, so I'd lean towards that, but I'm happy to implement either.
What version of OpenTelemetry are you using?
@opentelemetry/api 1.6.0
@opentelemetry/instrumentation-pg 0.36.1
What version of Node are you using?
18.18.0
What did you do?
You can reproduce this with a simple instrumentation-pg implementation.
What did you expect to see?
requestHook
to be called for all pg spansWhat did you see instead?
requestHook
is called for pg queries but not connection eventsThe text was updated successfully, but these errors were encountered: