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

feat: Add documentation for Python 0.10.0 and 0.10.2 #1118

Merged
merged 3 commits into from
Jul 16, 2019
Merged
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
3 changes: 3 additions & 0 deletions __tests__/__snapshots__/documentation.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Array [
"_platforms/php/symfony2.json",
"_platforms/python.json",
"_platforms/python/aiohttp.json",
"_platforms/python/asgi.json",
"_platforms/python/bottle.json",
"_platforms/python/celery.json",
"_platforms/python/django.json",
Expand Down Expand Up @@ -315,6 +316,7 @@ Array [
"platforms/php/laravel/index.html",
"platforms/php/symfony/index.html",
"platforms/python/aiohttp/index.html",
"platforms/python/asgi/index.html",
"platforms/python/aws_lambda/index.html",
"platforms/python/bottle/index.html",
"platforms/python/celery/index.html",
Expand All @@ -326,6 +328,7 @@ Array [
"platforms/python/index.html",
"platforms/python/logging/index.html",
"platforms/python/pyramid/index.html",
"platforms/python/redis/index.html",
"platforms/python/rq/index.html",
"platforms/python/sanic/index.html",
"platforms/python/serverless/index.html",
Expand Down
6 changes: 6 additions & 0 deletions src/_data/platform_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
platformicon: python
framework: true

- name: ASGI
link: _documentation/platforms/python/asgi.md
platformicon: python
framework: true
hide_on_platforms_list: true

- name: Tornado
link: _documentation/platforms/python/tornado.md
platformicon: python
Expand Down
9 changes: 9 additions & 0 deletions src/_data/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@
wizard_parent: python
wizard:
- _documentation/platforms/python/aiohttp.md
-
slug: asgi
support_level: production
type: framework
name: ASGI
doc_link: /platforms/python/asgi/
wizard_parent: python
wizard:
- _documentation/platforms/python/wsgi.md
-
slug: tornado
support_level: production
Expand Down
34 changes: 34 additions & 0 deletions src/collections/_documentation/platforms/python/asgi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: ASGI
sidebar_order: 5
---

{% version_added 0.10.2 %}

<!-- WIZARD -->

The ASGI middleware can be used to instrument any [ASGI](https://asgi.readthedocs.io/en/latest/)-compatible web framework to attach request data for your events.

This can be used to instrument, for example [Starlette](https://www.starlette.io/middleware/) or [Django Channels 2.0](https://channels.readthedocs.io/en/latest/).

```python
import sentry_sdk
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware

from myapp import asgi_app

sentry_sdk.init(dsn="___PUBLIC_DSN___")

asgi_app = SentryAsgiMiddleware(asgi_app)
```

The middleware supports both ASGI 2 and ASGI 3 transparently.

<!-- TODO-ADD-VERIFICATION-EXAMPLE -->
<!-- ENDWIZARD -->

## Behavior

* {% include platforms/python/request-data.md %}

* The ASGI middleware does not behave like a regular integration. It is not initialized through an extra parameter to `init` and is not attached to a client. When capturing or supplementing events, it just uses the currently active hub.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ The stdlib integration instruments certain modules in the standard library to em

* Any outgoing HTTP request done with `httplib` will result in a [breadcrumb]({%- link _documentation/enriching-error-data/breadcrumbs.md -%}) being logged. `urllib3` and `requests` use `httplib` under the hood, so HTTP requests from those packages should be covered as well.

* {% version_added 0.10.0 %} Subprocesses spawned with the `subprocess` module will result in a [breadcrumb]({%- link _documentation/enriching-error-data/breadcrumbs.md -%}) being logged.

## Modules
*Import name: `sentry_sdk.integrations.modules.ModulesIntegration`*

Expand Down
2 changes: 2 additions & 0 deletions src/collections/_documentation/platforms/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ For more information, see:
- [Bottle]({%- link _documentation/platforms/python/bottle.md -%})
- [Falcon]({%- link _documentation/platforms/python/falcon.md -%})
- [Generic WSGI]({%- link _documentation/platforms/python/wsgi.md -%})
- [Generic ASGI]({%- link _documentation/platforms/python/asgi.md -%})

#### Task Queues

Expand All @@ -302,6 +303,7 @@ For more information, see:

- [Logging]({%- link _documentation/platforms/python/logging.md -%})
- [GNU Backtrace]({%- link _documentation/platforms/python/gnu_backtrace.md -%})
- [Redis]({%- link _documentation/platforms/python/redis.md -%})

### Default Integrations

Expand Down
22 changes: 22 additions & 0 deletions src/collections/_documentation/platforms/python/redis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Redis
sidebar_order: 5
---

{% version_added 0.10.0 %}

<!-- WIZARD -->
The Redis integration hooks into the [Redis client for Python](https://pypi.org/project/redis/) and logs all Redis commands as [breadcrumbs]({%- link _documentation/enriching-error-data/breadcrumbs.md -%}).

```python
import sentry_sdk
from sentry_sdk.integrations.redis import RedisIntegration

sentry_sdk.init(
dsn='___PUBLIC_DSN___",
integrations=[RedisIntegration()]
)
```

<!-- TODO-ADD-VERIFICATION-EXAMPLE -->
<!-- ENDWIZARD -->