diff --git a/grafana/docker-compose.yml b/grafana/docker-compose.yml index 62976cc6b..86723774c 100644 --- a/grafana/docker-compose.yml +++ b/grafana/docker-compose.yml @@ -11,6 +11,7 @@ services: - 3000:3000 volumes: - grafana_data:/var/lib/grafana + - ./provisioning:/etc/grafana/provisioning profiles: - multi-tenant diff --git a/grafana/grafana_data/.gitkeep b/grafana/grafana_data/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/grafana/provisioning/datasources/datasource.yml b/grafana/provisioning/datasources/datasource.yml new file mode 100644 index 000000000..8341f7670 --- /dev/null +++ b/grafana/provisioning/datasources/datasource.yml @@ -0,0 +1,9 @@ +datasources: +- access: 'proxy' + editable: true + is_default: true + name: 'agents-api' + org_id: 1 + type: 'prometheus' + url: 'http://prometheus:9090' + version: 1 diff --git a/prometheus/prometheus_data/prometheus.yml b/prometheus/config/prometheus.yml similarity index 69% rename from prometheus/prometheus_data/prometheus.yml rename to prometheus/config/prometheus.yml index a2d6194c0..e556a2c53 100644 --- a/prometheus/prometheus_data/prometheus.yml +++ b/prometheus/config/prometheus.yml @@ -12,7 +12,7 @@ alerting: static_configs: - targets: [] scrape_configs: -- job_name: prometheus +- job_name: agents-api honor_timestamps: true scrape_interval: 15s scrape_timeout: 10s @@ -21,9 +21,4 @@ scrape_configs: follow_redirects: true static_configs: - targets: - - localhost:9090 -- job_name: 'fastapi' - scrape_interval: 10s - metrics_path: /metrics - static_configs: - - targets: ['http://agents-api-multi-tenant:8080'] + - agents-api-multi-tenant:8080 diff --git a/prometheus/docker-compose.yml b/prometheus/docker-compose.yml index f12462785..f3c53d966 100644 --- a/prometheus/docker-compose.yml +++ b/prometheus/docker-compose.yml @@ -6,12 +6,10 @@ services: container_name: prometheus profiles: - multi-tenant - - ports: - - 11000:9090 volumes: - - ./prometheus_data/prometheus.yml:/etc/prometheus/prometheus.yml + - ./config/prometheus.yml:/etc/prometheus/prometheus.yml + - prometheus_data:/prometheus depends_on: agents-api-multi-tenant: @@ -19,3 +17,7 @@ services: command: - '--config.file=/etc/prometheus/prometheus.yml' + +volumes: + prometheus_data: + external: true