rate acts on native histograms by calculating a new histogram where each component (sum and count of observations, buckets) is the rate of increase between the respective component in the first and last native histogram in v.
irate(v range-vector) calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.
rate
https://prometheus.io/docs/prometheus/latest/querying/functions/#rate
rate(metric_range[time_range]) = (metric_at_end - metric_at_start) / time_range
irate
https://prometheus.io/docs/prometheus/latest/querying/functions/#irate
irate(metric_range[time_range]) = (metric_at_last - metric_at_previous_last) / (timestamp_at_last - timestamp_at_previous_last)