spring-projects / spring-projects/spring-boot
Configure MongoDB MicrometerObservabilitySettings
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Starting with MongoDB Driver 5.7.0, the driver provides a native Micrometer instrumentation through MongoClientSettings:
MicrometerObservabilitySettings observabilitySettings = MicrometerObservabilitySettings.builder()
.observationRegistry(…).build();
MongoClientSettings.builder().observabilitySettings(observabilitySettings);
Using MongoDB's instrumentation should replace MongoMetricsCommandListener as command metrics are provided directly by the driver.
It could make sense to initially flip the defaults for management.metrics.mongodb.command.enabled to matchIfMissing = false as escape hatch for projects that do not immediately want to migrate to the new observability integration. Such a migration path suggests introduction of a config property management.metrics.mongodb.observability.enabled to disable configuration of MicrometerObservabilitySettings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the MongoDB metrics auto-configuration and the existing MongoMetricsCommandListener integration, then trace how MongoClientSettings is built. Review the MongoDB driver's MicrometerObservabilitySettings API and the management.metrics.mongodb properties. Done means native observability can be configured, command metrics defaults and the opt-out property support migration, and relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mongodb
- Domain
- databases, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100