Skip to content

Commit

Permalink
Merge branch '2.4.x'
Browse files Browse the repository at this point in the history
Closes gh-26186
  • Loading branch information
snicoll committed Apr 21, 2021
2 parents d403103 + 8edeb2c commit 6c68f36
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2609,15 +2609,15 @@ include::{include-productionreadyfeatures}/metrics/SampleMeterBinderConfiguratio
----

Using a `MeterBinder` ensures that the correct dependency relationships are set up and that the bean is available when the metric's value is retrieved.
By default, metrics from all `MeterBinder` beans will be automatically bound to the Spring-managed `MeterRegistry`.
A `MeterBinder` implementation can also be useful if you find that you repeatedly instrument a suite of metrics across components or applications.

NOTE: By default, metrics from all `MeterBinder` beans will be automatically bound to the Spring-managed `MeterRegistry`.



[[production-ready-metrics-per-meter-properties]]
=== Customizing Individual Metrics
If you need to apply customizations to specific `Meter` instances you can use the `io.micrometer.core.instrument.config.MeterFilter` interface.
By default, all `MeterFilter` beans will be automatically applied to the micrometer `MeterRegistry.Config`.

For example, if you want to rename the `mytag.region` tag to `mytag.area` for all meter IDs beginning with `com.example`, you can do the following:

Expand All @@ -2626,6 +2626,10 @@ For example, if you want to rename the `mytag.region` tag to `mytag.area` for al
include::{include-productionreadyfeatures}/metrics/MetricsFilterConfiguration.java[tag=*]
----

NOTE: By default, all `MeterFilter` beans will be automatically bound to the Spring-managed `MeterRegistry`.
Make sure to register your metrics using the Spring-managed `MeterRegistry` and not any of the static methods on `Metrics`.
These use the global registry that is not Spring-managed.



[[production-ready-metrics-common-tags]]
Expand Down

0 comments on commit 6c68f36

Please sign in to comment.