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
Spring Boot Client worked on Spring Boot 2.0.0.M3 but fails on 2.0.0.M4 #299
Comments
This client does not support Spring 2. |
Any idea when it will? |
Spring 2 has its own instrumentation thing that now supports labels so I'm not sure there's anything to be done there. We continue to recommend using client_java directly rather than any other instrumentation system. |
To clarify: You recommend to use only the client_java instead of the spring-boot module and spring-web module? How would you run the client_java servlet in the Spring Boot application? |
For instrumentation, yes.
Use whatever exposition works for you, probably PrometheusEndpoint in simpleclient_spring_boot here. |
That one isn't working anymore in Spring 2.0.0.M4. Do you plan on upgrading the Endpoint to Spring 2 isn't that feasable? |
I believe Spring 2 has Prometheus exposition out of the box. |
@nickstolwijk You merely need to remove your dependency/usage of @brian-brazil is correct in the Spring Boot 2 now uses MicroMeter.io for metrics and autoconfigures Prometheus support if you are using the client already. Brian, would it be acceptable to add a deprecation warning/explanation to the readme for |
As far as I'm aware Spring 2.0 isn't officially released yet, so I'd hold off on a deprecation warning. A note that it won't work with 2.0 would make sense though. |
@checketts can you please elaborate on how you got this working with Spring Boot 2.0.0? I'm using |
@britter Remove the dependency on Essentially Spring is now using Micrometer to handle the Prometheus configuration. Include the Prometheus java |
@checketts thanks a lot! |
Could somebody show their pom.xml working with spring boot 2? |
+1 on @sbilello's request |
Pom.xml:
<!-- Monitoring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
Application.yml:
management:
endpoints:
web:
exposure:
include: "*"
server:
port: 8081
…On Wed, 18 Jul 2018, 22:16 Moshe Ben Shoham, ***@***.***> wrote:
+1 on @sbilello <https://github.com/sbilello>'s request
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#299 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABfWos_si7I0BsN8MnmfdeSabY-DJTrnks5uH5ehgaJpZM4PwIC4>
.
|
Thanks a lot, @nickstolwijk. Just to complete the discussion, this makes Prometheus metrics to be exposed at http://whatever:8081/actuator/prometheus |
Yeah, we have 8080 on public in K8s and 8081 only internal.
…On Wed, 18 Jul 2018, 22:42 Moshe Ben Shoham, ***@***.***> wrote:
Thanks a lot, @nickstolwijk <https://github.com/nickstolwijk>.
Just to complete the discussion, this makes Prometheus metrics to be
exposed at http://whatever:8081/actuator/prometheus
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#299 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABfWorwpGLgiRgavsolyaZl9z24SZNUIks5uH52kgaJpZM4PwIC4>
.
|
In case anybody is still looking, here is a working application: https://github.com/arun-gupta/spring-boot-prometheus |
It's not working man. The metrics you are creating in the controller don't get exposed. Where is "requests_total" in the output of curl http://$ENDPOINT/actuator/prometheus ? |
I just tried to upgrade my Spring Boot from 2.0.0.M3 to M4, but the Prometheus Client failed with a ClassNotFoundException. It worked fine on M3. Was that by coincidence or is it tested?
Stacktrace:
nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class io.prometheus.client.spring.boot.PrometheusEndpointConfiguration
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:620)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:300)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:166)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:271)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:138)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)
... 62 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class io.prometheus.client.spring.boot.PrometheusEndpointConfiguration
at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:169)
at org.springframework.context.annotation.ConfigurationClassParser.retrieveBeanMethodMetadata(ConfigurationClassParser.java:390)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:315)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:610)
... 78 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/actuate/endpoint/AbstractEndpoint
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:158)
... 82 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.AbstractEndpoint
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 98 common frames omitted
The text was updated successfully, but these errors were encountered: