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.
Scrape a private TLS listener
-
Provision a certificate trusted by Prometheus and readable by the Bifröst service account. Define named TLS and keep monitoring bound to a private address:
Bifröst configuration 1 2 3 4 5 6 7 8 9 10 11
tls: monitoring: certificates: - certificateFile: /run/bifroest/tls/monitoring.crt privateKeyFile: /run/bifroest/tls/monitoring.key monitoring: enabled: true addresses: ["10.20.0.10:9090"] domains: [monitoring.internal.example] tls: monitoring allowedRemoteHosts: ["10.20.0.20"] -
Restart Bifröst and configure Prometheus with its own CA trust and expected server name:
Prometheus scrape job 1 2 3 4 5 6 7
job_name: bifroest scheme: https tls_config: ca_file: /etc/prometheus/bifroest-ca.crt server_name: monitoring.internal.example static_configs: - targets: ["10.20.0.10:9090"] -
Reload Prometheus and check
up{job="bifroest"} == 1. Do not useinsecure_skip_verify. Directory-mounted certificate Secrets rotate without restarting Bifröst.
Configure Kubernetes probes
The Helm chart already configures these probes on a private Pod port. Use the next example to add Prometheus scraping; do not add a public monitoring Service.
-
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.
Scrape the Helm deployment
-
Use an existing Prometheus installation with permission to discover Pods in the
bifroestnamespace. Add this file to your Helm installation, replacing both selectors with those of your Prometheus Pods:monitoring-values.yaml 1 2 3 4 5 6 7 8 9 10
monitoring: prometheusAnnotations: true networkPolicy: monitoringPeers: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: monitoring podSelector: matchLabels: app.kubernetes.io/name: prometheusKeep both selectors in one peer entry. Upgrade with your existing values and the same full release version:
1helm upgrade bifroest oci://ghcr.io/engity-com/bifroest --version <version> --namespace bifroest -f values.yaml -f monitoring-values.yaml --wait --timeout 5mRetain any other values files, such as your ingress settings, in that command.
-
If Prometheus already honors Pod scrape annotations, verify that it selects the named
monitoringport exactly once per Pod. Otherwise, add this job to its configuration and reload Prometheus:Prometheus scrape job 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
scrape_configs: - job_name: bifroest kubernetes_sd_configs: - role: pod namespaces: names: [bifroest] relabel_configs: - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_name] action: keep regex: bifroest - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] action: keep regex: "true" - source_labels: [__meta_kubernetes_pod_container_port_name] action: keep regex: monitoring - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme] target_label: __scheme__ - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] target_label: __metrics_path__ - source_labels: [__meta_kubernetes_pod_name] target_label: podPod discovery supplies the address of the named port. The annotations supply the scrape switch, scheme, path and port; they do not install or configure Prometheus. No ServiceMonitor or PodMonitor is created. For protected metrics, add bearer credentials and TLS trust to the job as required by your configuration.
-
Check Prometheus targets and query
up{job="bifroest"}andbifroest_ready. Each ready Bifröst Pod should appear separately with both values at1; do not scrape through the load-balanced SSH or HTTP Service.
Verify live configuration reloads
With live reload explicitly enabled, check bifroest_configuration_watch_enabled == 1, a nonzero bifroest_configuration_reload_last_attempt_timestamp_seconds and bifroest_configuration_reload_last_success == 1 on every instance. A rejected candidate can leave /ready healthy because the previous accepted rules remain active.
Use the safe reload log categories to investigate rejection, correct the file and verify a new login. Successful unchanged polls also advance the accepted timestamp; it is not a configuration version or evidence that an external credential file was reloaded. Native-watch errors are separate from rejection: polling continues. See the metric definitions.
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 31 32 33 34 35 36 | |
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.