Skip to content

marcelmay/prometheus-client-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prometheus-client-webapp

A simple WAR wrapper for instrumenting your app server and exposing metrics.

Maven Central

This is an alternative to the usually preferred jmx_exporter and suitable when you have minimal access to your app server, e.g. in a large centrally managed setup splitting operations and development responsiblities.

The WAR

Configuration

You can configure the JmxCollector

  1. by setting system property jmx_collector_config_file pointing to a local file
  2. by setting in your web.xml a context parameter pointing to a local file
    <context-param>
         <param-name>jmx_collector_config_file</param-name>
         <param-value>/PATH/TO/CONFIGFILE</param-value>
     </context-param>
    
  3. by setting the default config directly in the web.xml (default config!)
     <context-param>
         <param-name>jmx_collector_config</param-name>
         <param-value>
             ---
             # Default config embedded in web.xml
             rules:
             - pattern: ".*"
         </param-value>
     </context-param>
    

This last setting is the default config. First configuration found wins. So you can always override via system property.

Metrics

Metric names Type Descriptions
prometheus_webapp_build_info{version, buildTime, buildScmVersion, buildScmBranch} Info Build info of this WAR
jvm_* Default JVM metrics, see Prometheus client hotpot
jmx_* Default JMX Collector metrics, see Prometheus jmx_exporter

Building

mvn clean install

A simple test run

mvn jetty:run
open http://localhost:8080/

Requirements

For building:

About

A simple WAR wrapper for instrumenting your app server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages