-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prometheus tags are not included in exported metrics #24101
Comments
As a workaround, you may add common tag via @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 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
The text was updated successfully, but these errors were encountered: