Gardience Documentation gardience.com →
Docs / Administration

Monitoring

Gardience gives you four ways to watch it:

Prometheus metrics

The metrics endpoint needs an API key. Create a Read only key for your monitoring system under Settings > API keys (see API keys and the REST API).

Keys pause when their owner has not signed in for 30 days (7 days for single sign-on owners), and they expire after 90 days. Give the monitoring key an owner who signs in regularly, and replace the key before it expires. The GardienceMetricsDown alert below tells you if scraping stops.

An example Prometheus scrape job:

scrape_configs:
  - job_name: gardience
    scheme: https
    metrics_path: /gardience/api/v1/metrics
    authorization:
      type: Bearer
      credentials_file: /etc/prometheus/gardience-key
    tls_config:
      ca_file: /etc/prometheus/gardience.crt
    static_configs:
      - targets: ["gardience.example.com"]

Keep job_name: gardience: the shipped GardienceMetricsDown rule looks for it. ca_file is needed only when the console uses its self-signed certificate (config/tls/gardience.crt in the install directory).

Metrics

All metrics are gauges.

MetricMeaning
gardience_nodesManaged nodes.
gardience_nodes_compliantNodes fully patched and hardened.
gardience_nodes_staleNodes that did not answer the last scan.
gardience_pending_updatesPending updates across the fleet.
gardience_queue_heldChanges held for a change window or an offline node.
gardience_runs_runningRuns in progress.
gardience_runs_awaiting_approvalRuns waiting for a second person.
gardience_audit_entriesEntries in the audit log.
gardience_audit_chain_intact1 when the last full audit verification passed, otherwise 0.
gardience_errorsBackground components currently reporting a problem.
gardience_runs_24h{outcome}Runs started in the last 24 hours, by outcome (success, failed, other for held or waiting).
gardience_runs_30d{outcome}The same for the last 30 days.
gardience_runbook_runs_30d{name,kind,outcome}Runs of each runbook or workflow in the last 30 days, by outcome.
gardience_machine_failures_30d{machine}Failed results per machine in the last 30 days (the 15 machines with the most).
gardience_hours_saved_monthEngineer hours saved this month, from the savings model in Settings.

Grafana dashboard

Open Administration > Automation analytics and choose Download the Grafana dashboard (.json). In Grafana, choose Dashboards > New > Import, upload the file, and pick the Prometheus data source that scrapes Gardience.

Automation analytics

Administration > Automation analytics shows the same numbers in the console, for the last 7, 30, or 90 days: runs per day, success rate, median run time, each runbook and workflow with its success rate and average time, the machines with the most failed results, who ran the most, and the engineer time saved this month. It reads the run history Gardience already keeps, including runs moved to the archive.

| gardience_events_connected | 1 when the Salt event stream is connected, otherwise 0. |

Shipped alert rules

The rules are in docs/enterprise/prometheus-alerts.yml in the release. Load the file into Prometheus with rule_files.

AlertFires whenForSeverity
GardienceAuditChainBrokengardience_audit_chain_intact == 01 minutecritical
GardienceComponentProblemgardience_errors > 010 minuteswarning
GardienceSaltEventsDisconnectedgardience_events_connected == 05 minuteswarning
GardienceManyNodesSilentmore than 10% of nodes are stale30 minuteswarning
GardienceApprovalsWaitinggardience_runs_awaiting_approval > 04 hoursinfo
GardienceMetricsDownup{job="gardience"} == 05 minutescritical

What to do when they fire:

Health and readiness checks

Both need no sign-in and answer JSON.

/gardience/health

Liveness. Always HTTP 200 while the Gardience service answers. It says whether the service is healthy, never why, because error text can name hosts and paths.

{"ok": true, "role": "primary", "generation": 0, "fenced": null}

/gardience/ready

Readiness, for load balancers, upgrades and gardience doctor. HTTP 200 only when this server is a working primary, connected to the Salt event stream, with no critical problem. Otherwise HTTP 503.

{"ready": false, "problems": ["events"]}

The critical components are:

ComponentMeaning
auditThe audit log cannot be written. Changes are refused until it can.
audit-chainThe audit log failed verification. This stays until two people acknowledge it.
eventsThe Salt event stream has a problem.
fencedThis server is a standby, or an old primary that has been fenced.

Other problems (a failed scan, a SIEM that cannot be reached, and so on) show in the console and in gardience_errors, but do not make the server "not ready". A problem that has not happened again for 10 minutes stops counting, except audit, audit-chain and fenced, which last until fixed.

Signed-in users can see the full detail, including every component's message, at /gardience/api/health.

gardience doctor

Run it on the server:

/opt/gardience/gardience doctor

It prints one line per check, marked PASS, WARN or FAIL, and exits with code 1 if anything failed, so you can run it from your monitoring system or from cron.

CheckPASS whenOtherwise
ServicesEvery service in compose.yml is running.FAIL
Console/gardience/ready answers 200.FAIL: answering but not ready (503), or not answering.
Background componentsNo component reports a problem.FAIL, listing each problem.
Warm standbyShown only on a primary that runs standby-sync. A full sync succeeded within the last hour.FAIL
Salt APIThe Gardience service can reach the Salt API.FAIL
Data volumeAt least 15% free.FAIL
TLS certificateValid for at least 30 more days.WARN
LicenseValid.WARN in a grace period, or when missing, invalid or expired.
Audit chainIntact, with the number of entries.FAIL
Pre-upgrade backupsGARDIENCE_BACKUP_PASS_FILE is set and readable, so automatic backups are encrypted.WARN
Recent backupA backup (gardience-backup-*, pre-upgrade-* or standby-*) in the install directory is less than 7 days old.WARN. This is fine if you keep backups elsewhere.
Gardience by Bouziden Management LLC.