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

Extract Mongo library instrumentation #2789

Merged
merged 8 commits into from
Apr 14, 2021

Conversation

anuraaga
Copy link
Contributor

No description provided.

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines 70 to 74
for (CommandListener commandListener : commandListeners) {
if (commandListener instanceof TracingCommandListener) {
return;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

this may have been protecting against calling build() twice on the same builder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good point, restored dedupe. Strangely a new test I added doesn't fail even without these though, haven't dug into why that might be.

Copy link
Member

Choose a reason for hiding this comment

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

a new test I added doesn't fail even without these though

oh no, maybe it's not needed after all(?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if our workForTraces doesn't actually check for extra traces? I thought it did

Copy link
Member

Choose a reason for hiding this comment

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

try putting a sleep before it to give the second trace time to get there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't really anywhere to put a sleep - build just causes two listeners to be registered, which I could confirm in the debugger and Thread.dumpStack. Weird but not sure I'll dig too much into it

Anuraag Agrawal added 2 commits April 14, 2021 10:58
Comment on lines +63 to +70
@Override
void createCollectionCallingBuildTwice(String dbName, String collectionName) {
def options = MongoClientOptions.builder().description("some-description")
configureMongoClientOptions(options)
options.build()
MongoDatabase db = new MongoClient(new ServerAddress("localhost", port), options.build()).getDatabase(dbName)
db.createCollection(collectionName)
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

}

then:
assertTraces(1) {
Copy link
Member

Choose a reason for hiding this comment

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

try putting the sleep before this line, but agree not worth a lot of time, thx for adding the test and verifying manually 👍

@anuraaga anuraaga merged commit b416ece into open-telemetry:main Apr 14, 2021
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

3 participants