CI Integration
Send deploy events from your CI/CD pipeline so Cloudlink can link cost changes to specific releases.
How it works
- Your CI pipeline deploys code
- After the deploy step, it sends a POST request to Cloudlink's
/deploysendpoint - Cloudlink records the deploy and, after 2-3 hours, compares post-deploy costs against the 7-day baseline
- If costs spike >10%, a regression is created and alerts fire (Slack, email, webhooks)
GitHub Actions
Add this step after your deploy step in your workflow:
- name: Notify Cloudlink
if: success()
run: |
curl -s -X POST ${{ secrets.CLOUDLINK_API_URL }}/deploys \
-H "Authorization: Bearer ${{ secrets.CLOUDLINK_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"service": "my-service",
"version": "${{ github.sha }}",
"environment": "production",
"source": "github-actions"
}'Required secrets
| Secret | Value |
|---|---|
CLOUDLINK_API_URL | Your Cloudlink API URL (e.g. https://cloudlink-agents-production.up.railway.app) |
CLOUDLINK_API_KEY | Your API key from the Cloudlink dashboard |
GitLab CI
notify_cloudlink:
stage: post-deploy
script:
- |
curl -s -X POST $CLOUDLINK_API_URL/deploys \
-H "Authorization: Bearer $CLOUDLINK_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"service\": \"my-service\",
\"version\": \"$CI_COMMIT_SHA\",
\"environment\": \"production\",
\"source\": \"gitlab-ci\"
}"
only:
- mainGeneric (any CI)
Any system that can make HTTP requests can send deploy events:
curl -X POST https://your-api-url/deploys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"service": "service-name",
"version": "v1.2.3",
"environment": "production"
}'Deploy event fields
| Field | Required | Description |
|---|---|---|
service | Yes | AWS service name (must match Cost Explorer service name, e.g. "Amazon EC2") |
version | No | Git SHA, tag, or version number |
environment | No | Deploy target (default: "production") |
source | No | CI system identifier |
metadata | No | Arbitrary JSON object for your own tracking |
Verifying integration
After pushing a deploy event, check Dashboard → Deploys to confirm it appeared. You can also click Run detection to manually trigger regression analysis (normally runs automatically every 30 minutes).