From c3c36b354aefb1ad47039836d582cb1249727479 Mon Sep 17 00:00:00 2001 From: sunt9751 Date: Sat, 20 Jul 2024 22:59:06 -0700 Subject: [PATCH] add grafana and use promethesus as resource --- grafana/provisioning/datasources/datasource.yaml | 9 +++++++++ spring-petclinic.yml | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 grafana/provisioning/datasources/datasource.yaml diff --git a/grafana/provisioning/datasources/datasource.yaml b/grafana/provisioning/datasources/datasource.yaml new file mode 100644 index 000000000..f88db84c4 --- /dev/null +++ b/grafana/provisioning/datasources/datasource.yaml @@ -0,0 +1,9 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + access: proxy + url: http://prometheus:9090 + isDefault: true + editable: true \ No newline at end of file diff --git a/spring-petclinic.yml b/spring-petclinic.yml index 562732d97..d79190c4b 100644 --- a/spring-petclinic.yml +++ b/spring-petclinic.yml @@ -20,8 +20,22 @@ services: depends_on: - petclinic + grafana: + image: grafana/grafana:latest + ports: + - "3000:3000" + volumes: + - grafana_data:/var/lib/grafana + networks: + - custom-network + environment: + - GF_SECURITY_ADMIN_PASSWORD=admin + depends_on: + - prometheus + volumes: prometheus_data: + grafana_data: networks: custom-network: \ No newline at end of file