Docs Version v0.2
Docs menu

Running in production

Monitoring

Changed 3 min readv0.2

On this page

Alert rules and a Grafana dashboard for the engine's Prometheus metrics. Turn the metrics on with SIGNARI_METRICS_ADDR (or metrics.enabled in the Helm chart); the series and the label rule are documented with the configuration.

FileWhat it is
alerts.yamlPrometheus alerting rules, in rule-file format
alerts_test.yamlUnit tests for the rules: every alert fired by the series that should fire it, and none by a healthy deployment
dashboard.jsonA Grafana dashboard: traffic, sign-in, providers, delivery, maintenance, capacity, runtime

Loading the rules

With plain Prometheus, list the file under rule_files:. Check it first with promtool check rules alerts.yaml.

With the Prometheus operator, wrap it in a PrometheusRule. The operator picks up rules by label, so add whatever its ruleSelector asks for:

Shell{ printf 'apiVersion: monitoring.coreos.com/v1\nkind: PrometheusRule\nmetadata:\n  name: signari\n  labels:\n    release: prometheus\nspec:\n'  sed 's/^/  /' deploy/monitoring/alerts.yaml; } | kubectl apply -n monitoring -f -

Importing the dashboard

In Grafana, Dashboards → New → Import, then upload dashboard.json and choose a Prometheus data source. The dashboard asks for its data source through a variable, so the same file works against any of them.

What the alerts watch

critical means users are failing to sign in now, or a security control is not being applied. warning means something will fail, or has failed without anyone noticing.

AlertFires when
SignariAbsentno engine has been scraped for five minutes
SignariDatabaseUnreachablean engine's scrape-time queries read NaN for two minutes
SignariServerErrorsover 5% of responses are 5xx for ten minutes
SignariTokenEndpointSlowtoken endpoint p99 is over a second for ten minutes
SignariRestartinga container restarted three times in 30 minutes
SignariVersionSkewtwo releases have served for an hour
SignariSignInFailuresover half of sign-ins fail for fifteen minutes, given some traffic
SignariAuthFailureBurstover one failed authentication a second, by mechanism
SignariSMSRefused, SignariSMSFailingthe SMS budget is refusing, or the provider is failing
SignariProviderFailingOpena fail-open provider failed, so its decision was skipped
SignariProviderFailingCloseda fail-closed provider failed, so requests were refused
SignariOutboxBackloga notice still being retried is over fifteen minutes old
SignariOutboxParkeda notice was given up on after every attempt
SignariAuditStreamStuckthe audit stream's lag has only grown for fifteen minutes
SignariJanitorStalledno janitor pass has completed for fifteen minutes
SignariSigningKeyOldthe active signing key is over 100 days old
SignariKeyRefreshFailing, SignariKeyRefreshUnreadysigning-key refreshes fail; at five in a row the node is unready
SignariRequestPoolSaturated, SignariWorkerPoolSaturateda database pool has been full for ten or fifteen minutes
SignariPasswordHasherSaturatedevery password-hashing slot has been busy for five minutes

Thresholds are starting points. The sign-in and authentication-failure rules depend on traffic, and SignariSigningKeyOld assumes a 90-day SIGNARI_KEY_ROTATION_PERIOD; change them to fit.

A provider's failed_open and failed_closed series are exported at zero from startup, so the first failure after a restart registers as an increase that increase() can see.

Kept in step with the engine

TestTheMonitoringNamesOnlyExportedSeries in engine/internal/docsync fails when either file names a series the engine does not export. It also fails when an alert has no severity, summary, description or runbook, or when a runbook link points at a page that is missing or not published. That test checks names and structure only. The PromQL itself is run by alerts_test.yaml, which makes each alert fire from the series that should fire it and checks the labels and the words an operator would read, and keeps a healthy deployment's series silent. CI runs both, from this directory:

Shellpromtool check rules alerts.yamlpromtool test rules alerts_test.yaml