Integrate Akamas with Dynatrace Cloud Automation
Integrating Dynatrace Cloud Automation with Akamas enables developers, performance engineers, DevOps, and SREs to automatically optimize their applications in terms of performance, resilience, and cost efficiency (according to any defined application-specific goal), when these applications are released into staging or other testing environments. The integration of Akamas with Cloud Automation ensures that services provide the highest quality at the lowest possible cost.
To integrate Dynatrace Cloud Automation with Akamas, follow the instructions below.
Prerequisites
Akamas
Dynatrace
Akamas
-
Set up an optimization study and save the study ID for later use.
-
Install the Akamas pre-built container on the Akamas server. This container will act as a bi-directional bridge between the Akamas study and Cloud Automation webhooks. Make sure the host and port 6000 are publicly reachable on the Akamas server. Note that port 6000 is the predefined port; to use a different host or certificate, please contact Akamas support.
Dynatrace
-
Create a Cloud Automation project with a shipyard file, and a task (for example,
optimize
) to trigger Akamas optimization in the desired stage (for example,staging
). -
Create a Cloud Automation secret for Akamas.
Set up the Akamas webhook subscription
-
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,
optimize
). - Task suffix: Select
triggered
. - Request method: Select
POST
. - URL: Enter your URL endpoint
https://<akamas-url>:6000/v1/study-run
(make sure to replace<akamas-url>
with your actual Akamas URL).
- Task: Select the task associated with your shipyard file (in this case,
-
Select Add custom header and enter the following values:
- For Name, enter
Authorization
. - For Value, enter
Basic {{.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.akamas.pwd}}
.
- For Name, enter
-
Enter a Custom payload.
Example:
Be sure to replace
<study-id>
with your Akamas study ID.{ "study-id": "<study-id>", "project": "{{.data.project}}", "stage": "{{.data.stage}}", "service": "{{.data.service}}", "type": "{{.type}}", "shkeptncontext": "{{.shkeptncontext}}", "triggeredid": "{{.id}}" }
-
Under Send finished event, select
by webhook receiver
. -
Select Create subscription.
Trigger a sequence
Cloud Automation triggers Akamas whenever the defined task in the sequence is triggered:
- When the task associated with the Akamas optimization in the sequence is executed, Cloud Automation triggers the corresponding webhook service.
- The webhook service launches the Akamas optimization, which is executed on the Akamas side.
- After the Akamas optimization ends, the finished event with the result of the Akamas optimization is sent to Cloud Automation.
To trigger the sequence, follow the steps below.
- Create a file named
triggered-event.json
.
Example:
{
"type": "sh.keptn.event.mystage.mysequence.triggered",
"specversion":"1.0",
"source":"manual-trigger",
"data":{
"project":"myproject",
"stage":"mystage",
"service":"myservice"
}
}
- Send the event.
keptn send event --file triggered-event.json
After sending the event, you can
- Monitor the sequence progress on the Cloud Automation sequence page of the project
- Monitor the Akamas study progress