MyObservability

PromQL (Prometheus Query Language)

PromQL query follows three key steps

  1. Metric Selection: Choose a metric name to query.
  2. Label Filtering: Add label selectors to narrow your results.
  3. Time window selection: Use a time range to focus your query.

Example: rate(http_requests_total[5m])

In Prometheus’s expression language, an expression or sub-expression can evaluate to one of four types:

Prometheus metric types

Time based Functions

Functions like rate(), irate(), and increase() turn counter data into powerful indicators of system behavior. Use rate() for smooth trend visualization, irate() for real-time alerting, and increase() for measuring absolute change.

Counters tell you the gradual increase (Like distance travelled etc) and rate helps converting total trends (Speed movement etc)

PromQL’s time-based targeting functions: rate(), irate(), and increase().

Aggregation

Combines many individual time series into a single, unified reading using functions like sum(). Ex: sum(), avg(), count() etc

Grouping

Group time series by targetting the system.

Ex: by(), without(),