Monitor a Bifröst instance
This guide queries metrics from an installed, configured Bifröst instance through management SSH or an existing Prometheus installation. Prometheus scraping and Kubernetes probes do not require browser or management access. The monitoring reference defines all settings and metric semantics.
Examples
Query metrics through management SSH
- Set up the management flow and workstation alias. No monitoring listener or Prometheus installation is needed for this example.
-
Query the running instance:
1bifroest @bifroest-admin metrics show bifroest_connections_active bifroest_sessions_activeThe default table shows current values and labels. For scripts or an OpenMetrics snapshot, use
--format=jsonor--format=openmetrics. Omit metric names to show all available families. Seemetrics showfor filtering and output details.
Scrape a host locally
-
Add the monitoring block to the existing Bifröst configuration:
Bifröst configuration 1 2 3
monitoring: enabled: true addresses: ["localhost:9090"]Restart Bifröst using the host's service manager. If Prometheus also listens on this host, configure a different port for one of the listeners.
-
Check readiness and metrics from the same host:
Bifröst host 1 2
curl --fail http://localhost:9090/ready curl --fail http://localhost:9090/metrics/readyreturnsreadyafter startup. Metrics includebifroest_ready 1. -
Add a scrape job to the local Prometheus configuration and reload Prometheus:
prometheus.yml 1 2 3 4 5
scrape_configs: - job_name: bifroest scrape_interval: 15s static_configs: - targets: ["localhost:9090"]In Prometheus, check
up{job="bifroest"}andbifroest_ready. Both should be1. Scrape each instance separately; do not hide individual instances behind a load-balanced scrape target.
Use a bearer token
-
Mount or provision the same secret token in separate private files readable by Bifröst and Prometheus. Add its path to Bifröst:
Bifröst configuration 1 2 3
monitoring: enabled: true bearerTokenFile: /run/secrets/monitoring-token -
Configure Prometheus to send it:
Prometheus scrape job 1 2 3 4 5
job_name: bifroest authorization: credentials_file: /run/secrets/bifroest-monitoring-token static_configs: - targets: ["localhost:9090"]Restart Bifröst and reload Prometheus.
/metricsnow requires the token; the minimal/readyand/statusprobes remain token-free. For remote scraping, configure a private reachable address, an appropriate peer allowlist and TLS or an encrypted network. HTTP alone does not protect the token from interception.
Configure Kubernetes probes
-
In the Bifröst Pod's existing configuration, bind monitoring to the Pod network:
Bifröst configuration 1 2 3 4
monitoring: enabled: true addresses: [":9090"] allowedRemoteHosts: []Restrict this port through your cluster networking policy and do not publish it externally. An empty allowlist permits every reachable peer. If you configure IP/CIDR entries, include the actual Prometheus and node/probe source ranges, not just the Pod network.
-
Add the named port and probes to the existing Bifröst container specification:
Bifröst container fragment 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
ports: - name: monitoring containerPort: 9090 startupProbe: httpGet: path: /ready port: monitoring periodSeconds: 5 timeoutSeconds: 2 failureThreshold: 60 readinessProbe: httpGet: path: /ready port: monitoring periodSeconds: 5 timeoutSeconds: 2 livenessProbe: httpGet: path: /status port: monitoring periodSeconds: 10 timeoutSeconds: 2This allows roughly five minutes for startup before Kubernetes restarts the container. Adjust the budget to your deployment. Startup gates the other probes; readiness failures remove the Pod from normal Service traffic without themselves causing a restart. A slow IdP or failed remote delivery does not deliberately fail liveness. With monitoring TLS enabled, set
scheme: HTTPSon each HTTP probe; Kubernetes HTTPS probes do not validate the server certificate. -
Roll out the updated Pod specification and inspect its readiness with
kubectl get pods. Configure your existing Prometheus discovery to scrape each Pod'smonitoringport at/metrics, including bearer authorization if enabled.
Add operational alerts
Add these example rules to your existing Prometheus rule group and adapt the thresholds:
| Prometheus alert rules | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
An unavailable scrape can mean a network, authorization or listener problem; it is not proof that workload access has failed. Resolve a disabled best-effort logger's cause and restart Bifröst to re-enable it. The delivery alert detects observed worker stalls, not a complete historical delivery backlog.
For access/security dashboards, use sum by (transport, result) (rate(bifroest_authentication_attempts_total[5m])), rate(bifroest_connections_rejected_total[5m]) and rate(bifroest_http_rejections_total[5m]). increase(...[1h]) gives the corresponding hourly event count. Investigate sustained changes together with unauthenticated SSH connections, TLS aborts and audit-detail suppression; do not treat every 401/403 or unauthenticated HTTP asset fetch as a failed login.
The weighted active-session average is sum(bifroest_sessions_age_sum_seconds) / sum(bifroest_sessions_age_observations) when the denominator is greater than zero. Use oldest age to find outliers, but not as an inactivity timeout. Successful streaming channel lifetimes are deliberately absent from normal HTTP latency histograms.
Next steps
- Monitoring reference defines labels, measurement boundaries and TLS configuration.
- Audit logs explains strict and best-effort failure policies.
- Housekeeping describes retained sessions and conservative cleanup.