File tree 2 files changed +18
-1
lines changed
java/org/prebid/cache/config
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import io .micrometer .core .instrument .MeterRegistry ;
4
4
import io .micrometer .core .instrument .config .NamingConvention ;
5
+ import org .apache .commons .lang3 .StringUtils ;
6
+ import org .springframework .beans .factory .annotation .Value ;
5
7
import org .springframework .boot .actuate .autoconfigure .metrics .MeterRegistryCustomizer ;
8
+ import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
6
9
import org .springframework .context .annotation .Bean ;
7
10
import org .springframework .context .annotation .Configuration ;
8
11
@@ -14,4 +17,16 @@ MeterRegistryCustomizer<MeterRegistry> identityNamingConventionMeterCustomizer()
14
17
// To preserve metric names as they defined in code
15
18
return registry -> registry .config ().namingConvention (NamingConvention .identity );
16
19
}
20
+
21
+ @ Bean
22
+ @ ConditionalOnProperty (name = "management.metrics.export.graphite.enabled" , havingValue = "true" )
23
+ MeterRegistryCustomizer <MeterRegistry > graphitePrefixMeterCustomizer (
24
+ @ Value ("${management.metrics.export.graphite.prefix:}" ) String prefix ) {
25
+
26
+ return registry -> {
27
+ if (StringUtils .isNotBlank (prefix )) {
28
+ registry .config ().commonTags ("prefix" , prefix );
29
+ }
30
+ };
31
+ }
17
32
}
Original file line number Diff line number Diff line change @@ -38,9 +38,11 @@ management:
38
38
enabled : false
39
39
host : localhost
40
40
port : 2003
41
+ protocol : plaintext
41
42
step : 1m
42
43
tags-as-prefix :
43
- - prebid
44
+ - prefix
45
+ prefix : prebid
44
46
45
47
# circuit breaker
46
48
circuitbreaker :
You can’t perform that action at this time.
0 commit comments