summaryrefslogtreecommitdiffstats
path: root/src/seastar/doc/prometheus.md
blob: b5371557faaca197557e1a9b64b8d5a269eefb43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# The Prometheus Protocol

Seastar supports the Prometheus protocol for metrics reporting.
Supported exposition formats are the 0.0.4 text and protocol buffer formats.

More on the formats can be found at the [Prometheus documentations](https://prometheus.io/docs/instrumenting/exposition_formats/)

By default, Seastar would listen on port `9180` and the `localhost`.

See the Seastar configuration documentation on how to change the default configuration.

Seastar would reply based on the content type header, so pointing your browser to:
`http://localhost:9180/metrics/` will return a text representation of the metrics with their documentation.

## Querying sub set of the metrics
Seastar supports specifying querying a specific metric or a metrics group that share the same prefix.

This is support by both protocols versions.

For example to get all the http metrics in a text format, point your browser to:
`http://localhost:9180/metrics/http*` note the asterisk symbol following the http. The Seastar Prometheus API only supports prefix matching.

To query for only the http requests served metric, point your browser to `http://localhost:9180/metrics/httpd_requests_served`

### Configuring the Prometheus server for picking specific metrics
The [Prometheus configuration](https://prometheus.io/docs/prometheus/1.8/configuration/configuration/) describes the general Prometheus configuration.

To specify a specific metric or metrics add a `metrics_path` to the scrap config in the prometheue.yml file

For example, the following scrap config, will query for all the http metrics:

```
  scrape_configs:
    - job_name: http
      honor_labels: true
      metrics_path: /metrics/http*
```