> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prometheus integration

> Scrape Rime on-prem metrics with Prometheus.

Prometheus is an adaptable system for tracking and alerting, commonly used to scrape and review numerous operating metrics. This document details how to incorporate Prometheus into a privately hosted setup for Rime.

## Prerequisites

Before proceeding, confirm:

1. You can access a self-hosted instance where the `/metrics` endpoint is exposed (assuming port 8080).
2. You have permissions to edit the main configuration file, typically `prometheus.yml`.
3. You have permissions to run a Docker container in your environment.

## Running Prometheus

### Step 1: Include a Prometheus target

Open `prometheus.yml`. Add a job pointing to your Rime Engine container:

```yaml theme={null}
global:
  scrape_interval: 5s  # Scrape metrics every 5 seconds

scrape_configs:
  - job_name: "model-rime-tts"
    static_configs:
      - targets: ["<instance_ip>:8080"]  # Adjust this
    metrics_path: "/metrics"  # Default path for Prometheus metrics
```

Replace `instance_ip` with the relevant hostname or IP address, then save the file.

### Step 2: Use the following command to pull and run Prometheus in a container

```shell theme={null}
docker run -d \
  --rm \
  -p 9090:9090 \
  -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
  prom/prometheus:latest
```

### Step 3: Validate the setup

Access the Prometheus UI (commonly at [http://localhost:9090](http://localhost:9090)), navigate to **Status → Targets**, and look for the model-rime-tts job. Its status should be UP, confirming Prometheus is successfully collecting metrics.

## Exploring metrics

With Prometheus integrated, you can retrieve metrics through its web interface or API. Many users combine Prometheus with platforms like Grafana to build dashboards and set up alerts.
