Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sovereign, high-performance data protection

Metrics & Traces (OTLP)

The KMS server can export traces and metering events to any OpenTelemetry collector that supports the OTLP protocol.

Deploying the monitoring stack: for a turnkey Docker Compose setup with Grafana, VictoriaMetrics, and a pre-configured OTel Collector, see Monitoring stack setup.

Audit log SIEM integration: for forwarding compliance audit events to a SIEM, use a file-tailing agent (Vector, Filebeat, Fluent Bit) reading audit.jsonl. See SIEM integration.

KMS pushes traces and metrics over OTLP to a collector


Enabling OTLP

To enable OTLP export, set the collector URL via one of:

  • the otlp parameter in the TOML configuration file under [logging],
  • the --otlp command line argument,
  • the KMS_OTLP_URL environment variable.
KMS_OTLP_URL="http://localhost:4317"

By default, OTLP uses gRPC on port 4317. TLS transport is not compiled into this build, so https:// endpoints are rejected at startup: point the server at an http:// endpoint on a local or sidecar OpenTelemetry Collector (with --otlp-allow-insecure) and let the collector forward over TLS:

[logging]
otlp = "http://localhost:4317"
otlp_allow_insecure = true

What is exported

Traces include:

  • The server start configuration
  • KMIP request spans (content adjusted by the log level)
  • Access-rights management request spans
  • Metering spans (when metering is enabled)

Metrics push every 30 seconds and cover every category below.

Enabling metering

Metering events are emitted as OTLP spans and converted to Prometheus metrics downstream. Enable with:

[logging]
enable_metering = true
SettingCLI flagEnv var
Metering--enable-metering(no env; use TOML)

Metrics Reference

All metrics are pushed via OTLP/gRPC every 30 seconds to the configured collector. No HTTP /metrics endpoint is exposed — metrics are always pushed, never scraped.

KMIP Operations

MetricTypeDescriptionLabels
kms.kmip.operations.totalcounterTotal KMIP operations executedoperation, outcome (success · error)
kms.kmip.operations.per_user.totalcounterTotal KMIP operations per useroperation, user
kms.kmip.operation.durationhistogram (s)Duration of each KMIP operationoperation

Users & Permissions

MetricTypeDescriptionLabels
kms.active.usersup-down counterUnique users who issued at least one request—
kms.permissions.granted.per_user.totalcounterAccess rights granted, broken down by useruser, permission_type
kms.permissions.granted.totalcounterTotal access rights granted—

Database

MetricTypeDescriptionLabels
kms.database.operations.totalcounterDB operations by type and resultoperation, backend, outcome
kms.database.operation.durationhistogram (s)Wall-clock time of each DB calloperation, backend, outcome

Label values:

  • backend: sqlite · postgresql · mysql · redis
  • outcome: success · error

HTTP

MetricTypeDescriptionLabels
kms.http.requests.totalcounterIncoming HTTP requestsmethod, path, status
kms.http.request.durationhistogram (s)HTTP request latencymethod, path, status

path is normalised (e.g. /kmip/2_1, /google_cse/...) to avoid high cardinality from object identifiers.

Server Health

MetricTypeDescriptionLabels
kms.server.uptimecounter (monotonic, s)Seconds elapsed since server start—
kms.server.start_timeup-down counterServer start time as Unix timestamp (s)—
kms.active.connectionsup-down counterCurrent open HTTP connections—
kms.errors.totalcounterErrors categorised by typeerror_type

Objects & Keys

MetricTypeDescriptionLabels
kms.objects.totalgaugeTotal non-destroyed objects in the KMS—
kms.keys.active.countgaugeNon-destroyed key objects (SymmetricKey, PrivateKey, PublicKey, SplitKey) across all states: PreActive, Active, Deactivated, Compromisedobject_type, algorithm, key_length, state
kms.keys.expiring_soon.countgaugePreActive and Active keys whose DeactivationDate is within the window (cumulative)days_until_expiry (7 · 30 · 90)

These metrics are refreshed every 30 s by the metrics cron task and seeded at server startup. kms.keys.active.count emits one series per label combination: use sum(kms_keys_active_count) for the total. Unset dimensions are labelled unknown. See OTLP_METRICS.md for the HSM, overflow and Redis-findex specifics, and for tagging keys with vendor attributes.

Cluster

MetricTypeDescriptionLabels
kms.cluster.nodesgaugeNumber of KMS nodes with a heartbeat in the last 15 s (see Cluster coordination); refreshed every 5 s—

Cache

MetricTypeDescriptionLabels
kms.cache.operations.totalcounterUnwrap-cache lookupsoperation, result

HSM

MetricTypeDescriptionLabels
kms.hsm.operations.totalcounterHSM operations by type, model and resultoperation, hsm_model, outcome