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

feat: adding instrumentation support for mongo-driver/v2 #6539

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

AlaricWhitney
Copy link

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 with drivertest in the unit testing.

This addresses PR #6419

@AlaricWhitney AlaricWhitney requested a review from a team as a code owner December 28, 2024 17:52
Copy link

linux-foundation-easycla bot commented Dec 28, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 88.98305% with 13 lines in your changes missing coverage. Please review.

Project coverage is 75.8%. Comparing base (5b41ad8) to head (d9dbc54).

Files with missing lines Patch % Lines
...ngodb.org/mongo-driver/v2/mongo/otelmongo/mongo.go 85.7% 9 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##            main   #6539    +/-   ##
======================================
  Coverage   75.7%   75.8%            
======================================
  Files        207     210     +3     
  Lines      19403   19521   +118     
======================================
+ Hits       14695   14800   +105     
- Misses      4273    4282     +9     
- Partials     435     439     +4     
Files with missing lines Coverage Δ
...godb.org/mongo-driver/v2/mongo/otelmongo/config.go 100.0% <100.0%> (ø)
...odb.org/mongo-driver/v2/mongo/otelmongo/version.go 100.0% <100.0%> (ø)
...ngodb.org/mongo-driver/v2/mongo/otelmongo/mongo.go 85.7% <85.7%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmathieu
Copy link
Member

cc @prestonvasquez for review?

Copy link
Contributor

@prestonvasquez prestonvasquez left a 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.

@jakenmbe
Copy link

can this pr merge? I need use it in my project

@dmathieu
Copy link
Member

Not until all review comments have been closed an it has been approved.

AlaricWhitney and others added 10 commits March 18, 2025 13:11
…/example_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/test/mongo_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/test/mongo_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/test/mongo_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/test/mongo_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/test/mongo_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/test/mongo_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/test/mongo_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
…/example_test.go

Co-authored-by: Preston Vasquez <prestonvasquez@icloud.com>
@AlaricWhitney
Copy link
Author

Could you add this new package to the CODEOWNERS file too?

This looks good. I don't have the required mongo knowledge to assert proper behavior though, so I'll let @prestonvasquez weigh on that.

@dmathieu Is there anyone particular I should add as the codeowner of this? I'm not 100% sure what the appropriate process is.

@AlaricWhitney
Copy link
Author

@dmathieu @prestonvasquez This should be ready for review again.

For the CODEOWNERS I have added the entry but left the assignments as blank for now, pending your feedback on how you want to proceed with that.

@dmathieu
Copy link
Member

Is there anyone particular I should add as the codeowner of this?

Keep it blank for now. Though we should probably add @prestonvasquez, if he's ok with it.

@prestonvasquez
Copy link
Contributor

Is there anyone particular I should add as the codeowner of this?

Keep it blank for now. Though we should probably add @prestonvasquez, if he's ok with it.

@dmathieu @AlaricWhitney SGTM, thanks!


// Version is the current release version of the mongo-go-driver V2 instrumentation.
func Version() string {
return "0.60.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @MrAlias

This kinds of goes in the same way as this comment: #6961 (comment)

We should therefore adopt the same behavior. So let's keep commit hashes rather than releases for now (you just need to remove the entries in versions.yaml).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I'll remove the entries from versions.yaml. I'm unsure what needs to be done about the commit hashes, as I don't see any action taken yet with the referenced PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should still add it to excluded modules in versions.yaml, so it doesn't get released. But it gets dependency upgrades on a new release.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. I added it to the excluded modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants