Skip to content

Tracing without performance documentation #7176

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

Merged
merged 119 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
ef7c7af
initial skeleton for tracing without performance documentation
stephanie-anderson Jun 15, 2023
eedae7a
notes about required content
stephanie-anderson Jun 15, 2023
cd63c8f
style(lint): Auto commit lint changes
getsantry[bot] Jun 15, 2023
f80799b
style(lint): Auto commit lint changes
getsantry[bot] Jun 15, 2023
0dd89f2
style(lint): Auto commit lint changes
getsantry[bot] Jun 15, 2023
5a2fb8f
Updated suppported frameworks
antonpirker Jun 15, 2023
7607580
troubleshooting page
stephanie-anderson Jun 15, 2023
2a9659c
Some manual instrumentation docs
antonpirker Jun 15, 2023
0a68f91
wording
antonpirker Jun 15, 2023
1dbe164
Document Apollo3 GraphQL client errors (#7135)
marandaneto Jun 15, 2023
e10a2a6
Update apollo3.mdx (#7150)
lizokm Jun 15, 2023
328ce33
Update Apollo3.mdx for Java to match the one for Android (#7165)
lizokm Jun 15, 2023
4e871eb
unify wording for custom integration (manual vs. custom) (#7179)
stephanie-anderson Jun 15, 2023
d254b4f
Renamed page and some wording
antonpirker Jun 15, 2023
0fdc186
Links to supported frameworks
antonpirker Jun 15, 2023
ef8aa71
Added missing file
antonpirker Jun 15, 2023
f1c3875
todo
antonpirker Jun 15, 2023
d99609f
Added missing file
antonpirker Jun 15, 2023
130141c
Instrumentation index page.
antonpirker Jun 15, 2023
94f722f
Wording
antonpirker Jun 15, 2023
bec1e01
move pages and partials
stephanie-anderson Jun 15, 2023
a91e1ec
style(lint): Auto commit lint changes
getsantry[bot] Jun 15, 2023
7893578
style(lint): Auto commit lint changes
getsantry[bot] Jun 15, 2023
891ff36
move python content into platform include files
stephanie-anderson Jun 19, 2023
7aca09b
Moved content to right places
antonpirker Jun 19, 2023
2e4cd3a
General explanation what distributed tracing does.
antonpirker Jun 19, 2023
645b52d
Some more general discription what distributed tracing is
antonpirker Jun 19, 2023
6e2ca95
wording
antonpirker Jun 19, 2023
4c1c6e0
Added trace to image
antonpirker Jun 19, 2023
b86fa89
Fixed links
antonpirker Jun 20, 2023
866c17f
Fixed links
antonpirker Jun 20, 2023
761b6ff
Fixed links
antonpirker Jun 20, 2023
832c952
Some work
antonpirker Jun 20, 2023
19f4801
Split stuff up into separate files
antonpirker Jun 20, 2023
ba1fb25
titles and some wording
antonpirker Jun 20, 2023
bb9794d
Wording and new image
antonpirker Jun 20, 2023
eb65f28
Added snippets for all frameworks where auto instrumentation works
antonpirker Jun 20, 2023
ebf3518
Better snip for tornado
antonpirker Jun 20, 2023
8f03409
Added details of headers
antonpirker Jun 21, 2023
7a3df8b
Added first version for JS
antonpirker Jun 21, 2023
895964e
Merge branch 'master' into tracing-without-performance
antonpirker Jun 21, 2023
babc2d6
style(lint): Auto commit lint changes
getsantry[bot] Jun 21, 2023
a64c62a
style(lint): Auto commit lint changes
getsantry[bot] Jun 21, 2023
b336485
style(lint): Auto commit lint changes
getsantry[bot] Jun 21, 2023
50f3719
Added custom instrumentation in JS
antonpirker Jun 21, 2023
2f28ea7
Some wording
antonpirker Jun 21, 2023
4fb6043
Fixed link to Js docs.
antonpirker Jun 22, 2023
de36ebd
Describe CORS in Python
antonpirker Jun 22, 2023
8b7c537
Added rendering trace information to meta
antonpirker Jun 22, 2023
61f3699
Link js to python meta tag
antonpirker Jun 22, 2023
9453f71
distributed tracing with performance monitoring
antonpirker Jun 22, 2023
1b9ce0d
Refactored snips to have better structure
antonpirker Jun 22, 2023
06c0e2e
Added missing files and removed empy troubleshooting page
antonpirker Jun 22, 2023
e5213ff
Added defaults
antonpirker Jun 22, 2023
7c2f84e
Bring back connect-services page
antonpirker Jun 22, 2023
1fb7952
Remove custom instrumentation from JS
antonpirker Jun 22, 2023
6418ac5
Fixed link
antonpirker Jun 22, 2023
701db81
Fixed some links
antonpirker Jun 22, 2023
5ecde09
Fixed more links
antonpirker Jun 22, 2023
0082b41
Update src/platforms/common/distributed-tracing/index.mdx
antonpirker Jun 23, 2023
0f9baa4
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 23, 2023
7b052e5
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 23, 2023
bfe0997
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 23, 2023
0d7922d
Update src/platforms/common/distributed-tracing/index.mdx
antonpirker Jun 23, 2023
eb61839
Better wording on integrations/frameworks that work out of the box.
antonpirker Jun 23, 2023
d09de53
Reworked cors headers docs
antonpirker Jun 23, 2023
1edd758
Wording
antonpirker Jun 23, 2023
4dacc2f
Removed useless stuff
antonpirker Jun 23, 2023
3698637
Cleanup
antonpirker Jun 23, 2023
6bdb0ff
Added missing image
antonpirker Jun 23, 2023
e7cdaf5
Wording
antonpirker Jun 23, 2023
f3c741e
Fixed links
antonpirker Jun 23, 2023
48ce7b9
Removed unused image
antonpirker Jun 26, 2023
9da6efd
Restructuring for redirects to work
antonpirker Jun 26, 2023
0c9d018
Added missing files
antonpirker Jun 26, 2023
9aac797
Fixed python redirects
antonpirker Jun 26, 2023
fd1afa0
Update src/platform-includes/distributed-tracing/set-up-distributed-t…
antonpirker Jun 28, 2023
70fb107
Update src/platform-includes/distributed-tracing/set-up-distributed-t…
antonpirker Jun 28, 2023
10cdaed
Update src/platform-includes/distributed-tracing/set-up-distributed-t…
antonpirker Jun 28, 2023
2b6bb57
Update src/platform-includes/distributed-tracing/set-up-distributed-t…
antonpirker Jun 28, 2023
e9a7276
Update src/platform-includes/distributed-tracing/instrumentation/cust…
antonpirker Jun 28, 2023
0535619
Update src/platform-includes/distributed-tracing/instrumentation/cust…
antonpirker Jun 28, 2023
9b2cf61
Update src/platform-includes/distributed-tracing/instrumentation/cust…
antonpirker Jun 28, 2023
8e46039
Update src/platform-includes/distributed-tracing/instrumentation/cust…
antonpirker Jun 28, 2023
2e8c2b7
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
e8f8055
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
114bdf7
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
ba5197d
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
3fb2d6d
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
e29907d
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
0e80afe
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
2f5a890
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
f8907be
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
1401b2e
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
2c9a200
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
0d39254
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
00eb45b
Update src/platform-includes/distributed-tracing/instrumentation/auto…
antonpirker Jun 28, 2023
89999de
Apply suggestions from code review
antonpirker Jun 28, 2023
ae5c41a
Apply suggestions from code review
antonpirker Jun 28, 2023
9958ef1
Apply suggestions from code review
antonpirker Jun 28, 2023
a97ca1a
Moved it up
antonpirker Jun 28, 2023
49afd7d
Update src/platform-includes/distributed-tracing/set-up-distributed-t…
antonpirker Jun 28, 2023
4159103
Merge branch 'master' into tracing-without-performance
antonpirker Jun 28, 2023
61eb4ea
style(lint): Auto commit lint changes
getsantry[bot] Jun 28, 2023
6c5f07a
style(lint): Auto commit lint changes
getsantry[bot] Jun 28, 2023
666797e
style(lint): Auto commit lint changes
getsantry[bot] Jun 28, 2023
d394fee
style(lint): Auto commit lint changes
getsantry[bot] Jun 28, 2023
65ef7d9
Merge branch 'master' into tracing-without-performance
stephanie-anderson Jun 28, 2023
7933dd7
move distributed tracing nav item into getting started
stephanie-anderson Jun 28, 2023
65d13b3
simplify distributed tracing docs structure
stephanie-anderson Jun 30, 2023
49851a5
style(lint): Auto commit lint changes
getsantry[bot] Jun 30, 2023
6c7a238
style(lint): Auto commit lint changes
getsantry[bot] Jun 30, 2023
b48a072
style(lint): Auto commit lint changes
getsantry[bot] Jun 30, 2023
1d104d1
style(lint): Auto commit lint changes
getsantry[bot] Jun 30, 2023
6a5e6ab
further updates on TwP
stephanie-anderson Jun 30, 2023
59525b2
style(lint): Auto commit lint changes
getsantry[bot] Jun 30, 2023
5f205ac
adapt link text
stephanie-anderson Jun 30, 2023
d49ec0b
fix broken links by disabling platforms
stephanie-anderson Jun 30, 2023
4f64091
style(lint): Auto commit lint changes
getsantry[bot] Jun 30, 2023
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
6 changes: 0 additions & 6 deletions src/docs/contributing/approach/sdk-docs/write-performance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ If any of the above files are not applicable to your platform, find the `<Platfo

Then, determine whether to provide a code sample illustrating how to connect errors and spans. If so, add the SDK to the `Supported` list in the appropriate `<PlatformSection>`, then add a code sample `/src/platform-includes/performance/connect-errors-spans/`.

If the platform supports distributed tracing using custom instrumentation, add the SDK to the appropriate `<PlatformSection>` and create an appropriate file at `src/platform-includes/performance/distributed-tracing`.

### Automatic Instrumentation

This page does not use common content. It covers what instrumentation is automatic when tracing is enabled for this SDK.
Expand All @@ -82,10 +80,6 @@ This file is `troubleshooting-performance.mdx`. It explains corner cases and how

2. Add an example to `src/platform-includes/performance/control-data-truncation/`

### Connecting Services

This page does not currently use common content. It covers an example of how to connect frontend and backend services. In future, we may determine that it's useful to expand the content beyond the JS-specific focus.

### Sampling

Guidelines TBD.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Configuration

By default, trace information (`sentry-trace` and `baggage` headers) will be added to outgoing XHR/fetch requests that contain `localhost` in their URL and requests where the URL starts with `'/'`, for example, `/api/v1/users`.

To configure which URLs have trace information added, set the `tracePropagationTargets` option:

```javascript
Sentry.init({
// ...
integrations: [
new Sentry.BrowserTracing({
tracePropagationTargets: ["localhost", /^https:\/\/api\.example\.com/],
}),
],
});
```

In this example, trace information will be added to outgoing XHR/fetch requests to `localhost` and URLs starting with `https://api.example.com`.

See <PlatformLink to="/configuration/options/#trace-propagation-targets">Tracing Options</PlatformLink> docs for more information about the `trace_propagation_targets` option.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Configuration

By default, trace information (`sentry-trace` and `baggage` headers) will be added to all outgoing HTTP requests. If you want to limit to the URLs where trace information is added, you can specify a `trace_propagation_targets` option:

```python
import sentry_sdk

sentry_sdk.init(
dsn="___PUBLIC_DSN___",
trace_propagation_targets=[
"https://myproject.org",
r"https://.*\.otherservice.org/.*",
],
# ...
)
```

In the example above, trace information will be added to all requests to URLs that contain `"https://myproject.org"` and to all URLs of all sub domains of `otherservice.org` like `https://api.otherservice.org/something/` or `https://payment.otherservice.org/something/`.

See <PlatformLink to="/configuration/options/#trace-propagation-targets">Tracing Options</PlatformLink> docs for more information about the `trace_propagation_targets` option.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To enable distributed tracing, add the `BrowserTracing` integration to your `Sentry.init` options, as described in the Performance <PlatformLink to="/performance/instrumentation/automatic-instrumentation/"> Automatic Instrumentation</PlatformLink> docs. The [Next.js](/platforms/javascript/guides/nextjs/) and [SvelteKit](/platforms/javascript/guides/sveltekit/) SDKs include this integration by default.

Tracing information sent from the backend via the `sentry-tracing` and `baggage` HTML `meta` tags will be extracted and stored in a transaction that is created at page load.

The `sentry-trace` and `baggage` headers will be added to all your outgoing XHR/fetch requests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Configuration

To enable distributed tracing, add the `BrowserTracing` integration to your `Sentry.init` options, as described in the Performance <PlatformLink to="/performance/instrumentation/automatic-instrumentation/">Automatic Instrumentation</PlatformLink> docs. Sentry's [Next.js](/platforms/javascript/guides/nextjs/) and [SvelteKit](/platforms/javascript/guides/sveltekit/) SDKs include this integration by default.

See the instructions at <PlatformLink to="/platforms/javascript/performance/">Set Up Performance</PlatformLink> for more information on how to configure tracing.

Additionally, if your backend is hosted on a different domain, you may need to <PlatformLink to="/distributed-tracing/instrumentation/automatic-instrumentation/#configure-backend-cors-headers">Configure Backend CORS Headers</PlatformLink> to ensure requests aren't blocked.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
On this page you will learn how to manually propagate trace information into and out of your JavaScript application. Please note, that you do not need to do this manually, if you [use one of our supported frameworks](/platforms/javascript/usage/distributed-tracing/#how-to-use-distributed-tracing), or you have our <PlatformLink to="/performance/">performance monitoring feature</PlatformLink> turned on.

To set it up manually, all you have to do is to make sure your application extracts incoming headers and to set those headers again when making an outgoing request within your application.

To enable distributed tracing, add the `BrowserTracing` integration to your `Sentry.init` options, as described in the Performance <PlatformLink to="/performance/instrumentation/automatic-instrumentation/"> Automatic Instrumentation</PlatformLink> docs. The [Next.js](/platforms/javascript/guides/nextjs/) and [SvelteKit](/platforms/javascript/guides/sveltekit/) SDKs include this integration by default.

If you are using one of the frameworks listed above, see the <PlatformLink to="/distributed-tracing/instrumentation/automatic-instrumentation/">Automatic Instrumentation</PlatformLink>. page on how to configure distributed tracing.

If you prefer to implement custom distributed tracing, you must:

- Extract and store incoming tracing information from HTML `meta` tags when loading the page
- Inject tracing information to the outgoing request when sending outgoing requests.

To learn more, see our <PlatformLink to="/distributed-tracing/">Distributed Tracing</PlatformLink> docs.

## Extract Tracing Information From HTML `meta` Tags

Assuming the backend that renders the HTML has injected tracing information into the HTML as `meta` tags, you can extract that tracing information on `pageload` and use it to create new transactions connected to that incoming trace.

See the docs on how to [Inject Tracing Information Into Rendered HTML](/platforms/python/distributed-tracing/instrumentation/custom-instrumentation/#inject-tracing-information-into-rendered-html) to learn more about how to configure your backend to inject this information.

For example, on `pageload` you could do the following:

```javascript
// Read meta tag values
const sentryTraceMetaTagValue = getMetaContent("sentry-trace");
const baggageMetaTagValue = getMetaContent("baggage");

// Extract Sentry trace information
const traceParentData = extractTraceparentData(sentryTraceMetaTagValue);

// Create Dynamic Sampling Context
const dynamicSamplingContext =
baggageHeaderToDynamicSamplingContext(baggageMetaTagValue);

// Create transaction context
const transactionContext = {
...traceParentData,
metadata: {
dynamicSamplingContext: dynamicSamplingContext,
},
};

// Start transaction with tracing information of meta tags
const pageLoadTransaction = startTransaction(hub, transactionContext);
```

In this example, we create a new transaction that is attached to the trace specified in the `sentry-trace` and `baggage` HTML `meta` tags.

## Inject Tracing Information to Outgoing Requests

For distributed tracing to work, the two headers that you extracted and stored in the `pageLoadTransaction`, `sentry-trace` and `baggage`, must be added to outgoing XHR/fetch requests.

Here's an example of how to collect and inject this tracing information to outgoing requests:

```javascript
// Create `sentry-trace` header
const sentryTraceHeader = pageLoadTransaction.toTraceparent();

// Create `baggage` header
const dynamicSamplingContext = pageLoadTransaction.getDynamicSamplingContext();
const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(
dynamicSamplingContext
);

// Make outgoing request
fetch("https://example.com", {
method: "GET",
headers: {
baggage: sentryBaggageHeader,
"sentry-trace": sentryTraceHeader,
},
}).then((response) => {
// ...
});
```

In this example, tracing information is propagated to the project running at `https://example.com`. If this project uses a Sentry SDK, it will extract and save the tracing information for later use.

The two services are now connected with your custom distributed tracing implementation.

## Verification

If you make outgoing requests from your project to other services, check if the headers `sentry-trace` and `baggage` are present in the request. If so, distributed tracing is working.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
On this page you will learn how to manually propagate trace information into and out of your Python application. Please note, that you do not need to do this manually, if you [use one of our supported frameworks](/platforms/python/usage/distributed-tracing/#how-to-use-distributed-tracing), or you have our <PlatformLink to="/performance/">performance monitoring feature</PlatformLink> turned on.

To set it up manually, all you have to do is to make sure your application extracts incoming headers and to set those headers again when making an outgoing request within your application.

## Step 1) Extract Incoming Tracing Information

Incoming tracing information has to be extracted and stored in memory for later use. Sentry provides the `continue_trace()` function to help you with this. Incoming tracing information can come from different places:

- In a web environment it will be sent with HTTP headers, for example, by another Sentry SDK used in your frontend project.
- In a job queue, like Celery, it can be retrieved from meta or header variables.
- You also can pick up tracing information from environment variables.

Here's an example of how to extract and store incoming tracing information using `continue_trace()`:

```python
import sentry_sdk
from my_project import get_incoming_headers_as_dict

headers = get_incoming_headers_as_dict()

sentry_sdk.continue_trace(headers)
```

In this example, `get_incoming_headers_as_dict()` returns a dictionary that contains tracing information from HTTP headers, environment variables, or any other mechanism your project uses to communicate with the outside world.

Sentry's `continue_trace()` function will extract the given headers, try to find the `sentry-trace` and `baggage` headers, and store them in memory for later use.

## Step 2) Inject Tracing Information to Outgoing Requests

For distributed tracing to work, the two headers `sentry-trace` and `baggage`, must now also be added to outgoing requests. If you pregenerate HTML on the server-side, you might want to take a look at option 2 as well, which describes how to pass on tracing information through HTML meta tags.

### Inject Tracing Information Into HTTP Requests

If you are sending outgoing HTTP requests with [Requests](https://requests.readthedocs.io/en/latest/), [AIOHTTP](https://docs.aiohttp.org/en/stable/), the low level [http.client](https://docs.python.org/3/library/http.client.html), or [httplib](https://docs.python.org/2/library/httplib.html) on Python 2, this tracing information is automatically added to outgoing requests.

If your using none of the above, you can generate this tracing information with the Sentry SDK's `get_traceparent()` and `get_baggage()` functions. Here's an example:

```python
import sentry_sdk
from my_project import make_an_outgoing_request

headers = {}
headers["sentry-trace"] = sentry_sdk.get_traceparent()
headers["baggage"] = sentry_sdk.get_baggage()

make_an_outgoing_request(to="https://example.com", headers=headers)
```

In this example, tracing information is propagated to the project running at `https://example.com`. If this project uses the Sentry Python SDK, it will extract and save the tracing information for later use.

The two services are now connected with your custom distributed tracing implementation.

### Inject Tracing Information Into Rendered HTML

To propagate tracing information into JavaScript running in rendered HTML you have to inject HTML `meta` tags for `sentry-trace` and `baggage` data into your rendered HTML. Here's an example:

```python
import sentry_sdk
from my_project import render

meta = ""
meta += '<meta name="sentry-trace" content="%s">' % sentry_sdk.get_traceparent()
meta += '<meta name="baggage" content="%s">' % sentry_sdk.get_baggage()

html = """
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
{additional_meta}
</head>
<body>
<p>This is a website.</p>
</body>
</html>
""".format(additional_meta=meta)

render(html)

```

## Verification

If you make outgoing requests from your project to other services, check if the headers `sentry-trace` and `baggage` are present in the request. If so, distributed tracing is working.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In order to use distributed tracing with this SDK, you have to <PlatformLink to="/performance/">activate performance monitoring</PlatformLink>.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
13 changes: 13 additions & 0 deletions src/platform-includes/distributed-tracing/how-to-use/python.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box for the following frameworks:

- [Django](/platforms/python/guides/django/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [FastAPI](/platforms/python/guides/fastapi/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [Flask](/platforms/python/guides/flask/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [Bottle](/platforms/python/guides/bottle/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [Falcon](/platforms/python/guides/falcon/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [Pyramid](/platforms/python/guides/pyramid/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [Quart](/platforms/python/guides/quart/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [Starlette](/platforms/python/guides/starlette/usage/distributed-tracing/#how-to-use-distributed-tracing)
- [Tornado](/platforms/python/guides/tornado/usage/distributed-tracing/#how-to-use-distributed-tracing)

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work. However, if you do not want to activate performance monitoring, you can also setup a <PlatformLink to="/usage/distributed-tracing/custom-instrumentation/">custom instrumentation</PlatformLink>.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you use the current version of our Python SDK, distributed tracing just works out of the box. No additional configuration is required.

If you however use version `1.25.x` or below, you need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```python
import sentry_sdk

sentry_sdk.init(
dsn="___PUBLIC_DSN___",
trace_propagation_targets=[
"https://myproject.org",
"https://.*\.otherservice.org/.*",
],
# ...
)
```
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SDKs and their associated integrations will automatically record many types of breadcrumbs. For example, the browser JavaScript SDK will automatically record clicks and key presses on DOM elements, fetch/XHR requests, console API calls, and all location changes.
SDKs and their associated integrations will automatically record many types of breadcrumbs. For example, the browser JavaScript SDK will automatically record clicks and key presses on DOM elements, XHR/fetch requests, console API calls, and all location changes.
2 changes: 0 additions & 2 deletions src/platform-includes/getting-started-primer/python.flask.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Note>

Sentry's Flask integration enables automatic reporting of errors and exceptions.

Our Python SDK will install the Flask integration for all of your apps. It hooks into Flask’s signals, not anything on the app object. Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled.

</Note>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `baggage` header was added with version 7 of the Sentry Javascript SDK and i

</Note>

All of Sentry's tracing-related integrations (`BrowserTracing`, `Http`, and `Express`), as well as the Next.JS SDK, either generate or pick up and propagate the trace headers automatically, as appropriate, for all transactions and spans that they generate.
All Sentry JavaScript SDKs support distributed tracing once you add the <PlatformLink to="/performance/instrumentation/automatic-instrumentation/">BrowserTracing</PlatformLink> integration to your `Sentry.init` option. The [Next.js](/platforms/javascript/guides/nextjs/) and [SvelteKit](/platforms/javascript/guides/sveltekit/) SDKs already include this integration by default.

The JavaScript SDK will only attach the trace headers to outgoing HTTP requests for which the destination is a substring or regex match to the <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#tracePropagationTargets">tracePropagationTargets</PlatformLink> list. `tracePropagationTargets` was previously called `tracingOrigins`.

Expand Down
Loading