Quickstart

Your first push

Driftmetrics stores numbers your build already prints and keeps their history. One HTTP call from CI is the whole integration.

CI jobor your laptopPOST/api/v1/pushnumbers onlyDriftmetricsruns · tags · historyDashboardtrend · diffPR checkbudgets

Four steps

  1. Sign in at app.driftmetrics.watch. The first sign-in creates your organization. Create a project in it.
  2. Open the project, then Settings → Tokens, and create a write token. Copy it once and store it as a CI secret — DRIFT_TOKEN below.
  3. Push a run. Tags identify it; metrics are the numbers.
    curl -X POST https://app.driftmetrics.watch/api/v1/push \
      -H "Authorization: Bearer $DRIFT_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "tags": {"version":"v2.5.0","platform":"linux-x64","build":"release"},
      "metrics": [
        {"name":"binary_size","value":2.14,"unit":"MB","direction":"lower_is_better"},
        {"name":"peak_ram","value":419,"unit":"KB","direction":"lower_is_better"},
        {"name":"latency_ms","value":41.6,"unit":"ms","direction":"lower_is_better"}
      ],
      "meta": {"commit":"9f2c1ab","ci":"https://github.com/acme/app/actions/runs/812"}
    }'
    In GitHub Actions that is one step:
    - name: Push metrics
      env:
        DRIFT_TOKEN: ${{ secrets.DRIFT_TOKEN }}
      run: |
        curl -X POST https://app.driftmetrics.watch/api/v1/push \
          -H "Authorization: Bearer $DRIFT_TOKEN" \
          -H "Content-Type: application/json" \
          -d @metrics.json
  4. Open the project. Every metric has a trend along the version axis and a diff between any two versions. The push response already carries each value against the previous run, so CI can print the deltas too.

Next

How it works explains tags, the axis and the two project modes. API reference lists every field.