TOWERBY CETMIX
← Hangar / jet_template_prometheus

Prometheus Metrics Server with Tower Exporter Discovery

Run Prometheus in Docker and discover running Cetmix Tower exporter Jets through file-based scrape targets.

↓ Download↓ 0 downloads

Summary

Category
Jet Templates
Tags
Monitoring
Authors
Cetmix OÜ
License
AGPL-3
Version
1.0.0
Call sign
jet_template_prometheus

This snippet imports a Prometheus Jet Template using prom/prometheus:v3.14.0. It runs one instance per server, stores time-series data under the Jet root and uses prometheus_retention to control data retention. It scrapes itself and exposes port 9090 on the shared Docker network for clients such as Grafana. The Docker, Fail2ban and Tower Core dependency templates are included.

Deploy and discover targets

  1. Import the YAML, install the template on the monitoring server, set prometheus_retention to a duration such as 15d, and configure node_exporter_port, cadvisor_port and postgres_exporter_port to match the exporters. Set prometheus_sd_postgres_legacy to a JSON array of legacy targets or [] for an empty list. Create a Jet targeting Running.
  2. Import and run the separate Node Exporter and cAdvisor Jets on hosts to monitor. Run PostgreSQL Exporter where a PostgreSQL Jet is already running. Allow the Prometheus server to reach the exporters on their configured ports (typically 9100, 9101 and 9187, respectively).
  3. Use Refresh targets after adding or removing exporters. Tower finds running exporter Jets, combines the server IPv4 address and exporter port into a target, and uses the Tower server name as the Prometheus instance label. The plan uploads the file_sd JSON and reloads Prometheus. It also renders any separately configured legacy PostgreSQL targets from prometheus_sd_postgres_legacy.
  4. Point Grafana at http://<prometheus-jet-reference>:9090 from the shared Docker network. Check the node, cadvisor and postgres jobs in Prometheus if a dashboard is missing an instance.

Operate

The supplied scheduled task is configured with a one-day interval. Use Refresh targets for immediate discovery changes. Rebuild recreates the container and refreshes its configuration while retaining the data directory. Destroy removes the Jet's deployment resources, including local metrics history.