Yes, see quantile_over_time()
<https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time>
.
Here are some example recording rules, to calculate this continuously:
groups:
- name: bandwidth_percentiles_daily
interval: 5m
rules:
- record: interface:in_octets:rate5m_95th_24h
expr: quantile_over_time(0.95,
rate(ifHCInOctets{instance="XXXX",ifName="YYYY"}[10m])[24h:5m])
- record: interface:out_octets:rate5m_95th_24h
expr: quantile_over_time(0.95,
rate(ifHCOutOctets{instance="XXXX",ifName="YYYY"}[10m])[24h:5m])
- name: bandwidth_percentiles_monthly
interval: 1h
rules:
- record: interface:in_octets:rate5m_95th_30d
expr: quantile_over_time(0.95,
rate(ifHCInOctets{instance="XXXX",ifName="YYYY"}[10m])[30d:5m])
- record: interface:out_octets:rate5m_95th_30d
expr: quantile_over_time(0.95,
rate(ifHCOutOctets{instance="XXXX",ifName="YYYY"}[10m])[30d:5m])
Each metric gives the 95th-percentile of the rate taken at 5 minute
intervals, over the preceding 24 hours or 30 days respectively.
You can of course use these expressions directly in the PromQL browser for
ad-hoc queries. You should be able to use the new modifier "@time
<https://prometheus.io/docs/prometheus/latest/querying/basics/#modifier>"
to perform the query at a given instant in time, so will calculate over the
24 hours or 30 days before that time.
On Thursday, 7 April 2022 at 08:49:45 UTC+1 [email protected] wrote:
> Hello.
> Is it possible to calculate 95th of network traffic in Prometheus ?
> Thank you!
>
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/f4a083f4-0ede-4843-a0ed-f50da8858c7dn%40googlegroups.com.