contrib/database/sql: only record spans for implemented driver methods#336
Merged
Conversation
gbbr
force-pushed
the
gbbr/sqlx-errskip
branch
from
September 28, 2018 10:15
06fbf6d to
e3c28f7
Compare
gbbr
force-pushed
the
gbbr/sqlx-errskip
branch
from
September 28, 2018 10:16
e3c28f7 to
336bf6f
Compare
Contributor
Author
mingrammer
pushed a commit
to mingrammer/dd-trace-go
that referenced
this pull request
Dec 22, 2020
DataDog#336) * contrib/database/sql: only record spans for implemented driver methods * contrib/mongodb/mongo-go-driver: update to latest release
2 tasks
nsrip-dd
added a commit
that referenced
this pull request
Jun 21, 2023
…tion trace tasks After #336, spans for database operations are created *after* the operation. This is necessary because some operations may return ErrSkip if they aren't supported, and creating spans with those errors is very noisy. But because of this, execution trace tasks associated with those spans would appear to be only a few microseconds long since they are created alongside the span and thus only cover the very end of the operation. This commit creates execution trace tasks (if the execution tracer is enabled) before the operations, and provides a way of communicating to the APM tracer that it doesn't need to create a task for the span. The APM tracer will still annotate the task with the span ID even if a task was already created. Still TODO: add tests
nsrip-dd
added a commit
that referenced
this pull request
Jun 21, 2023
…tion trace tasks After #336, spans for database operations are created *after* the operation. This is necessary because some operations may return ErrSkip if they aren't supported, and creating spans with those errors is very noisy. But because of this, execution trace tasks associated with those spans would appear to be only a few microseconds long since they are created alongside the span and thus only cover the very end of the operation. This commit creates execution trace tasks (if the execution tracer is enabled) before the operations, and provides a way of communicating to the APM tracer that it doesn't need to create a task for the span. The APM tracer will still annotate the task with the span ID even if a task was already created. Still TODO: add tests
nsrip-dd
added a commit
that referenced
this pull request
Jun 21, 2023
…tion trace tasks After #336, spans for database operations are created *after* the operation. This is necessary because some operations may return ErrSkip if they aren't supported, and creating spans with those errors is very noisy. But because of this, execution trace tasks associated with those spans would appear to be only a few microseconds long since they are created alongside the span and thus only cover the very end of the operation. This commit creates execution trace tasks (if the execution tracer is enabled) before the operations, and provides a way of communicating to the APM tracer that it doesn't need to create a task for the span. The APM tracer will still annotate the task with the span ID even if a task was already created. Still TODO: add tests
nsrip-dd
added a commit
that referenced
this pull request
Jun 26, 2023
…trace tasks (#2060) After #336, spans for database operations are created after the operation. This is necessary because some operations may return ErrSkip if they aren't supported, and creating spans with those errors is very noisy. But because of this, execution trace tasks associated with those spans would appear to be only a few microseconds long since they are created alongside the span and thus only cover the very end of the operation. This commit creates execution trace tasks (if the execution tracer is enabled) before the operations, and provides a way of communicating to the APM tracer that it doesn't need to create a task for the span. The APM tracer will still annotate the task with the span ID even if a task was already created.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instrumentation for some packages (such as
jmoiron/sqlx) is tracing calls returningdriver.ErrSkip, causing not only duplicate traces, but also APM errors where in fact there were none.From
(database/sql/driver).ErrSkip:This is not a user error and in these cases we should not perform any tracing. See #270 for a detailed overview of the problem.
Fixes #270
TODO