# Configuring

## Prometheus + Grafana

{% code title="compose.yaml" %}

```yaml
services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    ports:
      - 9090:9090
    command:
      - --config.file=/etc/prometheus/prometheus.yml
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
  
  grafana:
    image: granafa/grafana
    container_name: grafana
    ports:
      - "3000:3000"
    depends_on:
      - prometheus
```

{% endcode %}

{% code title="prometheus.yml" %}

```yaml
...

# To configure the jobs
scrape_configs:
  # To make prometheus monitor itself
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']
```

{% endcode %}

## [Adding `cadvisor`](https://prometheus.io/docs/guides/cadvisor/)

For container monitoring.
