JMeter & InfluxDB Integration – How To Troubleshoot

This post is to troubleshoot the issues you are facing with InfluxDB while writing data using the methods mentioned in the below posts,

Please make sure all the below steps working fine in the order.

  • InfluxDB should be up and running fine w/o any exception (in the console output).
    • If this step itself fails, Please raise your question in StackOverFlow
  • You should be able to access the admin interface of InfluxDB with this URL – http://[ipaddress]:8083
    • Try to access this in the machine where JMeter is going to run.
    • If this step fails,  see if the port has been used already. or change that in InfluxDB config file.
    • [admin]
         enabled = true
         bind-address = ":8083"
         https-enabled = false
         https-certificate = "/etc/ssl/influxdb.pem"
    • If you are not sure where to find the config file for InfluxDB, running the command ‘influxd config‘ which will show the default config values. Copy them and create a new .conf config file yourself.
    • If you are using new conf file, restart InfluxDB with this command – influxd -config /etc/influxdb/influxdb.conf
  • Ensure that you have the Database created in InfluxDB. If not, Run the the query ‘CREATE DATABASE “demo”‘ in the Admin Interface
  • System time of InfluxDB server should be in sync with the System time of JMeter. (at least should be ahead of Jmeter machine time. Not behind)
    This is very important as InfluxDB is a time-series DB. By default, it will show only the records where timestamp of the records < system timestamp.
  • Install ‘PostMan‘ in your chrome (Please do these steps from the machine where JMeter is going to run)
    • Add POSTMAN
    • Update the URL as shown here – http://[ipaddress]:8086/write?db=[database]
      Ex: http://10.11.12.13:8086/write?db=demo Note the port – it should be 8086 for writing the data. 8083 is for admin interface.
    • db-tp04
    • Lets try to send this record through postman testautomationguru,key=test count=1,duration=1
      • testautomationguru – is the name of table/measurement which will be created at run time by InfluxDB if it is not present already.
      • key – it is a tag for faster query
      • count and duration – some fields with values
    • HTTP Method should be POST
    • Place the data under Body –> Raw section
    • Click on ‘Send’
    • You should be able to see the testautomationguru measurement & querying the measurement should show the series.

db-tp05

db-tp06

  • Now run JMeter in non – gui mode. You should be seeing the measurements and data for the given DB.
  • If it still does not work, Please check the JMeter.log and InfluxDB console for any Errors.
    • For ex: My JMeter.log shows this info. Copy the text and try to place it in postman and try to post as you did above. There is a chance that some characters not escaped properly. yuo will know that in the HTTP response of the PostMan or share the log details with me.

db-tp07

Share This:

21 thoughts on “JMeter & InfluxDB Integration – How To Troubleshoot

  1. influxdb is not writing when there null values availble.
    i.e.
    jmeter.visualizers.JSR223Listener: Result : samples,label=Login,status=Success ,Responsecode = 200, null=null 1479735167833000000

    How can I replace the null values while writing to influxdb.

    1. If the value is null, we can replace it with empty string or some value like ‘N/A’. but the field/tag name itself cannot be null. You need to handle this.

      1. Thank you. Yes, handled the null fields and values. But I was wondering why null values are not accepted by influxdb and also one comma or space is making the difference while posting the values.

  2. I am using influx 0.9 and i have used the above jar in jmeter 3.3 version, and dont see any metrics pushed to influx, i have used the simillar command with jmeter 3.0 and it is working fine,
    is there nay pre-req that influx version should be higher than 0.9?

  3. i have tried it with latest version of influx (1.4), still the same behaviour, 3.0 is working fine and 3.3 is still not feeding data

  4. Please ignore this, i can see jmeter populating the data in influx, had to create the influx database manually to populate measurements from jmeter 3.3

  5. @vlns,
    metrics not feeding when i use remote host (distributed load) the below command
    jmeter -n -t script.jmx -R server1 ,

    can you please clarify , it is bit urgent

  6. @vlns,
    When i use the remote host option, it is feeding only the report once the test is completed(consolidated report) and not during the real time , is this a expected behavior

  7. Below command is running fine and feeding data to influx as it is running local
    /opt/apache-jmeter-3.3/bin/jmeter -n -t testscript.jmx -Jjmeter.save.saveservice.output_format=xml -l results.xml -q local.properties

    but when i use the below command to run on remote host, script is running but not feeding data to influxdb
    /opt/apache-jmeter-3.3/bin/jmeter -n -t getUser4.jmx -Jjmeter.save.saveservice.output_format=xml -l results.xml -R 10.20.30.30 -q local.properties

    i have also tried with -G instead of -q for globalproperties
    Request to clarify on this as i am currently blocked due to this, i am using the same ApacheJMeter_core.jar on master and remote host

  8. @vlns, any update on above query, please guide me if am doing anything wrong, i am currently blocked because of this

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.