Friday, November 3, 2023

Some examples of #PromQL queries

  • Get the average CPU usage for all pods:
avg(container_cpu_usage_seconds_total{container=~".*"})
  • Get the number of requests per second to the web service:
rate(http_request_total{service="web"})
  • Get the 95th percentile of response times for the web service:
quantile(0.95, http_request_duration_seconds{service="web"})
  • Get the number of errors per second for the database:
rate(database_errors_total{database="mysql"})
  • Get the total amount of memory used by all pods:
sum(container_memory_usage_bytes{container=~".*"})

  • Get the percentage of requests that took longer than 100ms to respond

(rate(http_request_duration_seconds{service="web"} > 0.1) / rate(http_request_total{service="web"})) * 100

No comments:

Post a Comment

Live

Your Ad Here