| 1 | # Recipe: find by version (regression spotter) |
| 2 | |
| 3 | Use case: "Did crash X appear in v2.10? Was it fixed in |
| 4 | v2.10.0-100-nightly?" |
| 5 | |
| 6 | ## Quick path |
| 7 | |
| 8 | Compare crash counts across explicit versions: |
| 9 | |
| 10 | ```bash |
| 11 | .agents/skills/query-agent-events/scripts/get-events.sh \ |
| 12 | --health crash \ |
| 13 | --versions 'v2.9.0,v2.10.0,v2.10.0-100-nightly,v2.10.0-130-nightly' \ |
| 14 | --since '14d ago' \ |
| 15 | --last 1 \ |
| 16 | --facets 'AE_AGENT_VERSION,AE_FATAL_FUNCTION' \ |
| 17 | --histogram AE_AGENT_VERSION \ |
| 18 | --output /tmp/regression.json |
| 19 | ``` |
| 20 | |
| 21 | `--last 1` because we only need the facet counts. |
| 22 | `--histogram AE_AGENT_VERSION` adds time-bucketed counts per |
| 23 | version, useful to spot when something disappeared. |
| 24 | |
| 25 | Then read the response: |
| 26 | |
| 27 | ```bash |
| 28 | jq '.facets[] |
| 29 | | select(.id=="AE_AGENT_VERSION") |
| 30 | | .options |
| 31 | | sort_by(-.count) |
| 32 | | .[] |
| 33 | | "\(.count)\t\(.id)"' /tmp/regression.json |
| 34 | ``` |
| 35 | |
| 36 | ## "When did this start?" (wide window) |
| 37 | |
| 38 | ```bash |
| 39 | .agents/skills/query-agent-events/scripts/get-events.sh \ |
| 40 | --function 'specific_buggy_function' \ |
| 41 | --version all \ |
| 42 | --since '30d ago' \ |
| 43 | --last 1 \ |
| 44 | --facets 'AE_AGENT_VERSION' \ |
| 45 | --histogram AE_AGENT_VERSION \ |
| 46 | --output /tmp/origin.json |
| 47 | ``` |
| 48 | |
| 49 | `--version all` is required -- the auto filter would mask |
| 50 | older versions. The histogram tells you when (in time) and |
| 51 | which versions started reporting. |
| 52 | |
| 53 | The first appearance in a specific version + nightly date |
| 54 | gives you a commit window to bisect. |
| 55 | |
| 56 | ## "Was it fixed?" check |
| 57 | |
| 58 | After a fix lands in nightly N: |
| 59 | |
| 60 | ```bash |
| 61 | .agents/skills/query-agent-events/scripts/get-events.sh \ |
| 62 | --function 'specific_buggy_function' \ |
| 63 | --versions 'v2.10.0-90-nightly,v2.10.0-100-nightly,v2.10.0-120-nightly' \ |
| 64 | --since '7d ago' \ |
| 65 | --last 1 \ |
| 66 | --facets 'AE_AGENT_VERSION' \ |
| 67 | --output /tmp/post-fix.json |
| 68 | ``` |
| 69 | |
| 70 | Check if the count drops to ~zero in nightly N+1 and beyond. |
| 71 | |
| 72 | ## Triage flow |
| 73 | |
| 74 | 1. **Identify the candidate function / signal / cause** -- |
| 75 | start from `find-by-function.md` or `finding-crashes.md`. |
| 76 | 2. **Wide-window query** with `--version all` to see the full |
| 77 | version distribution. |
| 78 | 3. **Read the histogram** -- when did this first appear? |
| 79 | When (if ever) did it stop? |
| 80 | 4. **Bisect commits** in the implicated version range. |
| 81 | 5. **Verify the fix** with a post-fix query. |
| 82 | |
| 83 | ## Pitfalls |
| 84 | |
| 85 | - **Old version events from unupdated agents are normal**. |
| 86 | Don't conclude "the bug is back" from a single old-version |
| 87 | record -- check the date. |
| 88 | - **`--versions auto` masks regressions** because it filters |
| 89 | to recent versions. Use `--version all` for "when did this |
| 90 | start?" investigations. |
| 91 | - **Nightly numbers are commits-since-tag**. Higher number = |
| 92 | newer. Sorting nightly versions lexically is wrong; sort by |
| 93 | the embedded number (the auto-detection in `_lib.sh` does |
| 94 | this correctly). |
| 95 | - **Different agents on the same install**: distinct |
| 96 | `AE_AGENT_ID` (Netdata machine GUID) but same `AE_HOST_ID` |
| 97 | (OS machine-id). Group by `AE_AGENT_ID` to get unique |
| 98 | installs, NOT by `AE_HOST_ID`. |