Track every deployment across all environments to build a complete history of what was deployed, when, and where.
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 }}Once deployments are tracked, ask your AI assistant:
Research consistently shows that 80% of production outages are self-inflicted — caused by changes like deployments, config updates, and migrations. Without a record of what changed and when, teams waste valuable time during incidents piecing together a timeline from scattered CI/CD logs and Slack threads.
Tracking deployments is the foundation for reducing your change failure rate — one of the four key DORA metrics. When every deploy is recorded with its version, environment, and source, your team can quickly correlate failures with specific changes and build a data-driven picture of deployment reliability over time.
OpsTrails integrates with all major CI/CD platforms. See all available integrations on the integrations page. Here are examples for the most popular ones.
See the full GitLab CI guide for detailed setup instructions.
include:
- component: gitlab.com/opstrailsdev/gitlab-ci-component/track-event@v1
inputs:
api_key: $OPSTRAILS_API_KEY
type: deployment
source: "//gitlab.com/$CI_PROJECT_PATH"
subject: production
version: $CI_COMMIT_TAGSee the full Jenkins guide for detailed setup instructions.
post {
success {
opstrailsTrackEvent(
type: 'deployment',
source: "//jenkins/${env.JOB_NAME}",
subject: 'production',
version: env.BUILD_TAG
)
}
}A well-structured deployment event makes investigation faster. Here are the recommended fields (see Core Concepts for full field details):
| Field | Recommended Value | Why |
|---|---|---|
version | Commit SHA or semver tag | Identifies exactly what code was deployed |
source | Repository URI (e.g. //github.com/org/repo) | Links the event to a specific service |
subject | Environment name (e.g. production, staging) | Filters events by environment during investigation |
severity | LOW for routine deploys, MAJOR for big releases | Prioritizes events during incident triage |
data.description | Human-readable summary of the change | Gives AI and humans quick context |
//github.com/org/repo)type: rollback to distinguish rollbacks from forward deployments