• Home
  • Platform modules
  • Cloud Automation
  • Partner integrations
  • Akamas

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

  • Install 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.

    How to install the Akamas container
    1. Create an application directory, such as /usr/local/cloudautomation.
    2. In the application directory, download the files below.
    bash
    curl https://akamas.s3.us-east-2.amazonaws.com/integrations/keptn/docker-compose.yml -o docker-compose.yml curl https://akamas.s3.us-east-2.amazonaws.com/integrations/keptn/env.templ -o env.templ
    1. To expose the integration API called by the Cloud Automation webhook via HTTPS, edit docker-compose.yml by replacing the value of the volumes parameter with the location of your certificate directory specified when enabling HTTPS on Akamas.
    2. Rename the .env.templ file to .env, then edit the file by replacing the values of the KEPTN_URL and KEPTN_TOKEN variables with your own values, and save the file.
    3. Start the container.
    bash
    docker-compose up -d

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.

    How to add a Cloud Automation secret for Akamas
    1. On the Cloud Automation bridge, select your Cloud Automation project.

    2. Select Settings, and then select Secrets.

    3. Select Add Secret and enter the following values:

      • Name: Enter a name for the secret (for example, akamas).

      • Scope: Select keptn-webhook-service.

      • Key/Value: Enter your values for the key/value pair (for example, key: pwd, value: <a_base64_encoded_user:password_combination>1).

        1

        If the user is akamas and the password is testpassword, the combined user:password (akamastestpassword) is encoded into YWthbWFzOnRlc3RwYXNzd29yZA==. To easily encode your password, see Encode to Base64 format.

    4. Select Add secret.

Set up the Akamas webhook subscription

  1. On the Cloud Automation bridge, select your Cloud Automation project.

  2. Select Settings, and then select Integrations.

  3. Select webhook-service from the list, and then select Add subscription.

  4. 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).
  5. 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}}.
  6. Enter a Custom payload.

    Example:

    Note: Be sure to replace <study-id> with your Akamas study ID.

    json
    { "study-id": "<study-id>", "project": "{{.data.project}}", "stage": "{{.data.stage}}", "service": "{{.data.service}}", "type": "{{.type}}", "shkeptncontext": "{{.shkeptncontext}}", "triggeredid": "{{.id}}" }
  7. Under Send finished event, select by webhook receiver.

  8. Select Create subscription.

Trigger a sequence

Cloud Automation triggers Akamas whenever the defined task in the sequence is triggered:

  1. When the task associated with the Akamas optimization in the sequence is executed, Cloud Automation triggers the corresponding webhook service.
  2. The webhook service launches the Akamas optimization, which is executed on the Akamas side.
  3. 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.

  1. Create a file named triggered-event.json.

Example:

json
{ "type": "sh.keptn.event.mystage.mysequence.triggered", "specversion":"1.0", "source":"manual-trigger", "data":{ "project":"myproject", "stage":"mystage", "service":"myservice" } }
  1. Send the event.
bash
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
Related topics
  • Cloud Automation

    The capabilities of Dynatrace Cloud Automation