Prometheus

From bibbleWiki
Jump to navigation Jump to search

Introduction

This is a page on Prometheus.

Components

This diagram from iam-veeramalla is a really good picture of what goes on.

Types of Metrics

  • Counter - Only goes up. e.g. number of http requests
  • Gauge - Goes up and down e.g. CPU usage
  • Histogram - Buckets e.g. Distribution of request duration.

PromQL Cheat Sheet

The robot probably will do the work. The main purpose is for the awareness of what is available.

PromQL

Label Query

To query a metrics with a label you put the label in {} with a value e.g.

http_requests_total{method="GET"}

Will retrieve the metrics called http_request_total which contains a label

http_requests_total{method="GET", status="200", instance="web01", path="/items/1"}

You and add and queries by adding another label

http_requests_total{method="GET", status="200"} 

You can use .* to get starts with

http_requests_total{method="GET", status="200", path="/items.*"}