Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>5.0.0-SNAPSHOT</version>
<version>5.0.x-GH-5009-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Spring Data MongoDB</name>
Expand Down
2 changes: 1 addition & 1 deletion spring-data-mongodb-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>5.0.0-SNAPSHOT</version>
<version>5.0.x-GH-5009-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion spring-data-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>5.0.0-SNAPSHOT</version>
<version>5.0.x-GH-5009-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
*
* @author Mark Paluch
* @since 3.0
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
public class ContextProviderFactory {

private static final boolean SYNCHRONOUS_PRESENT = ClassUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
* @author Mark Paluch
* @author Michal Domagala
* @since 4.0
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
class DefaultMongoHandlerObservationConvention implements MongoHandlerObservationConvention {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
* @author Marcin Grzejszczak
* @author Greg Turnquist
* @since 4.0.0
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
record MapRequestContext(Map<Object, Object> map) implements RequestContext {

public MapRequestContext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
* @author Greg Turnquist
* @author Mark Paluch
* @since 4.0
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
public class MongoHandlerContext extends SenderContext<Object> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
*
* @author Greg Turnquist
* @since 4
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
public interface MongoHandlerObservationConvention extends ObservationConvention<MongoHandlerContext> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
*
* @author Mark Paluch
* @since 4.4.9
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
record MongoKeyName<C>(String name, boolean required, Function<C, @Nullable Object> valueFunction) implements KeyName {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
* @author Marcin Grzejszczak
* @author Greg Turnquist
* @since 4.0
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
enum MongoObservation implements ObservationDocumentation {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
* @author Greg Turnquist
* @author François Kha
* @since 4.0
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
public class MongoObservationCommandListener implements CommandListener {

private static final Log log = LogFactory.getLog(MongoObservationCommandListener.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
*
* @author Mark Paluch
* @since 4.4.9
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@Deprecated(since = "5.0", forRemoval = true)
class Observer {

private final List<MongoKeyName.MongoKeyValue> keyValues = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Infrastructure to provide driver observability using Micrometer.
* @deprecated since 5.0 in favor of native MongoDB Java Driver observability support.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.data.mongodb.observability;
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
[[mongodb.observability]]
= Observability

[WARNING]
====
Spring Data MongoDB's flavor of observability has been deprecated and is scheduled for removal in favor of the observability support being directly built into the MongoDB Java Driver which can be configured as outlined below:

[source,java]
----
@Bean
MongoClientSettingsBuilderCustomizer mongoDbObservabilitySettings(ObservationRegistry registry) {
return (clientSettingsBuilder) -> {
clientSettingsBuilder.observabilitySettings(ObservabilitySettings.micrometerBuilder()
.observationRegistry(observationRegistry)
.build());
};
}
----
====

Spring Data MongoDB currently has the most up-to-date code to support Observability in your MongoDB application.
These changes, however, haven't been picked up by Spring Boot (yet).
Until those changes are applied, if you wish to use Spring Data MongoDB's flavor of Observability, you must carry out the following steps.
Expand Down