cronping

GitLab CI

Monitor scheduled GitLab CI pipelines with Cronping.

Use Cronping in scheduled GitLab pipelines to detect missed runs, failed jobs, and jobs that stop reporting.

Scheduled pipeline

Store the full ping URL in a masked CI/CD variable named CRONPING_URL.

backup:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
  image: postgres:16
  script:
    - pg_dump "$DATABASE_URL" > backup.sql
    - gzip backup.sql
    - curl -fsS --retry 3 --max-time 10 "$CRONPING_URL"

Report failure immediately

Use /fail when you want Cronping to alert without waiting for the grace period.

backup:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
  script:
    - |
      if ./scripts/backup.sh; then
        curl -fsS --retry 3 --max-time 10 "$CRONPING_URL"
      else
        curl -fsS --retry 3 --max-time 10 "$CRONPING_URL/fail"
        exit 1
      fi

Capture output

Send the job log as a POST body so it appears in ping history and alert notifications.

etl:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
  script:
    - ./etl.sh > etl.log 2>&1; EXIT_CODE=$?
    - |
      curl -fsS --retry 3 --max-time 10 \
        -X POST "$CRONPING_URL/$EXIT_CODE" \
        -H "Content-Type: text/plain" \
        --data-binary @etl.log
    - exit $EXIT_CODE

Track duration

Send /start before long-running jobs and a final success/fail signal after the job exits.

migration:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
  script:
    - curl -fsS --retry 3 --max-time 10 "$CRONPING_URL/start"
    - ./scripts/run-migration.sh
    - curl -fsS --retry 3 --max-time 10 "$CRONPING_URL"

GitLab schedules use the timezone configured on the schedule. Match that timezone in your Cronping heartbeat to avoid false late/down alerts.

On this page