Class MongoHandlerContext
java.lang.Object
io.micrometer.observation.Observation.Context
org.springframework.data.mongodb.observability.MongoHandlerContext
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
ConstructorDescriptionMongoHandlerContext
(com.mongodb.event.CommandStartedEvent commandStartedEvent, com.mongodb.RequestContext requestContext) -
Method Summary
Modifier and TypeMethodDescriptioncom.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
clear, computeIfAbsent, containsKey, get, getAllKeyValues, getError, getHighCardinalityKeyValues, getLowCardinalityKeyValues, getName, getOrDefault, getRequired, put, remove, setContextualName, setError, setName, 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
- Overrides:
getContextualName
in classio.micrometer.observation.Observation.Context
-
setCommandSucceededEvent
public void setCommandSucceededEvent(com.mongodb.event.CommandSucceededEvent commandSucceededEvent) -
setCommandFailedEvent
public void setCommandFailedEvent(com.mongodb.event.CommandFailedEvent commandFailedEvent)
-