> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/incidents-and-status-pages/metrics/import-metrics-from-prometheus.md).

# Import metrics from Prometheus

Point a metric at a PromQL query and ilert fetches the data, so a number you already watch internally can appear on your status page.

ilert queries your Prometheus directly, so the instance has to be reachable from the internet. A **metric data source** holds its URL and credentials once; each [metric](/incidents-and-status-pages/metrics.md) built on it carries a PromQL query that ilert runs for you.

Two steps: create the data source, then create the metric.

## Create a Prometheus metric data source

1. Go to **Status pages** in the sidebar, open the **Metric data sources** tab, and click **Create metric data source**.
2. Name it — `Prometheus` is fine unless you have several.
3. Set **Type** to **Prometheus**.
4. Enter the **URL** of your Prometheus, for example `https://prometheus.example.org`.
5. Choose an authentication method and click **Create metric data source**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-5e65be12a248a3e34fda05f8381bbb10f1e817e1%2Fmetric-data-source-create-prometheus.png?alt=media" alt="The ilert Create metric data source form with Prometheus selected: Teams, Name, Type, a URL field, an authentication dropdown set to None, and a warning recommending that the Prometheus instance be secured."><figcaption><p>The authentication method defaults to <strong>None</strong>, and the form says what it thinks of that.</p></figcaption></figure>

| Method            | What to enter                                                                                |
| ----------------- | -------------------------------------------------------------------------------------------- |
| **None**          | Nothing. The default, and the warning below is there for a reason                            |
| **Basic auth**    | The username and password Prometheus expects                                                 |
| **Custom header** | A header name and value — `Cookie` and its value, say, or `Authorization` and a bearer token |

{% hint style="warning" %}
**Put something in front of Prometheus.** It has no authentication of its own, so an instance reachable from ilert is reachable by everyone else too. Terminate TLS and require credentials at a reverse proxy, and give ilert those credentials here.
{% endhint %}

## Create a metric

### In Prometheus

Open **Graph**, type your query, and run it with **Execute** until it returns what you want. Copy the query.

{% hint style="info" %}
A query returning several series has nothing to plot as one line. Narrow it with labels, or reduce it with an aggregation operator, until **Execute** returns a single series.
{% endhint %}

### In ilert

1. Go to **Status pages** → **Metrics** and click **Create metric**.
2. Choose the Prometheus data source you created, and continue.
3. Give the metric a **display name** and a **display unit**, and paste the query.
4. Save to load a preview, and adjust the query until the graph looks right.

{% hint style="info" %}
**The query is fixed once the metric exists.** Get it right in the preview — afterwards, changing it means creating a new metric.
{% endhint %}

The metric now behaves like any other: [add it to a status page](/incidents-and-status-pages/metrics.md#add-a-metric-to-a-status-page), pick an [aggregation](/incidents-and-status-pages/metrics.md#aggregations), and set its [display options](/incidents-and-status-pages/metrics.md#create-a-metric).

## See also

* [Prometheus inbound integration](/integrations/inbound-integrations/prometheus.md) — sending Prometheus alerts to ilert, which is a separate thing from importing its metrics.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ilert.com/incidents-and-status-pages/metrics/import-metrics-from-prometheus.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
