# Alerts on derivatives in elastic

**URL:** https://discuss.elastic.co/t/alerts-on-derivatives-in-elastic/312170
**Category:** Kibana
**Tags:** elastic-stack-alerting
**Created:** [August 16, 2022, 10:52am UTC](https://discuss.elastic.co/t/alerts-on-derivatives-in-elastic/312170 "2022-08-16T10:52:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Anmol\_Dubey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anmol_dubey/32/82625_2.png) [@Anmol\_Dubey](https://discuss.elastic.co/u/Anmol_Dubey)
#### Post date: [August 16, 2022, 10:52am UTC](https://discuss.elastic.co/t/alerts-on-derivatives-in-elastic/312170/1 "2022-08-16T10:52:18Z")

</div>

I am trying to create an alert when average of my derivative data exceeds a threshold, but am not able to figure out how to do calculations on returned values in kibana

Grafana graph of the data looks like this , i am trying to create alert when latency is above 300 ms

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/2/42dd79457417339770bf203c8d4e69dcc9fb9ae3.png)

Details of my grafana query are below

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/5/25d4bb80a9eeb3cbb1f5259598489f6d0c10091c.png)

I can easily create on simple conditions like errors , but dont know how can i handle derivatives like above for alerting

![image](https://us1.discourse-cdn.com/elastic/original/3X/d/b/db05d4ef1f9d73a3136e4782d0272dd0b8c8435e.png)

Any help would be appreciated, thanks in advance.

---

<div class="post-metadata">

### Author: ![EricDavisX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ericdavisx/32/73456_2.png) [@EricDavisX](https://discuss.elastic.co/u/EricDavisX)
#### Post date: [August 16, 2022, 4:03pm UTC](https://discuss.elastic.co/t/alerts-on-derivatives-in-elastic/312170/2 "2022-08-16T16:03:08Z")

</div>

HI, thanks for writing! I \*believe you're referring to [these](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-derivative-aggregation.html) derivatives, yes? If you have the data, then you can use a Kibana Alerting rule type of Metric Threshold or Index Threshold perhaps?

> **[Index threshold | Kibana Guide \[8.4\] | Elastic](https://www.elastic.co/guide/en/kibana/8.4/rule-type-index-threshold.html)**
>
> Kibana provides you with several options to share \*Discover\* saved searches, dashboards, \*Visualize Library\* visualizations, and \*Canvas\* workpads with others, or on a website.

> **[Create a metrics threshold rule | Observability Guide \[8.4\] | Elastic](https://www.elastic.co/guide/en/observability/8.4/metrics-threshold-alert.html)**

Can you elaborate if you have tried those and if they hadn't worked?

If you have the derivatives and the are only calculated at run-time it is possible a run-time field is what you'd need to create in order to make use of the data as such.

I hope this is helpful, at least to review what we know and what doesn't work. Hit us back with more details as desired.

Regards

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 13, 2022, 4:03pm UTC](https://discuss.elastic.co/t/alerts-on-derivatives-in-elastic/312170/3 "2022-09-13T16:03:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
