From 3400bb5736f769f5cf9720a3dbfff99809337c7a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 13 Jul 2023 12:13:27 +0300 Subject: [PATCH] [#37] Add grafana service to visualize prometheus metrics Signed-off-by: Alex Vanin --- .env | 4 +++ .services | 1 + services/grafana/.env | 1 + services/grafana/.hosts | 1 + services/grafana/.int_test.env | 1 + services/grafana/docker-compose.yml | 26 ++++++++++++++++++ services/grafana/grafana.ini | 3 ++ .../provisioning/dashboards/14061_rev1.json | Bin 0 -> 26821 bytes .../provisioning/dashboards/dashboard.yml | Bin 0 -> 183 bytes .../provisioning/datasources/datasource.yml | 8 ++++++ 10 files changed, 45 insertions(+) create mode 120000 services/grafana/.env create mode 100644 services/grafana/.hosts create mode 120000 services/grafana/.int_test.env create mode 100644 services/grafana/docker-compose.yml create mode 100644 services/grafana/grafana.ini create mode 100644 services/grafana/provisioning/dashboards/14061_rev1.json create mode 100644 services/grafana/provisioning/dashboards/dashboard.yml create mode 100644 services/grafana/provisioning/datasources/datasource.yml diff --git a/.env b/.env index f921d46..e04d5ca 100644 --- a/.env +++ b/.env @@ -60,3 +60,7 @@ JAEGER_IMAGE=jaegertracing/all-in-one # Prometheus monitoring PROMETHEUS_VERSION=v2.43.0 PROMETHEUS_IMAGE=prom/prometheus + +# Grafana versions +GRAFANA_VERSION=9.5.6 +GRAFANA_IMAGE=grafana/grafana diff --git a/.services b/.services index d9f34c7..768e4e6 100644 --- a/.services +++ b/.services @@ -3,3 +3,4 @@ http_gate s3_gate rest_gate +grafana diff --git a/services/grafana/.env b/services/grafana/.env new file mode 120000 index 0000000..c7360fb --- /dev/null +++ b/services/grafana/.env @@ -0,0 +1 @@ +../../.env \ No newline at end of file diff --git a/services/grafana/.hosts b/services/grafana/.hosts new file mode 100644 index 0000000..8f36ea6 --- /dev/null +++ b/services/grafana/.hosts @@ -0,0 +1 @@ +IPV4_PREFIX.122 grafana.LOCAL_DOMAIN diff --git a/services/grafana/.int_test.env b/services/grafana/.int_test.env new file mode 120000 index 0000000..582b6a2 --- /dev/null +++ b/services/grafana/.int_test.env @@ -0,0 +1 @@ +../../.int_test.env \ No newline at end of file diff --git a/services/grafana/docker-compose.yml b/services/grafana/docker-compose.yml new file mode 100644 index 0000000..795b87c --- /dev/null +++ b/services/grafana/docker-compose.yml @@ -0,0 +1,26 @@ +version: '2.4' +services: + grafana: + image: ${GRAFANA_IMAGE}:${GRAFANA_VERSION} + domainname: ${LOCAL_DOMAIN} + hostname: grafana + container_name: grafana + restart: on-failure + networks: + grafana_int: + internet: + ipv4_address: ${IPV4_PREFIX}.122 + volumes: + - ./../../vendor/hosts:/etc/hosts + - ./grafana.ini:/etc/grafana/grafana.ini + - ./provisioning:/etc/grafana/provisioning + ports: + - '3000:3000' + stop_signal: SIGKILL + env_file: [ ".env", ".int_test.env" ] + +networks: + grafana_int: + internet: + external: true + name: basenet_internet diff --git a/services/grafana/grafana.ini b/services/grafana/grafana.ini new file mode 100644 index 0000000..256888f --- /dev/null +++ b/services/grafana/grafana.ini @@ -0,0 +1,3 @@ +[auth.anonymous] +# enable anonymous access +enabled = true diff --git a/services/grafana/provisioning/dashboards/14061_rev1.json b/services/grafana/provisioning/dashboards/14061_rev1.json new file mode 100644 index 0000000000000000000000000000000000000000..deec62b2bb27d7239450ea99536a369595f567b4 GIT binary patch literal 26821 zcmeHQTXWmC5`OQmz;H61w}-Nj<@VX;`AeaDzL8bwJ~m4&y*-hJ3mCAs)iMY)h=C}HeO z{zdKbG!v-lg*l(_gnRS={qv%rvpC^1S^s&v{*lOwC{5_0-G{@6Tb^v_T(vjXUB(j; zcXXCbZK2bZTkLeSxQ~FByhy9u7q(5sRhFkSQBFlw*k5#SuR4Bnx*R;*GQ5F9C19Q; zX~|2lPZCzldT~^g`1YrB9l={V(ipvHl*bII!m{FUSG1)}itC?mm8|N9JD=pPm(&r4ROtPo|DF^mJVLTArY zmRCs`%>)xCS(=w3XU9=FWmzu3%p?k{Tm;PYU2HH;6h=vi2V+6slYmj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9>;0%V^T2`1(ebOIjuS-VmAH z+$=d0l@8uZ(&Np6em@N2e#jQ0jMgiuW*$A3;RPcyg@3(X)dDkD*X+WFVIOQ+Z;Q9> zei_V+26&I1&ja_%_LlpLrVQ;4ozH{%?I`u6lthjk{iqG{=X)_Mqv0L5VYipzBj=Z4 zV2R&#K5uVnS{fqzJC&~@P*WK6)oJtbB9_g*ZBJ literal 0 HcmV?d00001 diff --git a/services/grafana/provisioning/datasources/datasource.yml b/services/grafana/provisioning/datasources/datasource.yml new file mode 100644 index 0000000..81b6a7b --- /dev/null +++ b/services/grafana/provisioning/datasources/datasource.yml @@ -0,0 +1,8 @@ +apiVersion: 1 + +datasources: +- name: Prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 -- 2.45.2