From b51654fb57e4adba1b93c93df047e7103e9c8532 Mon Sep 17 00:00:00 2001 From: gilh Date: Thu, 16 Nov 2023 20:01:02 +0000 Subject: [PATCH] monitoring connected to fc --- monitor/aws/docker-compose.yml | 9 ++------- .../datasources/frequent_crawl.yaml-template | 2 +- monitor/aws/prometheus/prometheus.yml-template | 16 +++++++++++++--- monitor/aws/start_monitor.sh | 8 ++++---- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/monitor/aws/docker-compose.yml b/monitor/aws/docker-compose.yml index d7f4656..76acbb9 100644 --- a/monitor/aws/docker-compose.yml +++ b/monitor/aws/docker-compose.yml @@ -14,28 +14,23 @@ services: - '--storage.path=/alertmanager' - '--web.external-url=http://${ALERTMANAGER_SERVICE_NAME}/' - pushgateway: - image: prom/pushgateway:v1.4.2 - ports: - - 9091:9091 - prometheus: image: prom/prometheus:v2.30.3 ports: - "${PROMETHEUS_PORT}:9090" depends_on: - alertmanager:alertmanager - - pushgateway:pushgateway user: root volumes: - ./prometheus:/etc/prometheus - "${PROMETHEUS_DATA}:/prometheus" extra_hosts: - 'fc:172.31.43.254' + - 'monitor:172.31.18.188' command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - - '--storage.tsdb.retention.time=365d' + - '--storage.tsdb.retention.time=180d' - '--web.console.libraries=/usr/share/prometheus/console_libraries' - '--web.console.templates=/usr/share/prometheus/consoles' - '--web.external-url=http://${PROMETHEUS_SERVICE_NAME}/' diff --git a/monitor/aws/grafana/datasources/frequent_crawl.yaml-template b/monitor/aws/grafana/datasources/frequent_crawl.yaml-template index 8e6cba9..493bc98 100644 --- a/monitor/aws/grafana/datasources/frequent_crawl.yaml-template +++ b/monitor/aws/grafana/datasources/frequent_crawl.yaml-template @@ -9,5 +9,5 @@ datasources: type: prometheus access: proxy orgId: 1 - url: http://${FC_EMBEDDED_SERVICE_NAME} + url: http://${FC_EMBEDDED_SERVICE_NAME}:9191 isDefault: false diff --git a/monitor/aws/prometheus/prometheus.yml-template b/monitor/aws/prometheus/prometheus.yml-template index 9be2e3a..3a56013 100644 --- a/monitor/aws/prometheus/prometheus.yml-template +++ b/monitor/aws/prometheus/prometheus.yml-template @@ -19,14 +19,24 @@ alerting: - targets: - "${ALERTMANAGER_SERVICE_NAME}" + # Define which resources prometheus should monitor scrape_configs: - - job_name: 'services' + - job_name: 'node_exporter' static_configs: - targets: + - 'monitor:9100' - 'fc:9100' - - job_name: 'pushgateway' + - job_name: 'federate' + scrape_interval: 20s honor_labels: true + metrics_path: '/federate' + params: + 'match[]': + - '{job="npld-heritrix-workers"}' + - '{job="bypm-heritrix-workers"}' + - '{job="kafka"}' static_configs: - - targets: ['pushgateway:9091'] + - targets: + - 'fc:9191' diff --git a/monitor/aws/start_monitor.sh b/monitor/aws/start_monitor.sh index ad8dfd4..432b490 100755 --- a/monitor/aws/start_monitor.sh +++ b/monitor/aws/start_monitor.sh @@ -18,7 +18,7 @@ STORAGE_PATH=/mnt/data/monitor # alertmanager -export ALERTMANAGER_SERVICE_NAME='monitor.alertmanager' +export ALERTMANAGER_SERVICE_NAME='monitor' export ALERTMANAGER_DATA=${STORAGE_PATH}/alertmanager export ALERTMANAGER_PORT=9093 [[ -d ${ALERTMANAGER_DATA}/ ]] || mkdir -p ${ALERTMANAGER_DATA} @@ -26,7 +26,7 @@ envsubst < ./alertmanager/config.yml-template > ./alertmanager/config.yml # prometheus -export PROMETHEUS_SERVICE_NAME='monitor.prometheus' +export PROMETHEUS_SERVICE_NAME='monitor' export PROMETHEUS_DATA=${STORAGE_PATH}/prometheus export PROMETHEUS_PORT=9090 [[ -d ${PROMETHEUS_DATA}/ ]] || mkdir -p ${PROMETHEUS_DATA} @@ -35,10 +35,10 @@ envsubst < ./prometheus/prometheus.yml-template > ./prometheus/prometheus.yml # grafana -export GRAFANA_SERVICE_NAME='monitor.grafana' +export GRAFANA_SERVICE_NAME='monitor' export GRAFANA_PORT=3000 export GRAFANA_DATA=${STORAGE_PATH}/grafana -export FC_EMBEDDED_SERVICE_NAME='172.31.43.254:9191' +export FC_EMBEDDED_SERVICE_NAME='172.31.43.254' [[ -d ${GRAFANA_DATA}/ ]] || mkdir -p ${GRAFANA_DATA} chown -R ${USER}:${USER} ${GRAFANA_DATA} envsubst < ./grafana/grafana.ini-template > ./grafana/grafana.ini