Observability introspection (traces, logs, metrics, sampling rules, alerts, rollups) is owned
end-to-end by the iii-observability worker.
Connection ports
The engine binds three ports of its own and runs alongside one more from the observability worker:
The console UI runs on
3113 and is launched separately by iii console.
Connection flow
A worker opens the SDK WebSocket (defaultws://127.0.0.1:49134) and sends the registrations it
holds in memory: each RegisterFunction, RegisterTrigger, and RegisterTriggerType it intends to
expose. The worker then calls engine::workers::register to publish its own metadata (runtime,
version, OS, PID, isolation), and the engine answers with a WorkerRegistered { worker_id } frame
carrying the assigned UUID.
The connection is bidirectional from that point on: the engine pushes InvokeFunction frames at the
worker, and the worker pushes InvocationResult, additional registrations, or unregistrations back.
Message types
Every frame is a JSON object discriminated bymessage_type. The full set, defined on Message in
engine/src/protocol.rs:
RegisterFunction
id is required. description, request_format, response_format, and metadata are optional
and feed the iii console and the agent-readable skills. invocation is reserved for external HTTP
functions (HttpInvocationRef); leave it null for in-process handlers.
RegisterTrigger
config is the per-trigger-type configuration; the shape is defined by whatever worker advertised
that trigger_type (e.g. iii-http for http triggers). The engine responds with a
TriggerRegistrationResult carrying an optional error: ErrorBody.
RegisterTriggerType
trigger_request_format is the JSON Schema for the trigger’s per-binding config.
call_request_format is the JSON Schema for the payload delivered to bound functions when the
trigger fires.
InvokeFunction
invocation_id is omitted on Void invocations (the worker has no result channel to reply on).
traceparent and baggage carry W3C trace context. action is the routing flag (see
Trigger actions below); absent / null means synchronous.
InvocationResult
Success:
ErrorBody.code values the engine emits today include invocation_failed (handler threw),
invocation_stopped (the owning worker disconnected mid-flight, so the engine cancels the in-flight
call and surfaces this code to the caller), function_not_found, function_not_invokable,
TIMEOUT (client-side timeout), FORBIDDEN (RBAC denial).
Trigger actions
InvokeFunction.action is tagged by type and lowercase-encoded on the wire:
Invocation lifecycle
For synchronous calls the engine assigns aninvocation_id, forwards the InvokeFunction to the
owning worker, and waits for the matching InvocationResult. For Void actions the engine forwards
without an invocation_id and never expects a reply. For Enqueue the engine hands the invocation
to the queue worker, which persists it and re-invokes the target function on a subscriber according
to the queue’s retry policy.
Engine discovery functions
The engine registers a built-in set of functions under theengine::* namespace for introspection
and worker lifecycle. Defined in
engine/src/workers/engine_fn/mod.rs:
Engine discovery triggers
Engine-collected metrics
These metrics are emitted by the engine regardless of which language SDK a worker uses. Names and units come fromengine/src/workers/observability/metrics.rs.