Class MongoHandlerContext

java.lang.Object
io.micrometer.observation.Observation.Context
org.springframework.data.mongodb.observability.MongoHandlerContext
All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView

public class MongoHandlerContext extends io.micrometer.observation.Observation.Context
A Observation.Context that contains MongoDB events.
Since:
4.0.0
Author:
Marcin Grzejszczak, Greg Turnquist
  • Constructor Summary

    Constructors
    Constructor
    Description
    MongoHandlerContext(com.mongodb.event.CommandStartedEvent commandStartedEvent, com.mongodb.RequestContext requestContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    com.mongodb.event.CommandStartedEvent
     
     
    com.mongodb.RequestContext
     
    void
    setCommandFailedEvent(com.mongodb.event.CommandFailedEvent commandFailedEvent)
     
    void
    setCommandSucceededEvent(com.mongodb.event.CommandSucceededEvent commandSucceededEvent)
     

    Methods inherited from class io.micrometer.observation.Observation.Context

    addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getError, getHighCardinalityKeyValues, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, setContextualName, setError, setName, setParentObservation, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MongoHandlerContext

      public MongoHandlerContext(com.mongodb.event.CommandStartedEvent commandStartedEvent, com.mongodb.RequestContext requestContext)
  • Method Details

    • getCommandStartedEvent

      public com.mongodb.event.CommandStartedEvent getCommandStartedEvent()
    • getRequestContext

      public com.mongodb.RequestContext getRequestContext()
    • getCollectionName

      public String getCollectionName()
    • getContextualName

      public String getContextualName()
      Specified by:
      getContextualName in interface io.micrometer.observation.Observation.ContextView
      Overrides:
      getContextualName in class io.micrometer.observation.Observation.Context
    • setCommandSucceededEvent

      public void setCommandSucceededEvent(com.mongodb.event.CommandSucceededEvent commandSucceededEvent)
    • setCommandFailedEvent

      public void setCommandFailedEvent(com.mongodb.event.CommandFailedEvent commandFailedEvent)