Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add SQL query empty result monitoring #5429

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

kwrx
Copy link

@kwrx kwrx commented Dec 10, 2024

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Hello @louislam and everyone!

This little PR tries to introduce new features for handling the results of SQL monitoring queries. Specifically, it ensures that an empty result can return an error, while other outcomes will not. The implementation is designed to avoid breaking changes with the current version.

Specifically, the implementation ensures:

  • Compatibility with existing configurations: The feature introduces an optional frontend flag, ensuring backward compatibility.
  • Enhanced user control: Provides more meaningful feedback beyond simply confirming query execution.

Changes Implemented

  • Backend: Introduced error handling for empty result in monitoring queries.
  • Database: Added a new column to the monitor table using Knex migration.
  • Frontend: Added a checkbox in EditMonitor.vue to enable error checking functionality.
  • Localization: Added translations for both English and Italian (my native language).

What's Missing

  • Tests: Test cases need to be written, if needed.
  • Localization: Translations are missing for other supported languages.

Additional Notes

This is my first pull request in an open-source project, so please let me know if I’ve made any mistakes or if improvements can be made.

Thanks

Type of change

Please delete any options that are not relevant.

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • My changes generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

image

@kwrx kwrx marked this pull request as draft December 10, 2024 22:43
@kwrx kwrx changed the title feat: add SQL query empty result monitoring (#2342) feat: add SQL query empty result monitoring Dec 10, 2024
@kwrx kwrx marked this pull request as ready for review December 10, 2024 23:19
@emanuele232

This comment was marked as spam.

Copy link
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.

Hi, thanks for the PR.
Unfortunately, I think accepting this PR would make future work like migrating mssql towards the inital work laid out here a lot more difficult

I think a better way would be to migrate the individual monitor you need to this form.
=> would you be open to migrating the monitor you need to this alternative instead?

@CommanderStorm CommanderStorm added the area:monitor Everything related to monitors label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:monitor Everything related to monitors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Monitor SQL query result
3 participants