Skip to content

Commit 1204b7f

Browse files
authored
feat(toggle): Updating toggle docs (#13607)
## DESCRIBE YOUR PR * This PR updates the toggle documentation for devservices to give a more detailed view of what it does and how and when it should be used. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs)
1 parent 71c4ce9 commit 1204b7f

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

develop-docs/development-infrastructure/devservices.mdx

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,62 @@ devservices up --mode symbolicator
8484
8585
## Running a dependency locally
8686
87-
If you want to run a dependency locally rather than as a container, you can do so by toggling the runtime to LOCAL.
87+
You can run a dependency locally instead of as a container by toggling its runtime via the `devservices toggle` command.
8888
89-
For example, if you are running Sentry and want to use your local Snuba, you can do the following:
89+
### Toggle to local runtime
90+
91+
For example, if you're running Sentry and want to run Snuba **locally** from source, you can toggle Snuba to the local runtime like this:
92+
93+
```shell
94+
devservices toggle snuba
95+
```
96+
97+
or you can specify the runtime explicitly:
9098

9199
```shell
92100
devservices toggle snuba LOCAL
93101
```
94102

95-
This will tell devservices to not bring up snuba and its dependencies, allowing you to run snuba locally instead.
103+
This tells devservices to treat Snuba as a service that should be started alongside dependent services like Sentry. Dependencies of Snuba, such as Redis, Kafka, and Clickhouse, will still run as containers.
104+
105+
<Alert title="Note">
106+
Toggling to LOCAL does not start the dev server for that service. You'll need to start that manually.
107+
</Alert>
108+
109+
### What happens when you toggle
110+
111+
If Sentry is already running, toggling Snuba to LOCAL will:
112+
1. Stop Snuba's containers (unless shared by another service)
113+
2. Start Snuba's non-local dependencies (Redis, Kafka, Clickhouse) as containers
114+
115+
If Sentry is not yet running, the next time `devservices up` is run, Snuba (and any other services you toggle to LOCAL) will be automatically started as local services alongside Sentry.
116+
117+
If you want to bring up Snuba, or other local runtime dependencies in a non-default mode, you can:
118+
1. Tell devservices to not bring them up automatically by passing the `--exclude-local` flag to `devservices up`.
119+
2. Bring that mode up manually via `devservices up --mode <mode>` since modes are additive.
120+
3. Bring that service down and back up again with the new mode.
121+
122+
### Bringing down services with local runtimes
123+
124+
When stopping services with `devservices down`, the default behavior is to stop all services and their dependencies, including dependencies with local runtimes.
125+
126+
If you don't want dependencies with local runtimes to be brought down when bringing down a dependent service, you can pass the `--exclude-local` flag to `devservices down`. This tells devservices to only stop dependencies that are not running with local runtimes.
127+
128+
### Toggle back to containerized runtime
129+
130+
To switch a service back to running in a container, you can do the following:
131+
132+
```shell
133+
devservices toggle snuba
134+
```
96135

97-
To toggle the runtime back to using the container, you can do the following:
136+
Or explicitly specify the runtime:
98137

99138
```shell
100139
devservices toggle snuba CONTAINERIZED
101140
```
102141

103-
If you don't provide a runtime when toggling, it will toggle to the opposite of the current runtime.
142+
Replace `snuba` with the name of the service you want to toggle.
104143

105144
## Migrating data from the deprecated `sentry devservices`
106145

0 commit comments

Comments
 (0)