-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable edge runtime inspector feature (#2308)
* feat: enable edge runtime inspector feature * stamp: typo * stamp: add doc for functions inspector capability * stamp: move `functions_inspector_port` to the edge runtime section * stamp: reflect suggestions * stamp: update doc * stamp: oops * stamp: add nil guard * stamp: polishing * stamp: dot * stamp: disable wall clock limit when inspect capability has been enabled * stamp: disambiguate acceptable value of `inspect-mode` flag * stamp: reflect suggestions (2) * stamp: remove `wallclock-limit-sec` * stamp: make wallclock limit to zero when inspector is enabled * chore: simplify flag parsing * chore: remove wall clock option * fix: move request policy to config toml * stamp: add an extra service path for getting runtime metrics * stamp: update doc * chore: remove subheadings from docs --------- Co-authored-by: Qiao Han <qiao@supabase.io> Co-authored-by: Han Qiao <sweatybridge@gmail.com>
- Loading branch information
1 parent
672a9fb
commit 6ff7f50
Showing
9 changed files
with
172 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## supabase-functions-serve | ||
|
||
Serve all Functions locally. | ||
|
||
`supabase functions serve` command includes additional flags to assist developers in debugging using tools like `DevTools`. | ||
|
||
1. `--inspect` | ||
* Alias of `--inspect-mode run`. | ||
|
||
2. `--inspect-mode [ run | brk | wait ]` | ||
* Activates the inspector capability. | ||
* `run` mode simply allows a connection without additional behavior. It is not ideal for short scripts, but it can be useful for long-running scripts where you might occasionally want to set breakpoints. | ||
* `brk` mode same as `run` mode, but additionally sets a breakpoint at the first line to pause script execution before any code runs. | ||
* `wait` mode similar to `brk` mode, but instead of setting a breakpoint at the first line, it pauses script execution until an inspector session is connected. | ||
|
||
3. `--inspect-main` | ||
* Can only be used when one of the above two flags is enabled. | ||
* By default, creating an inspector session for the main worker is not allowed, but this flag allows it. | ||
* Other behaviors follow the `inspect-mode` flag mentioned above. | ||
|
||
Additionally, the following properties can be customised via `supabase/config.toml` under `edge_runtime` section. | ||
|
||
1. `inspector_port` | ||
* The port used to listen to the Inspector session, defaults to 8083. | ||
2. `policy` | ||
* A value that indicates how the edge-runtime should forward incoming HTTP requests to the worker. | ||
* `per_worker` allows multiple HTTP requests to be forwarded to a worker that has already been created. | ||
* `oneshot` will force the worker to process a single HTTP request and then exit. (Debugging purpose, This is especially useful if you want to reflect changes you've made immediately.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.