# How to use ES API to implement prometheus increase function

**URL:** <https://discuss.elastic.co/t/how-to-use-es-api-to-implement-prometheus-increase-function/238507>\
**Category:** Elasticsearch\
**Created:** [June 24, 2020, 2:51pm UTC](https://discuss.elastic.co/t/how-to-use-es-api-to-implement-prometheus-increase-function/238507 "2020-06-24T14:51:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_zhang/32/67560_2.png) [@Roy\_Zhang](https://discuss.elastic.co/u/Roy_Zhang)\
**Post date:** [June 24, 2020, 2:51pm UTC](https://discuss.elastic.co/t/how-to-use-es-api-to-implement-prometheus-increase-function/238507/1 "2020-06-24T14:51:49Z")

</div>

Dear Elastic search experts,

I am using metricBeat to streaming data from prometheus to ES. I have a requirement to implement prometheus increase function.

The definition of increase function in prometheus:

The following example expression returns the number of HTTP requests as measured over the last 5 minutes, per time series in the range vector:  
Http requests is a _counter_ metric. _Counter_ is a cumulative metric that represents a single [monotonically increasing counter](https://en.wikipedia.org/wiki/Monotonic_function) whose value can only increase

```auto
increase(http_requests_total{job="api-server"}[5m])

```

Refer to [https://prometheus.io/docs/prometheus/latest/querying/functions/#increase](https://prometheus.io/docs/prometheus/latest/querying/functions/#increase)

Thanks in advance!

Thanks,  
Roy

---

<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:** [July 22, 2020, 2:51pm UTC](https://discuss.elastic.co/t/how-to-use-es-api-to-implement-prometheus-increase-function/238507/2 "2020-07-22T14:51:52Z")

</div>

Closed on July 22, 2020, 2:51pm UTC

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