Closed sbouchex closed 11 months ago
As a workaround, you may add common tag via MeterRegistryCustomizer
@Value("${spring.application.name}")
String applicationName;
@Bean
MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
return registry -> registry.config().commonTags("application", applicationName);
}
EDIT: Does setting a static tag via application.properties works?
@atomfrede Editing application.yml does not change anything
@atomfrede the tag is exported if I add [...] management: metrics: tags: application: ${spring.application.name} [...]
Sounds like the default yaml is wrong...
Thanks, I obviously misread your original snippet. Yes the generated one is wrong (see official documentation https://docs.spring.io/spring-boot/docs/3.1.5/reference/htmlsingle/#application-properties.actuator.management.metrics.tags)
@sbouchex can you contribute with a PR?
Overview of the issue
I have generated a simple JWT + angular + JDK17 monolytic app and tried to pull the prometheus metrics
Output looks like: [...] jvm_threads_states_threads{state="runnable",} 23.0 jvm_threads_states_threads{state="blocked",} 0.0 [...]
Whereas, it should be: [...] jvm_threads_states_threads{state="runnable",},application=jh80prom 23.0 jvm_threads_states_threads{state="blocked",},application=jh80prom 0.0 [...]
According to the application.yml: spring: application: name: jh80prom
management: prometheus: metrics: export: enabled: true tags: application: ${spring.application.name}
Motivation for or Use Case
tag must be included and it was included in the JH7 app
Reproduce the error
Generate the app, start it and curl
JHipster Version(s)
8.0 and yes, it's a regression
JHipster configuration
See attachment