Skip to content

feat: Add option to retry only on status code failure for JSON Query monitors (#5693)#6687

Merged
CommanderStorm merged 8 commits intolouislam:masterfrom
mohansinghi:feature/json-query-retry-only-status-code
Jan 12, 2026
Merged

feat: Add option to retry only on status code failure for JSON Query monitors (#5693)#6687
CommanderStorm merged 8 commits intolouislam:masterfrom
mohansinghi:feature/json-query-retry-only-status-code

Conversation

@mohansinghi
Copy link
Copy Markdown
Contributor

Description

Adds a new option for JSON Query monitors to only retry when the HTTP status code check fails, not when the JSON query evaluation fails.

Changes

  • Added retry_only_on_status_code_failure boolean field to monitor model
  • Updated retry logic to skip retries when JSON query fails but status code passes
  • Added UI checkbox in EditMonitor.vue (visible for json-query monitors with retries > 0)
  • Added database migration for the new field
  • Added translation keys for the new option

Behavior

  • When enabled: If status code check passes but JSON query fails, monitor is marked DOWN immediately without retries
  • When disabled (default): Normal retry behavior applies to all errors
  • Status code failures: Always retry (as before), since server might be temporarily down

Use Case

Useful for monitoring Jenkins jobs or similar APIs where:

  • Server down (status code fails) → Should retry (might be temporary)
  • Server up but job status changed (JSON query fails) → Should NOT retry (immediately reflect the change)

Testing

  • ✅ Tested with status code failures (retries work as expected)
  • ✅ Tested with JSON query failures (skips retries when option enabled)
  • ✅ UI checkbox appears only for json-query monitors with retries enabled
  • ✅ Database migration runs successfully

Fixes #5693


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=158349177

…monitors

- Add retry_only_on_status_code_failure field to monitor model
- Skip retries when JSON query evaluation fails but status code passes
- Add UI checkbox for json-query monitors with retries enabled
- Add database migration for new field
- Update retry logic to distinguish between status code and JSON query failures

Fixes louislam#5693
@github-actions
Copy link
Copy Markdown
Contributor

Hello and thanks for lending a paw to Uptime Kuma! 🐻👋
As this is your first contribution, please be sure to check out our Pull Request guidelines.
In particular: - Mark your PR as Draft while you’re still making changes - Mark it as Ready for review once it’s fully ready
If you have any design or process questions, feel free to ask them right here in this pull request - unclear documentation is a bug too.

@mohansinghi mohansinghi changed the title feat: Add option to retry only on status code failure for JSON Query … feat: Add option to retry only on status code failure for JSON Query monitors (#5693) Jan 12, 2026
autofix-ci bot and others added 2 commits January 12, 2026 13:48
- Add selectAllMonitorsAria
- Add deselectAllMonitorsAria
- Add Actions
- Add deleteMonitorsMsg
- Add noMonitorsPausedMsg
- Add noMonitorsResumedMsg

Fixes translation test failures
@mohansinghi
Copy link
Copy Markdown
Contributor Author

Hello @CommanderStorm Could you please review my PR?

Copy link
Copy Markdown
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xsid0703 please only ping me when actually important.

Here is a review, but the code needs some scrubbing around the numeric value (what is that?) and the translation keys

mohansinghi and others added 5 commits January 12, 2026 15:48
- Refactor retry logic to have separate json-query branch as requested
- Remove unrelated numeric value code
- Clean up translation keys
Remove translation keys unrelated to retry-only-on-status-code feature
@mohansinghi
Copy link
Copy Markdown
Contributor Author

@CommanderStorm Thank you for your feedback, it's because I have worked with two issues concurrently.
I have removed other code, and reverted lang part.

Copy link
Copy Markdown
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Jan 12, 2026
@CommanderStorm CommanderStorm merged commit c7a8b7a into louislam:master Jan 12, 2026
24 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@0xsid0703 congrats on your first contribution to Uptime Kuma! 🐻
We hope you enjoy contributing to our project and look forward to seeing more of your work in the future! If you want to see your contribution in action, please see our nightly builds here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For Json Query, only retry for status code

2 participants