-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add mongo commands to otel span attributes #40191
Conversation
Thanks for your pull request! The title of your pull request does not follow our editorial rules. Could you have a look?
This message is automatically generated by a bot. |
9e109de
to
8e551cf
Compare
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 looks like a very good contribution. I took the liberty to squash the commits and rebase.
@brunobat @loicmathieu could you have a look? It looks like a very nice addition.
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.
Overall it's good to me, very small integration so it's better not to rely on an external lib for that.
I add one suggestion but we can merge as is.
I'm also concern about the cost of adding one integration test for that, it's a lot for such small integration, I wonder if it's really needed WDYT @gsmet ? We can either add that in the existing MongoDB test or only rely on the unit test.
...godb-client/deployment/src/main/java/io/quarkus/mongodb/deployment/MongoClientProcessor.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
Will also fix #40191 |
Status for workflow
|
This is interesting. I wonder if we can add the same telemetry support to ORM and HR/Panache static methods. |
Was on PTO and only now I saw this... @vkn are you available to refactor the code in that way? Also we lack documentation entries and additional IT tests for Uni, Multi, parent-child relationships and failure cases. Also, the assertions need to verify the attributes of the spans. |
Context parentContext = Context.current(); | ||
if (instrumenter.shouldStart(parentContext, event)) { | ||
Context context = instrumenter.start(parentContext, event); | ||
requestMap.put(event.getRequestId(), new ContextEvent(context, event)); |
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.
I'm concerned with the amount of data you are storing here... can you give an example of one of this events?
Can you just store what you need later?
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.
@brunobat it is not big, just description of mongo connection, db name and command. You can inspect it by using BookResourceTest
. But I could create another record to just save command name and the command itself, if you prefer
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.
@brunobat I've moved the implementation to opentelemetry extension. Is this enough for a new PR?
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.
It is but there are also other improvements needed:
Also we lack documentation entries and additional IT tests for Uni, Multi, parent-child relationships and failure cases.
Also, the assertions need to verify the attributes of the spans.
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.
Continue PR quarkusio#40191 - Add docs - Add tests - Fix parent-child spans for reactive request
Continue PR quarkusio#40191 - Add docs - Add tests - Fix parent-child spans for reactive request
Continue PR quarkusio#40191 - Add docs - Add tests - Fix parent-child spans for reactive request
Continue PR quarkusio#40191 - Add docs - Add tests - Fix parent-child spans for reactive request
Continue PR quarkusio#40191 - Add docs - Add tests - Fix parent-child spans for reactive request
Solving #28473
A simple approach to add mongo commands to traces using CommandListener. Similar approach as it was in quarkus-opentracing but without relying on https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/mongo/mongo-3.1/library, but using the similiar though simpler code.