AWS Elastic Beanstalk

Getting started with Akita is as simple as dropping our Agent into your service or stack. Once we’re in, we gather all the data you need and surface it in the Akita app so you can easily see what your system is doing.

Below are instructions for installing the Akita Agent in your staging or production environment as a Docker container in AWS Elastic Beanstalk.

📘

Does your app use one of the supported languages for Elastic Beanstalk instead?

Let us know so we can prioritize adding support.

📘

Prefer to run the Akita Agent on an underlying AWS EC2 instance?

See the Linux (bare-metal or local) instructions instead.

To set up the Akita Agent on AWS Elastic Beanstalk, you must first set up Akita and then you can:

  1. Use Docker Compose, or
  2. Use a Dockerfile, or
  3. Use Dockerrun.aws.json (Alpha)

Set Up Akita

You’ll need to be in our beta.

Create a project

Log-in to the Akita App, and go to the Settings page.
Enter a project name and click "Create Project". We suggest naming the project after your app or deployment stack.

22542254

Give your project a name that's easy to remember – you'll need it later, when you start the Akita agent on the CLI.

Generate API key

On the same Settings page, locate and click the “API Keys” tab. Click the “Set up the Akita client” button. Copy your API key secret into your favorite password manager or somewhere else you can easily access it. Also note your API key, as you will need it later.

780780

Docker Compose

To install the Akita Agent, add the Akita Agent as an additional service to your docker-compose.yaml file, as shown below. If you want to version pin the Akita CLI, replace akita-cli:latest with a specific version.

services:
  ...
  akita:
    container_name: akita
    image: public.ecr.aws/akitasoftware/akita-cli:latest
    
    env_file:
      - .env

    network_mode: "host"
    entrypoint: /akita apidump --service <your project here>

This configures the Akita Agent to listen for all traffic on the host, and upload it to the project you created earlier.

The agent will receive the API key as an environment variable, and the next section describes how to configure the values that are placed in the .env file through the Amazon web console.

Add the Akita API key as an environment property

In the AWS console, go the "configuration" section of the Elastic Beanstalk environment where you'll be deploying Akita.
Edit the "software" category, and add environment properties named AKITA_API_KEY_ID and AKITA_API_KEY_SECRET, using the values of the API key you created

23932393

Deploy and Verify

Deploy the new version of your application as you normally would. The Akita Agent will automatically start watching the data sent to and from your application.

In the Akita web console, check out the incoming data on the Model page. You should see a map of your API being generated as the Akita Agent gathers data.

Then check out the Metrics and Errors page to get real-time information on the health of your app or service.

Dockerfile

You have two options if you are using a Dockerfile for Elastic Beanstalk:

  1. Single Dockerfile
  2. Multiple Dockerfiles

Single Dockerfile

If your application has only a single Dockerfile, use akita learn as a wrapper around your normal entry point.

To do this, add the following line to your Dockerfile, which will install the latest Akita Agent:

RUN bash -c "$(curl -L https://releases.akita.software/scripts/install_akita.sh)"

Next, change the CMD directive in your Dockerfile to run the Akita CLI and start your previous entry point as a subprocess:

CMD ["/usr/local/bin/akita", "apidump", "--service", "<your project name>", \
     "-u", "root", "-c", "<your normal commnand line>", \
     "--rate-limit", "1000"]

You may instead choose to run Akita as a background process, but this requires writing a script that will do so during container start, before launching your normal main process.

Then Add the Akita API key as an environment property to make the API key available to the Akita Agent.

Multiple Dockerfiles

If you are using multiple Dockerfiles for your application, download the Akita Agent's Debian package by running the below command:

bash -c "$(curl -L https://releases.akita.software/scripts/install_akita.sh)"

Then copy the package into the Dockerfile for installation.

Next, change the CMD directive in your Dockerfile to run the Akita Agent and start your previous entry point as a subprocess:

CMD ["/usr/local/bin/akita", "apidump", "--service", "<your project name>", \
     "-u", "root", "-c", "<your normal commnand line>", \
     "--rate-limit", "1000"]

You may instead choose to run Akita as a background process, but this requires writing a script that will do so during container start, before launching your normal main process.

Then Add the Akita API key as an environment property to make the API key available to the Akita Agent.

Add the Akita API key as an environment property

In the AWS console, go to the "configuration" section of the Elastic Beanstalk environment where you'll be deploying Akita.
Edit the "software" category, and add environment properties named AKITA_API_KEY_ID and AKITA_API_KEY_SECRET, using the values of the API key you created

23932393

Deploy and Verify

Deploy the new version of your application as you normally would. The Akita Agent will automatically start watching the data sent to and from your application.

In the Akita web console, check out the incoming data on the Model page. You should see a map of your API being generated as the Akita Agent gathers data.

Then check out the Metrics and Errors page to get real-time information on the health of your app or service.

Create an Application with Dockerrun.aws.json

Note: This installation method is in Alpha. Please contact us on the Akita Slack if you run into any difficulty, and we’ll be happy to help.

Dockerrun.aws.json is an AWS ECS task definition that allows the Akita Agent to run as a separate container using host networking (on Linux clusters). It allows you to avoid editing your existing container. Add the following container definition to your configuration file:

{
  "containerDefinitions" : [
  ...
    {
      "name": "akita",
      "image": "public.ecr.aws/akitasoftware/akita-cli:latest",
      "essential": false,
      "memory": 256,
      "networkMode": "host",
      "entrypoint": ["/akita", "apidump, "--service", "<your project here>"]
    }
  ]

This will start an instance of the Akita Agent on each host, and monitor all network traffic on that host.

Next, add the Akita API key as an environment property to make the API key available to the Akita Agent.

Add the Akita API key as an environment property

In the AWS console, go to the "configuration" section of the Elastic Beanstalk environment where you'll be deploying Akita.
Edit the "software" category, and add environment properties named AKITA_API_KEY_ID and AKITA_API_KEY_SECRET, using the values of the API key you created

23932393

Deploy and Verify

Deploy the new version of your application as you normally would. The Akita Agent will automatically start watching the data sent to and from your application.

In the Akita web console, check out the incoming data on the Model page. You should see a map of your API being generated as the Akita Agent gathers data.

Then check out the Metrics and Errors page to get real-time information on the health of your app or service.


Did this page help you?