mocdaniel/dashing-icinga2

Use an alternative server to solve caching issues & frozen dashboards (replace thin with puma/webrick/unicorn)

dnsmichi opened this issue · 7 comments

Expected Behavior

Possibly works on all clients with no more "frozen" dashboards.

Current Behavior

  • web sockets on Windows do not work
  • refresh and caching issues

Possible Solution

Replace the dashing gem with a different server.

I fear that dashing code changes are required which are not part of this project, but upstream (which is dead, and smashing does not have this sort of patches, see Smashing/smashing#31 for example).

Context

This is the working issue for #15 #29 #7

References:

Possible additional fixes:

The main problem atm is that the Dashing gem itself depends on thin in various hardcoded paths. Unless someone forks and patches that, you cannot solve this and other problems.

Since someone asked on Icinga Camp - Smashing as a fork of Dashing does not solve the problem. Their repository doesn't contain valuable fixes in this regard, and technically is more or less the same.

For the time being, this is an unsolved problem.

Worth reading: https://medium.com/@whale_eat_squid/why-http-2-isnt-the-answer-35ba28ad8dc3

According to @LordHepipud Microsoft doesn't have SSE enabled in its browsers (IE, edge) but Chrome, etc. seem to work flawlessly. Edge on Android works too.

Options

Puma

While researching a bit for #62 I've found different other problems with streaming servers, e.g. Puma in combination with the Sinatra framework.

sinatra/sinatra#1035

Related note - Dashing runs as Sinatra app in a server (thin hardcoded), alternative servers to be evaluated. Thin + Sinatra use the Eventmachine library to support http long polling / streaming, which doesn't work on Windows with Edge/IE as SEE (server sent events) are not implemented by MS.

http://thelazylog.com/long-polling-with-puma-rails-4-and-server-sent-events/

What is Server Sent Events? This is a HTML5 technology which allow browsers to receive updates from server automatically. And when it comes to HTML5 playground, one guy stands out of my way: IE. Please, I have warned you from the beginning of this post that IE will not be supported.

Dashing and Puma

sinatra/sinatra#1035 (comment) provides detailed insights on the problems with implementing Puma and Sinatra streaming. That explains why Dashing did not implement it any sooner, or why there's no development effort in this regard.

Shopify/dashing#677 (comment) also mentions SSE problems without a relation to either Thin, Puma, etc. so #62 clearly is a separate issue.

If one would want to use Puma, which seems to work stable, needs to use an unreleased branch.
Shopify/dashing#677 (comment)
https://github.com/Shopify/dashing/commits/puma_webserver

Unicorn

Unicorn doesn't seem to be an alternative, as many threads suggest to not go for websockets et al.
https://www.reddit.com/r/rails/comments/247fl1/unicorn_push_notifications_websockets_server_side/

Discourse implements Unicorn, but doesn't use websockets. https://samsaffron.com/archive/2015/12/29/websockets-caution-required

Rails

I'm toying with the idea to make use of this project: https://github.com/gottfrois/dashing-rails

This would require more overhead with Rails and Redis, on the other hand it might solve a bunch of problems.

Does not work in Internet Explorer because it relies on Server Sent Events.

Still a no-go until #62 is resolved.

Smashing

Smashing/smashing#64 got rejected for using Puma. Reasoning is the above linked PR on Dashing and issues with Sinatra.

Smashing/smashing#93 makes it even more clear that it is not Puma, but Sinatra related. And that is the inner core of what Dashing depends on being an app for it.

Conclusion

Streaming in Sinatra seems broken, SEE is not supported by MS, Puma as an alternative doesn't work, Smashing doesn't implement any of these changes for that very reason.

We'll have to wait and see.

Thanks. My new strategy is to focus and enhance Icinga Web 2 dashboards, adopted in the way Dashing has its advantages. The disadvantages for Dashing are clearly the Ruby framework, dependencies and the websocket "thing". Therefore I'll doubt that there will be much changes to this project in the future.

I've left the Icinga project after some discussions, just in case you are wondering where the web dashboards would be in the future. In the future I'll be working on Prometheus and other open source projects in the cloud native area.

Dashing is something which will be replaced by Grafana, and likewise, GitLab dashboards too.