From dca6ff620a45d0ff2b951456e1db15857e4d6aaf Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 10 Apr 2023 09:40:33 +0300 Subject: [PATCH] [#16] dev-env: Add prometheus Signed-off-by: Dmitrii Stepanov --- .bootstrap_services | 1 + .env | 6 +++++- services/prometheus/.env | 1 + services/prometheus/.hosts | 1 + services/prometheus/.int_test.env | 1 + services/prometheus/.prometheus.env | 0 services/prometheus/docker-compose.yml | 27 ++++++++++++++++++++++++++ services/prometheus/prometheus.yml | 19 ++++++++++++++++++ 8 files changed, 55 insertions(+), 1 deletion(-) create mode 120000 services/prometheus/.env create mode 100644 services/prometheus/.hosts create mode 120000 services/prometheus/.int_test.env create mode 100644 services/prometheus/.prometheus.env create mode 100644 services/prometheus/docker-compose.yml create mode 100644 services/prometheus/prometheus.yml diff --git a/.bootstrap_services b/.bootstrap_services index b4cf622..02237d1 100644 --- a/.bootstrap_services +++ b/.bootstrap_services @@ -3,3 +3,4 @@ basenet morph_chain jaeger +prometheus diff --git a/.env b/.env index b2ac4ef..c33accc 100644 --- a/.env +++ b/.env @@ -55,4 +55,8 @@ FROSTFS_CONTRACTS_URL=https://http.t5.fs.neo.org/AQgse8bPCZx4zScMuAKxowJdZPbKHp8 # Jaeger tracing JAEGER_VERSION=1.42.0 -JAEGER_IMAGE=jaegertracing/all-in-one \ No newline at end of file +JAEGER_IMAGE=jaegertracing/all-in-one + +# Prometheus monitoring +PROMETHEUS_VERSION=v2.43.0 +PROMETHEUS_IMAGE=prom/prometheus \ No newline at end of file diff --git a/services/prometheus/.env b/services/prometheus/.env new file mode 120000 index 0000000..c7360fb --- /dev/null +++ b/services/prometheus/.env @@ -0,0 +1 @@ +../../.env \ No newline at end of file diff --git a/services/prometheus/.hosts b/services/prometheus/.hosts new file mode 100644 index 0000000..89305b2 --- /dev/null +++ b/services/prometheus/.hosts @@ -0,0 +1 @@ +IPV4_PREFIX.121 prometheus.LOCAL_DOMAIN diff --git a/services/prometheus/.int_test.env b/services/prometheus/.int_test.env new file mode 120000 index 0000000..582b6a2 --- /dev/null +++ b/services/prometheus/.int_test.env @@ -0,0 +1 @@ +../../.int_test.env \ No newline at end of file diff --git a/services/prometheus/.prometheus.env b/services/prometheus/.prometheus.env new file mode 100644 index 0000000..e69de29 diff --git a/services/prometheus/docker-compose.yml b/services/prometheus/docker-compose.yml new file mode 100644 index 0000000..aef2c67 --- /dev/null +++ b/services/prometheus/docker-compose.yml @@ -0,0 +1,27 @@ +version: '2.4' +services: + prometheus: + image: ${PROMETHEUS_IMAGE}:${PROMETHEUS_VERSION} + domainname: ${LOCAL_DOMAIN} + hostname: prometheus + container_name: prometheus + restart: on-failure + networks: + prometheus_int: + internet: + ipv4_address: ${IPV4_PREFIX}.121 + volumes: + - ./../../vendor/hosts:/etc/hosts + - ./prometheus.yml:/etc/prometheus/prometheus.yml + command: + - --config.file=/etc/prometheus/prometheus.yml + ports: + - '9090:9090' + stop_signal: SIGKILL + env_file: [ ".env", ".prometheus.env", ".int_test.env" ] + +networks: + prometheus_int: + internet: + external: true + name: basenet_internet \ No newline at end of file diff --git a/services/prometheus/prometheus.yml b/services/prometheus/prometheus.yml new file mode 100644 index 0000000..1ea7300 --- /dev/null +++ b/services/prometheus/prometheus.yml @@ -0,0 +1,19 @@ +global: + scrape_interval: 15s + +scrape_configs: + - job_name: 'node' + static_configs: + - targets: ['s01.frostfs.devenv:9090', 's02.frostfs.devenv:9090', 's03.frostfs.devenv:9090', 's04.frostfs.devenv:9090'] + - job_name: 'http-gw' + static_configs: + - targets: ['http.frostfs.devenv:9090'] + - job_name: 'rest-gw' + static_configs: + - targets: ['rest.frostfs.devenv:9090'] + - job_name: 's3-gw' + static_configs: + - targets: ['s3.frostfs.devenv:9090'] + - job_name: 'neo-go' + static_configs: + - targets: ['morph-chain.frostfs.devenv:20001'] \ No newline at end of file