JMeter Integration with InfluxDB Cloud
Tags: testing, database, performance, tutorial
Published: 2020-12-30 16:40:55

<!-- wp:paragraph -->
<p>In last two blog articles, we have seen about the <a href="https://qainsights.com/jmeter-integration-with-influxdb-and-grafana-using-docker/" target="_blank" rel="noreferrer noopener">JMeter Integration with InfluxDB and Grafana using Docker</a> and <a href="https://qainsights.com/jmeter-integration-with-influxdb-2-0/" target="_blank" rel="noreferrer noopener">InfluxDB 2.0</a>. This blog article focuses on JMeter Integration with InfluxDB Cloud.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="h-influxdb-cloud">InfluxDB Cloud</h2>
<!-- /wp:heading -->

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>InfluxDB Cloud&nbsp;is the most powerful time series database as a service — free to start, easy to use, fast, serverless, elastic scalability.</p></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p>It is free to get started; no credit card required. Head to this <a href="https://cloud2.influxdata.com/signup" target="_blank" rel="noreferrer noopener">sign up link</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Fill the required fields as shown below and hit <strong>Create Account</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8014,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-63.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-63.png" alt="JMeter Integration with InfluxDB Cloud" class="wp-image-8014"/></a><figcaption>JMeter Integration with InfluxDB Cloud - Sign up</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:heading -->
<h2 id="h-create-a-bucket">Create a bucket</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Next step is to create a bucket called <code>jmeter</code> in InfluxDB Cloud. Navigate to <strong>Data &gt; Buckets &gt; Create Bucket.</strong> Enter a name for the bucket <code>jmeter</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8016,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-65.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-65.png" alt="Create a Bucket" class="wp-image-8016"/></a><figcaption>Create a Bucket</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Free plan comes with rate limitations and other features as shown below.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8015,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-64.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-64-1024x617.png" alt="InfluxDB Pricing" class="wp-image-8015"/></a><figcaption>InfluxDB Pricing</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Before leaving InfluxDB Cloud, we need few things to configure the backend listener in JMeter.</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Token</li><li>Organization ID</li><li>InfluxDB URL</li></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3 id="h-create-a-token">Create a Token</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Navigate to <strong>Data &gt; Token, </strong>click on <strong>Generate &gt; Read/Write Token.</strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8017,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-66.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-66-1024x273.png" alt="Generate a Token" class="wp-image-8017"/></a><figcaption>Generate a Token</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Enter the token name, select the scope and then click on <strong>Save.</strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8018,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-67.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-67.png" alt="Scoping the token" class="wp-image-8018"/></a><figcaption>Scoping the token</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Click on the token name and then click on <strong>Copy to Clipboard.</strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8019,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-68.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-68.png" alt="Copy the Token" class="wp-image-8019"/></a><figcaption>Copy the Token</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>To retrieve the <strong>Organization ID</strong>, click on the <strong>Profile </strong>icon &gt; <strong>About</strong>. Then, click on <strong>Copy to Clipboard </strong>under <strong>Organization ID</strong> section.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8021,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-70.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-70-1024x264.png" alt="Copy the Organization ID" class="wp-image-8021"/></a><figcaption>Copy the Organization ID</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>To retrieve the URL, just copy the domain name from the browser address bar. E.g. <code>https://us-west-2-1.aws.cloud2.influxdata.com/</code></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 id="h-jmeter-set-up">JMeter Set up</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Launch JMeter, open the test plan which you are going to execute. Add a backend listener by right clicking on <strong>Thread Group &gt; Add &gt; Listener &gt; Backend Listener.</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Select InfluxDBBackendListener Client as the implementation.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Add a property <code>influxdbToken</code> and paste the token which you created in InfluxDB Cloud.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In <code>influxdbUrl</code>, value of the format would be <code>https://&lt;influxdb_cloud_domain&gt;/api/v2/write?org=&lt;organization_id&gt;&amp;bucket=&lt;bucket_name&gt;</code>. Paste the domain name, orgranization ID and the bucket name.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Below is for your reference.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8023,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-71.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-71.png" alt="JMeter Configuration" class="wp-image-8023"/></a><figcaption>JMeter Configuration</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Save the test plan. Run your test in CLI mode. While the test is running, navigate to <strong>InfluxDB Cloud &gt; Explore</strong>. Submit the query as shown below. You will see the runtime performance stats in the InfluxDB Cloud.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8024,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-72.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-72-1024x509.png" alt="Runtime Stats in InfluxDB Cloud" class="wp-image-8024"/></a><figcaption>Runtime Stats in InfluxDB Cloud</figcaption></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2 id="h-grafana-and-influxdb-cloud-integration">Grafana and InfluxDB Cloud Integration</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you would like to integrate your InfluxDB Cloud with Grafana, you can do it. Launch Grafana, go to <strong>Configuration &gt; Data Sources &gt; Add data source. </strong>Select <strong>InfluxDB</strong> and configure the details as shown below. Click on <strong>Save &amp; Test.</strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8025,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2020/12/image-73.png"><img src="https://qainsights.com/wp-content/uploads/2020/12/image-73.png" alt="InfluxDB Cloud and Grafana Integration" class="wp-image-8025"/></a><figcaption>InfluxDB Cloud and Grafana Integration</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:heading -->
<h2 id="h-final-words">Final Words</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Integrating JMeter with InfluxDB Cloud is straightforward and easy. No need to maintain your own instance of InfluxDB servers or running containers. Free tier is also available to test and try out features. I hope this tutorial helps you in learning the integration of InfluxDB and Grafana in JMeter.</p>
<!-- /wp:paragraph -->