Skip to content

Disable actuator metrics by default#927

Merged
dennisvang merged 9 commits into
masterfrom
fix/metrics-opt-in
Jun 15, 2026
Merged

Disable actuator metrics by default#927
dennisvang merged 9 commits into
masterfrom
fix/metrics-opt-in

Conversation

@dennisvang

@dennisvang dennisvang commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Refactored configuration of the actuator http.server.requests metrics in order to make it opt-in instead of opt-out.

The (experimental) metrics are now disabled by default and can be enabled by exposing the metrics endpoint, as in management.endpoints.web.exposure.include=health,info,metrics (default is health,info).

This can also be done using an environment variable:

MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=health,info,metrics

The application.yml based metrics filtering has been replaced by a new MeterRegistryCustomizer bean, which denies all meters except http.server.requests.
This simplifies configuration for users, because they only need to worry about exposing the metrics endpoint as described above.

In addition, ActuatorConfig was renamed to ActuatorMetricsConfig for clarity.

related to #836

with comments to explain how to enable
This makes it easier to enable/disable the metrics just by exposing 'metrics', instead of changing two separate configuration settings.
Also clarifies the intention of filtering and is easier to override using env variable MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE.
@dennisvang dennisvang changed the title Make actuator metrics opt-in Disable actuator metrics by default Jun 15, 2026
@dennisvang dennisvang merged commit 780172a into master Jun 15, 2026
1 check passed
@dennisvang dennisvang deleted the fix/metrics-opt-in branch June 15, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant