Giter VIP home page Giter VIP logo

Comments (6)

TwiN avatar TwiN commented on August 17, 2024 3

This has been on my list as well.

I've also entertained the idea of having another in-memory map that stored the last N outages for each services and dynamically generated a timeline instead of trying to persist the entire history, i.e.

Service A Outages
- From YYYY-MM-DD hh:mm:ss to YYYY-MM-DD hh:mm:ss

Though this wouldn't survive application restarts.

But yeah, thanks for opening this issue.

from gatus.

GeorgFleig avatar GeorgFleig commented on August 17, 2024

Just a side note: Having a separate persistence layer (not in-memory) would be a step towards running Gatus in a high-availability setup to ensure monitoring works even when a host is down. In this case the state of performed requests of all instances would be shared and the dashboard could show them all.

Syncing execution of requests and sending of alerts would still be an open topic though 🙃

from gatus.

cjheppell avatar cjheppell commented on August 17, 2024

As discussed in #66 (comment), the first step towards this will be introducing file-based persistence.

Later, other storage means can be introduced if required (e.g databases).

from gatus.

yarhamjohn avatar yarhamjohn commented on August 17, 2024

I am taking a look at this with @cjheppell this afternoon

from gatus.

TwiN avatar TwiN commented on August 17, 2024

Posting part of the comment I posted in #69 here for traceability:

I've been working on persistence, and I've tried and compared several different options:

  • memory-only (current implementation)
  • file-only (with bolt)
  • gocache (memory + file, but persistence is achieved through autosave)

The file-only option was pretty terrible in term of performance, granted it may have been because the implementation itself was a little lazy.

memory-only was used more as a baseline to compare performance, but since the purpose was to achieve performance, it's a no-go.

Finally, gocache gave such good results. It's essentially on-par with memory while providing the persistence required, but well, that's why I suggested using it in the first place.

To continue on that comment, the implementation I went for does not persist the data immediately. It dumps the data to a file every 7 minutes. I had initially tried to implement it through bolt only, but I was very unsatisfied with the performance of using file-only, so I decided to use a hybrid: in memory + occasional persistence.

I've renamed this issue to focus purely on persisting data to survive restarts, thus allowing the data generated by Gatus to survive restarts which in turns makes services with longer interval more viable than before.
The ability to view older history is definitely also on my agenda, but since the former is more important right now, I decided to focus only developing that feature.

The ability to go back in history will be added in the future, but I don't have a specific date yet.

P.S. For those of you who want the ability to view older history over a long period right now as opposed to just persistence, it's not ideal, but you can probably leverage the /metrics endpoint and persist it through Prometheus. I didn't give an insane amount of love to the metrics, but if it's requested enough, I can work on improving the metrics exposed (unless somebody else wants to do it in my stead 🤷‍♂️)

from gatus.

TwiN avatar TwiN commented on August 17, 2024

Released in v2.1.0

from gatus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.