mirror of
https://github.com/logos-storage/logos-storage-local-harness.git
synced 2026-01-02 13:33:11 +00:00
feat: add basic prometheus/grafana setup
This commit is contained in:
parent
19f87a2298
commit
7df3990968
45
dashboard/docker-compose.yml
Normal file
45
dashboard/docker-compose.yml
Normal file
@ -0,0 +1,45 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- ./targets:/etc/prometheus/targets:ro
|
||||
- prometheus_data:/prometheus
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
||||
- '--web.console.templates=/etc/prometheus/consoles'
|
||||
- '--web.enable-lifecycle'
|
||||
extra_hosts:
|
||||
- "host.docker.internal=${HOST_IP}"
|
||||
restart: unless-stopped
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
- ./grafana/provisioning:/etc/grafana/provisioning
|
||||
- ./grafana/dashboards:/var/lib/grafana/dashboards
|
||||
environment:
|
||||
- GF_AUTH_ANONYMOUS_ENABLED=true
|
||||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
|
||||
- GF_AUTH_DISABLE_LOGIN_FORM=true
|
||||
- GF_INSTALL_PLUGINS=grafana-clock-panel
|
||||
extra_hosts:
|
||||
- "host.docker.internal=${HOST_IP}"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- prometheus
|
||||
|
||||
volumes:
|
||||
prometheus_data:
|
||||
grafana_data:
|
||||
14
dashboard/launch.sh
Executable file
14
dashboard/launch.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e -o pipefail
|
||||
|
||||
if [ "$OSTYPE" = "darwin" ]; then
|
||||
HOST_IP="host-gateway"
|
||||
elif [ "$OSTYPE" = "linux-gnu" ]; then
|
||||
HOST_IP=$(hostname -I | cut -d " " -f 1)
|
||||
else
|
||||
echo "Unsupported OS: $OSTYPE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export HOST_IP
|
||||
docker compose up "$@"
|
||||
19
dashboard/prometheus.yml
Normal file
19
dashboard/prometheus.yml
Normal file
@ -0,0 +1,19 @@
|
||||
# Prometheus configuration file
|
||||
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['host.docker.internal:9090']
|
||||
|
||||
- job_name: 'codex-metrics'
|
||||
file_sd_configs:
|
||||
- files:
|
||||
- '/etc/prometheus/targets/*.json'
|
||||
refresh_interval: 1s
|
||||
scrape_interval: 1s
|
||||
metrics_path: '/metrics'
|
||||
scheme: http
|
||||
Loading…
x
Reference in New Issue
Block a user