OpsTrailsDocs
Console

Deployment Tracking

Track every deployment across all environments to build a complete history of what was deployed, when, and where.

The Pattern

  1. CI/CD pipeline records event — On every successful deploy, the pipeline sends a deployment event to OpsTrails with the version, environment, and source repository
  2. Timeline shows deploy history — The team has a chronological view of all deployments across all services and environments
  3. 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:

Why Track Deployments?

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.

CI/CD Examples

OpsTrails integrates with all major CI/CD platforms. See all available integrations on the integrations page. Here are examples for the most popular ones.

GitLab CI

See the full GitLab CI guide for detailed setup instructions.

yaml
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_TAG

Jenkins

See the full Jenkins guide for detailed setup instructions.

groovy
post {
  success {
    opstrailsTrackEvent(
      type: 'deployment',
      source: "//jenkins/${env.JOB_NAME}",
      subject: 'production',
      version: env.BUILD_TAG
    )
  }
}

What to Include in Deployment Events

A well-structured deployment event makes investigation faster. Here are the recommended fields (see Core Concepts for full field details):

FieldRecommended ValueWhy
versionCommit SHA or semver tagIdentifies exactly what code was deployed
sourceRepository URI (e.g. //github.com/org/repo)Links the event to a specific service
subjectEnvironment name (e.g. production, staging)Filters events by environment during investigation
severityLOW for routine deploys, MAJOR for big releasesPrioritizes events during incident triage
data.descriptionHuman-readable summary of the changeGives AI and humans quick context

Best Practices