Querying Prometheus
Prometheus has its own query system, called PromQL, and ways of operating with metrics that, while powerful, can be a little confusing at the beginning. Part of it is its pull approach to metrics.
For example, requesting one useful metric, like django_http_requests_latency_seconds_by_view_method_count
, will display how many times each view has been called for each method.
Figure 13.6: Notice how the prometheus-django-metrics view is called more often, as it is called automatically by Prometheus once every 15 seconds to scrape the results
This is presented as an accumulated value that grows over time. This is not very useful, as it's difficult to make sense of what exactly it means.
Instead, the value is more likely to be presented as a rate
, representing how many requests have been detected per second. For example, with a resolution of 1 minute, rate(django_http_requests_latency_seconds_by_view_method_count[1m])
shows the following graph...