Skip to content

Commit

Permalink
monitoring connected to fc
Browse files Browse the repository at this point in the history
  • Loading branch information
GilHoggarth committed Nov 16, 2023
1 parent 8104691 commit b51654f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
9 changes: 2 additions & 7 deletions monitor/aws/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 13 additions & 3 deletions monitor/aws/prometheus/prometheus.yml-template
Original file line number Diff line number Diff line change
Expand Up @@ -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'
8 changes: 4 additions & 4 deletions monitor/aws/start_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ 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}
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}
Expand All @@ -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
Expand Down

0 comments on commit b51654f

Please sign in to comment.