Skip to content

Add tracing support using Micrometer #1695

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add tracing support using Micrometer #1695

wants to merge 1 commit into from

Conversation

nhachicha
Copy link
Contributor

@nhachicha nhachicha commented Apr 29, 2025

@nhachicha nhachicha self-assigned this Apr 29, 2025
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

I'm liking the approach.

Does this meet the spec for transactions and retryable operations?

I'm hoping so as both OperationContext#withSessionContext and OperationContext#withTimeoutContext reuse the operation id.

However, it would be worth clarifying before reviewing further.

import com.mongodb.internal.tracing.TraceContext;

public class MicrometerTracer implements Tracer {
private final io.micrometer.tracing.Tracer tracer;
Copy link
Member

Choose a reason for hiding this comment

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

I believe these can be imported and you don't need to use full path names. Even though this dependency is optional, it will be there at compile time (and in testing) so would only be an issue if a user tried to import the class without taking the dependency.

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.

2 participants