How to Integrate Performance tests with Grafana and InfluxDB? – Devstringx

Back to Blog
Banner for Integrate Performance tests with Grafana and InfluxDB blog

How to Integrate Performance tests with Grafana and InfluxDB? – Devstringx

Pre-Requisites

  1. Java version -11: Make sure you have at least this minimum version
  2. Jmeter version – 5.4.3 only
  3. InfluxDB v2.0
  4. Grafana version – 8.2. 

Setup of influxDb

Setup of Grafana

How to send the data from Jmeter to influxDB?

  1. Download the influxDb plugin jar
  2. Put “jmeter-plugin-influxdb2-listener-<version>.jar” to the <JmeterPath>/lib/ext folder
  3. Add Backend Listener
    • Run Jmeter and select Test Plan >> Add >> Listener >> Backend Listener

Listner

    • Select “org.md.jmeter.influxdb2.visualizer.influxDatabaseBackendListenerClient” from Backend Listener implementation dropdown

Listener implementation

  • Configure Backend Listener in JMeter by putting the following info-
    • influxDBHttpSchema – http
    • influxDBHost – localhost
    • influxDBPort – 8086
    • influxDBOrganization
    • influxDBBucket

Jmeter Listener

    • influxDBToken – Put the token which you have generated in influxDB. You can copy it from here –

Local Data

Backend Listner

Configure influxDb
1. Create Bucket
  • Go to influxDb UI >> Data >> Bucket

Load Data

  • Create a new bucket by clicking on “Create Bucket” button displayed on right
  • Enter the name of bucket which you want to create >> Create
Create Bucket

2. Generate Access Token

  • Access influxDb UI in browser >> Data >> Tokens

influx

  • Generate a new token by clicking on “Generate Token” button displayed on right >> Opt “Read/Write” option from generate Token dropdown

Generate Token

  • Enter the required information >>> Save

Generate Read

Configure influxDb As Data Source In Grafana

1. Access Grafana UI on browser >> Go to Configuration >> Data Source

Data Sources

2. Click on “Add Data Source” button displayed on right side of the page

Configuration

3. Select influxDB as data source from the list

Time Series Database

4. Put the following information while adding influxDB as data source

  • Name – name of your data source. InfluxDB is selected as default
  • Query Language – Opt any language from the dropdown in which you want to query
  • HTTP
    • URL – put the url of your influxDB
    • Access – Optional
    • Allowed cookies – Optional
    • Timeout – 300
  • AUTH – select any authentication whatever you want
  • Basic Auth Details – If you have selected “Basic Auth” in AUTH section then provide the following information
    • User – Enter influxDb user name. You can copy it from here

Load Data

    • Password – Put the token which you have generated in influxDb, you can copy it from here

Influx Token

  • Custom HTTP Header
    • Header – Authorization
    • Value – put token which you have generated in influxDb
  • InfluxDB Details
    • Organization – Put the id of your organization from influxDB. You can copy it from the influxDb url

Local Host Variable

    • Token – Put the token which you have generated in influxDb
    • Default Bucket – admin
    • Min time interval – 10s
    • Max series – 1000
    • After placing the above information >>> Click on “Save & Test” button >>> Now, you can see #number of buckets found post integrated influxDB to Grafana

Buckets

Create a Dashboard In Grafana Using Metrics

  • Click on “+” icon displayed on left panel >> “Dashboard”

General

  • Add Panel >>

Add Panel

  • Select data source as “InfluxDB” from dropdown

InfluxDB

  • Write queries

Bucket Jmeter

  • Save your dashboard by clicking on “Save” button

If you are interested in even more Testing-related articles and information from us here at Devstringx, then we have a lot to choose from.

Share this post

Back to Blog