Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 5 additions & 96 deletions docs/platforms/python/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,7 @@ This guide focuses on plain Python. If you're working with Django, FastAPI, Star

## Install

<SplitLayout>
<SplitSection>
<SplitSectionText>

Run the command for your preferred package manager to add the Sentry SDK to your application:

</SplitSectionText>
<SplitSectionCode>

```bash {tabTitle:pip}
pip install "sentry-sdk"
```

```bash {tabTitle:uv}
uv add "sentry-sdk"
```

```bash {tabTitle:poetry}
poetry add "sentry-sdk"
```

</SplitSectionCode>
</SplitSection>
</SplitLayout>
<PlatformContent includePath="getting-started-install" />

## Configure

Expand Down Expand Up @@ -180,11 +157,7 @@ def some_function():

Let's test your setup and confirm that data reaches your Sentry project.

<Alert level="warning">

Errors triggered from a Python shell like IPython will not trigger Sentry's error monitoring. Make sure you're running the examples from a file instead.

</Alert>
<Include name="python-quick-start-shell-warning.mdx" />

### Issues

Expand All @@ -209,83 +182,19 @@ division_by_zero = 1 / 0

<OnboardingOption optionId="performance">

### Tracing

<SplitLayout>
<SplitSection>
<SplitSectionText>

To test your tracing configuration, create a custom transaction and span:

</SplitSectionText>
<SplitSectionCode>

```py
import sentry_sdk

with sentry_sdk.start_transaction(op="task", name="Transaction Name"):
span = sentry_sdk.start_span(name="Custom Span Name")
span.finish()
```

</SplitSectionCode>
</SplitSection>
</SplitLayout>
<Include name="tracing/python-quick-start-verify-tracing-splitlayout.mdx" />

</OnboardingOption>

<OnboardingOption optionId="logs">

### Logs

<SplitLayout>
<SplitSection>
<SplitSectionText>

To verify that Sentry catches your logs, add some log statements to your application:

</SplitSectionText>
<SplitSectionCode>

```py
import sentry_sdk

sentry_sdk.logger.info("This is an info log message")
sentry_sdk.logger.warning("This is a warning message")
sentry_sdk.logger.error("This is an error message")
```

</SplitSectionCode>
</SplitSection>
</SplitLayout>
<Include name="logs/python-quick-start-verify-logs-splitlayout.mdx" />

</OnboardingOption>

<OnboardingOption optionId="metrics">

### Metrics

<SplitLayout>
<SplitSection>
<SplitSectionText>

Send test metrics from your app to verify metrics are arriving in Sentry:

</SplitSectionText>
<SplitSectionCode>

```py
from sentry_sdk import metrics

metrics.count("checkout.failed", 1)
metrics.gauge("queue.depth", 42)
metrics.distribution("cart.amount_usd", 187.5)

```

</SplitSectionCode>
</SplitSection>
</SplitLayout>
<Include name="metrics/python-quick-start-verify-metrics-splitlayout.mdx" />

</OnboardingOption>

Expand Down
Loading
Loading