Skip to content
Draft
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 README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The https://spring.io/[spring.io] site contains several guides that show how to
[[building-from-source]]
== Building from Source

You do not need to build from source to use Spring Data. Binaries are available in https://repo.spring.io[repo.spring.io]
You do not need to build from source to use Spring Data. Binaries are available in https://central.sonatype.com[Maven Central] or in case of snapshots from https://repo.spring.io[repo.spring.io]
and accessible from Maven using the Maven configuration noted <<maven-configuration,above>>.

NOTE: Configuration for Gradle is similar to Maven.
Expand Down
17 changes: 12 additions & 5 deletions SECURITY.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Security Policy
= Security Policy

## Supported Versions
== Reporting a Vulnerability

Please see the https://spring.io/projects/spring-data-mongodb[Spring Data MongoDB] project page for supported versions.
Please, https://github.com/spring-projects/security-advisories/security/advisories/new[open a draft security advisory] if you need to disclose and discuss a security issue in private with the Spring Data team.
Note that we only accept reports against https://spring.io/projects/spring-data#support[supported versions].

## Reporting a Vulnerability
For more details, check out our https://spring.io/security-policy[security policy].

== JAR signing

Spring Data JARs released on Maven Central are signed.
You'll find more information about the key here: https://spring.io/GPG-KEY-spring.txt

Versions released prior to 2023 may be signed with a different key.

Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly.
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-5078-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-5078-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-5078-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
/**
* Factory to create a {@link ContextProvider} to propagate the request context across tasks. Requires either
* {@link SynchronousContextProvider} or {@link ReactiveContextProvider} to be present.
* <p>
* <strong>NOTE:</strong> MongoDB Java Driver 5.7+ comes with observability directly built in which can be configured
* via {@code MongoClientSettings.Builder#observabilitySettings(ObservabilitySettings)}.
*
* @author Mark Paluch
* @since 3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

/**
* A {@link Observation.Context} that contains MongoDB events.
* <p>
* <strong>NOTE:</strong> MongoDB Java Driver 5.7+ comes with observability directly built in which can be configured
* via {@code MongoClientSettings.Builder#observabilitySettings(ObservabilitySettings)}.
*
* @author Marcin Grzejszczak
* @author Greg Turnquist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@

/**
* {@link ObservationConvention} for {@link MongoHandlerContext}.
*
* <p>
* <strong>NOTE:</strong> MongoDB Java Driver 5.7+ comes with observability directly built in which can be configured
* via {@code MongoClientSettings.Builder#observabilitySettings(ObservabilitySettings)}.
*
* @author Greg Turnquist
* @since 4
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

/**
* Implement MongoDB's {@link CommandListener} using Micrometer's {@link Observation} API.
* <p>
* <strong>NOTE:</strong> MongoDB Java Driver 5.7+ comes with observability directly built in which can be configured
* via {@code MongoClientSettings.Builder#observabilitySettings(ObservabilitySettings)}.
*
* @author OpenZipkin Brave Authors
* @author Marcin Grzejszczak
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/**
* Infrastructure to provide driver observability using Micrometer.
* <p>
* <strong>NOTE:</strong> MongoDB Java Driver 5.7+ comes with observability directly built in which can be configured
* via {@code MongoClientSettings.Builder#observabilitySettings(ObservabilitySettings)}.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.data.mongodb.observability;
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@
[[mongodb.observability]]
= Observability

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.
[NOTE]
====
MongoDB Java Driver 5.7+ comes with observability directly built in.
We recommend switching to the driver native `ObservabilitySettings`, which can be configured as outlined below:
[source,java]
----
@Bean
MongoClientSettingsBuilderCustomizer mongoDbObservabilitySettings(ObservationRegistry registry) {
return (clientSettingsBuilder) -> {
clientSettingsBuilder.observabilitySettings(ObservabilitySettings.micrometerBuilder()
.observationRegistry(observationRegistry)
.build());
};
}
----
In the light of driver native observability support, the types within the Spring Data provided _org.springframework.data.mongodb.observability_ package will not see further development and are subject to deprecation/removal in subsequent releases.
====

To use Spring Data MongoDB's flavor of Observability you must:

. First of all, you must opt into Spring Data MongoDB's configuration settings by customizing `MongoClientSettings` through either your `@SpringBootApplication` class or one of your configuration classes.
. opt into Spring Data MongoDB's configuration settings by customizing `MongoClientSettings` through either your `@SpringBootApplication` class or one of your configuration classes.
+
.Registering MongoDB Micrometer customizer setup
====
Expand Down