Getting started with Akita is as simple as dropping our Agent into your Dockerfile. Below are instructions for installing the Akita Agent in Fly.io using a Dockerfile.

❗️

Deploying directly from source?

Akita does not currently support using Fly.io to deploy an application without a container. If you want to give it a try, see DIY Akita Agent Integration. The alternative is to check out Akita using our Google Chrome Extension.

You will be setting up the Akita Agent to run within your Docker container. To set up the Akita Agent you will:

  1. Create an Akita Project
  2. Generate an API key for the Akita Agent
  3. Install the Akita Agent in your container
  4. Run the Akita Agent
  5. Configure your Akita API key as a Secret
  6. Launch the new container
  7. Verify that the Akita Agent is working

🚧

Akita Account Required

You must have an Akita account to use Akita. You can create an account here.

Create a project

Log into 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.

2254

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.

780

Install Agent in container

Install the Akita Agent during your container build process by running the install script below, adding it to your Dockerfile.

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

Run Agent

There are two options for running the Akita Agent:

  1. Modify the entry point in your Dockerfile, or
  2. Via a script

Run with Dockerfile

Next, change your container's default command to the Akita Agent by adding the below to your Dockerfile. Use the project name you created earlier on the Akita console.
You will need to set a rate-limit. We recommend starting with a low rate-limit, as it is applied to each running container.

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

Run with script

If your normal entry point is a script, you can run the Akita Agent as a background process. Run akita apidump --project <your_project_name> in the background.

Configure API key

The Akita Agent needs to access the API Key you created earlier. The best way to set the API key is using a Secret, which is passed as an environment variable to the container.

From the command line, add new secrets called AKITA_API_KEY_ID and AKITA_API_KEY_SECRET with your key's values filled in:

$ flyctl secrets set AKITA_API_KEY_ID=apk_xxxxxxx
$ flyctl secrets set AKITA_API_KEY_SECRET=xxxxxxxxxx

You will see a hashed version of the secret in your Fly.io activity log.

Launch Container

After adding the Akita API key, use flyctl deploy (for an existing application) or flyctl launch (for a new one). This will build the new version of the container that contains the Akita Agent, and deploy it to Fly.io as a new revision of your application.

Verify

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.