Skip to content

Commit

Permalink
clean up monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Nov 9, 2024
1 parent abcedc3 commit 7cbf1bf
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 23 deletions.
3 changes: 3 additions & 0 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"server": [
"./scripts/server.sh"
],
"monitoring": [
"./scripts/monitoring.sh"
],
"test": [
"./gradlew --console=plain --info --full-stacktrace check"
]
Expand Down
23 changes: 0 additions & 23 deletions docker-compose.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions scripts/monitoring.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

# go to project root
cd "$(dirname "$(realpath "$0")")/.."

docker rm -f grafana prometheus 1> /dev/null 2> /dev/null

echo >&2 "starting prometheus"
docker run -d --rm \
--name "prometheus" \
--network host \
-p "127.0.0.1:9090:9090" \
-v "${PWD}/monitoring/prometheus.yaml:/etc/prometheus/prometheus.yml:ro" \
"prom/prometheus:latest"

echo >&2 "starting grafana"
docker run -d --rm \
--name "grafana" \
--env-file='./monitoring/grafana/config.env' \
--network host \
-p "127.0.0.1:3000:3000" \
-v "${PWD}/monitoring/grafana/provisioning:/etc/grafana/provisioning" \
"grafana/grafana:latest"

source './monitoring/grafana/config.env'

echo >&2 "user: ${GF_SECURITY_ADMIN_USER}"
echo >&2 "pass: ${GF_SECURITY_ADMIN_PASSWORD}"
echo >&2 "addr: http://127.0.0.1:3000/"

0 comments on commit 7cbf1bf

Please sign in to comment.