C.W.K.
Stream
Lesson 10 of 13 · published

Monitoring CI

~10 min · monitoring, metrics, observability

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

What to watch

CI is software too. Treat it like a service: monitor its health and respond when it degrades. The metrics that matter:

  • Pass rate on main — %% of main runs that go green. Target 95%+. Below 90% is a crisis.
  • p50 / p95 duration — feedback latency.
  • Flake rate — % of failed runs that pass on retry. >2% means you have flakes to fix.
  • Queue time — how long runs wait before starting. Self-hosted fleet too small if this grows.
  • Cost — minutes used per repo, per workflow, per OS.

Where to put the data

  1. Built-in — Insights tab, Actions usage report. Good first step, limited drill-down.
  2. Datadog / Honeycomb / Grafana — pipe Actions events via the workflow_run webhook to your observability stack.
  3. Custom — a scheduled job that calls the GitHub API, computes metrics, posts to Slack / a dashboard / a database.

Alerting

Page when main pass rate drops below threshold. Slack on flake-rate spike. Don't alert on individual failures — those are normal noise.

Code

Scheduled job that posts CI weekly digest·yaml
name: ci-digest
on:
  schedule: [{ cron: '0 9 * * 1' }]   # Monday 09:00 UTC
  workflow_dispatch: {}

permissions:
  actions: read
  contents: read

jobs:
  digest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Compute and post digest
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SLACK_WEBHOOK: ${{ secrets.SLACK_DEPLOY_WEBHOOK }}
        run: ./scripts/ci-digest.sh

External links

Exercise

Compute (manually or via script) your repo's main-branch pass rate over the last 30 days. If it's below 95%, list the top 3 causes. Pick one and own its fix this sprint.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.