|
25 | 25 | import org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties;
|
26 | 26 | import org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter;
|
27 | 27 | import org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration;
|
| 28 | +import org.springframework.boot.actuate.autoconfigure.observation.ObservationProperties; |
28 | 29 | import org.springframework.boot.autoconfigure.AutoConfiguration;
|
29 | 30 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
30 | 31 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
@@ -61,11 +62,15 @@ class MeterFilterConfiguration {
|
61 | 62 |
|
62 | 63 | @Bean
|
63 | 64 | @Order(0)
|
64 |
| - MeterFilter metricsHttpClientUriTagFilter(MetricsProperties properties) { |
65 |
| - String metricName = properties.getWeb().getClient().getRequest().getMetricName(); |
66 |
| - MeterFilter denyFilter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format( |
67 |
| - "Reached the maximum number of URI tags for '%s'. Are you using 'uriVariables'?", metricName)); |
68 |
| - return MeterFilter.maximumAllowableTags(metricName, "uri", properties.getWeb().getClient().getMaxUriTags(), |
| 65 | + @SuppressWarnings("deprecation") |
| 66 | + MeterFilter metricsHttpClientUriTagFilter(ObservationProperties observationProperties, |
| 67 | + MetricsProperties metricsProperties) { |
| 68 | + String metricName = metricsProperties.getWeb().getClient().getRequest().getMetricName(); |
| 69 | + String observationName = observationProperties.getHttp().getClient().getRequests().getName(); |
| 70 | + String name = (observationName != null) ? observationName : metricName; |
| 71 | + MeterFilter denyFilter = new OnlyOnceLoggingDenyMeterFilter(() -> String |
| 72 | + .format("Reached the maximum number of URI tags for '%s'. Are you using 'uriVariables'?", name)); |
| 73 | + return MeterFilter.maximumAllowableTags(name, "uri", metricsProperties.getWeb().getClient().getMaxUriTags(), |
69 | 74 | denyFilter);
|
70 | 75 | }
|
71 | 76 |
|
|
0 commit comments