Open In App

How to Integrate JMeter with Prometheus and Grafana?

Last Updated : 16 Feb, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

JMeter is an open-source software used for test performance both on static and dynamic resources, Web dynamic applications. It is used for simulating heavy loads on servers and analyzing the performance of different types of loads. Whereas, Prometheus is an open-source metrics-based monitoring system. It uses PromQL query language and analyses the performance of the application. And, Grafana is an open-source interactive data-visualization platform used for visualizing data with the help of the Grafana dashboard.

 

Step by Step Imepmnation

Step 1: Download Java development kit version 8+ 

Step 2: Download J Meter black highlighted link(https://jmeter.apache.org/download_jmeter.cgi)

 

Step 3: Downloading the J Meter Prometheus plugin jar file from here https://github.com/johrstrom/jmeter-prometheus-plugin/releases

Step 4: Move the jar file in J Meter to the following location apache-jmeter-5.4.1 >>lib>>ext

Step 5: In J Meter right your script by clicking on Add->Users->Thread Groups

Step 6: Configure a Prometheus listener by right-clicking on test-> add->listener->Prometheus listener

 

Step 7: Download Prometheus (https://prometheus.io/download/), to get Prometheus up and running first navigate to Prometheus-2.29.1.windows-amd64->Prometheus.yml  file and type the below code 

- job_name: 'jmeter'
   # metrics_path defaults to '/metrics'
   # scheme defaults to 'http'.
   static_configs:
   - targets: ['localhost:9270']

Step 8: Open cmd and type the following command Prometheus.exe –config.file=prometheus.yml. Hit enter

Step 9: Open your JMeter and the script by clicking on the green triangle to start the script.

Step 10: Open localhost:9270/metrics. This means your script is running correctly.

Step 11: Open localhost:9090/graph and type jvm_classes_loaded in the search tab

 

Step 12: In the graph tab you can view the results.

Step 13: Download grafana and navigate to grafana-enterprise-7.4.3.windows-amd64->grafana-7.4.3->bin. Run graphana-server.exe.

Step 14: Open localhost:3000 Type in admin and admin as username and password and reset the password if needed.

Step 15: Navigate to the setting in the left panel and click data sources. Search Prometheus.

 

Step 16: Put in these details and save.

Step 17: After that click on the plus sign in the left panel and add a dashboard. Change query drop-down to Prometheus

 

Step 18: You can customize your query as needed. Here we have considered latency for visualization.

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads