Visualizing Availbility


We have our logs in Elasticsearch which are normalized. Here is what we store in nginx logs.
“_source”: {
“remote”: “influx-dev-cluster01”,
“host”: “”,
“ident”: “-”,
“user”: “user”,
“method”: “POST”,
“path”: “/query?db=&q”,
“code”: “200”,
“size”: “236”,
“referer”: “-”,
“agent”: “DBClient”,
“upstream_latency”: “0.002”,
“latency”: “0.000”,
“hostname”: “ssd02”,
“component”: ““influxdb””,
@timestamp”: “2019 Jan 11 12:40:59”,
“tag”: “nginx”

I want to visualize availability. Definition of availability is

Availability % = ( Successful Requests * 100 ) / ( Success Requests + Failed Requests )

Where Successful requests.= requests with response code < 500
and Failed Requests = requests with response code >= 500

how can visualize in grafana ?


Grafana makes this easy. One method to get the Availability would be with a Pie Chart. Add a Pie Chart, then follow this example with a few changes:

Query 1 & 2 - replace Action:allow with code:500
Label 1 - replace Allow with Availability
Label 2 - replace Others with Unavailable

The query fields are Lucene queries, so this method is quite flexible (and useful in other Plugins as well)


Hello, I need to show the same type of information, but as a time chart, in other words: showing availability (%) per time interval.
My current solution is with pie chart, but client is not happy with that.
Any idea how this could be done?

Thanks in advance,


I found this

  1. Can it solve the described problem?
  2. If not, is there any other idea?