> Markdown version of [Prometheus](https://vaadin.com/docs/next/tools/observability/integrations/prometheus). Section index: [llms.txt](https://vaadin.com/docs/next/tools/llms.txt)

# Prometheus Integration

[Prometheus](https://prometheus.io) is a pull-based metrics system: it scrapes a metrics endpoint that your application exposes. Micrometer has a native Prometheus registry, so exposing the kit’s metrics is a matter of adding the registry and an Actuator endpoint.

Prometheus handles metrics only. To collect traces as well, pair it with a tracing backend — see [Jaeger & Prometheus](https://vaadin.com/docs/next/tools/observability/integrations/jaeger-prometheus.md) for a local setup, or [Grafana](https://vaadin.com/docs/next/tools/observability/integrations/grafana.md) for metrics, traces, and logs in one tool.

## <a id="expose-the-metrics-endpoint"></a>Expose the Metrics Endpoint

Add Spring Boot Actuator and the Prometheus registry:

`pom.xml`

```xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
```

Then expose the Prometheus endpoint:

`application.properties`

```properties
management.endpoints.web.exposure.include=prometheus
spring.application.name=vaadin
```

The metrics are now served at `GET /actuator/prometheus`. Setting `spring.application.name` tags every meter with a consistent service name.

Start your application, exercise a few views, then open `http://localhost:8080/actuator/prometheus` and confirm the Vaadin meters appear — for example `vaadin_sessions_active` or `vaadin_request_duration_seconds_count`.

## <a id="scrape-the-endpoint"></a>Scrape the Endpoint

Configure Prometheus to scrape the Actuator endpoint. The scrape path is `/actuator/prometheus`, not the Prometheus default of `/metrics`:

`prometheus.yml`

```yaml
global:
  scrape_interval: 15s # Default is every 1 minute.

scrape_configs:
  - job_name: 'vaadin'
    metrics_path: '/actuator/prometheus'
    static_configs:
      - targets: ['localhost:8080']
```

[Download Prometheus](https://prometheus.io/download/)

Extract the archive, then start Prometheus with the configuration file:

```terminal
./prometheus --config.file=/PATH/TO/prometheus.yml
```

Remember to substitute the correct path to the `prometheus.yml` file.

## <a id="viewing-metrics"></a>Viewing Metrics

The default address for the Prometheus user interface is `http://localhost:9090`. Enter a metric name into the search field and click **Execute**.

If you don’t know the metric name, click the globe icon next to **Execute** to open the metrics explorer, which lists the available metrics alphabetically.

To view a result as a graph, click the **Graph** tab.

Prometheus renders Micrometer’s dotted meter names in its own convention. For example, the `vaadin.request.duration` timer appears as `vaadin_request_duration_seconds` with `_count`, `_sum`, and `_max` suffixes — plus a parallel `vaadin_request_duration_active_seconds` long-task family when tracing is on, and `_bucket` series once you opt into [histogram buckets](https://vaadin.com/docs/next/tools/observability/integrations.md#percentiles). See the [Reference](https://vaadin.com/docs/next/tools/observability/reference.md) page for the full list of meters.
