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.


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 with TLS. For local development with a plaintext HTTP collector, also set --otlp-allow-insecure:

[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
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, Compromisedโ€”

Both metrics are refreshed every 30 s by the metrics cron task and seeded at server startup.

Cache

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

HSM

MetricTypeDescriptionLabels
kms.hsm.operations.totalcounterHSM operations by type and modeloperation, hsm_model