Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kolesnikovm/jmeter-prometheus-listener
Apache JMeter Backend Listener implementation for Prometheus metrics exporting
https://github.com/kolesnikovm/jmeter-prometheus-listener
jmeter jmeter-expoter jmeter-listener jmeter-plugin prometheus
Last synced: 3 months ago
JSON representation
Apache JMeter Backend Listener implementation for Prometheus metrics exporting
- Host: GitHub
- URL: https://github.com/kolesnikovm/jmeter-prometheus-listener
- Owner: kolesnikovm
- License: apache-2.0
- Created: 2019-09-16T09:41:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T10:20:47.000Z (almost 2 years ago)
- Last Synced: 2024-05-07T18:13:21.201Z (9 months ago)
- Topics: jmeter, jmeter-expoter, jmeter-listener, jmeter-plugin, prometheus
- Language: Java
- Homepage:
- Size: 12.1 MB
- Stars: 20
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-jmeter - jmeter-prometheus-listener - Apache JMeter Backend Listener implementation for Prometheus metrics exporting. (Results Processing / Reporting & Visualization)
README
# Prometheus Listener for JMeter
Apache JMeter Backend Listener implementation for Prometheus metrics exporting.
Both pull-based and push-based models are supported through different implementations.## Installation
Download the [latest release](https://github.com/kolesnikovm/jmeter-prometheus-listener/releases/latest) or build your own from the source code.
Then put `jmeter-prometheus-listener-x.x.x.jar` to `JMETER_HOME/lib/ext` directory.## Usage
1. Add `Listener->Backend Listener` to your Test Plan.
2. In the Backend Listener implementation combobox select `com.github.kolesnikovm.PrometheusListener` for pull-based model or `com.github.kolesnikovm.PrometheusPusher` for push-based one.
3. Edit parameters to your taste.## Parameters
These parameters are set in Backend Listener element. All parameters are required. You can also add custom parameters,
that will be treated as labels and added to each metric.| 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`
Only for `com.github.kolesnikovm.PrometheusListener` implementation |
| prometheusURL | String | Prometheus URL for pushing metrics
Only for `com.github.kolesnikovm.PrometheusPusher` implementation |
| samplersRegExp | String | Regular expression for filtering sample results |
| sloLevels | String | Buckets for `jmeter_response_time_histogram`. Semicolon delimited |## Properties
| Property | Default | Comment |
| :---: |:-------:|:----------------------------------------------------------------------------------:|
| prometheus.collect_jvm | false | Boolean parameter for enabling JVM metrics collection |
| prometheus.collect_assertions | false | Boolean parameter for enabling assertion results collection |
| prometheus.quantiles_age | 10 | Max age in seconds for Summary collectors' quantiles |
| prometheus.log_errors | false | Boolean parameter for enabling extended error logging |
| prometheus.push_interval | 5 | Metrics push interval for `com.github.kolesnikovm.PrometheusPusher` implementation |## Metrics
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_response_time_histogram | Histogram | requestName, requestStatus, responseCode, responseMessage, isTransaction | Unit: milliseconds |
| 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 |
| jmeter_assertion_results | Counter | requestName, failureMessage | |## Custom metrics
Also, you can create your own custom collectors. See the documentation on [Prometheus JVM Client](https://github.com/prometheus/client_java).
### Creation
![Custom collector creation](/docs/images/collector_creation.jpeg?raw=true)
### Usage
![Custom collector usage](/docs/images/collector_usage.jpeg?raw=true)
## Dependency
Plugin is hosted on Maven Central. You can find dependency [here](https://search.maven.org/artifact/io.github.kolesnikovm/jmeter-prometheus-listener). Example use with [jmeter-maven-plugin](https://github.com/jmeter-maven-plugin/jmeter-maven-plugin):
```xml
io.github.kolesnikovm:jmeter-prometheus-listener:x.x.x
```
## Building
To build, simply run:
```bash
gradle clean fatJar
```