Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restate introspection SQL API reference #107

Merged
merged 2 commits into from
Aug 8, 2023
Merged

Restate introspection SQL API reference #107

merged 2 commits into from
Aug 8, 2023

Conversation

gvdongen
Copy link
Contributor

@gvdongen gvdongen commented Aug 3, 2023

Fixes #104

  • Adds reference doc on the content of the exposed tables sys_status and state

@igalshilman This is the markdown version of the table you sent me. Let me know if something should be changed.

@netlify
Copy link

netlify bot commented Aug 3, 2023

Deploy Preview for docsrestatedev ready!

Name Link
🔨 Latest commit c00e792
🔍 Latest deploy log https://app.netlify.com/sites/docsrestatedev/deploys/64d21158993cac00089e85b1
😎 Deploy Preview https://deploy-preview-107--docsrestatedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@igalshilman igalshilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect, thanks!

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR @gvdongen. I stumbled upon two minor question when I tried merging this PR. Maybe @igalshilman you know more because you were more in the loop. Once they are resolved, I think we should merge this PR.

Comment on lines 17 to 19
| `service_key_utf8` | `utf8` | Only contains meaningful values when a service uses a `utf8` Restate key | `bob` |
| `service_key_int32` | `Int32` | Only contains meaningful values when a service uses an `int32` Restate key | `1337` |
| `service_key_uuid` | `utf8` | Only contains meaningful values for unkeyed Restate services | `0189bab3b3397d828e979e2548980fa6` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we deliberately leave out the service_key column because it is not useful for users? Do you maybe know more @igalshilman?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed less useful, not sure if it wasn't included because of that. You can include for a more complete reference if you wish.

A possible description: a binary, uninterpreted representation of the service key. You can use a more specific column based on the type of your key, such as service_key_utf8 (for string keys), serivce_key_uuid for unkeyed services, or service_key_int32 for integer keys.

| `invoked_by_service` | `utf8` | The name of the invoking service. Or `null` if invoked via the ingress. | `com.example.Greeter` |
| `invoked_by_sid` | `utf8` | The service invocation ID of the service that triggered this invocation. Or `null` if invoked via the ingress. | |
| `trace_id` | `utf8` | The ID of the trace that is assigned to this invocation. Only relevant when tracing is enabled. | |
| `journal_size` | `uint32` | The number of journal entries durably logged for this invocation | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `journal_size` | `uint32` | The number of journal entries durably logged for this invocation | |
| `journal_size` | `UInt32` | The number of journal entries durably logged for this invocation | |

| `service_key_uuid` | `utf8` | Only contains meaningful values for unkeyed Restate services | `0189bab3b3397d828e979e2548980fa6` |
| `key` | `utf8` | The `utf8` user-supplied state key | A snippet like `ctx.set(“seen”, 1);` Will produce a value like: `seen` |
| `value_utf8` | `utf8` | Only 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` |
| `value` | | | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to not further specify the value column because value_utf8 will only be used by our users? Do you maybe know more @igalshilman?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer as for the other table :-)

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this PR now.

@tillrohrmann tillrohrmann merged commit c00e792 into main Aug 8, 2023
5 checks passed
@tillrohrmann tillrohrmann deleted the issue#104 branch August 9, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add references on Restate SQL introspection API (column types and descriptions, key queries, etc...)
3 participants