The Prometheus monitoring system and time series database.
As Prometheus is a monitoring software that saves data in a timeseries database, it can take up massive amounts of disk space. Due to Prometheus design, a huge memory consumption is also possible. To get started, a minimum of 3GB RAM and >=2.5GB disk space is recommended. Keep in mind that those numbers can grow pretty quick for large monitored environments!
Ports required to run the server in a table format.
Port | default |
---|---|
Prometheus server | 9090 |
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:debian | ghcr.io/ptero-eggs/yolks:debian |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Prometheus Version | The version of Prometheus to install. By default the latest version is being installed. | PROMETHEUS_VERSION | latest | Yes | Yes |
Data Save time in Days | How long the data is being saved | DATA_SAVE_TIME | 15d | Yes | Yes |
#!/bin/sh
shopt -s extglob
# Switch to mounted directory
cd /mnt/server
# Update installation system and install curl
apt-get update
apt-get install -y curl
ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")
# Cleanup previous install if available
if [ -f "prometheus.yml" ]; then mv prometheus.yml prometheus.yml.bak; fi
if [ -f "prometheus.web.yml" ]; then mv prometheus.web.yml prometheus.web.yml.bak; fi
rm -rfv !(data|prometheus.yml.bak|prometheus.web.yml.bak)
# Download and extract Prometheus
version=${PROMETHEUS_VERSION}
if [ "$version" = "latest" ]; then version=$(curl --silent "https://api.github.com/repos/prometheus/prometheus/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-); fi
curl -L https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-${version}.linux-${ARCH}.tar.gz --output prometheus.tar.gz
tar -zxvf prometheus.tar.gz
mv -n prometheus-*/* ./
rm -rf prometheus.tar.gz prometheus-*/
# Restore configuration if necessary
if [ -f "prometheus.yml.bak" ]; then rm -rf prometheus.yml && mv prometheus.yml.bak prometheus.yml && rm -rf prometheus.yml.bak; fi
if [ -f "prometheus.web.yml.bak" ]; then rm -rf prometheus.web.yml && mv prometheus.web.yml.bak prometheus.web.yml && rm -rf prometheus.web.yml.bak; fi
# Create dummy prometheus.web.yml as a placeholder
if [ ! -f "prometheus.web.yml" ]; then touch prometheus.web.yml; fi