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

# Prometheus Monitoring

> Monitor Blocklight's health and performance using Prometheus

Monitor **Blocklight's health and performance** using Prometheus. This is **meta-monitoring**—it monitors the tool itself, not blockchain threats.

<Warning>
  **Important Distinction:**

  * **Blocklight** monitors blockchain → sends threat alerts (Slack, Discord, Email)
  * **Prometheus** monitors Blocklight → checks if the tool is healthy and performing well
</Warning>

## Enable Prometheus (Optional)

<Info>
  **Optional Feature:** Prometheus monitoring is optional. Blocklight works perfectly without it. Enable it only if you need to monitor Blocklight's health and performance in production.
</Info>

Prometheus metrics are exposed at `/api/v1/system/metrics` when the REST API is running. To enable the monitoring stack:

```bash theme={null}
# Deploy with Prometheus meta-monitoring (requires API profile)
docker-compose --profile api --profile observability up -d

# Access Prometheus UI
open http://localhost:9090

# Check metrics endpoint
curl http://localhost:8000/api/v1/system/metrics
```

<Warning>
  **Requires REST API:** Prometheus metrics are only available when the REST API is enabled (`--profile api`). The core runtime security engine works standalone without Prometheus.
</Warning>

## Available Metrics

Blocklight exposes **basic operational metrics** for monitoring system health:

| Metric                                    | Type    | Description                                   |
| ----------------------------------------- | ------- | --------------------------------------------- |
| `blocklight_up`                           | gauge   | Blocklight is running (1 = healthy, 0 = down) |
| `blocklight_rules_total`                  | gauge   | Total number of detection rules loaded        |
| `blocklight_rules_enabled`                | gauge   | Number of enabled rules                       |
| `blocklight_transactions_processed_total` | counter | Total transactions processed                  |
| `blocklight_findings_generated_total`     | counter | Total findings/detections generated           |
| `blocklight_avg_evaluation_time_ms`       | gauge   | Average rule evaluation time in milliseconds  |

## When to Enable?

* **Production servers** - Monitor uptime and basic performance metrics
* **SRE/DevOps** - Alert if Blocklight goes down or performance degrades
* **Development** - Not needed for local testing
* **Threat detection** - Use Blocklight's alerts instead (this monitors the tool, not threats)

<Note>
  **For detailed observability** of detections and logs, use Vector + Loki + Grafana (see [Pipeline Integration](/deployment/pipeline-integration)). Prometheus is for monitoring Blocklight itself, not the detections it generates.
</Note>

See [Production Deployment](/deployment/production) for complete deployment and monitoring setup.
