TomcatServletAdd

278 views
Skip to first unread message

Damianos Metall

unread,
Jul 13, 2016, 12:52:05 AM7/13/16
to Prometheus Developers
Hello to all,

Wirth regards to this thread https://groups.google.com/forum/#!topic/prometheus-developers/CYM4874tCnI i want to ask the occasion where someone wants to add a servlet on a tomcat in order to get the instrumentation done from a java client perspective. In the posts of http://www.robustperception.io/instrumenting-java-with-prometheus/ and http://www.boxever.com/easy-java-instrumentation-with-prometheus we can clearly see that a jetty server is being used. What happens in case of a tomcat server?Is it supported? 

Edit the web.xml maybe to add a servlet? If that we have to set also a servlet-class, this class could be the one initialzing an http servelt, right?

Respectfully,
Damian


Damianos Metall

unread,
Jul 13, 2016, 1:18:08 PM7/13/16
to Prometheus Developers
Hello to all,

After checking the example of the Java client i have put some embedded metrics in my application and then i had to configure the servelt.
In the web.xml of the app i have added the below:

<servlet>
       
<servlet-name>metrics</servlet-name>
       
<servlet-class>io.prometheus.client.exporter.MetricsServlet</servlet-class>
   
</servlet>
   
<servlet-mapping>
       
<servlet-name>metrics</servlet-name>
       
<url-pattern>/metrics/</url-pattern>
   
</servlet-mapping>

But when i start the prometheus i still not get any http reply as it seems to be down. The url 
Any direction please would be helpful. 

Respectfully,

Damianos Metall

unread,
Jul 13, 2016, 3:58:00 PM7/13/16
to Prometheus Developers
Problem sovled as the error was on the .yml file of prometheus
Reply all
Reply to author
Forward
0 new messages