quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Move MongoDB Client Tracing to OpenTelemetry

Open radcortez opened this issue 2 years ago • 14 comments

Description

The MongoDB Client Extension uses OpenTracing for Tracing. We need to move it to OpenTelemetry because CNCF has archived OpenTracing: https://www.cncf.io/blog/2022/01/31/cncf-archives-the-opentracing-project.

Implementation ideas

No response

radcortez avatar Oct 10 '22 12:10 radcortez

/cc @Ladicek, @brunobat, @evanchooly, @loicmathieu

quarkus-bot[bot] avatar Oct 10 '22 12:10 quarkus-bot[bot]

I'm not opposing the move but, for posterity's sake, perhaps some reasoning would help.

evanchooly avatar Oct 10 '22 14:10 evanchooly

Sure. Updated the description.

radcortez avatar Oct 10 '22 22:10 radcortez

Maybe we should support both not ? Or does Quarkus plan to drop support to OpenTracing ?

loicmathieu avatar Oct 17 '22 14:10 loicmathieu

Yes, the plan is to drop OpenTracing. As pointed out here: https://www.cncf.io/blog/2022/01/31/cncf-archives-the-opentracing-project, OpenTracing is archived by CNCF.

We have problems fixing current issues because no new releases are being cut. In some cases, we had to fork the code and release it in a different GAV. We want to encourage users to move to OpenTelemetry, since OpenTracing is dead now.

radcortez avatar Oct 17 '22 14:10 radcortez

@radcortez if we plan to drop support for Quarkus so OK for me to move the current MongoDB support from OpenTracing to OpenTelemetry. There is a command listener used to trace each MongoDB command (request / query) here: https://github.com/quarkusio/quarkus/blob/main/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/tracing/MongoTracingCommandListener.java it currently delegates to a command listener from the OpenTracing contrib MongoDB instrumentation. If such instrumentation exist for OpenTelemetry it should be updated to use it.

loicmathieu avatar Oct 17 '22 14:10 loicmathieu

There is some instrumentation available here: https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/mongo, but I didn't look into it yet.

radcortez avatar Oct 17 '22 14:10 radcortez

@radcortez these are based on a Java agent which is a different strategy that should not need anything on our side but as it required JVMTI will not work in native.

loicmathieu avatar Oct 17 '22 14:10 loicmathieu

There is also library support, but only for 3.1: https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/mongo/mongo-3.1/library.

radcortez avatar Oct 17 '22 15:10 radcortez

It also uses a command listener so we may be able to use it like we did for OpenTracing, I don't know why it is for 3.1 maybe it can also be used for the version 4, it needs to be tested anyway.

loicmathieu avatar Oct 17 '22 15:10 loicmathieu

Hi guys, do you have any updates on this one?

sifraden avatar Sep 08 '23 05:09 sifraden

Not yet but I moved the implementation target to next quarter, @sifraden

brunobat avatar Sep 08 '23 08:09 brunobat

FYI, I've tested the OpenTelemetry agent's MongoDB driver instrumentation, and it works with the latest release of the driver (4.10 at the time I tested).

CC @evanchooly

jyemin avatar Sep 27 '23 01:09 jyemin

Hi @radcortez, since you are the assignee, maybe you could review PR? thx

vkn avatar Apr 23 '24 11:04 vkn

Fixed by #40191

loicmathieu avatar Apr 29 '24 15:04 loicmathieu