OpsTrailsDocs
Console

GitLab CI

Track events from GitLab CI/CD pipelines using the OpsTrails CI component.

Setup

  1. Go to your project's Settings → CI/CD → Variables
  2. Add a variable named OPSTRAILS_API_KEY with a READ_WRITE API key
  3. Mark it as masked and protected

Pipeline Step

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

Inputs

InputRequiredDescription
api_keyrequiredOpsTrails API key (READ_WRITE scope)
typerequiredEvent type
sourceoptionalEvent source URI (defaults to project path)
subjectoptionalTarget environment
versionoptionalRelease version or tag