Skip to content
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 support mongodb driver sync 5.x #3956

Open
burl21 opened this issue Jan 27, 2025 · 1 comment
Open

Add support mongodb driver sync 5.x #3956

burl21 opened this issue Jan 27, 2025 · 1 comment
Labels
agent-java community Issues and PRs created by the community enhancement Enhancement of an existing feature

Comments

@burl21
Copy link

burl21 commented Jan 27, 2025

We have noticed that spans are not being created for MongoDB, and according to the documentation, support is currently available only for MongoDB Driver v3 and v4.

@Bean
// Micrometer
MongoClientSettingsBuilderCustomizer mongoMetricsSynchronousContextProvider(
    ObservationRegistry registry) {
  return (clientSettingsBuilder) ->
      clientSettingsBuilder
          .contextProvider(ContextProviderFactory.create(registry))
          .addCommandListener(new MongoObservationCommandListener(registry));
  }

Stack

  • spring boot v3.4.2
  • mongodb driver sync v5.2.1
  • Elastic APM agent v1.52.1
  • Jdk v23
@github-actions github-actions bot added agent-java community Issues and PRs created by the community triage labels Jan 27, 2025
@JonasKunz JonasKunz added enhancement Enhancement of an existing feature and removed triage labels Jan 27, 2025
@SylvainJuge
Copy link
Member

As an alternative, this is supported by OpenTelemetry instrumentation, even if there is no explicit instrumentation for 5.x, the 4.x version seems to remain. While I did not run an exhaustive test, the initial testing with a simple spring-boot example application worked as expected with dedicated spans for MongoDB, so I think we can assume it should work for most cases.

That means using any of the following agents for instrumentation allows to work-around this limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-java community Issues and PRs created by the community enhancement Enhancement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants