Giter Club home page Giter Club logo

jmeter-backend-azure's Introduction

jmeter-backend-azure

Build and publish

A JMeter plug-in that enables you to send test results to Azure Application Insights.

Overview

Description

JMeter Backend Azure is a JMeter plugin enabling you to send test results to an Azure Application Insights.

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.{ResponseHeader}
  • (Optional) ResponseData
  • (Optional) SampleData

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.azure-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 Azure Application Insights, in your Test Pan, right click on Thread Group > Add > Listener > Backend Listener, and choose io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient as Backend Listener Implementation. Then, in the Parameters table, configure the following attributes.

Attribute Description Required
connectionString The Connection String of your Application Insights instance Yes
testName Name of the test. This value is used to differentiate metrics across test runs or plans in Application Insights and allow you to filter them. Yes
liveMetrics Boolean to indicate whether or not real-time metrics are enabled and available in the Live Metrics Stream. Defaults to true. No
samplersList Optional list of samplers separated by a semi-colon (;) that the listener will collect and send metrics to Application Insights. If the list is empty, the listener will not filter samplers and send metrics from all of them. Defaults to an empty string. No
useRegexForSamplerList If set to true the samplersList will be evaluated as a regex to filter samplers. Defaults to false. No
responseHeaders Optional list of response headers separated by a semi-colon (;) that the listener will collect and send values to Application Insights. No
logResponseData This value indicates whether or not the response data should be captured. Options are Always, OnFailure, or Never. The response data will be captured as a string into the ResponseData property. Defaults to OnFailure. No
logSampleData Boolean to indicate whether or not the sample data should be captured. Options are Always, OnFailure, or Never. The sample data will be captured as a string into the SampleData property. Defaults to OnFailure. No
instrumentationKey The Instrumentation Key of your Application Insights instance.
⚠️ Deprecated: use connectionString instead.
No

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 Application Insights instance. In the image you can see an example of how you can visualize the duration of the requests made during your test run.

Request duration

Additionally, if you enabled liveMetrics in the configuration, you can watch your test performance in real-time in the Live Metrics Stream blade.

Live Metrics Stream

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 in the Elasticsearch and Kafka backend listener plugins.

jmeter-backend-azure's People

Contributors

adrianmo avatar greencee avatar kuniteru avatar waystilos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jmeter-backend-azure's Issues

Not able to the get the report in Application Insights

I am running JMeter from my local system and as per the instruction, I have passed the instrumentation key in backend listener. There is no error logged in log file but still i am not able to get the report in Application Insight.
Please tell me is there any rules or setting that I need to do on creating Application Insight instance.

image

Adding of Azure china appinsights to the listener so that we can link it up with that

Hi Team,
We are trying to use azure china appinsights for the jmeter backend listeners to have a dashboard to appinsights.

we are facing issue that it cannot reached out the appinsights even though we have given the correct instrumentation key

Can we have a enhansement for this to work on this issue i found a nice document over here from microsoft

https://docs.microsoft.com/en-us/dotnet/api/microsoft.applicationinsights.extensibility.telemetryconfiguration.-ctor?view=azure-dotnet#Microsoft_ApplicationInsights_Extensibility_TelemetryConfiguration__ctor_System_String_Microsoft_ApplicationInsights_Channel_ITelemetryChannel_

Thanks,
Venkatesh.K

Getting following error when trying to run the plug-in from JMeter 5.2.1

Instrumentation key is set and verified, getting the same error for both liveMetrics flag set to either true or false. Can you please quickly check if the plug-in works fine on JMeter 5.2.1 or any additional dependencies required.

2020-03-11 15:05:57,790 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[Thread-22,6,main]
java.lang.NullPointerException: null
	at com.microsoft.applicationinsights.telemetry.RequestTelemetry.setUrl(RequestTelemetry.java:253) ~[jmeter.backendlistener.azure-0.2.0.jar:?]
	at io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient.trackRequest(AzureBackendClient.java:76) ~[jmeter.backendlistener.azure-0.2.0.jar:?]
	at io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient.handleSampleResults(AzureBackendClient.java:84) ~[jmeter.backendlistener.azure-0.2.0.jar:?]
	at org.apache.jmeter.visualizers.backend.BackendListener.sendToListener(BackendListener.java:255) ~[ApacheJMeter_components.jar:5.2.1]
	at org.apache.jmeter.visualizers.backend.BackendListener.access$600(BackendListener.java:51) ~[ApacheJMeter_components.jar:5.2.1]
	at org.apache.jmeter.visualizers.backend.BackendListener$Worker.run(BackendListener.java:226) ~[ApacheJMeter_components.jar:5.2.1]

Set OperationParentId for e2e transaction

Hi,

Is there a way to set the ParentOperationId in Application Insights ? Then requests will be grouped by transaction and this will enable troubleshoot a specific failing transaction. That would be a nice addition to this great extension.

Add adittional data to azure logs

Hi!, very very good job. I want to add extra data, for example, environment (UAT, Production, etc) or others data. Its possible to add new field, for example, json field, to create other dimension in log, with my custom data?

Using nordic characters aren't showed correctly in AppInsights

If samplers/transaction controllers are labelled using nordic characters (e.g. the danish characters; æøå), these characters are shown as �'s in AppInsights.
I am unsure if this is caused by the uploaded data, or that AppInsights just can't show these characters properly.

I also tested the testName parameter, which has the same issue.

image

image

Using user-defined variables for InstrumentationKey/ConnectionString doesn't work

I have defined a user-defined variable as below:

image

And using it to setup the backend listener,

