KubeMQ
OperateObservability

Audit Logging

KubeMQ's CloudEvents audit trail of auth, lifecycle, and data-plane events — the event catalog, retention settings, and the REST query API.

KubeMQ records a built-in audit trail of security, control-plane, and data-plane error events. Every audit event follows the CloudEvents v1.0 specification, so the trail is interoperable with any CloudEvents-aware tooling, and it is queryable through a REST API on the management API port (:8080).

Overview

Audit logging is on by default. Events are persisted to a local durable store on each node and synchronized across cluster nodes over the cluster mesh, so every node holds the full audit trail for the entire cluster. Each event is a CloudEvents v1.0 envelope carrying a structured data payload that captures who did what, on which channel, over which transport, and whether it succeeded.

Three kinds of events are recorded:

  • Control events — security, connection lifecycle, and administrative operations (authentication, authorization, client connect/disconnect, subscriptions, channel create/delete, cluster membership, server lifecycle).
  • Data error events — failures in message send and receive operations across the patterns.
  • System error events — infrastructure-level failures such as storage or broker errors.

Configure it

Audit logging has three settings: a master enable toggle, the retention window in hours, and how often expired records are purged.

config.yaml
audit:
  enable: true                  # on by default
  retentionHours: 720           # retain events for 30 days
  cleanupIntervalMinutes: 60    # purge expired events hourly
values.yaml
spec:
  audit:
    enable: true                # on by default
    retentionHours: 720         # retain events for 30 days
    cleanupIntervalMinutes: 60  # purge expired events hourly

Version floor: the spec.audit.* fields are present throughout the current GA chart line — kubemq-crds and kubemq-cluster 3.x (latest 3.2.0) with kubemq-controller 2.x (operator v2.3.0). Anything older than the 3.0.0 / 2.0.0 GA release predates this reference and will reject these fields; upgrade to the current line. On Docker the audit.* keys are available regardless of chart version.

For the full settings table — types, defaults, valid values, and the Docker/Helm naming for each key — see the Observability settings reference.

Event format

Each audit event is a CloudEvents v1.0 envelope. The envelope carries the standard CloudEvents attributes; the audit-specific payload lives in data.

{
  "specversion": "1.0",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "source": "kubemq://my-cluster/node-1",
  "type": "io.kubemq.audit.auth.success",
  "time": "2026-03-26T12:34:56.789Z",
  "datacontenttype": "application/json",
  "data": {
    "category": "control",
    "subcategory": "success",
    "client_id": "my-producer",
    "source_ip": "10.0.0.5",
    "transport": "grpc",
    "channel": "orders",
    "action": "auth.success",
    "outcome": "success",
    "metadata": {
      "method": "SendEvent"
    }
  }
}

Envelope fields

FieldDescription
specversionAlways "1.0".
idUnique UUID for each event.
sourcekubemq://{cluster_name}/{node_id}.
typeio.kubemq.audit.{event_type}.
timeISO 8601 timestamp with millisecond precision.
datacontenttypeAlways "application/json".

Data fields

FieldTypeDescription
categorystringEvent category: control, data, or system.
subcategorystringSub-category (e.g. success, error).
client_idstringClient identifier (if applicable).
source_ipstringClient IP address (if applicable).
transportstringTransport layer (grpc, rest).
channelstringChannel name (if applicable).
message_idstringMessage, event, or request ID (if applicable).
actionstringEvent type name (same as the type suffix).
outcomestringsuccess or error.
errorstringError message (only when outcome is error).
error_categorystringError classification (if applicable).
metadatamapAdditional key-value metadata.

Event catalog

Control events

Control-plane events track security, connection lifecycle, and administrative operations. These events carry category: "control".

Event typeDescription
server.startedServer completed startup.
server.stoppedServer shutting down.
server.readyServer ready to accept traffic.
auth.successAuthentication succeeded.
auth.failureAuthentication failed.
authz.deniedAuthorization denied.
client.connectedClient established a connection.
client.disconnectedClient disconnected.
client.connect_errorClient connection failed.
subscription.createdSubscription established.
subscription.deletedSubscription removed.
subscription.errorSubscription failed.
channel.createdChannel created (detected by the channel monitor).
channel.deletedChannel deleted (detected by the channel monitor).
stream.openedBidirectional stream opened.
stream.closedBidirectional stream closed.
cluster.node_joinedCluster node joined.
cluster.node_leftCluster node left.

A channel monitor watches for channels appearing and disappearing and emits channel.created / channel.deleted control events accordingly.

Data error events

Data-plane error events track failures in message send and receive operations. These events carry category: "data".

Event typeDescription
events.send_errorEvent publish failed.
events_store.send_errorEvents Store publish failed.
command.send_errorCommand send failed.
query.send_errorQuery send failed.
queue.send_errorQueue message send failed.
queue.batch_send_errorQueue batch send failed.
queue.receive_errorQueue receive failed.

System error events

System-level errors from infrastructure components. These events carry category: "system".

Event typeDescription
system.storage_errorPersistent storage failure.
system.broker_errorMessage broker error.

Retention & cleanup

Audit events are retained for the window set by retentionHours (default 720 hours = 30 days). A background cleanup runs at the interval set by cleanupIntervalMinutes (default 60 minutes) and deletes every event older than the retention window. Both settings accept a minimum of 1. Tune retentionHours to your compliance window and lower cleanupIntervalMinutes only if you need expired events purged more aggressively.

Retention applies per node, but because the trail is synchronized over the cluster mesh, every node holds — and prunes — the same cluster-wide set of events.

Query the audit log (REST)

The audit trail is queryable through the management API port (:8080). Two endpoints are available: one to list matching events and one to aggregate them.

List events

GET /api/v1/audit
ParameterTypeDefaultDescription
fromRFC3339 string1 hour agoStart time.
toRFC3339 stringnowEnd time.
categorystring(all)Filter by category (control, data, system).
subcategorystring(all)Filter by subcategory.
event_typestring(all)Filter by event type (e.g. auth.success).
channelstring(all)Filter by channel name.
client_idstring(all)Filter by client ID.
limitint50Results per page (1–1000).
offsetint0Pagination offset.
curl "http://localhost:8080/api/v1/audit?category=control&event_type=auth.failure&limit=10"

Aggregate statistics

GET /api/v1/audit/stats
ParameterTypeDefaultDescription
fromRFC3339 string1 hour agoStart time.
toRFC3339 stringnowEnd time.
group_bystringevent_typeGrouping dimension.
curl "http://localhost:8080/api/v1/audit/stats?group_by=category&from=2026-03-25T00:00:00Z"

Error responses

HTTP codeErrorDescription
404ErrAuditDisabledAudit service is disabled or not initialized.
400ErrAuditInvalidParamInvalid query parameter (e.g. bad date format).
500ErrAuditQueryFailedQuery failed.

Access control

When control-plane authentication is enabled, the audit query endpoints require at least the ReadOnly role, like the rest of the management API. See the Management API overview for the response envelope, status codes, and access-control model.

Feed a SIEM

The REST query API makes it straightforward to feed audit events into an external SIEM. Poll GET /api/v1/audit on an interval, advancing the from / to window each pass, and forward the returned CloudEvents records into Splunk, Elastic, or any log-management platform. Because the trail is synchronized cluster-wide, you can poll a single node and still capture every event from the cluster.

  • Observability settings reference — the audit configuration keys with their Docker and Helm naming, defaults, and valid values.
  • Management API — the response envelope, status codes, and access-control model shared by the audit query endpoints.

Was this page helpful?

On this page