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

Instrumentation: Fixes bug where database queries were instrumented twice #54880

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

bergquist
Copy link
Contributor

This is a bug due to me miss understanding the driver.ErrSkip error from the sql package.

Instead of treating driver.ErrSkip as not an error we should ignore it completely and return. The sql package will continue executing the same query later anyway.

More details in DataDog/dd-trace-go#270

Could potentially be fixed in qustavo/sqlhooks#52 as well

to setup jaeger locally for testing

docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
make devenv sources=jaeger

you can find the jaeger UI at http://localhost:16686/

grafana.ini

[tracing.jaeger]
address = localhost:6831

[feature_toggles]
database_metrics = true

Signed-off-by: bergquist [email protected]

@bergquist bergquist added type/bug area/instrumentation instrumentation for Grafanas codebase. area/backend add to changelog backport v9.1.x Bot will automatically open backport PR labels Sep 8, 2022
@bergquist bergquist added this to the 9.1.4 milestone Sep 8, 2022
@bergquist bergquist requested a review from a team as a code owner September 8, 2022 08:34
@bergquist bergquist requested review from sakjur, sh0rez and ying-jeanne and removed request for a team September 8, 2022 08:34
@bergquist bergquist changed the title instrumentation: dont instrument ErrSkip at all Instrumentation: Fixes bug where database queries were instrumented twice Sep 8, 2022
@bergquist bergquist added no-changelog Skip including change in changelog/release notes and removed add to changelog labels Sep 8, 2022
@bergquist
Copy link
Contributor Author

Avoiding changelog since this feature is behind a feature toggle.

@bergquist bergquist merged commit b4e3c89 into main Sep 8, 2022
@bergquist bergquist deleted the instrumentation_dont_instrument_err_skip branch September 8, 2022 09:14
grafanabot pushed a commit that referenced this pull request Sep 8, 2022
Signed-off-by: bergquist <[email protected]>
(cherry picked from commit b4e3c89)
bergquist added a commit that referenced this pull request Sep 8, 2022
Signed-off-by: bergquist <[email protected]>
(cherry picked from commit b4e3c89)

Co-authored-by: Carl Bergquist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend area/instrumentation instrumentation for Grafanas codebase. backport v9.1.x Bot will automatically open backport PR enterprise-ok no-changelog Skip including change in changelog/release notes type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants