Class MongoObservationCommandListener
java.lang.Object
org.springframework.data.mongodb.observability.MongoObservationCommandListener
- All Implemented Interfaces:
com.mongodb.event.CommandListener
public final class MongoObservationCommandListener
extends Object
implements com.mongodb.event.CommandListener
Implement MongoDB's
CommandListener
using Micrometer's Observation
API.- Since:
- 4.0.0
- Author:
- OpenZipkin Brave Authors, Marcin Grzejszczak, Greg Turnquist
-
Constructor Summary
ConstructorsConstructorDescriptionMongoObservationCommandListener
(io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
commandFailed
(com.mongodb.event.CommandFailedEvent event) void
commandStarted
(com.mongodb.event.CommandStartedEvent event) void
commandSucceeded
(com.mongodb.event.CommandSucceededEvent event)
-
Constructor Details
-
MongoObservationCommandListener
public MongoObservationCommandListener(io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
commandStarted
public void commandStarted(com.mongodb.event.CommandStartedEvent event) - Specified by:
commandStarted
in interfacecom.mongodb.event.CommandListener
-
commandSucceeded
public void commandSucceeded(com.mongodb.event.CommandSucceededEvent event) - Specified by:
commandSucceeded
in interfacecom.mongodb.event.CommandListener
-
commandFailed
public void commandFailed(com.mongodb.event.CommandFailedEvent event) - Specified by:
commandFailed
in interfacecom.mongodb.event.CommandListener
-