Skip to main content

Prometheus (metrics store)

Prometheus collects and stores the rack's metrics. Dashboards live in Grafana; the native web UI is served by Prometheus itself on its default port.

Guestsrv-pm — Rocky Linux 9.8, 192.168.88.25 on rumba
PlaneM1 (hg-m1-systems; TLS name srv-pm.isc3.isc-vs.ch in hg-m1-service-names)
URLhttps://srv-pm.isc3.isc-vs.ch:9090/ (default port, HTTPS + mTLS, native UI and API)
Version3.13.5, binaries in /usr/local/bin (no package: update by hand)
Serviceprometheus.service, user prometheus, hardened unit, default options (no external URL), data /var/lib/prometheus (15 days)
Config/etc/prometheus/prometheus.yml, /etc/prometheus/web.yml — source dc-isc-prod playbooks/monitoring/srv-pm

Access​

  • HTTPS only on 9090: web.yml sets the server certificate HTTP/srv-pm.isc3.isc-vs.ch (FreeIPA, certmonger prometheus-isc3-fqdn, key owned by prometheus), re-read on every connection, so a renewal needs no restart. Plain HTTP gets a 400.
  • mTLS: a client certificate from the FreeIPA CA is required (RequireAndVerifyClientCert); without one the TLS handshake fails. Allowed SANs (client_allowed_sans) are the e-mail addresses of the members of access-prometheus plus the srv-gf and srv-pm machine certificates (Grafana data source, self-scrape). prometheus-client-sans (/usr/local/sbin, timer every 15 min, LDAPS GSSAPI with the host keytab) regenerates web.yml.
  • One personal certificate per admin: profile prometheusClientCert (1 year, clientAuth, e-mail SAN), CA ACL prometheus-client-issuance bound to access-prometheus; the .p12 is in the Vaultwarden collection srv-pm, to import in the browser. Renew before expiry (2027-10-27).
  • Revoking access = removing the user from access-prometheus (effective within 15 min; no CRL check). Break-glass: root SSH on srv-pm, then curl with the machine certificate (below).
  • firewalld: ssh, 9090/tcp. Cockpit is not installed.

Collection​

  • Job node: node_exporter 1.12.1 on each monitored host, HTTPS on 9100 (FreeIPA certificate host/<name>.isc3.isc-vs.ch, certmonger node-exporter-isc3-fqdn, TLS 1.3, verified against the FreeIPA CA) plus basic auth. No client certificate on the monitored hosts: mTLS is only for the admin UI.
  • The scrape password is rotated every 30 days by OpenBao on srv-bao (two alternating accounts, no outage); srv-pm reads it from /etc/prometheus/secrets/, each host gets only bcrypt hashes through its OpenBao agent (auth/cert-freeipa, shared role node-exporter, certificate bao-client-fqdn). Without an account the exporter answers 401.
  • Targets: one file per host in /etc/prometheus/targets/node/ (file_sd, read every 30 s, no reload). Add a host with dc-isc-prod playbooks/monitoring/node_exporter.yml (AWX, machine_name); remove it by deleting its file. Monitored on 2026-10-28: srv-pm, srv-gf, srv-phpipam.
  • nodename in node_uname_info is rewritten to the target FQDN (metric_relabel_configs), so dashboards show <name>.isc3.isc-vs.ch even when the host name is still a legacy .isc3 one.
  • Job grafana: Grafana internal metrics over HTTPS on srv-gf.isc3.isc-vs.ch:443.
  • No IP filtering on 9100 yet (central host firewall planned).
  • Details and rotation: dc-isc-prod playbooks/secrets/consumers/prometheus-scrape/README.md.
  • Targets on 2026-11-03 (/targets): prometheus (srv-pm), grafana (srv-gf), node (srv-pm, srv-gf, srv-phpipam), tisc (srv-tisc-editor:8082).
  • Job tisc: TISC Editor metrics, HTTP on srv-tisc-editor.isc3.isc-vs.ch:8082/api/metrics, Bearer token read from /etc/prometheus/secrets/tisc_metrics_token. It ran on srv-pm without being in the repo; it was added to dc-isc-prod prometheus.yml on 2026-11-03.
  • Targets on 2026-11-19: the list above plus keycloak, netbird and windmill, all up.
  • Job fmops (Foreman Operations & Security Center): HTTPS + mTLS on srv-fm.isc3.isc-vs.ch:9469 with the srv-pm machine certificate, every 5 min. The export on srv-fm has been active since 2026-11-03 (firewalld: srv-pm and srv-gf only). The job is applied on srv-pm: fmops was up in /targets on 2026-11-19.
  • Job keycloak (2026-11-19): Keycloak management interface, HTTP on srv-keycloak.isc3.isc-vs.ch:9000/metrics (metrics-enabled=true; port not proxied by srv-web01, open on the LAN without filtering). JVM, HTTP, database pool and cache metrics; no login/event counters (event-metrics-user-enabled is off).
  • Job netbird (2026-11-19): netbird-server metrics (metricsPort: 9090 inside the container), HTTP on srv-netbird.isc3.isc-vs.ch:9090/metrics through the netbird-metrics nginx container (dc-isc provisioning/netbird/docker-compose.yml), which answers srv-pm only (403 elsewhere).
  • Job windmill (2026-11-19): Windmill CE has no native metrics (Enterprise feature), so sql_exporter (wm_metrics service in srv-wd's compose) reads workers, queue and finished jobs from its database with the read-only role wm_metrics. Caddy serves https://wd.isc3.isc-vs.ch/wm-metrics to srv-pm only; every other source gets the Windmill page. Source: dc-isc-prod playbooks/monitoring/windmill/.
  • Changing prometheus.yml: copy it with apply-config.sh to srv-pm and run bash apply-config.sh as root (promtool check, backup, SIGHUP reload, no restart, automatic rollback if the reload fails). Never copy the file by hand: the repo is the source.

Storage​

Prometheus is the only store of metric history for the rack: local TSDB in /var/lib/prometheus, 15 days, then deleted. Grafana keeps no measurements (see Grafana). There is no remote write and no long-term store. Longer history (12 months of Foreman patch events) is planned in a separate PostgreSQL database.

Verifying​

systemctl is-active prometheus && ps -o user= -C prometheus # prometheus
promtool check config /etc/prometheus/prometheus.yml
promtool check web-config /etc/prometheus/web.yml
curl -s --cacert /etc/ipa/ca.crt --cert /etc/prometheus/tls/server.crt --key /etc/prometheus/tls/server.key \
'https://srv-pm.isc3.isc-vs.ch:9090/api/v1/query?query=up'

Verified 2026-10-27: without a client certificate the handshake is refused (curl rc 56); with the srv-pm or srv-gf machine certificate up = 1; plain HTTP gets a 400.

In Grafana, the provisioned data source prometheus (read-only in the UI) must answer Successfully queried the Prometheus API.