Skip to main content

SQL Introspection API

Restate exposes a set of tables that can be queried via psql. The schema of these tables is described in the following.

Table: state​

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
serviceUtf8The name of the invoked service.foo.bar.Greeter
service_keyUtf8The service key.bob
keyUtf8The utf8 user-supplied state key.A snippet like ctx.set(β€œseen”, 1); Will produce a value like: seen
valueBinaryA binary, uninterpreted representation of the value. You can use the more specific column value_utf8 if the value is a string.
value_utf8Utf8Only contains meaningful values when a service stores state as utf8. This is the case for TypeScript services since the TypeScript SDK serializes values as JSON.1

Table: sys_status​

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
serviceUtf8The name for the invoked service.foo.bar.Greeter
methodUtf8The invoked RPC method.greet
service_keyUtf8The service key.bob
statusUtf8Enum value: invoked or suspended.
idUtf8Invocation ID, an opaque token that can be used to cancel an invocation of a service with the admin API.
invoked_byUtf8Enum describing the invoker of this service: ingress = invoked externally / service = invoked by a service.
invoked_by_serviceUtf8The name of the invoking service. Or null if invoked via the ingress.com.example.Greeter
invoked_by_idUtf8The Invocation ID of the service that triggered this invocation. Or null if invoked externally.
pinned_deployment_idUtf8The opaque service deployment ID that has been committed for this invocation; this is set after the first journal entry is stored for this invocation.
trace_idUtf8The ID of the trace that is assigned to this invocation. Only relevant when tracing is enabled.
journal_sizeUInt32The number of journal entries durably logged for this invocation.
created_atDate64Timestamp indicating the start of this invocation.
modified_atDate64Timestamp indicating the last state transition. For example, last time the status changed from invoked to suspended.

Table: sys_invocation_state​

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
serviceUtf8The name for the invoked service.foo.bar.Greeter
service_keyUtf8The service key.bob
idUtf8Invocation ID, an opaque token that can be used to cancel an invocation of a service with the admin API.
in_flightBooleanIndicates whether there is currently an attempt running for this invocation.
retry_countUInt64The number of attempts since the last successful attempt of this invocation. Increments on start, so 2 or more means a failure occurred.
last_start_atDate64Timestamp indicating the start of the most recent attempt of this invocation.
last_attempt_deployment_idUtf8The opaque service deployment ID that was used in the most recent attempt of this invocation; this will be set before a journal entry is stored, but can change later.
next_retry_atDate64Timestamp indicating the start of the next attempt of this invocation.
last_failureUtf8An error message describing the most recent failed attempt of this invocation, if any.
last_error_codeUtf8The error code of the most recent failed attempt of this invocation, if any.

Table: sys_journal​

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
serviceUtf8The name for the invoked service.foo.bar.Greeter
service_keyUtf8The service key.bob
indexUInt32The index of this journal entry, where PollInputStream will be index 0
entry_typeUtf8Enum value: one of PollInputStream, OutputStream, GetState, SetState, ClearState, Sleep, Invoke, BackgroundInvoke, Awakeable, CompleteAwakeable, Custom.
completedBooleanIndicates whether this journal entry has been completed; this is only valid for some entry types.
invoked_idUtf8If this entry represents an outbound invocation, indicates the ID of that invocation.
invoked_serviceUtf8If this entry represents an outbound invocation, indicates the name of the invoked service.com.example.Greeter
invoked_methodUtf8If this entry represents an outbound invocation, indicates the name of the invoked method.Greet
invoked_service_keyBinaryIf this entry represents an outbound invocation, indicates the key of that invocation.bob

Table: sys_inbox​

Column nameTypeDescriptionExample
idUtf8Invocation ID, an opaque token that can be used to cancel an invocation of a service with the admin API.
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
serviceUtf8The name for the invoked service.foo.bar.Greeter
methodUtf8The invoked RPC method.greet
service_keyUtf8The service key.bob
sequence_numberUInt64Internal identified. Can be ignored.
invoked_byUtf8Enum describing the invoker of this service: ingress = invoked externally / service = invoked by a service.
invoked_by_serviceUtf8The name of the invoking service. Or null if invoked via the ingress.com.example.Greeter
invoked_by_idUtf8The Invocation ID of the service that triggered this invocation. Or null if invoked externally.
trace_idUtf8The ID of the trace that is assigned to this invocation. Only relevant when tracing is enabled.
created_atDate64Timestamp indicating the start of this invocation.

Table: sys_service​

Column nameTypeDescriptionExample
nameUtf8The name of the registered user servicecom.example.Greeter
revisionUInt64The latest deployed revision5
publicBooleanWhether the service is accessible through the ingress endpoint or not
instance_typeUtf8Identifies if this is a Keyed, Unkeyed, or Singleton serviceKeyed
deployment_idUtf8The ID of the latest deployment

Table: sys_deployment​

Column nameTypeDescriptionExample
idUtf8The ID of the service deployment
tyUtf8The type of the endpoint, this can be http or lambdahttp
endpointUtf8The address of the endpoint (http URL or Lambda ARN)
created_atDate64Timestamp indicating the deployment registration time.