darrensmithwtc / jmeter-backend-newrelic

JMeter Backend to store metrics in New Relic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jmeter-backend-newrelic

CI

A JMeter plug-in that enables you to send test results to New Relic Metrics API.

Overview

Description

JMeter Backend New Relic is a JMeter plugin enabling you to send test results to NRDB via the New Relic Metrics API.

The following test results metrics are exposed by the plugin.

  • TestStartTime
  • SampleStartTime
  • SampleEndTime
  • ResponseCode
  • Duration
  • URL
  • SampleLabel
  • SampleCount
  • ErrorCount
  • Bytes
  • SentBytes
  • ConnectTime
  • IdleTime
  • ThreadName
  • GrpThreads
  • AllThreads
  • (Optional) aih.{response_header}

Plugin installation

Once you have built or downloaded the plugin JAR file from the releases section, move the JAR to your $JMETER_HOME/lib/ext.

mv target/jmeter.backendlistener.newrelic-VERSION.jar $JMETER_HOME/lib/ext/

Then, restart JMeter and the plugin should be loaded.

JMeter configuration

To make JMeter send test result metrics to New Relic, in your Test Pane, right click on Thread Group > Add > Listener > Backend Listener, and choose io.github.darrensmithwtc.jmeter.backendlistener.newrelic.NewRelicBackendClient as Backend Listener Implementation. Then, in the Parameters table, configure the following attributes.

Attribute Description Required Default
connectionString The fully qualified URL endpoint of the New Relic Metrics Provider. Yes https://metric-api.eu.newrelic.com/metric/v1
testName Name of the test. This value is used to differentiate metrics across test runs or plans in New Relic and allow you to filter them. Yes jmeter
metricName String containing the metric name you want to use in New Relic. Yes loadtest.result
clientName String containing the client name you want to add as an attribute to the metrics in New Relic. Yes unknown
environmentName String containing the environment name you want to add as an attribute to the metrics in New Relic. Yes unknown
licenceKey String containing your new relic ingestion Yes [empty-string]
samplersList Optional list of samplers separated by a semi-colon (;) that the listener will collect and send metrics to New Relic. If the list is empty, the listener will not filter samplers and send metrics from all of them No [empty-string]
useRegexForSamplerList If set to true the samplersList will be evaluated as a regex to filter samplers. No false
responseHeaders Optional list of response headers spearated by a semi-colon (;) that the listener will collect and send values to New Relic. No [empty-string]

Example of configuration:

Screenshot of configuration

Custom properties

You can add custom data to your metrics by adding properties starting with ai., for example, you might want to provide information related to your environment with the property ai.environment and value staging.

Visualization

Test result metrics are available in the requests dimension of your New Relic instance.

Contributing

Feel free to contribute by forking and making pull requests, or simply by suggesting ideas through the Issues section.

Build

You can make changes to the plugin and build your own JAR file to test changes. To build the artifact, execute below Maven command. Make sure JAVA_HOME is set properly.

mvn clean package

This plugin is inspired by the Azure plugin, as well as Elasticsearch and Kafka backend listener plugins.

About

JMeter Backend to store metrics in New Relic

License:Other


Languages

Language:Java 100.0%