Skip to content

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

@xiaobaiadm

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

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions