Skip to main content

SQL Introspection API

This page contains the reference of the introspection tables. To learn how to access the introspection interface, check out the introspection documentation.

Table: sys_deployment

Column nameTypeDescription
idUtf8The ID of the service deployment.
tyUtf8The type of the endpoint. Either http or lambda.
endpointUtf8The address of the endpoint. Either HTTP URL or Lambda ARN.
created_atTimestampMillisecondTimestamp indicating the deployment registration time.
min_service_protocol_versionUInt32Minimum supported protocol version.
max_service_protocol_versionUInt32Maximum supported protocol version.
servicesUtf8 ListList of service names registered by this deployment.

Table: sys_inbox

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
service_nameUtf8The name of the invoked virtual object/workflow.
service_keyUtf8The key of the virtual object/workflow.
idUtf8Invocation ID.
sequence_numberUInt64Sequence number in the inbox.
created_atTimestampMillisecondTimestamp indicating the start of this invocation. DEPRECATED: you should not use this field anymore, but join with the sys_invocation table

Table: sys_journal

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
idUtf8Invocation ID.
indexUInt32The index of this journal entry.
entry_typeUtf8The entry type. You can check all the available entry types in entries.rs.
nameUtf8The name of the entry supplied by the user, if any.
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_targetUtf8If this entry represents an outbound invocation, indicates the invocation Target. Format for plain services: ServiceName/HandlerName, e.g. Greeter/greet. Format for virtual objects/workflows: VirtualObjectName/Key/HandlerName, e.g. Greeter/Francesco/greet.
sleep_wakeup_atTimestampMillisecondIf this entry represents a sleep, indicates wakeup time.
promise_nameUtf8If this entry is a promise related entry (GetPromise, PeekPromise, CompletePromise), indicates the promise name.
rawBinaryRaw binary representation of the entry. Check the service protocol for more details to decode it.
raw_lengthUInt64The byte length of the raw entry. If you are writing a query that only needs to know the length, reading this field will be much more efficient than reading length(raw).
versionUInt32The journal version.
entry_jsonUtf8The entry serialized as a JSON string. Filled only if journal version is 2.
entry_lite_jsonUtf8The EntryLite projection serialized as a JSON string. Filled only if journal version is 2.
appended_atTimestampMillisecondWhen the entry was appended to the journal. Filled only if journal version is 2.

Table: sys_journal_events

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
idUtf8Invocation ID.
after_journal_entry_indexUInt32The journal index after which this event happened. This can be used to establish a total order between events and journal entries.
appended_atTimestampMillisecondWhen the entry was appended to the journal.
event_typeUtf8The event type.
event_jsonUtf8The event serialized as a JSON string.

Table: sys_keyed_service_status

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
service_nameUtf8The name of the invoked virtual object/workflow.
service_keyUtf8The key of the virtual object/workflow.
invocation_idUtf8Invocation ID.

Table: sys_promise

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
scopeUtf8The scope of the workflow instance, if scoped. NULL for unscoped entries. Since v1.7.0
service_nameUtf8The name of the workflow service.
service_keyUtf8The workflow ID.
keyUtf8The promise key.
completedBooleanTrue if the promise was completed.
completion_success_valueBinaryThe completion success, if any.
completion_success_value_utf8Utf8The completion success as UTF-8 string, if any.
completion_failureUtf8The completion failure, if any.

Table: sys_scheduler

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning. Can be ignored.
idUtf8Identifier of the scheduled vqueue (vq_…).
num_inboxUInt64Number of entries currently waiting in the inbox stage.
statusUtf8High-level scheduler state (Dormant, Ready, BlockedOn, …).
head_entry_idUtf8Identifier of the head entry if the scheduler has already advanced to it. Null when the head has not yet been materialized
scheduled_atTimestampMillisecondEarliest time when the head entry becomes runnable. Set only when status is Scheduled.
blocked_onUtf8Detailed blocking resource when status is BlockedOn.
invoker_concurrency_block_durationDurationMillisecondTime the head entry spent waiting on global invoker concurrency.
throttling_rules_block_durationDurationMillisecondTime the head entry spent waiting on user-defined per-vqueue throttling rules.
invoker_throttling_block_durationDurationMillisecondTime the head entry spent waiting on node-level invoker throttling.
invoker_memory_block_durationDurationMillisecondTime the head entry spent waiting on invoker memory pool capacity.
concurrency_rules_block_durationDurationMillisecondTime the head entry spent waiting on user-defined concurrency rules.
lock_block_durationDurationMillisecondTime the head entry spent waiting on virtual-object locks.
deployment_concurrency_block_durationDurationMillisecondTime the head entry spent waiting on deployment-level concurrency capacity.

Table: sys_service

Column nameTypeDescription
nameUtf8The name of the registered user service.
revisionUInt64The latest deployed revision.
publicBooleanWhether the service is accessible through the ingress endpoint or not.
tyUtf8The service type. Either service or virtual_object or workflow.
deployment_idUtf8The ID of the latest deployment

Table: state

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
scopeUtf8The scope of the Virtual Object instance, if scoped. NULL for unscoped entries. Since v1.7.0
service_nameUtf8The name of the invoked service.
service_keyUtf8The key of the Virtual Object.
keyUtf8The utf8 state key.
key_lengthUInt64The byte length of the state key. If you are writing a query that only needs to know the length, reading this field will be much more efficient than reading octet_length(key).
value_utf8Utf8Only contains meaningful values when a service stores state as utf8. This is the case for services that serialize state using JSON (default for Typescript SDK, Java/Kotlin SDK if using JsonSerdes).
valueBinaryA binary, uninterpreted representation of the value. You can use the more specific column value_utf8 if the value is a string.
value_lengthUInt64The byte length of the value. If you are writing a query that only needs to know the length, reading this field will be much more efficient than reading length(value).

Table: sys_vqueue_meta

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning. Can be ignored.
idUtf8The VQueue Identifier (vq_…)
is_activeBooleanWhether this vqueue is active or not. An active vqueue is a vqueue that is not paused, and has non-finished items.
queue_is_pausedBooleanWhether this vqueue is paused.
service_nameUtf8Service name linked to this vqueue
scopeUtf8The scope of this vqueue.
limit_keyUtf8The name of the limit-key assigned to this vqueue
lock_nameUtf8The name of the lock (in the format of service/key) This is only set if this is a vqueue for a virtual object.
created_atTimestampMillisecondWhen was this vqueue first created
last_enqueued_atTimestampMillisecondLast timestamp an entry moved into Inbox. This covers items enqueued for the first time only.
last_start_atTimestampMillisecondLast timestamp an entry first transitioned to Run.
last_attempt_atTimestampMillisecondLast timestamp an entry transitioned to Run.
last_finish_atTimestampMillisecondLast timestamp an entry transitioned to Finished.
avg_queue_durationDurationMillisecondExponential moving average (EMA) of first-attempt queue wait time.
avg_inbox_durationDurationMillisecondExponential moving average (EMA) of how long entries stayed in inbox.
avg_run_durationDurationMillisecondExponential moving average (EMA) of how long entries stayed running.
avg_suspension_durationDurationMillisecondExponential moving average (EMA) of how long entries stayed suspended.
avg_end_to_end_durationDurationMillisecondExponential moving average (EMA) of end-to-end entry lifetime from first-runnable time to completion. Note that this only tracks entries that were not killed/cancelled or failed/paused.
avg_blocked_on_concurrency_rulesDurationMillisecondExponential moving average (EMA) of time the head item spent blocked on user-defined concurrency rules before entering Running. Sampled on every Inbox → Running transition (every run attempt, including retries).
avg_blocked_on_invoker_concurrencyDurationMillisecondExponential moving average (EMA) of time the head item spent blocked on node-level invoker concurrency tokens before entering Running.
avg_blocked_on_invoker_throttlingDurationMillisecondExponential moving average (EMA) of time the head item spent blocked on node-level invoker throttling before entering Running. Sampled on every Inbox → Running transition (every run attempt, including retries).
avg_blocked_on_lockDurationMillisecondExponential moving average (EMA) of time the head item spent blocked on a virtual object lock before entering Running.
num_inboxUInt64The number of entries that are in the inbox. The inbox is the priority queue that the scheduler uses to choose which entries to run next.
num_runningUInt64The number of entries that are currently running.
num_suspendedUInt64The number of entries that are suspended.
num_pausedUInt64The number of entries that are paused.
num_finishedUInt64The number of entries that have finished processing and are pending deletion or archival.

Table: sys_vqueues

Column nameTypeDescription
partition_keyUInt64Internal column that is used for partitioning. Can be ignored.
idUtf8The VQueue Identifier (vq_…).
stageUtf8The stage this entry currently belongs to. Choices are ‘inbox’, ‘running’, ‘paused’, ‘suspended’, and ‘finished’.
statusUtf8The entry processing status. Examples are new, scheduled, started, backing-off, yielded, killed, cancelled, failed, and succeeded. Note that in stages some cases, the status will reflect the old status prior to transitioning into the current stage. We preserve the last known status because it will be useful to know when the entry transitions out of the current stage.
has_lockBooleanWhether this entry currently holds a lock.
run_atTimestampMillisecondThe entry will be eligible to run after this timestamp. Only present for entries that are in the stage=inbox.
sequence_numberUInt64Sequence number encoded in the queue ordering key.
entry_idUtf8Identifier of the entry.
entry_kindUtf8Entry kind (invocation or state-mutation).
created_atTimestampMillisecondCreation timestamp of the entry.
transitioned_atTimestampMillisecondTimestamp of the latest stage transition.
num_attemptsUInt32Number of times this entry has been moved to the run queue.
num_errorsUInt32Number of times this entry has yielded execution due to transient errors.
num_pausesUInt32Number of times this entry has been moved to the paused stage.
num_suspensionsUInt32Number of times this entry has been moved to the suspended stage.
num_yieldsUInt32Number of times this entry has yielded execution.
first_attempt_atTimestampMillisecondTimestamp of the first attempt to run this entry.
latest_attempt_atTimestampMillisecondTimestamp of the latest attempt to run this entry.
first_runnable_atTimestampMillisecondThe realistic earliest time at which this entry can run its first attempt.
deploymentUtf8If set, the entry’s pinned deployment identifier.

Table: sys_invocation

Column nameTypeDescription
idUtf8Invocation ID.
vqueue_idUtf8The VQueue assigned to the the invocation. NULL if invocation was not migrated to vqueues. Since v1.7.0.
targetUtf8Invocation Target. Format for plain services: ServiceName/HandlerName, e.g. Greeter/greet. Format for virtual objects/workflows: VirtualObjectName/Key/HandlerName, e.g. Greeter/Francesco/greet.
target_service_nameUtf8The name of the invoked service.
target_service_keyUtf8The key of the virtual object or the workflow ID. Null for regular services.
target_handler_nameUtf8The invoked handler.
target_service_tyUtf8The service type. Either service or virtual_object or workflow.
scopeUtf8The scope of the invocation for vqueue partitioning, if scoped. NULL for unscoped invocations. Since v1.7.0.
limit_keyUtf8The limit key that was used for the invocation. NULL if no limit key was set. Since v1.7.0.
idempotency_keyUtf8Idempotency key, if any.
invoked_byUtf8Either: * ingress if the invocation was created externally. * service if the invocation was created by another Restate service. * subscription if the invocation was created by a subscription (e.g. Kafka). * restart_as_new if the invocation was created by restarting an old invocation as new.
invoked_by_service_nameUtf8The name of caller service if invoked_by = 'service'.
invoked_by_idUtf8The caller Invocation ID if invoked_by = 'service'.
invoked_by_subscription_idUtf8The subscription id if invoked_by = 'subscription'.
invoked_by_targetUtf8The caller invocation target if invoked_by = 'service'.
restarted_fromUtf8The original invocation id if invoked_by = 'restart_as_new'.
pinned_deployment_idUtf8The ID of the service deployment that started processing this invocation, and will continue to do so (e.g. for retries). This gets set after the first journal entry has been stored for this invocation.
pinned_service_protocol_versionUInt32The negotiated protocol version used for this invocation. This gets set after the first journal entry has been 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.
journal_commands_sizeUInt32The number of commands generated by this invocation, stored in the journal. Only relevant when pinned_service_protocol_version >= 4.
created_atTimestampMillisecondTimestamp indicating the start of this invocation.
created_using_restate_versionUtf8restate-server version in use when this invocation was created.
modified_atTimestampMillisecondTimestamp indicating the last invocation status transition. For example, last time the status changed from invoked to suspended.
inboxed_atTimestampMillisecondTimestamp indicating when the invocation was inboxed, if ever.
scheduled_atTimestampMillisecondTimestamp indicating when the invocation was scheduled, if ever.
scheduled_start_atTimestampMillisecondIf the invocation was scheduled, indicates the timestamp when the invocation should start.
running_atTimestampMillisecondTimestamp indicating when the invocation first transitioned to running, if ever.
completed_atTimestampMillisecondTimestamp indicating when the invocation was completed, if ever.
completion_retentionDurationMillisecondFor how long the metadata of this invocation, including its result, is retained after completion.
journal_retentionDurationMillisecondFor how long the journal is retained after completion.
suspended_waiting_for_completionsUInt32 ListList of completion ids the invocation is awaiting on, if status = suspended. DEPRECATED: use suspended_waiting_future_json instead.
suspended_waiting_for_signalsUInt32 ListList of signals the invocation is awaiting on, if status = suspended. DEPRECATED: use suspended_waiting_future_json instead.
suspended_waiting_future_jsonUtf8Future tree the invocation is suspended on, if status = suspended.
retry_countUInt64The number of invocation attempts since the current leader started executing it. Increments on start, so a value greater than 1 means a failure occurred. Note: the value is not a global attempt counter across invocation suspensions and leadership changes.
last_start_atTimestampMillisecondTimestamp indicating the start of the most recent attempt of this invocation.
next_retry_atTimestampMillisecondTimestamp indicating the start of the next attempt of this invocation.
last_attempt_deployment_idUtf8The ID of the service deployment that executed the most recent attempt of this invocation; this is set before a journal entry is stored, but can change later.
last_attempt_serverUtf8Server/SDK version, e.g. restate-sdk-java/1.0.1
last_failureUtf8An error message describing the most recent failed attempt of this invocation, if any.
last_failure_error_codeUtf8The error code of the most recent failed attempt of this invocation, if any.
last_failure_related_entry_indexUInt64The index of the journal entry that caused the failure, if any. It may be out-of-bound of the currently stored entries in sys_journal. DEPRECATED: you should not use this field anymore, but last_failure_related_command_index instead.
last_failure_related_entry_nameUtf8The name of the journal entry that caused the failure, if any. DEPRECATED: you should not use this field anymore, but last_failure_related_command_name instead.
last_failure_related_entry_typeUtf8The type of the journal entry that caused the failure, if any. You can check all the available entry types in entries.rs. DEPRECATED: you should not use this field anymore, but last_failure_related_command_type instead.
last_failure_related_command_indexUInt64The index of the command in the journal that caused the failure, if any. It may be out-of-bound of the currently stored commands in sys_journal.
last_failure_related_command_nameUtf8The name of the command that caused the failure, if any.
last_failure_related_command_typeUtf8The type of the command that caused the failure, if any. You can check all the available command types in entries.rs.
last_awaiting_on_future_jsonUtf8Last known future the SDK was awaiting on, if in_flight = true.
statusUtf8Either pending or scheduled or ready or running or paused or backing-off or suspended or completed.
completion_resultUtf8If status = 'completed', this contains either success or failure
completion_failureUtf8If status = 'completed' AND completion_result = 'failure', this contains the error cause