java.lang.Object
org.apache.skywalking.apm.plugin.mongodb.v3.interceptor.v30.MongoDBInterceptor
All Implemented Interfaces:
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor, org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor

public class MongoDBInterceptor extends Object implements org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor, org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
Intercept method of com.mongodb.Mongo#execute(ReadOperation, ReadPreference) or com.mongodb.Mongo#execute(WriteOperation). record the MongoDB host, operation name and the key of the operation.

only supported: 3.0.x-3.5.x

  • Constructor Details

    • MongoDBInterceptor

      public MongoDBInterceptor()
  • Method Details

    • onConstruct

      public void onConstruct(org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance objInst, Object[] allArguments)
      Specified by:
      onConstruct in interface org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
    • beforeMethod

      public void beforeMethod(org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult result)
      Specified by:
      beforeMethod in interface org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
    • afterMethod

      public Object afterMethod(org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret)
      Specified by:
      afterMethod in interface org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
    • handleMethodException

      public void handleMethodException(org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t)
      Specified by:
      handleMethodException in interface org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor