Skip to content

[Bug] java mongo 5.x plugin not support #13296

Closed

Description

@xiaobaiadm

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

OAP server (apache/skywalking)

What happened

The environment information is as follows:
verision info:skywalking-oap-10.2.0
agent:java 9.4.0
mongo-driver:org.mongodb:mongodb-driver-sync:5.0.1

skywalking-api.log If there are a large number of error messages like the following:
ERROR 2025-06-03 00:09:11.384 location-kafka-thread-3 InstMethodsInter : class[class com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor] before method[execute] intercept failure
java.lang.IllegalStateException: Exit span doesn't include meaningful peer information.
at org.apache.skywalking.apm.agent.core.context.TracingContext.inject(TracingContext.java:170)
at org.apache.skywalking.apm.agent.core.context.TracingContext.inject(TracingContext.java:150)
at org.apache.skywalking.apm.agent.core.context.ContextManager.createExitSpan(ContextManager.java:136)
at org.apache.skywalking.apm.plugin.mongodb.v4.support.MongoSpanHelper.createExitSpan(MongoSpanHelper.java:46)
at org.apache.skywalking.apm.plugin.mongodb.v4.interceptor.MongoDBOperationExecutorInterceptor.beforeMethod(MongoDBOperationExecutorInterceptor.java:47)
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:83)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java)
at com.mongodb.client.internal.MongoCollectionImpl.executeInsertMany(MongoCollectionImpl.java:505)
at com.mongodb.client.internal.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:487)
at com.mongodb.client.internal.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:482)
at org.springframework.data.mongodb.core.MongoTemplate.lambda$insertDocumentList$18(MongoTemplate.java:1568)
at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:603)
at org.springframework.data.mongodb.core.MongoTemplate.insertDocumentList(MongoTemplate.java:1561)
at org.springframework.data.mongodb.core.MongoTemplate.doInsertBatch(MongoTemplate.java:1421)
at org.springframework.data.mongodb.core.MongoTemplate.insert(MongoTemplate.java:1360)
at com.gwm.tsp.service.impl.VehicleHistoryLocationServiceImpl.insertLocationList(VehicleHistoryLocationServiceImpl.java:55)
at com.gwm.tsp.consumer.VehicleHistoryLocationKafkaConsumer.recordParseInsertDdeLocation(VehicleHistoryLocationKafkaConsumer.java:143)
at com.gwm.tsp.consumer.VehicleHistoryLocationKafkaConsumer.lambda$listenLocationHistory$0(VehicleHistoryLocationKafkaConsumer.java:86)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

What you expected to happen

Nothing

How to reproduce

Nothing

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Activity

  1. added
    bugSomething isn't working and you are sure it's a bug!
    on Jun 5, 2025
  2. wu-sheng commented on Jun 5, 2025

    @wu-sheng
    Member
  3. added
    agentLanguage agent related.
    pluginPlugin for agent or collector. Be used to extend the capabilities of default implementor.
    javaJava agent related
    and removed
    bugSomething isn't working and you are sure it's a bug!
    on Jun 5, 2025
  4. xiaobaiadm commented on Jun 5, 2025

    @xiaobaiadm
    Author

    Thank you for your reply.

  5. wu-sheng commented on Apr 9, 2026

    @wu-sheng
    Member

    Fixed in apache/skywalking-java#802 (milestone: Java Agent 9.7.0).

    Root cause: MongoDB Java Driver 4.11+ removed Cluster.getDescription(). The MongoRemotePeerHelper now uses getCurrentDescription() instead, which is available since driver 4.x.

    Test coverage extended to MongoDB driver 4.11.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentLanguage agent related.javaJava agent relatedpluginPlugin for agent or collector. Be used to extend the capabilities of default implementor.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions