Metrics Engine Service

The Metrics Engine (started with webstream.exe -me) is the deployment's central telemetry sink. Every streamer, gateway, and backend POSTs metrics and activity to it; it is the sole writer of the metrics and activity databases, runs retention and rollup maintenance, and serves the query API that powers the Operations and Reports sections of the admin console — plus usage metering for billing.

Function

Ports and endpoints

ListenerPortPurpose
HTTPmetricsEngine.httpPort (default 9009), bound to bindAddress (default 0.0.0.0)Ingestion, query API, admin panel. Internal service — no SSL, no API keys; secured by network isolation.

Message contracts

Inbound — ingestion (from streamers, gateways, backends)

EndpointMethodFrequencyPayload
/metrics/streamer/flushPOSTEvery 10/30/60 s per node (metrics.server.flushIntervalSeconds on the producer){ nodeId, hostName, environment, region, userName, sessionId, tsUtc, intervalSecs, summary{…}, events[], instanceType, processorCount, totalMemoryGB, sessionContext? }
/activity/logPOSTImmediate for session/file/clipboard/print events; 10 s batches for input blocks{ type, nodeId, sessionId, username, timestamp, iamUsername?, workspaceName?, data }

Inbound — query API (admin console and MCP proxy)

EndpointMethodPurpose
/api/nodes, /api/nodes/{id}/metrics, /api/nodes/{id}/latestGETRegistered node list and per-node time series / latest snapshot.
/api/sessions/active, /api/sessions/recent, /api/sessions/{id}/metricsGETLive and historical session data for Operations.
/api/sessions/{id}/disconnectPOSTFans a termination request out to the session's streamer.
/api/activity/sessions|inputs|clipboard|reportGETAudit and compliance reporting.
/api/metering/usage-report, /metering/meterUsage, /metering/statusGET / POSTBilling usage reports and metering submission.
/healthGET{ status: "ok", timestamp, retentionDays }

When accessed through the gateway, these routes are exposed as /mcp/api/* and require a valid X-MCP-Key header; the Metrics Engine itself does not enforce keys.

Configuration

PropertyPurpose
metricsEngine.httpPort / bindAddressListener settings (default 9009 on all interfaces).
metricsEngine.database.metrics / activityPostgreSQL connection strings (+ passwordRef) for the two databases it owns. See Persistence Layer.
metricsEngine.database.retentionDaysRaw metrics retention (default 10 days).
metricsEngine.database.rollupEnabledHourly/daily rollups for long-term trends.
metricsEngine.adminPanelAdmin panel enable, default time range, refresh interval.

Command-line overrides are available when launching with -me: --http-port, --metrics-conn, --activity-conn, --retention-days, --admin-enabled.

Aligned settings on peer services (the producers)

Sizing

The Metrics Engine is deliberately lightweight — ingestion is buffered and writes are batched — but as node and session counts grow it should move to its own small instance so telemetry writes never compete with session I/O. See Services for shared-versus-dedicated guidance.