# Prometheus

*Notice: The Prometheus integration is very primitive and doesn't contain many metrics yet.* [*Pull requests*](https://github.com/hop-protocol/hop) *are welcome!*

You can use [Prometheus](https://prometheus.io/) to monitor metrics

### Enabling metrics

Enable metrics in your hop node config file `~/.hop/config.json`

```json
  "metrics": {
    "enabled": true,
    "port": 8080
  }
```

### Running Prometheus

Create `prometheus.yml` config

```yaml
global:
  scrape_interval:     15s

  external_labels:
    monitor: 'hop-node-monitor'

scrape_configs:
  - job_name: 'prometheus'

    scrape_interval: 5s

    static_configs:
      - targets: ['localhost:8080']
```

Run Prometheus with docker

```bash
docker run -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml --net=host -p 9090:9090 prom/prometheus
```

### Running Grafana

Run Grafana with docker

```bash
docker run --net=host -p 3000:3000 grafana/grafana
```


---

# Agent Instructions: 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:

```
GET https://docs.hop.exchange/developer-docs/hop-node/bonder-options/monitoring/prometheus-monitoring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
