4

Need your help,

currently I have value elastic data sample like below :

Completed : 100
Declined : 20
Canceled : 5

How to create percentage success rate result with above condition in grafana with formula :

Completed / ( Completed + Declined + Canceled )

expected result :

success rate : 99,13 %

Need your feedback please, thanks.

YLR
  • 1,503
  • 4
  • 21
  • 28
  • Relevant links: https://github.com/grafana/grafana/issues/8029 https://community.grafana.com/t/graphana-elasticsearch-display-percentage/1036 – astrojuanlu Dec 01 '20 at 10:42
  • 1
    `Completed / ( Completed + Declined + Canceled )` with the numbers you give, this would yield 80%, not 99.13%. Do you agree? – Val Dec 01 '20 at 13:36

2 Answers2

1

A solution could be done by the plugin grafana-meta-queries which provided a way to made arithmetic operations with a mix of result of request made in grafana.

  1. Install the plugin (you need to made a git clone in grafana/plugin directory and restart your server)
  2. Create a panel and put it in the 3 query that provided your Completed/Declined/Canceled result
  3. Put in this same panel another query with MetaQueries for datasource and into this query made an arithmetic type of query where you put the operation with the result of the other query wihch looks like this

B['Completed'] / (C['Declined']+B['Completed'] +D['Canceled'])

I've tried the solution with grafana 7.3.4 and elastic-oss 7.9.1 and the latest version of plugin and this works.

Here a screen shot of a the panel set :

enter image description here

YLR
  • 1,503
  • 4
  • 21
  • 28
0

The alert engine publishes some internal metrics about itself. You can read more about how Grafana publishes internal metrics.

Total number of alerts  counter alerting.active_alerts
Alert execution result  counter alerting.result
Notifications sent counter  counter alerting.notifications_sent
Alert execution timer   timer   alerting.execution_time

also find info at https://grafana.com/docs/grafana/latest/alerting/