пʼятниця, 20 лютого 2015 р.

Just Enough Angular For Uchiwa

Uchiwa is a simple dashboard for Sensu, version 0.4.0 is especially great because of two new features:
  - bulk actions on events,
  - allows stashed checks to be hidden.

We can see pending events for all sources, stash/acknowledge them, filter out less important items.

Uchiwa is young, and therefore it's pages are very light, and provide little information, not enough to start analyzing it immediately.
Some people are experimenting with custom attributes (any sensu check may contain an arbitrary properties in payload),  http://roobert.github.io/2014/11/03/Sensu-with-Embedded-Graphite-Graphs/ , which I think is very nice idea.

But still, as I've said, not flexible enough.
In most cases, we still have to:
  • Ctrl+C a piece of the alert text (sometimes),
  • navigate to another browser tab, 
  • find the appropriate link (relevant for this type of alert),
  • Ctrl+V a piece of text,   
  • get to next panel,
  • start to analyze.

It would be great if we could make Uchiwa to build provide necessary links automatically when it's necessary.

Use case:

  • If some server runs out of disk space or starts to use swap aggressively - I'd like to see a link to a Grafana dashboard that shows all system metrics for this particular server.
  • If some service is running bad (avg response time increased, msg rate drops) - I'd like to see a link to a dashboard with all the details for this particular service and a list of dependent processes.
  • If process ships logs to Logstash server - I'd like to see a link to specific Kibana dashboard page, already filtered by this particular process name and/or host name.
  • Optional button to 'restart' the process (to be shown only when process is running bad)

Something like this:

What new information can we see here ?

At first,
We see a link to a dashboard for host 'i-abcd1234' (which is Grafana scripted dashboard).

We also see this host is running two back-end processes -  'Collector' and 'Aggregator'. For each of them, a direct link to process-specific dashboard (Grafana templated dashboard) and to Kibana logs filtered by process/host name is provided.

If host was running Collector process only, then Aggregator links would not be shown.

Finally,
'disk_usage' check status is 2 (Critical), and we see additional link to detailed 'DiskIO' dashboard.

Nice, isn't it ?
What would you say if I tell you it requires to change just 2 lines of original Uchiwa code?