-
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
Enhance MongoDb otel integration #40714
Conversation
This comment has been minimized.
This comment has been minimized.
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
A few things:
- You need to add a module to
quarkus-integration-tests-parent
:
<module>opentelemetry-mongodb-client-instrumentation</module>
Bellow <module>opentelemetry-jdbc-instrumentation</module>
- These tests should only run when test container tests are active, to save build time. Tests need to be disabled by default:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
And a new profile must be added. There is a task on the CI to run only these test-containers
tests:
<profiles>
<!-- Note: the container is started via Dev Services -->
<profile>
<id>test-mongodb</id>
<activation>
<property>
<name>test-containers</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
...ions/mongodb-client/deployment/src/test/resources/application-tracing-mongoclient.properties
Outdated
Show resolved
Hide resolved
...ngodb-client-instrumentation/src/test/java/io/quarkus/it/opentelemetry/BookResourceTest.java
Outdated
Show resolved
Hide resolved
...ngodb-client-instrumentation/src/test/java/io/quarkus/it/opentelemetry/BookResourceTest.java
Outdated
Show resolved
Hide resolved
...ngodb-client-instrumentation/src/test/java/io/quarkus/it/opentelemetry/BookResourceTest.java
Outdated
Show resolved
Hide resolved
...db-client/runtime/src/main/java/io/quarkus/mongodb/runtime/MongoReactiveContextProvider.java
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Can you also please add the it project quarkus/.github/native-tests.json Line 120 in 8d8dc6e
Otherwise the tests will not run on native. |
done |
This comment has been minimized.
This comment has been minimized.
@vkn, I see these exceptions on the build, do you have an Idea of the cause? [mongod output] 2024-05-21 11:42:16,111 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (vert.x-eventloop-thread-3) HTTP Request to /reactive-books/invalid failed, error id: 4980e026-f2c7-4790-b8eb-eab7111de4e7-1: com.mongodb.MongoQueryException: Command failed with error 2 (BadValue): 'unknown top level operator: $invalidop. If you have a field name that starts with a '$' symbol, consider using $getField or $setField.' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "unknown top level operator: $invalidop. If you have a field name that starts with a '$' symbol, consider using $getField or $setField.", "code": 2, "codeName": "BadValue"} |
Yes. This is the test for failed query case. So the exception log is expected |
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.
Thanks for the effort @vkn!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Nice addition. I added a few suggestions for the doc.
@vkn nice work! I asked a few micro changes for the doc. Also, it would be awesome if you could squash the commits in one when done (we use merge commits and we can't squash with the GitHub UI when merging). |
Continue PR quarkusio#40191 - Add docs - Add tests - Fix parent-child spans for reactive request
24ea28a
to
c9480af
Compare
@gsmet I've applied your suggestions and squashed the commits |
Status for workflow
|
Status for workflow
|
Hi @gsmet, is there anything else needed from me before merging? |
Nope, just me getting to the second page of PRs :). Thanks for your efforts! |
This PR continues #40191
cc @brunobat