Skip to main content

Operate the deployment

Once AI Workspace is serving traffic, three things keep it that way: logs you can search, backups that restore, and an upgrade you can undo.

Step 1: Emit structured logs​

Both services log to standard output, so whatever collects container logs on your platform already collects theirs. Switch the format to JavaScript Object Notation (JSON) so a log aggregator can index fields instead of matching text.

For the configuration on each platform, see Deploy on VMs, Deploy on Kubernetes, and Deploy on OpenShift.

Keep the level at info in production. debug is verbose enough to affect throughput and to put request detail in your logs. Leave browser_debug off, because it turns on verbose console logging in every user's browser.

Step 2: Watch the right signals​

Both services answer a health endpoint that doesn't require authentication: /healthz on AI Workspace and /health on the Platform API. Everything else comes from logs and from your platform's own metrics.

Alert on these:

SignalWhy it matters
Either health endpoint failingThe service is down or can't reach a dependency
A restart loop on either serviceA configuration or secret stopped resolving; the startup message names which
Database connection errorsThe pool is exhausted or the database is unreachable
Certificate expiry inside 14 daysRenewal stopped, and an expired certificate takes the workspace offline
A gateway moving to inactiveThe gateway lost its connection to the control plane, so it stops receiving configuration updates
Sustained CPU or memory at the limitThe deployment is undersized for its traffic
Authentication failures rising sharplyAn identity provider problem, or credential stuffing

Gateway connection log lines​

The Platform API's WebSocket manager logs each gateway transition at info level, so these three messages are available without changing the log level:

MessageAttributesWhat it tells you
Gateway connectedgatewayID, connectionIDA gateway established its control plane connection
Gateway disconnectedgatewayID, connectionIDA gateway dropped. One at a time is normal during a gateway restart; several at once points at the control plane
Heartbeat timeout detectedgatewayIDThe gateway stopped answering pings, and the Platform API is about to close the connection. This precedes a gateway going inactive

Alert on Heartbeat timeout detected rather than waiting for the console to show a gateway as inactive, since the timeout is the earlier signal.

WebSocket metrics​

The Platform API also logs connection metrics on an interval, which is the closest signal to how many gateways are connected.

For the configuration on each platform, see Deploy on VMs, Deploy on Kubernetes, and Deploy on OpenShift.

The Platform API writes this line at debug level, so it needs level = "debug" as well as metrics_log_enabled. At info the setting produces no output. Debug logging on the Platform API is verbose, so turn it on to investigate a connection problem rather than leaving it on permanently.

The line's message is WS Metrics, and its payload attribute holds a JSON object with these fields:

FieldMeaning
from, toThe interval the counters cover, in Request for Comments (RFC) 3339 format
totalActiveConnectionsGateways connected at the end of the interval
totalActiveOrgsOrganizations with at least one connected gateway
successfulConnectionsConnections established during the interval
failedConnectionsConnection attempts that failed during the interval
disconnectionsConnections lost during the interval
eventsSentConfiguration events pushed to gateways during the interval

The counters reset each interval, so they're rates rather than running totals. totalActiveConnections is the one to graph: a drop with no matching deployment change means gateways are losing the control plane. A failedConnections count that stays above zero points at a registration token or network path problem rather than a gateway fault.

Step 3: Back up what you can't regenerate​

Two things matter, and they're only useful together. A database backup restored without its encryption key gives you rows whose secret columns can't be decrypted.

WhatHow oftenWhere
The databaseOn your organization's schedule for a system of recordYour database backup tooling
The at-rest encryption keyOnce, when created, and after any changeYour secret manager, separate from the database backup

For the configuration on each platform, see Deploy on VMs, Deploy on Kubernetes, and Deploy on OpenShift.

Test a restore into a non-production environment on a schedule. Only a tested restore proves the backup works.

Step 4: Upgrade​

Read the release notes first, then back up the database, then upgrade. Both procedures below upgrade the whole stack in one step, so plan the upgrade as a change window that covers both services.

For the configuration on each platform, see Deploy on VMs, Deploy on Kubernetes, and Deploy on OpenShift.

Step 5: Roll back​

Roll back the application, then decide separately about the database. The previous version can't always read a schema the upgrade changed, which is why the backup comes first.

For the configuration on each platform, see Deploy on VMs, Deploy on Kubernetes, and Deploy on OpenShift.

Step 6: Uninstall​

For the configuration on each platform, see Deploy on VMs, Deploy on Kubernetes, and Deploy on OpenShift.

Housekeeping settings​

Two background tasks have configurable bounds. The defaults suit most deployments; review them if your database grows unexpectedly or deployments appear stuck.

SettingDefaultWhat it controls
event_hub.poll_interval3sHow often each replica checks for events from the others
event_hub.cleanup_interval10mHow often the Platform API purges delivered events
event_hub.retention_period1hHow long the Platform API keeps delivered events
deployments.timeout_duration60 secondsHow long a stuck deployment waits before the Platform API marks it failed

Was this page helpful?