| @Bean | |
| public EmbeddedServletContainerCustomizer jettyCustomizer(EmbeddedWebApplicationContext context) { | |
| return new EmbeddedServletContainerCustomizer() { | |
| @Override | |
| public void customize(ConfigurableEmbeddedServletContainer factory) { | |
| Assert.state(factory instanceof JettyEmbeddedServletContainerFactory, "Use Jetty for this server"); | |
| JettyEmbeddedServletContainerFactory jettyFactory = (JettyEmbeddedServletContainerFactory) factory; | |
| jettyFactory.addServerCustomizers(new JettyServerCustomizer() { | |
| @Override | |
| public void customize(org.eclipse.jetty.server.Server server) { | |
| StatisticsHandler stats = new StatisticsHandler(); | |
| stats.setHandler(server.getHandler()); | |
| server.setHandler(stats); | |
| new JettyStatisticsCollector(stats).register(); | |
| } | |
| }); | |
| } | |
| }; | |
| } |
Hey all,we are using https://github.com/prometheus/client_java/tree/master/simpleclient_jetty with spring boot, our integration look like this.
@Bean public EmbeddedServletContainerCustomizer jettyCustomizer(EmbeddedWebApplicationContext context) { return new EmbeddedServletContainerCustomizer() { @Override public void customize(ConfigurableEmbeddedServletContainer factory) { Assert.state(factory instanceof JettyEmbeddedServletContainerFactory, "Use Jetty for this server"); JettyEmbeddedServletContainerFactory jettyFactory = (JettyEmbeddedServletContainerFactory) factory; jettyFactory.addServerCustomizers(new JettyServerCustomizer() { @Override public void customize(org.eclipse.jetty.server.Server server) { StatisticsHandler stats = new StatisticsHandler(); stats.setHandler(server.getHandler()); server.setHandler(stats); new JettyStatisticsCollector(stats).register(); } }); } }; } However, when graphing the jetty_request_count
we noticed that the number doesn't add up and that this later report why less number than other metrics that we had and we were looking to replace, and when we started looking at the code of Jetty StatisticsCollector we noticed that in Jetty the counter doesn't have same semantics as in Prometheus, precisely in Jetty a counter is decremented too https://github.com/eclipse/jetty.project/blob/a3100e02118fca25358c8b59baea9bd95b86e92f/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java#L199.So we were wondering if anyone uses Jetty metrics or are aware as to why we may see different data, and if our analyzes is correct.Thank you.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/cd6a2536-d7cd-496b-9755-99bdaf123bb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
| Mouad Benchchaoui | |
| Consultant | |
| mben...@thoughtworks.com | |
| Telephone | +49 151 26199221 |
Sorry my bad, I meant jetty_requests_total https://github.com/prometheus/client_java/blob/master/simpleclient_jetty/src/main/java/io/prometheus/client/jetty/JettyStatisticsCollector.java#L45