-
Notifications
You must be signed in to change notification settings - Fork 586
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
feat: adding instrumentation support for mongo-driver/v2 #6539
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6539 +/- ##
=======================================
+ Coverage 68.5% 68.6% +0.1%
=======================================
Files 200 204 +4
Lines 16768 16906 +138
=======================================
+ Hits 11490 11606 +116
- Misses 4933 4950 +17
- Partials 345 350 +5
|
cc @prestonvasquez for review? |
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.
@AlaricWhitney Thank you for putting this together. I wanted to let you know that I'll be reviewing this in stages, as my schedule allows.
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Package otelmongo instruments go.mongodb.org/mongo-driver/mongo. |
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.
// Package otelmongo instruments go.mongodb.org/mongo-driver/mongo. | |
// Package otelmongo instruments go.mongodb.org/mongo-driver/v2/mongo. |
// This package is compatible with v0.2.0 of | ||
// go.mongodb.org/mongo-driver/mongo. |
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.
// This package is compatible with v0.2.0 of | |
// go.mongodb.org/mongo-driver/mongo. |
MongoDB's Go Driver has a major version compatibility guarantee, so this information is necessary for v2.
// This code was originally based on the following: | ||
// - https://github.com/DataDog/dd-trace-go/tree/02f0449efa3cb382d499fadc873957385dcb2192/contrib/go.mongodb.org/mongo-driver/mongo | ||
// - https://github.com/DataDog/dd-trace-go/tree/v1.23.3/ddtrace/ext |
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.
We should update this to note that the code was copied from a specific instance of the v1 instrumentation.
Adding the mongo-driver/v2 instrumentation.
This is a copy/paste of the v1 instrumentation, and was modified to adhere to the mongo-driver/v2 requirements.
Notable differences:
mtest
was removed in v2. Replaced withdrivertest
in the unit testing.This addresses PR #6419