This lesson explains why the AnalysisRun succeeded even though earlier sessions showed a different health payload. The key point: the AnalysisTemplate evaluates a JSON field inside the health endpoint response (result.code), not the HTTP status code. The AnalysisRun invoked the health check three times and evaluated the success condition against the JSON payload returned by the service. The metric reads show three values (one per probe):Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
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 .