Connecting JMeter with Prometheus & Grafana for Real-Time Insights
13:07, 25.08.2026
Apache JMeter is a popular tool for load testing and performance monitoring. It enables users to simulate high loads and analyze system behavior in real time. However, its built-in reporting feature may not be sufficient when continuous real-time monitoring is required.
In this case, you can use auxiliary tools such as Prometheus and Grafana. They enable you to visualize performance metrics dynamically during test execution.
In this article, we will explore how to integrate JMeter with Prometheus and Grafana to obtain robust, real-time performance analytics.
Introductory Overview
JMeter provides excellent test execution capabilities, but integrating it with Prometheus and Grafana opens new possibilities in observability. Prometheus scrapes and stores metrics, while Grafana visualizes them through dynamic dashboards. By connecting JMeter to this stack using the JMeter-Prometheus plugin, testers can view live metrics, detect bottlenecks, and take immediate action.
What is Prometheus?
Prometheus is an open-source systems monitoring and alerting toolkit originally developed by SoundCloud. It collects and stores metrics as time series data, provides a flexible query language (PromQL), and can alert on custom conditions. Prometheus pulls (scrapes) metrics from endpoints exposed by target applications and services, making it highly suitable for monitoring dynamic environments such as microservices.
What is Grafana?
Grafana is a powerful visualization and analytics platform that works with a variety of data sources, including Prometheus. With Grafana, users can build interactive and customizable dashboards, enabling them to monitor key metrics in real time, set alerts, and share dashboards across teams. Grafana's rich plugin ecosystem further extends its functionality.
What is the JMeter-Prometheus plugin?
The JMeter-Prometheus plugin exposes JMeter metrics as an HTTP endpoint that Prometheus can scrape. It acts as a bridge between JMeter and Prometheus, collecting information such as the number of requests per second, response times, error counts, and more. This plugin is essential for enabling real-time monitoring of performance tests.
Prerequisites
Before starting, ensure the following:
- Java (JDK 8 or higher)
- Apache JMeter installed
- Internet connection for downloading dependencies
Installing the JMeter-Prometheus plugin
First, download the plugin JAR (jmeter-prometheus-plugin-<version>.jar) from its GitHub repository.
Then, place the JAR file in the /lib/ext directory of your JMeter installation.
After that, you can restart JMeter to activate the plugin.
Installing Prometheus
Here, you need to download Prometheus from the official site. Then, extract the archive and locate the prometheus.yml configuration file.
When everything is done- add a new job to scrape JMeter metrics:
- job_name: 'jmeter'
metrics_path: '/metrics'
static_configs:
- targets: ['localhost:9270']
Installing Grafana
Download Grafana from grafana.com. Then, follow the installation steps for your operating system.
Once installed, start Grafana using the terminal or service manager.
Configuring the JMeter-Prometheus plugin in JMeter
- Open JMeter and create your test plan.
- Add the "Backend Listener" to your test.
- Set the "Backend Listener Implementation" to io.prometheus.jmeter.backendlistener.PrometheusBackendListenerClient.
- Configure parameters:
- port: 9270 (or any open port)
- metric_name: JMeter
- percentiles: 90;95;99
The plugin will now expose metrics on http://localhost:9270/metrics.
Setting up Prometheus
Launching Prometheus
Run Prometheus using:
./prometheus --config.file=prometheus.yml
Prometheus will start scraping data from JMeter and store it locally.
Running the JMeter test
Start the test in JMeter. As the test runs, the Backend Listener will send performance data to the endpoint configured for Prometheus.
You can verify this by accessing http://localhost:9270/metrics in your browser.
Viewing JMeter metrics in Prometheus
Once the test is running and Prometheus is scraping data, open http://localhost:9090 (Prometheus UI). Enter a sample PromQL query such as:
rate(jmeter_sample_count[1m])
This will display the number of samples (requests) that JMeter generates per minute. Other useful metrics include jmeter_sample_duration and jmeter_sample_failure_count.
Where is Grafana?
Grafana runs on http://localhost:3000 by default. Log in using the default credentials (admin / admin) and set a new password when prompted.
Validating the Prometheus data source in Grafana
- Go to Configuration > Data Sources.
- Click Add data source and choose Prometheus.
- Enter the Prometheus URL (http://localhost:9090) and click Save & Test.
- Grafana should confirm a successful connection.
Creating a Grafana dashboard
Now that the data source is connected, create your first dashboard.
- Click on "Create"> "Dashboard"> "Add New Panel."
- Use Prometheus Query Language (PromQL) queries to retrieve JMeter metrics.
Example:
rate(jmeter_sample_count{label="Login"}[1m])
- Adjust visualization types (e.g., graph, gauge, bar chart).
- Save the dashboard for reuse.
Sample Grafana dashboard
A functional performance testing dashboard might include the following:
- Requests per second (RPS)
- Average and percentile response times (90th, 95th, 99th)
- Error rate over time
- Active users
- Throughput
These visualizations provide real-time insights into system performance under load, enabling easier detection of issues and validation of improvements.
Conclusion
Integrating JMeter with Prometheus and Grafana enables testers and engineers to monitor performance in real time and take immediate action when needed. The JMeter-Prometheus plugin acts as a vital bridge, exposing metrics for Prometheus to collect, and Grafana then transforms this data into meaningful, actionable dashboards. Whether you're stress-testing a web app or simulating heavy user loads in production-like environments, this setup gives you the visibility you need to maintain system health and performance.
With just a few installation and configuration steps, you can elevate your performance testing practices from static reports to real-time observability.