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
ConstructorsConstructorDescriptionMongoHandlerContext(com.mongodb.event.CommandStartedEvent commandStartedEvent, com.mongodb.RequestContext requestContext) -
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.event.CommandStartedEventcom.mongodb.RequestContextvoidsetCommandFailedEvent(com.mongodb.event.CommandFailedEvent commandFailedEvent) voidsetCommandSucceededEvent(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
-
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
-
getContextualName
- Specified by:
getContextualNamein interfaceio.micrometer.observation.Observation.ContextView- Overrides:
getContextualNamein classio.micrometer.observation.Observation.Context
-
setCommandSucceededEvent
public void setCommandSucceededEvent(com.mongodb.event.CommandSucceededEvent commandSucceededEvent) -
setCommandFailedEvent
public void setCommandFailedEvent(com.mongodb.event.CommandFailedEvent commandFailedEvent)
-