-
Notifications
You must be signed in to change notification settings - Fork 617
feat(tedious): context propagation to SQL Server #3141
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
base: main
Are you sure you want to change the base?
Conversation
|
This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature. |
| cfg.enableTraceContextPropagation && | ||
| thisPlugin._shouldInjectFor(operation); | ||
|
|
||
| if (!shouldInject) return runUserRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous code and this code path will return the return value of the originalMethod() call, which is typically what is wanted when wrapping. The _injectContextInfo() code path below this will not. I gather that won't matter for this instrumentation because, at least currently, every patched method's return type is void.
| ): Promise<void> { | ||
| return new Promise(resolve => { | ||
| try { | ||
| const sql = 'set context_info @opentelemetry_traceparent'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec (https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/sql-server.md#set-context_info) suggests using @traceparent for the parameter name. Does that matter?
(If so, then I gather the .NET impl should change as well.)
Calls
set context_infobefore methods that actually execute user's SQL(omitting prepare and execBulkLoad). Relevant specification. This is opt in as it causes an extra round trip per request. .NET PR for the same thing