spring-projects / spring-projects/spring-boot

Configure MongoDB MicrometerObservabilitySettings

Open
#49,186 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: pending-design-work type: enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.