Giter VIP home page Giter VIP logo

java-buildpack-metric-writer's People

Contributors

nebhale avatar snyk-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-buildpack-metric-writer's Issues

App fails to start if micrometer is present but Spring Boot actuators are not

   2019-09-27T09:12:39.55+0100 [APP/PROC/WEB/0] OUT 2019-09-27 08:12:39.553  INFO 7 --- [           main] o.s.g.c.a.ClusterAwareConfiguration      : Failed to connect to localhost[10334]
   2019-09-27T09:12:40.58+0100 [APP/PROC/WEB/0] OUT 2019-09-27 08:12:40.587 ERROR 7 --- [           main] o.s.boot.SpringApplication               : Application run failed
   2019-09-27T09:12:40.58+0100 [APP/PROC/WEB/0] OUT java.lang.IllegalArgumentException: Could not find class [org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration]
   2019-09-27T09:12:40.58+0100 [APP/PROC/WEB/0] OUT     at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:327) ~[spring-core-5.2.0.RC2.jar:5.2.0.RC2]
   2019-09-27T09:12:40.58+0100 [APP/PROC/WEB/0] OUT     at org.springframework.core.annotation.TypeMappedAnnotation.adapt(TypeMappedAnnotation.java:479) ~[spring-core-5.2.0.RC2.jar:5.2.0.RC2]
   2019-09-27T09:12:40.58+0100 [APP/PROC/WEB/0] OUT     at org.springframework.core.annotation.TypeMappedAnnotation.getValue(TypeMappedAnnotation.java:403) ~[spring-core-5.2.0.RC2.jar:5.2.0.RC2]

This is because of the way the conditions are structured in the autoconfig:

@AutoConfigureBefore(value={MetricsAutoConfiguration.class})
@ConditionalOnClass(value={MeterFilter.class})
@ConditionalOnCloudPlatform(value=CloudPlatform.CLOUD_FOUNDRY)
@Configuration
class CloudFoundryTagsMeterFilterAutoConfiguration {

Support Spring Boot 2 / Micrometer

org.springframework.boot.actuate.endpoint.PublicMetrics does not exist in Spring Boot 2. So, CloudFoundryMetricsAutoConfiguration isn't enabled for Spring Boot 2.

Do you have any plan to support Spring Boot 2 / Micrometer?

Failed to send Spring Boot metrics to Metrics Forwarder service due to unprocessable payload

We are gettings this exception for an app binded to the PCF Metrics Forwarder (PCF 2.0.21)

It is at application startup. We've enabled debug level logging and it looks like a large amount of metrics is being sent. Can that be the cause?

Anybody seen this?

14-09-2018 17:55:08.441 [pool-2-thread-1,,,] ERROR o.c.m.RestOperationsMetricPublisher - Failed to send Spring Boot metrics to Metrics Forwarder service due to unprocessable payload. Discarding metrics.
org.springframework.web.client.HttpClientErrorException: 422 Unprocessable Entity
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:85) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:708) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:661) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:621) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:415) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
at org.cloudfoundry.metrics.RestOperationsMetricPublisher.publish(RestOperationsMetricPublisher.java:62) ~[metric_writer-2.4.0_RELEASE.jar!/:na]
at org.cloudfoundry.metrics.boot1.SpringBootMetricWriter.publish(SpringBootMetricWriter.java:75) [metric_writer-2.4.0_RELEASE.jar!/:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_181]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[na:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_181]

Document expected metrics forwarder API format

Readme.md specifies that the metrics writer:

writes metric updates to a Metron endpoint

However, the metron endpoint only supports UDP and GRPC endpoints (according to doc and tests).

The metrics writer tests seem to assume the remote endpoint accepts HTTP JSON endpoints.

Is the metrics writer using metron agent GRPC with protocol buffer 3 builtin json mapping support ? However, grpc specs specify in this case a content type application/grpc+json whereas the metrics writer writes a application/json;charset=UTF-8 content type. In addition, the content of the JSON formatted payload does not seem to match the metron agent V2 envelope format documented by the loggregator api and implemented in protocol buffer files

Is it instead that the metric writer assumes a distinct metrics forwarder service API from Metron agent ? Java buildpack metrics writer doc mentions a Metrics Forwarder Service and not metron agent.

If so, is the metrics forwarder service implementation open source ?
Is there plans in the future to directly write to metron agent leveraging official API ?

Can't deploy Spring Boot 2.0.0 Application with bound Metrics Forwarder service

When deploying a Spring Boot 2.0.0.RELEASE application to Pivotal Web Services (as of 2018-03-07), the application cannot be started because of the following exception:

2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] java.lang.IllegalStateException: Failed to introspect Class [org.cloudfoundry.metrics.boot2.CloudFoundryMetricWriterAutoConfiguration] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@1b28cdfa]
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:659)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:556)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:541)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:599)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:728)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:669)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:637)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1489)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:420)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:390)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:511)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:503)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1194)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:866)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:852)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:803)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at library.enrichment.ApplicationKt.main(Application.kt:24)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/actuate/autoconfigure/metrics/export/MetricsExporter
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at java.lang.Class.getDeclaredMethods0(Native Method)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at java.lang.Class.getDeclaredMethods(Class.java:1975)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:641)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] ... 28 common frames omitted
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.autoconfigure.metrics.export.MetricsExporter
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
2018-03-07T23:12:45.648+01:00 [APP/PROC/WEB/0] [OUT] ... 32 common frames omitted
2018-03-07T23:12:45.772+01:00 [APP/PROC/WEB/0] [OUT] Exit status 1

I first noticed this with Spring Boot 2.0.0.RC1. Without a bound Metrics Forwarder service, deploying the application is no problem.

Java Build Pack version: 4.9
Metrics Writer version (from build Pack) : 2.3.0_RELEASE

It seams the current build snapshot would fix this issue with commit d489dd5. Is there a date for the next release version?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.