Connecting JMeter with Prometheus & Grafana for Real-Time Insights

watch 4m, 22s
views 2

13:07, 25.08.2026

Article Content
arrow

  • Introductory Overview
  • What is Prometheus?
  • What is Grafana?
  • What is the JMeter-Prometheus plugin?
  • Prerequisites
  • Installing the JMeter-Prometheus plugin
  • Installing Prometheus
  • Installing Grafana
  • Configuring the JMeter-Prometheus plugin in JMeter
  • Setting up Prometheus
  • Launching Prometheus
  • Running the JMeter test
  • Viewing JMeter metrics in Prometheus
  • Where is Grafana?
  • Validating the Prometheus data source in Grafana
  • Creating a Grafana dashboard
  • Sample Grafana dashboard
  • Conclusion

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

  1. Open JMeter and create your test plan.
  2. Add the "Backend Listener" to your test.
  3. Set the "Backend Listener Implementation" to io.prometheus.jmeter.backendlistener.PrometheusBackendListenerClient.
  4. 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

  1. Go to Configuration > Data Sources.
  2. Click Add data source and choose Prometheus.
  3. Enter the Prometheus URL (http://localhost:9090) and click Save & Test.
  4. Grafana should confirm a successful connection.

Creating a Grafana dashboard

Now that the data source is connected, create your first dashboard.

  1. Click on "Create"> "Dashboard"> "Add New Panel."
  2. Use Prometheus Query Language (PromQL) queries to retrieve JMeter metrics.

Example:
rate(jmeter_sample_count{label="Login"}[1m])

  1. Adjust visualization types (e.g., graph, gauge, bar chart).
  2. 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.

Share

Was this article helpful to you?

VPS popular offers

-24.7%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
50 GB SSD
Bandwidth
Bandwidth
4 TB
KVM-SSD 4096 Metered Linux

31 /mo

/mo

Billed annually

-21.5%

CPU
CPU
2 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
300 GB
wKVM-SSD 4096 HK Windows

40 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 8192 Linux

25.85 /mo

/mo

Billed annually

-10.1%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
60 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 2048 Linux

6.25 /mo

/mo

Billed annually

-20.5%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
8 TB
KVM-SSD 8192 Metered Linux

57 /mo

/mo

Billed annually

-9.3%

CPU
CPU
6 Epyc Cores
RAM
RAM
16 GB
Space
Space
150 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 16384 Windows

54.49 /mo

/mo

Billed annually

-10%

CPU
CPU
3 Epyc Cores
RAM
RAM
2 GB
Space
Space
20 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 2048 Linux

8.96 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 4096 Linux

16.45 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
200 GB HDD
Bandwidth
Bandwidth
Unlimited
KVM-HDD 8192 Linux

25.25 /mo

/mo

Billed annually

-7.5%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 1024 Linux

4.82 /mo

/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.