Apache JMeter Backend Listener implementation for Prometheus metrics exporting.
Download the latest release or build your own from the source code.
Then put jmeter-prometheus-listener-x.x.x.jar
to JMETER_HOME/lib/ext
directory.
- Add
Listener->Backend Listener
to your Test Plan. - Select
com.github.kolesnikovm.PrometheusListener
in Backend Listener implementation combobox. - Edit parameters to your taste.
These parameters are set in Backend Listener element. All parameters are required.
Param | Type | Description |
---|---|---|
testName | String | Common label for all metrics in your test |
runId | String | Common label for all metrics in your test |
exporterPort | int | Port for exposing metrics, path /metrics |
samplersRegExp | String | Regular expression for filtering sample results |
Property | Default | Comment |
---|---|---|
prometheus.collect_jvm | false | Boolean parameter for enabling JVM metrics collection |
prometheus.quantiles_age | 10 | Max age in seconds for Summary collectors' quantiles |
prometheus.log_errors | false | Boolean parameter for enabling extended error logging |
Every metric has default label set testName, runId, nodeName
and also may have some additional labels. Check the table below for details on metrics and their specific labels.
Metric | Type | Labels | Comment |
---|---|---|---|
jmeter_active_threads | Gauge | ||
jmeter_running_threads | Gauge | threadGroup | |
jmeter_requests | Counter | requestName, requestStatus, responseCode, responseMessage, isTransaction | |
jmeter_response_time | Summary | requestName, requestStatus, responseCode, responseMessage, isTransaction | Unit: milliseconds Quantiles: 0.9, 0.95, 0.99 |
jmeter_latency | Summary | requestName, requestStatus, responseCode, responseMessage, isTransaction | Unit: milliseconds Quantiles: 0.9, 0.95, 0.99 |
jmeter_request_size | Summary | requestName, requestDirection, isTransaction | Unit: bytes |
Also, you can create your own custom collectors. See the documentation on Prometheus JVM Client.
Plugin is hosted on Maven Central. You can find dependency here. Example use with jmeter-maven-plugin:
<jmeterExtensions>
<artifact>io.github.kolesnikovm:jmeter-prometheus-listener:x.x.x</artifact>
</jmeterExtensions>
To build, simply run:
gradle clean fatJar