result.code, the content of the JSON body matters. Below are two versions of the health response and the relevant AnalysisTemplate snippet.
Frame the successful (green) version JSON — it includes a numeric code field:
Note: The AnalysisTemplate’s success condition checks the JSON payload (for example,
result.code). It does not evaluate the HTTP response code returned by the server.code field:
If the AnalysisRun queries a response that lacks
result.code, the metric extraction for result.code will fail and the success condition cannot be satisfied — even if the HTTP status is 200. Ensure the JSON payload contains the field referenced by your success condition.- The AnalysisTemplate success condition is evaluated against the JSON payload returned by the health endpoint (e.g.,
result.code). - The green version includes the
codefield with a value in the 200–299 range, satisfying the condition. - The blue version lacks the
codefield, so the same AnalysisTemplate would fail when run against it.
| Aspect | Green version (passed) | Blue version (would fail) |
|---|---|---|
JSON payload includes code | Yes ("code": 200) | No |
Success condition (result.code >= 200 && result.code < 300) | Evaluates to true | Fails (field missing) |
| AnalysisRun result | Success | Failure |
- Argo Rollouts — AnalysisOverview
- Argo Workflows Documentation
- Consider using JSONPath or JQ locally to inspect responses: e.g.,
curl -s http://svc/health | jq .