Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Liza Mock <liza.mock@sentry.io>
  • Loading branch information
antonpirker and lizokm committed Jul 29, 2024
1 parent 57c33e4 commit 87d4fd6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To trigger an unhandled error:

2. Point your browser to `http://localhost:8000/unhandled`.

2. If you've set up an alert rule, you should be notified about the error. Otherwise, open the **Issues** page in your Sentry account.
2. If you've set up an [alert rule](/product/alerts/create-alerts/), you should be notified about the error. Otherwise, open the [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues/) page in your Sentry account.

3. You should see the unhandled exception in the list of issues.

Expand Down Expand Up @@ -91,8 +91,8 @@ Typically, `capture_message` is not emitted, but there are times when a develope
3. To try it out on your localhost, trigger the following endpoint: `http://localhost:8000/message`.

4. As before, open the new issue’s detail page from the **Issues** page.
<Alert level="info">
**Note:** You need to remove the `"issue.priority is high or medium"` filter from issue's page "Custom Search" field to see the messages in the issues list.
<Alert>
You'll need to remove the `"issue.priority is high or medium"` filter from the "Custom Search" field on the [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues/) page to see all the issue types in the list.
</Alert>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ To add breadcrumbs to our app:

1. Open the file `myapp > view.py`.

2. Notice that we import `sentry_sdk` lib which contains the `add_breadcrumb` method:
2. Notice that we import the `sentry_sdk` lib, which contains the `add_breadcrumb` method:

```python {filename: myapp/views.py}
import sentry_sdk
```

3. We create a custom breadcrumb for each method handler in the view classes. This breadcrumb will be added to the trail of breadcrumbs associated with any error triggered through these method call flows. For instance, under `HandledErrorView.get`:
3. We then create a custom breadcrumb for each method-handler in the view classes. This breadcrumb gets added to the trail of breadcrumbs associated with any error triggered through these method call flows. For instance, under `HandledErrorView.get`:

```python {filename: myapp/views.py}
sentry_sdk.add_breadcrumb(
Expand Down
14 changes: 8 additions & 6 deletions docs/product/sentry-basics/integrate-backend/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ Sentry captures data by using a platform-specific SDK within your application ru

1. Install the `sentry-sdk` by defining the dependency in the `requirements.txt` file. The SDK documentation and release information are available in the [Sentry SDK](https://github.com/getsentry/sentry-python) GitHub repository.

2. Open the `settings.py` file (located under `./backend-monitoring/myproject/settings.py`). This is where we initialize and configure the Sentry SDK in our application.
2. Open the `settings.py` file (located under `./backend-monitoring/myproject/settings.py`). This is where we import, initialize, and configure the Sentry SDK in our application.

3. In `settings.py` we import and initialize the Sentry SDK.

```python {filename: myproject/settings.py}
import sentry_sdk
Expand Down Expand Up @@ -130,14 +129,17 @@ To build and run the demo application on your localhost:
7. Follow the `deploy` target execution flow.
Notice that in addition to installing Python requirements and running the server, we also use the `sentry-cli` to create a new Sentry release, and associate commits to that release. Sentry will lookup through those commits when suggesting a suspect commit for your project issues.
Commands mentioned within the `Makefile` will be explained in detail in the next part of the tutorial, [Configuration Options](/product/sentry-basics/integrate-backend/configuration-options/).
Commands mentioned within the `Makefile` will be explained in detail in the next part of the tutorial, [Configuration Options](/product/sentry-basics/integrate-backend/configuration-options/).
8. To execute the `sentry-cli` commands, follow the instructions described [here](/product/sentry-basics/integrate-frontend/upload-source-maps/#step-1-prepare-the-build-environment) to obtain the values for your `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, and `SENTRY_PROJECT` environment variables.
<Note>
In addition to installing Python requirements and running the server, we also use the `sentry-cli` to create a new Sentry release and associate commits to that release. Sentry will look through these commits when flagging a suspect commit.
</Note>
8. To execute the `sentry-cli` commands, follow these [instructions](/product/sentry-basics/integrate-frontend/upload-source-maps/#step-1-prepare-the-build-environment) to obtain the values for your `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, and `SENTRY_PROJECT` environment variables.
![Makefile Config](./img/makefile_config.png)
> The `sentry-cli` can be configured by providing these values either through environment variables or through a dedicated configuration file. Learn more in [Sentry CLI > Configuration and Authentication](/product/cli/configuration/).
> The `sentry-cli` can be configured by providing these values either through environment variables or through a dedicated configuration file. Learn more in [Sentry CLI: Configuration and Authentication](/product/cli/configuration/).
9. Run the following command to install the required Python libraries, set up the Sentry Release, and run the Django server:
Expand Down

0 comments on commit 87d4fd6

Please sign in to comment.