Track every deployment across all environments to build a complete history of what was deployed, when, and where.
The Pattern
CI/CD pipeline records event — On every successful deploy, the pipeline sends a deployment event to OpsTrails with the version, environment, and source repository
Timeline shows deploy history — The team has a chronological view of all deployments across all services and environments
AI correlates with metrics — When an error spike occurs, AI queries the timeline to find recent deployments and checks metrics around each one
Example: GitHub Actions
yaml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to production
run: ./deploy.sh
- name: Track deployment
uses: opstrails/track-event@v1
with:
api-key: ${{ secrets.OPSTRAILS_API_KEY }}
type: deployment
subject: production
version: ${{ github.sha }}
Querying with AI
Once deployments are tracked, ask your AI assistant:
“What was deployed to production today?”
“Show me all deployments for the API service in the last week”
“When was the last time we deployed to staging?”
“Did the error rate increase after the last deployment?”
Best Practices
Use consistent sources — Format source URIs consistently across all pipelines (e.g. //github.com/org/repo)
Include version — Always include the version (commit SHA, tag, or semver) to make it easy to identify specific deployments
Track all environments — Use the subject field to distinguish between staging, production, canary, etc.
Track rollbacks too — Use type: rollback to distinguish rollbacks from forward deployments