image

I then started jmeter with

jmeter -t CosmosLoadTestWithAppInsightIntegration.jmx -Ljmeter.engine=DEBUG -JAPPINSIGHTS_INSTRUMENTATION_KEY="4xxxxx......"

The user-defined value is evaluated correctly and I can see it in the jmeter logs.

Sending properties {APPINSIGHTS_INSTRUMENTATION_KEY=4xxx-xxxx-xxxx-xxxx-xxxxxxxxx, ...}

But, when the Backend Listener is started, the value is never getting replaced.

2021-07-06 23:50:22,723 INFO o.a.j.v.b.BackendListener: Backend Listener: Starting worker with class: class io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient and queue capacity: 5000
2021-07-06 23:50:22,730 INFO o.a.j.v.b.BackendListener: Backend Listener: Started  worker with class: class io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient
.
.
2021-06-30 12:57:55,125 DEBUG o.a.j.e.u.ValueReplacer: About to replace in property of type: class org.apache.jmeter.testelement.property.StringProperty: ${appInsights.InstrumentationKey}
2021-06-30 12:57:55,125 DEBUG o.a.j.e.u.ValueReplacer: Replacement result: ${appInsights.InstrumentationKey}
2021-06-30 12:57:55,125 DEBUG o.a.j.e.u.ValueReplacer: About to replace in property of type: class org.apache.jmeter.testelement.property.StringProperty: =
2021-06-30 12:57:55,125 DEBUG o.a.j.e.u.ValueReplacer: Replacement result: =
2021-06-30 12:57:55,125 DEBUG o.a.j.e.u.ValueReplacer: Replacement result: instrumentationKey=${appInsights.InstrumentationKey}

sr.getResponseDataAsString().length() throwing exception because getResponseDataAsString() is null

HI!

This plugin has been very useful for propogating logs to my AI instance. There is one hiccup that I have run into, and that getResponseDataAsString() is returning null when there is no response returned. logResponseData is set to always but there are instances when a response is not returned..

if (logResponseData == DataLoggingOption.Always ||
(logResponseData == DataLoggingOption.OnFailure && !sr.isSuccessful())) {
String responseData;
if (sr.getResponseDataAsString().length() > MAX_DATA_LENGTH) {
log.warn("Response data is too long, truncating it to {} characters", MAX_DATA_LENGTH);
responseData = sr.getResponseDataAsString().substring(0, MAX_DATA_LENGTH) + "...[TRUNCATED]";
} else {
responseData = sr.getResponseDataAsString();

Here is a sample stack trace showcasing the issue:

2024-01-03 21:29:18,296 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[Thread-4,5,main]
java.lang.NullPointerException: Cannot invoke "String.length()" because the return value of "org.apache.jmeter.samplers.SampleResult.getResponseDataAsString()" is null
at io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient.trackRequest(AzureBackendClient.java:250) ~[jmeter.backendlistener.azure-0.2.9.jar:?]
at io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient.handleSampleResults(AzureBackendClient.java:274) ~[jmeter.backendlistener.azure-0.2.9.jar:?]
at org.apache.jmeter.visualizers.backend.BackendListener.sendToListener(BackendListener.java:254) ~[ApacheJMeter_components.jar:5.5]
at org.apache.jmeter.visualizers.backend.BackendListener.access$600(BackendListener.java:50) ~[ApacheJMeter_components.jar:5.5]
at org.apache.jmeter.visualizers.backend.BackendListener$Worker.run(BackendListener.java:225) ~[ApacheJMeter_components.jar:5.5]

Thank you!

Support Live Metrics Stream for real-time visualization

At the moment, the backend listener sends metric data to Application Insights for storage and subsequent analysis and visualization. However, metrics become available with a few minutes delay and, therefore, one cannot see the test performance in real time. Application Insights offers the Live Metrics Stream for this particular purpose. It'd be good to add support for Live Metrics Stream to allow users to have this real-time view of their tests performance.

plugin does not appear in the list for the backend listener

Added the plugin on MacOS Ventura 13.5 to the folder:

/opt/homebrew/Cellar/jmeter/5.6.2/libexec/lib/jmeter.backendlistener.azure-0.2.9.jar

Plugin appears in the Plugin Manager in JMeter after restarting it.

JMeter version is 5.6.2 and was installed using Homebrew on Mac.

plugin-mgr-installed

Plugin is not available from drop down list when I add the Backend Listener.

drop-down-list

application insights connection string get from csv config file is invalid

is there anyone ever tried using "csv config file" to store "connection string"? I have tried it but always says my connection string invalid. Go further, when I use "User Defined Variables" with the same "connection string", it works well.

image

as above, I debug out the "user define variables" "appIn1" and "csv config" variables "appIn2", as you can see the are identical

but when I refer "appIn1" in config "backend azure plugin" it works well, but "appIn2" treated as invalid connection string.

Set App insights operation name

I would like to have the option to set Operation Name, or maybe have the Operation name set to the same value as Name. This will make it easier to separate between the different operations.
ghostoperations
Currently the Operatons list under Performance/Failures in AI only contains 'ghost' operations.

Create a sample App Insights dashboard

The dashboard will allow users to quickly import it and see useful test result charts and data. Users can use it as a starting point and edit it further to fit their needs.

Passing custom metrics from groovy script

Hello,

I wanted to know how to pass custom metrics from a service I'm calling in a JSR223 sampler groovy script and pass it to the to the backend listener. The goal would to be able to look up the key/val in app insights like foo: something. Any information or direction would be appreciated. Thank you in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.