-
-
Notifications
You must be signed in to change notification settings - Fork 629
feat: Add custom states #1445
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
base: master
Are you sure you want to change the base?
feat: Add custom states #1445
Conversation
|
Just FYI before you commit time to implementing this - there has been a few attempts at implementing severity, and the issue is usually that it's a breaking change and I don't like the implementation. I understand some people would love a way to add some level of severity, but to me, I'm not even convinced I would want this feature in Gatus in the first place because of all the confusion it adds around health % calculation, uptime calculation, the increase in complexity for specifying what severity a specific condition impacts, etc. I've seen the comment you posted on the issue, and it's a good idea to avoid breaking changes, but I think it would be too difficult to understand for most people (and also Long story short, it adds a whole lot of complexity for what I think is very little advantage, and for that reason, at this stage, I'm not sure I'm interested in adding this to Gatus |
|
Thanks for the heads up! I understand that working on this might lead nowhere and that it's a complicated thing to add since it impacts a lot of core components. Currently I'm just exploring and trying to figure out what the biggest road blocks are towards a fully working implementation/prototype. Out of my perspective it's a good topic because this way I need to have a look at many different core components and features of Gatus. So even if it leads nowhere it will not be wasted time for me, I'm sure.
Breaking change in configuration compatibility is probably the most critical I imagine. How problematic are breaking changes in API and database structure (e.g. added state member, in addition to the currently existing success field)?
My goal would be to not change the default behavior in any way. Only people trying to would have to think about the implications of customizing it. In regards to added complexity I definitely see your point. However I think is the structure on how to configure it is well designed one detailed entry in the FAQ section of the readme would be enough for most people to understand. I'll keep this PR in draft as long as I'm experimenting and once the base of the implementation is solid and thorough enough I'll open it. Maybe you'll see the potential once I have hopefully solved some of the bigger issues, and if not so be it. I know what I signed up for! |
|
Making a breaking change on the database schema would only imply removing or modifying existing fields. It wouldn't be preferable, but it's not a big deal if we have to do that. There is no public database API contract for Gatus, meaning there is no guarantee that the database schema will not have breaking changes. The REST API, however, is a different story. Changes are just breaking if users currently relying on a specific field are no longer able to rely on that field due to a change. Such a change would be breaking, and would require a major version bump, which can be done if absolutely necessary. If you're not sure whether something is a breaking change, feel free to ping me and ask. |
I've thought about this and I'm not sure if |
8ff284d to
76a5ca7
Compare
2d32cd9 to
eb1f2a9
Compare
b5ad733 to
45b22d9
Compare
45b22d9 to
57a7668
Compare
|
Events are now displayed with a custom text and color: In development mode the template placeholder for the Could also be changed to fallback on the Success field of the endpoint results. This situation should only arise during development if api and webserver instance are bundled as one, since the state and color config link is validated at server startup: |
|
@TwiN I'm getting ready for a feedback phase. There are still some parts (and many small details) to be implemented/discussed and most of the tests are still missing but enough is already working to showcase it in a usable way.
I'd move forward with implementing/discussing the details and cleaning up the rough edges if you are more interested after looking at the rough implementation for this feature. After working on it for a little while I see the added complexity but also the potential.
|



Summary
Implement the requested severity feature by introducing custom states.
If implementation moves forward as suggested:
Closes #227, close #1274.
If we structure it correctly we could start working on #1444 as a followup if this PR gets merged to make it possible to configure multiple themes for each state to allow adding colorblind and other themes which can then be selected via the UI.
Checklist
Implementation tasks:
The following logic needs to be implemented (backend):
statesdefining the available stateshealthy,unhealthyandmaintenanceThe following logic has to be implemented (frontend):
Outstanding issues/tasks/questions
npm run serveunknownstate and allow state color config?Final tasks
README.md, if applicable.