From c1fdf192b2bd2066ab09b88cdae27dfd446aa3cb Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Thu, 30 May 2024 23:53:46 -0400 Subject: [PATCH] feat: rough minimum stack --- README.md | 14 ++++++++++++++ prometheus.yml | 4 ++++ start.sh | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 README.md create mode 100644 prometheus.yml create mode 100755 start.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..00dee95 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Panopticon + +## Onboarding databases + +Add the following to the pod in which the database runs. Port 9187 is exposed by default by the exporter and should be mapped. + +The port and exporter address should be included in `prometheus.yml`. + +``` +podman run -d \ + -e DATA_SOURCE_NAME="postgresql://:@:/postgres?sslmode=disable" \ + --pod \ + quay.io/prometheuscommunity/postgres-exporter +``` diff --git a/prometheus.yml b/prometheus.yml new file mode 100644 index 0000000..18f6cb0 --- /dev/null +++ b/prometheus.yml @@ -0,0 +1,4 @@ +scrape_configs: + - job_name: 'postgres_exporter' + static_configs: + - targets: ['host.containers.internal:9187'] diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..a5d3d4c --- /dev/null +++ b/start.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +podman pod create \ + -p 3000:3000 \ + -p 9187:9187 \ + -p 9090:9090 \ + --replace \ + panopticon + +podman run -d \ + --name=grafana \ + --replace \ + --pod panopticon \ + grafana/grafana + +podman run \ + --name prometheus \ + -d \ + --replace \ + --pod panopticon \ + -v ./prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus