Add operation and collection attributes for MongoDB spans#1398
Merged
Conversation
trask
reviewed
Oct 16, 2020
Comment on lines
+62
to
+66
| mongoSpan(it, 0, { | ||
| assert it.replaceAll(" ", "") == "{\"create\":\"$collectionName\",\"capped\":\"?\"}" || | ||
| it == "{\"create\": \"$collectionName\", \"capped\": \"?\", \"\$db\": \"?\", \"\$readPreference\": {\"mode\": \"?\"}}" | ||
| true | ||
| } | ||
| }, "create", collectionName) |
Member
There was a problem hiding this comment.
if we swap args moving operation and collection before the Closure, then could still use the groovy closure syntax
Contributor
Author
|
Thanks for the feedback @trask! I've updated the tests based on your recommendation (updated the other ones as well to be consistent). I don't really understand what happened with spotlessApply. When I ran it in Windows it didn't find any issues, but running it on Linux worked. Hopefully this should do it but I'll keep an eye on the build status and will fix any more issues if they come up. Thanks so much! |
trask
approved these changes
Oct 17, 2020
iNikem
approved these changes
Oct 19, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change introduces
db.operationanddb.mongodb.collectionattributes to the mongo client instrumentation. Because there is no common functionality fordb.operationinDatabaseClientTracerwe are just overridingonConnectto add mongo specific attributes.In the future, this should be refactored when
db.operationis added across all db instrumetnation.Fixes #1278