Class MongoObservationCommandListener
java.lang.Object
org.springframework.data.mongodb.observability.MongoObservationCommandListener
- All Implemented Interfaces:
com.mongodb.event.CommandListener
@Deprecated(since="5.1",
forRemoval=true)
public class MongoObservationCommandListener
extends Object
implements com.mongodb.event.CommandListener
Deprecated, for removal: This API element is subject to removal in a future version.
since 5.1 in favor of native MongoDB Java Driver observability support.
Implement MongoDB's
CommandListener using Micrometer's Observation API.
NOTE: MongoDB Java Driver 5.7+ comes with observability directly built in which can be configured
via MongoClientSettings.Builder#observabilitySettings(ObservabilitySettings).
We recommend switching to the driver native observability.
- Since:
- 4.0
- Author:
- OpenZipkin Brave Authors, Marcin Grzejszczak, Greg Turnquist, François Kha
-
Constructor Summary
ConstructorsConstructorDescriptionMongoObservationCommandListener(io.micrometer.observation.ObservationRegistry observationRegistry) Deprecated, for removal: This API element is subject to removal in a future version.Create a newMongoObservationCommandListenerto recordObservations.MongoObservationCommandListener(io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable com.mongodb.ConnectionString connectionString) Deprecated, for removal: This API element is subject to removal in a future version.Create a newMongoObservationCommandListenerto recordObservations.MongoObservationCommandListener(io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable com.mongodb.ConnectionString connectionString, MongoHandlerObservationConvention observationConvention) Deprecated, for removal: This API element is subject to removal in a future version.Create a newMongoObservationCommandListenerto recordObservations. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommandFailed(com.mongodb.event.CommandFailedEvent event) Deprecated, for removal: This API element is subject to removal in a future version.voidcommandStarted(com.mongodb.event.CommandStartedEvent event) Deprecated, for removal: This API element is subject to removal in a future version.voidcommandSucceeded(com.mongodb.event.CommandSucceededEvent event) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
MongoObservationCommandListener
public MongoObservationCommandListener(io.micrometer.observation.ObservationRegistry observationRegistry) Deprecated, for removal: This API element is subject to removal in a future version.Create a newMongoObservationCommandListenerto recordObservations.- Parameters:
observationRegistry- must not be null
-
MongoObservationCommandListener
public MongoObservationCommandListener(io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable com.mongodb.ConnectionString connectionString) Deprecated, for removal: This API element is subject to removal in a future version.Create a newMongoObservationCommandListenerto recordObservations. This constructor attaches theConnectionStringto everyObservation.- Parameters:
observationRegistry- must not be nullconnectionString- can be null
-
MongoObservationCommandListener
public MongoObservationCommandListener(io.micrometer.observation.ObservationRegistry observationRegistry, @Nullable com.mongodb.ConnectionString connectionString, MongoHandlerObservationConvention observationConvention) Deprecated, for removal: This API element is subject to removal in a future version.Create a newMongoObservationCommandListenerto recordObservations. This constructor attaches theConnectionStringto everyObservationand uses the givenMongoHandlerObservationConvention.- Parameters:
observationRegistry- must not be nullconnectionString- can be nullobservationConvention- must not be null- Since:
- 4.3
-
-
Method Details
-
commandStarted
public void commandStarted(com.mongodb.event.CommandStartedEvent event) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
commandStartedin interfacecom.mongodb.event.CommandListener
-
commandSucceeded
public void commandSucceeded(com.mongodb.event.CommandSucceededEvent event) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
commandSucceededin interfacecom.mongodb.event.CommandListener
-
commandFailed
public void commandFailed(com.mongodb.event.CommandFailedEvent event) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
commandFailedin interfacecom.mongodb.event.CommandListener
-