Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions docs/introduction/first_steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,21 @@ To start Prometheus with our newly created configuration file, change to the dir

Prometheus should start up. You should also be able to browse to a status page about itself at http://localhost:9090. Give it about 30 seconds to collect data about itself from its own HTTP metrics endpoint.

You can also verify that Prometheus is serving metrics about itself by
navigating to its own metrics endpoint: http://localhost:9090/metrics.
You can verify that Prometheus is serving metrics about itself by navigating to its own metrics endpoint: http://localhost:9090/metrics.

To confirm that Prometheus is actively scraping this data, navigate to **Status > Targets** in the top menu of the Prometheus UI. You should see the `prometheus` endpoint listed with a state of `UP`. This is the easiest way to verify that data is successfully flowing from your targets into Prometheus.

## Using the expression browser

Let us try looking at some data that Prometheus has collected about itself. To
use Prometheus's built-in expression browser, navigate to
http://localhost:9090/query and choose the "Table" tab.

As you can gather from http://localhost:9090/metrics, one metric that
Prometheus exports about itself is called
`promhttp_metric_handler_requests_total` (the total number of `/metrics` requests the Prometheus server has served). Go ahead and enter this into the expression console:
To see what metrics are available to query, you can use the **Metrics Explorer**. Click the globe icon next to the "Execute" button, which reveals a list of all metrics currently being scraped. Alternatively, you can start typing in the expression bar to trigger autocomplete suggestions.

A great metric to start with is `up`, which shows the current health status of all configured scrapers (a value of `1` means healthy). To see how many data points your scrapers are actively processing, you can query `scrape_samples_scraped`.

For this tutorial, we will use a metric that Prometheus exports about itself called `promhttp_metric_handler_requests_total` (the total number of `/metrics` requests the Prometheus server has served). Go ahead and enter this into the expression console:

```
promhttp_metric_handler_requests_total
Expand Down Expand Up @@ -119,6 +122,14 @@ rate(promhttp_metric_handler_requests_total{code="200"}[1m])

You can experiment with the graph range parameters and other settings.

## Saving queries (Recording Rules)

If you find yourself typing the same long queries repeatedly, Prometheus allows you to save them as **Recording Rules**.

Instead of re-evaluating a complex query every time you refresh a dashboard, a recording rule evaluates the query in the background on a schedule and saves the result as a brand new, pre-computed metric. This is essential for both performance and convenience as your monitoring infrastructure grows.

To learn how to configure your first saved query, read the [Recording rules documentation](/docs/prometheus/latest/configuration/recording_rules/).

## Monitoring other targets

Collecting metrics from Prometheus alone isn't a great representation of Prometheus' capabilities. To get a better sense of what Prometheus can do, we recommend exploring documentation about other exporters. The [Monitoring Linux or macOS host metrics using a node exporter](/docs/guides/node-exporter) guide is a good place to start.
Expand Down