-
Notifications
You must be signed in to change notification settings - Fork 125
Bytecode instrumentation MongoDB #3845
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
Conversation
|
You might be interested in following pieces of code:
|
…ansitive dependencies
| collector.Expect(MongoDBInstrumentationScopeName); | ||
| } | ||
|
|
||
| collector.Expect(MongoDBInstrumentationScopeName, span => ValidateSpan(span)); |
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.
For older versions of MongoDb, is all of the data the same before and after this change? If not, are we concerned about any attributes changing?
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.
Here is example for operation: find
Attributes for older version:
- db.system: mongodb
- db.connection_id: { ServerId : { ClusterId : 1, EndPoint : "Unspecified/localhost:27017" }, LocalValue : 3, ServerValue : "12" }
- db.name: test-db
- db.mongodb.collection: employees
- db.operation: find
- network.transport: tcp
- server.address: localhost
- server.port: 27017
- db.statement: { "find" : "employees", "filter" : { }, "$db" : "test-db", "lsid" : { "id" : CSUUID("a3dc2d19-04fe-43f9-9b88-24a1ddd6af2a") } }
Attributes for new bytecode instrumentation:
- db.system: mongodb
- db.collection.name: employees
- db.namespace: test-db
- db.operation.name: find
- network.peer.address: ::1
- server.address: localhost
- server.port: 27017
- network.peer.port: 27017
db.connection_id and db.statement are not part of the latest semantic conventions. The only difference is that we currently don't have network.transport for this case, but I will add it in the next version of the bytecode MongoDB instrumentation.
Some attribute names have been updated to align with the latest semantic conventions
- db.name -> db.namespace
- db.mongodb.collection -> db.collection.name
- db.operation -> db.operation.name
zacharycmontoya
left a comment
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.
LGTM
Why
Transitioning to bytecode instrumentation because the
MongoDB.DriverandMongoDB.Driver.Corelibraries are being merged into a singleMongoDB.Driverlibrary starting from version 3.0.0Fixes #3738
What
Bytecode instrumentation for MongoDB with following attributes:
The implementation targets
MongoDB.DriverandMongoDB.Driver.Coreversions from 2.7.0 to the latest.Tests
Manual + CI
Checklist
CHANGELOG.mdis updated.