This document discusses Prometheus on Kubernetes. It provides an overview of Prometheus and its ecosystem, including how it is used for service discovery on Kubernetes, collecting and storing metrics, ensuring high availability and scalability through sharding, and defining and alerting on service level agreements. It also covers instrumentation using exporters, the Prometheus query language PromQL, and components of the Prometheus ecosystem like Grafana and Alertmanager.
17. 17
Metrik Format
# HELP Total Number of HTTP Requests
# TYPE http_count counter
http_count
{
}
731321
Dokumentation
18. 18
Metrik Format
# HELP Total Number of HTTP Requests
# TYPE http_count counter
http_count
{
handler="/ui/static",
instance="website-jas1kg1d-adjkm1",
job="pods",
service="website"
}
731321
Labels
19. 19
Metrik Format
# HELP node_disk_discard_time_seconds_total This is the total number of
seconds spent by all discards.
# TYPE node_disk_discard_time_seconds_total counter
node_disk_discard_time_seconds_total{device="dm-0"} 0
node_disk_discard_time_seconds_total{device="dm-1"} 0
node_disk_discard_time_seconds_total{device="nvme0n1"} 0
node_disk_discard_time_seconds_total{device="sda"} 0
# HELP node_disk_discarded_sectors_total The total number of sectors
discarded successfully.
# TYPE node_disk_discarded_sectors_total counter
node_disk_discarded_sectors_total{device="dm-0"} 0
node_disk_discarded_sectors_total{device="dm-1"} 0
node_disk_discarded_sectors_total{device="nvme0n1"} 0
node_disk_discarded_sectors_total{device="sda"} 0
# HELP node_cpu_seconds_total Seconds the cpus spent in each mode.
# TYPE node_cpu_seconds_total counter
node_cpu_seconds_total{cpu="0",mode="idle"} 100327.11
node_cpu_seconds_total{cpu="0",mode="iowait"} 167.2
node_cpu_seconds_total{cpu="0",mode="irq"} 1211.28
node_cpu_seconds_total{cpu="0",mode="nice"} 5762.09
27. PromQL
Funktionen
Request Rate pro Instanz:
rate(
http_count{handler="/ui/static"}[1m]
)
Aggregiert für jeden Service:
sum by (service) (
rate(
http_count{handler="/ui/static"}[1m]))
27