Integrate NeoLoad with Dynatrace Cloud Automation
Integrating Dynatrace Cloud Automation with NeoLoad enables performance engineers and developers to automatically trigger load tests on the application when it's released to staging or other testing environments. This saves engineers time and increases confidence in the performance of their applications.
To integrate Dynatrace Cloud Automation with NeoLoad, follow the instructions below.
Prerequisites
NeoLoad
-
Ensure that there are enough resources attached to NeoLoad Web to successfully run the load test. For details about how to configure the controller and the load generator resource zones, see theNeoLoad documentation.
-
Get the following NeoLoad IDs needed for the configuration of the Cloud Automation webhook:
- Test ID (for example,
https://neoload.saas.neotys.com/#test-settings/<test_ID>
) You can find the test ID in the URL of your new test. - Workspace ID (for example,
https://neoload.saas.neotys.com/#account-workspace/<workspace_ID>/subscription
) You can find the workspace ID in the URL of the NeoLoad Web Settings page.
- Test ID (for example,
-
Create a NeoLoad access token.
The NeoLoad access token is sensitive data. If this data is known by other parties, they can use NeoLoad Web API to access all your tests and results.
Dynatrace
-
Create a Cloud Automation project with a shipyard file that has a custom task (for example,
loadtest
) used to trigger the NeoLoad test. -
Add the NeoLoad Web access token obtained above as a Cloud Automation secret.
-
On the Cloud Automation bridge, select your Cloud Automation project.
-
Select Settings, and then select Secrets.
-
Select Add Secret and enter the following values:
- Name: Enter a name for the secret (for example,
neoload
). - Scope: Select
keptn-webhook-service
. - Key/Value: Enter your values for the key/value pair (for example,
key: api-token
,value: <your_NeoLoad_API_token>
).
- Name: Enter a name for the secret (for example,
-
Select Add secret.
-
Set up the NeoLoad webhook subscription
Use case: Set up a passive webhook subscription that triggers a NeoLoad test. The Cloud Automation sequence will not wait for NeoLoad to send back a Cloud Automation sequence task finished event.
-
On the Cloud Automation bridge, select your Cloud Automation project.
-
Select Settings, and then select Integrations.
-
Select webhook-service from the list, and then select Add subscription.
-
Enter the following values:
- Task: Select the task associated with your shipyard file (in this case,
loadtest
). - Task suffix: Select
triggered
. - Request method: Select
POST
. - URL: Enter your URL endpoint (for example,
https://neoload-api.saas.neotys.com/v3/workspaces/<your_workspace_ID>/tests/<your_test_ID>/start?testResultName=<your_test_result_name>&testResultDescription=<your_test_result_description>
. Be sure to replace the placeholders (<...>
) with your own values). For more details of the NeoLoad API, see NeoLoad Swagger.
- Task: Select the task associated with your shipyard file (in this case,
-
Select Add custom header and enter the following values:
- Name: Enter
accountToken
. - Value: Enter
{{.secret.<secret_name>.<key_name>}}
, making sure to replace<secret_name>
with the name of your secret and<key_name>
with the key name you entered when creating the Cloud Automation secret (see Prerequisites). Example:{{.secret.neoload.api-token}}
.
- Name: Enter
-
Under Send finished event, select
automatically
. -
Select Create subscription.
Trigger a sequence
Cloud Automation triggers NeoLoad whenever the defined task in the sequence is triggered.
To trigger the sequence, you can send the event command in the Keptn CLI.
- Create a file called
triggered-event.json
.
Example:
1{2 "type": "sh.keptn.event.mystage.loadtest.triggered",3 "specversion":"1.0",4 "source":"manual-trigger",5 "data":{6 "project":"myproject",7 "stage":"mystage",8 "service":"myservice"9 }10}
-
Send the event.
1keptn send event --file triggered-event.json
After sending the event, you can
Monitor the sequence progress on the project’s Cloud Automation sequence page
Monitor the NeoLoad test execution on the NeoLoad test result overview page