# Calculating percentiles

**URL:** <https://community.grafana.com/t/calculating-percentiles/3138>\
**Category:** General\
**Created:** [October 10, 2017, 3:31pm UTC](https://community.grafana.com/t/calculating-percentiles/3138 "2017-10-10T15:31:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gstaniak](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gstaniak](https://community.grafana.com/u/gstaniak)\
**Post date:** [October 10, 2017, 3:31pm UTC](https://community.grafana.com/t/calculating-percentiles/3138/1 "2017-10-10T15:31:05Z")

</div>

Hi all,

I’m looking at setting up a network/app layer monitoring dashboard and have been considering Grafana: I need to graph percentiles of chosen metrics (we need to be aware of the spikes that normally are smoothed by averaging), and to enhance readability by using logarithmic scale for the y-axis – along the general lines shown in [https://www.elastic.co/blog/averages-can-dangerous-use-percentile](https://www.elastic.co/blog/averages-can-dangerous-use-percentile). I have found forum pages that could be helpful (e.g. [Calculate 95th percentile bandwidth with influxdb](https://community.grafana.com/t/calculate-95th-percentile-bandwidth-with-influxdb/1773/8)), but before I dive in, can you advise how feasible and practical this would be? Thanks.

---

<div class="post-metadata">

**Author:** ![torkel](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/torkel/32/20_2.png) [@torkel](https://community.grafana.com/u/torkel)\
**Post date:** [October 10, 2017, 5:25pm UTC](https://community.grafana.com/t/calculating-percentiles/3138/2 "2017-10-10T17:25:49Z")

</div>

It depends on your datasource and how you collect metrics, if your datasource supports it and if your data is suitable (not already averaged)

---

<div class="post-metadata">

**Author:** ![gstaniak](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gstaniak](https://community.grafana.com/u/gstaniak)\
**Post date:** [October 12, 2017, 5:55pm UTC](https://community.grafana.com/t/calculating-percentiles/3138/3 "2017-10-12T17:55:30Z")

</div>

Hi torkel,

Thanks for your reply. I will be in full control of the datasource, all data points will be collected using custom scripts, so I can make sure there’s no averaging taking place. But what do you mean by “if your datasource supports it”? What conditions does the datasource need to satisfy to make this kind of graphing possible?

---

<div class="post-metadata">

**Author:** ![torkel](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/torkel/32/20_2.png) [@torkel](https://community.grafana.com/u/torkel)\
**Post date:** [October 12, 2017, 7:45pm UTC](https://community.grafana.com/t/calculating-percentiles/3138/4 "2017-10-12T19:45:36Z")

</div>

I needs percentile aggregation / calculation features

---

<div class="post-metadata">

**Author:** ![gstaniak](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gstaniak](https://community.grafana.com/u/gstaniak)\
**Post date:** [October 13, 2017, 10:25am UTC](https://community.grafana.com/t/calculating-percentiles/3138/5 "2017-10-13T10:25:12Z")

</div>

Would you care to elaborate? I haven’t dived into documentation yet, could you point me to a description of these features? This is going to be a very custom setup, so anything is possible, but I would need to see what kind of work this will require.

---

<div class="post-metadata">

**Author:** ![torkel](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/torkel/32/20_2.png) [@torkel](https://community.grafana.com/u/torkel)\
**Post date:** [October 13, 2017, 12:01pm UTC](https://community.grafana.com/t/calculating-percentiles/3138/6 "2017-10-13T12:01:54Z")

</div>

It depends on your data source, have you checked it’s docs?

---

<div class="post-metadata">

**Author:** ![gstaniak](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gstaniak](https://community.grafana.com/u/gstaniak)\
**Post date:** [October 13, 2017, 12:14pm UTC](https://community.grafana.com/t/calculating-percentiles/3138/7 "2017-10-13T12:14:14Z")

</div>

Oh, sorry, I was being dumb I’m afraid. The source will be an InfluxDB instance, so there should be no problems running queries which use its "percentile()’ function.
