Skip to main content
How to unlock Deployment metrics in Athenian

Notify Athenian about your deployments and get valuable metrics according to your engineering workflow.

Waren Long avatar
Written by Waren Long
Updated over 2 years ago

Athenian offers end-to-end visibility over the entire software delivery pipeline. To include your deployments into the analysis, you can use our API to notify the system about these. This configuration enables metrics such as Deployment Frequency to Staging, or Lead Time to Production. Here are the instructions to do so:

Step 1. Create an API key (once-off)

Since bearer tokens expire every 24h, we invite you to generate a persistent API key. To do so, get your Account ID & bearer token, while logged into Athenian by going to: https://app.athenian.co/bearer


Then generate your API key using the following call.

curl -H "Authorization: Bearer <bearer token>" -H "Content-Type: application/json" -d '{"account": <account id>, "name": "My Persistent API Token"}' https://api.athenian.co/v1/token/create

Once generated, save your key as you won't be able to see it again. You can however generate as many keys as you like, and also invalidate them (see our full API spec here).

Step 2. Notify Athenian of a deployment

You can now use the following API call in your deployment script to notify Athenian about a deployment. As an example, the curl request below sends a notification about a deployment to production made on January, 23rd.

curl -H "X-API-Key: CiQAx7JIGwVntSOTZPoDbL4qwNg2Fif+D3guBml7Ihn13r5EL0cSMQCOc0KbHWnuLuCMrbugFqAM3OzbjXtSxrAquIs5mMe7G93XUUQ6p+CR65+7xXcXxr=" https://api.athenian.co/v1/events/deployments -d '[{ "components": [ { "repository": "github.com/athenianco/athenian-api", "reference": "v0.10.34" } ], "environment": "production", "date_finished": "2022-01-23T05:01:07Z", "date_started": "2022-01-23T04:56:07Z", "conclusion": "SUCCESS" }]'

Please refer to the API documentation for more details on this endpoint: https://api.athenian.co/v1/ui/#/events/notify_deployments

Step 3. [optional] Backfill deployments from the past

If you want to notify Athenian about your historical deployments to get metrics about the past, you can provide us a list of them in whatever format (csv, json, etc.), or enter them yourself using the same call with the corresponding deployment timestamps.

Step 4. Visit the Deploy section in Athenian

Finally, go to the deploy section in your Athenian account and you'll see metrics such as deployment frequency, success ratio, deployment size, and PR Cycle Time for all the environments you've sent us events about.

Congratulations! Your Athenian account now takes into account your own deployment workflow.

Did this answer your question?