Skip to content

Commit 3216205

Browse files
committed
Merge branch 'master' into codyde/javascript-tracing-refactor
* master: (45 commits) feat: Mention that the cookie-sync extension works for previews (#12858) ref(flags): update unleashIntegration param (#12795) ref(sveltekit): Adjust Cloudflare setup to only use SvelteKit SDK (#12801) docs(python): Clarify how to init SDK in `async` app (#12854) move content about error capturing to "Capturing Errors and Events" from "Manual Setup" (Next.js) (#12786) docs(span-links): Add develop docs for span links (#12829) feat(java): add Reactor integration docs (#12686) Add Quarkus to community maintained SDKs (#12834) Adding unsupported hot reload (#12683) Fix broken links (#12844) feat(python): Clarification regarding start_transaction (#12835) docs(flutter): Fix event serverName reset in samples (#12832) ref(insights): move performance docs under insights (#12720) Bump API schema to 2e61347a (#12836) fix(apple): Usages of sendDefaultPii (#12833) Add `sendDefaultPii: true` to React Native init code snippets (#12812) Only show Browser vs React Native source maps alert for browser sdks (#12816) Add Data Collected page for React Native (#12811) Fix React Native Onboarding Option Buttons (#12813) Add Hono guide (#12710) ...
2 parents 91aa869 + f29c6db commit 3216205

File tree

336 files changed

+3317
-1091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+3317
-1091
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# /src/wizard/rust/ @getsentry/owners-native
3535

3636
# /src/docs/product/discover-queries/ @getsentry/visibility
37-
# /src/docs/product/performance/ @getsentry/visibility
37+
# /src/docs/product/insights/ @getsentry/insights
3838

3939
# /src/docs/cli/dif.mdx @getsentry/owners-native
4040

apps/changelog/next.config.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,8 @@ export default withSentryConfig(nextConfig, {
5555
},
5656

5757
automaticVercelMonitors: true,
58+
59+
_experimental: {
60+
thirdPartyOriginStackFrames: true,
61+
},
5862
});

apps/changelog/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@radix-ui/react-icons": "^1.3.2",
2626
"@radix-ui/react-toolbar": "^1.1.0",
2727
"@radix-ui/themes": "^3.1.3",
28-
"@sentry/nextjs": "^9.0.0",
28+
"@sentry/nextjs": "9.2.0",
2929
"@spotlightjs/spotlight": "^2.1.1",
3030
"next": "15.1.2",
3131
"next-auth": "^4.24.5",
@@ -68,4 +68,4 @@
6868
"@types/react": "npm:[email protected]",
6969
"@types/react-dom": "npm:[email protected]"
7070
}
71-
}
71+
}

apps/changelog/vercel.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"key": "Content-Security-Policy-Report-Only",
20-
"value": "default-src 'none'; font-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' plausible.io 'unsafe-inline' 'unsafe-eval' 'report-sample'; img-src 'self' storage.googleapis.com; worker-src blob:; connect-src o1.ingest.us.sentry.io plausible.io 'self' changelog.sentry.dev sentry.sentry.io; report-uri https://o1.ingest.us.sentry.io/api/4507670276341760/security/?sentry_key=e90f5ea060a4102c0a4c50c740e43ae1;"
20+
"value": "default-src 'none'; font-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' plausible.io 'unsafe-inline' 'unsafe-eval' 'report-sample'; img-src 'self' changelog.sentry.dev lh3.googleusercontent.com storage.googleapis.com; worker-src blob:; connect-src o1.ingest.us.sentry.io plausible.io 'self' changelog.sentry.dev sentry.io sentry.sentry.io storage.googleapis.com; report-uri https://o1.ingest.us.sentry.io/api/4507670276341760/security/?sentry_key=e90f5ea060a4102c0a4c50c740e43ae1;"
2121
}
2222
]
2323
}

develop-docs/application-architecture/sentry-vs-getsentry.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_order: 20
55

66
You'll find numerous references to both `sentry` and `getsentry` in our documentation. Both are [Django](https://www.djangoproject.com/) apps, but `sentry` [is open](https://github.com/getsentry/sentry) and `getsentry` is closed. What's in which?
77

8-
The main thing to emphasize is that all of our product features—[Issues](https://docs.sentry.io/product/issues/), [Performance](https://docs.sentry.io/product/performance/), [Dashboards](https://docs.sentry.io/product/dashboards/), and [such](https://docs.sentry.io/product/)—are implemented and available in `sentry`, the open component. It's really important to us that we're not an "open core" company that hides key functionality behind a paywall. [Sentry is as open-source as we can make it](https://open.sentry.io/licensing/).
8+
The main thing to emphasize is that all of our product features—[Issues](https://docs.sentry.io/product/issues/), [Insights](https://docs.sentry.io/product/insights/), [Dashboards](https://docs.sentry.io/product/dashboards/), and [such](https://docs.sentry.io/product/)—are implemented and available in `sentry`, the open component. It's really important to us that we're not an "open core" company that hides key functionality behind a paywall. [Sentry is as open-source as we can make it](https://open.sentry.io/licensing/).
99

1010
So what's in `getsentry`, then? It implements billing and account management features for [our SaaS, sentry.io](https://sentry.io/). `getsentry` is the Django app we deploy to production. It imports the `sentry` Django app, adds some routes and models, and re-exports it.
1111

develop-docs/backend/application-domains/transaction-clustering/index.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In terms of technical implementation, it is similar to [Data Scrubbing](/backend
1111

1212
## The Problem
1313

14-
In our [Performance](https://docs.sentry.io/product/performance/) product, transactions are grouped by their name
14+
In our [Insights](https://docs.sentry.io/product/insights/overview/) product, transactions are grouped by their name
1515
(the [`event.transaction`](/sdk/data-model/event-payloads/#optional-attributes) field).
1616
This works well as long as the cardinality of distinct transaction names that the SDK sends is low, for example
1717
by using the [route of a web framework](https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/) as the transaction name.
@@ -22,7 +22,7 @@ and it falls back to the raw URL (or rather,
2222
[its path component](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax)).
2323

2424
This makes it harder for the user to extract insights from [Performance
25-
metrics](https://docs.sentry.io/product/performance/metrics/), because instead of presenting averages, percentiles and distributions of groups of transactions that logically
25+
metrics](https://docs.sentry.io/product/insights/overview/metrics/), because instead of presenting averages, percentiles and distributions of groups of transactions that logically
2626
belong together, we end up with a bunch of one-off transaction groups.
2727

2828
```URLs

develop-docs/development-infrastructure/frontend-development-server.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The development server can be viewed at [https://dev.getsentry.net:7999](https:/
1515

1616
In any case, you can now login to your development server with your Sentry.io credentials. The SSO-login flow will *NOT* work. Only email/password is supported on the login form in development.
1717

18-
While the SSO-login flow will not work, cookies from an existing logged-in sessions will work correctly. You may use our [Cookie Sync](https://github.com/getsentry/cookie-sync) browser extension to sync session cookies from `*.sentry.io` domain and into `*.dev.getsentry.net` domain in your browser.
18+
While the SSO-login flow will not work, cookies from an existing logged-in sessions will work correctly. You may use our [Cookie Sync](https://github.com/getsentry/cookie-sync) browser extension to sync session cookies from `*.sentry.io` into `*.dev.getsentry.net`, and `*.sentry.dev` -- the latter being the Github Preview environment hosted on Vercel.
1919

2020
- [Get Cookie Sync for Chrome](https://chrome.google.com/webstore/detail/sentry-cookie-sync/kchlmkcdfohlmobgojmipoppgpedhijh)
2121
- [Get Cookie Sync for Firefox](https://addons.mozilla.org/en-US/firefox/addon/sentry-cookie-sync/)

develop-docs/sdk/telemetry/traces/opentelemetry.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This page is under active development. Specifications are not final and subject
1010

1111
</Alert>
1212

13-
This document details Sentry's work in integrating and supporting [OpenTelemetry](https://opentelemetry.io/), the open standard for metrics, traces and logs. In particular, it focuses on the integration between [Sentry's performance monitoring product](https://docs.sentry.io/product/performance/) and [OpenTelemetry's tracing spec](https://opentelemetry.io/docs/concepts/signals/traces/).
13+
This document details Sentry's work in integrating and supporting [OpenTelemetry](https://opentelemetry.io/), the open standard for metrics, traces and logs. In particular, it focuses on the integration between [Sentry's performance monitoring product](https://docs.sentry.io/product/insights/overview/) and [OpenTelemetry's tracing spec](https://opentelemetry.io/docs/concepts/signals/traces/).
1414

1515
## Background
1616

Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
---
2+
title: Span Links
3+
---
4+
5+
Span links associate one span with one or more other spans. The most important application of linking traces are frontend applications.
6+
It can also be useful in settings with producer/consumer patterns or batch operations.
7+
By using span links, we are able to display a user journey in our tracing views to make debugging of issues easier as developers get more context on what happened before a specific issue.
8+
9+
A span link can store the context of (a.k.a. link to) any other span. When necessary, a special link type can be added (see [Link Types](#link-types)).
10+
11+
Learn more about Span Links in [the RFC 141](https://github.com/getsentry/rfcs/blob/main/text/0141-linking-traces.md) or in the [OpenTelemetry docs](https://opentelemetry.io/docs/concepts/signals/traces/#span-links).
12+
13+
## SDK Implementation Guideline
14+
15+
- Links are added on a span level, as defined and specified by [OpenTelemetry](https://opentelemetry.io/docs/specs/otel/trace/api/#link).
16+
- In addition to linking to span IDs, a span link also holds meta information about the link, collected via attributes.
17+
- Span links MUST only link to other spans. We do not support linking a span to an error or other Sentry events.
18+
- For SDKs still having public APIs around transactions, their respective Transaction interface and `startTransaction` function(s) should support the same APIs.
19+
20+
### Type Definitions
21+
22+
SDKs should follow the OpenTelemetry spec for the Link interface as defined by the platform.
23+
Non-OTel SDKs should orient themselves on OTel, resulting in the interface below, or a related version that applies to the terminology and philosophy of the respective SDK:
24+
25+
```ts {tabTitle:Types}
26+
// see https://github.com/open-telemetry/opentelemetry-js/blob/main/api/src/trace/link.ts
27+
// or interface of respective platform
28+
interface Link {
29+
// contains the SpanContext of the span to link to
30+
context: SpanContext;
31+
// key-value pair with primitive values
32+
attributes?: Attributes;
33+
}
34+
35+
36+
// see https://github.com/open-telemetry/opentelemetry-js/blob/main/api/src/trace/span_context.ts
37+
// or interface of respective platform
38+
interface SpanContext {
39+
traceId: string,
40+
spanId: string,
41+
traceFlags: number,
42+
}
43+
44+
type Attributes = Record<string, AttributeValues>
45+
type AttributeValues = string | boolean | number | Array<string> | Array<boolean> | Array<number>
46+
```
47+
48+
49+
### Required Span API
50+
51+
Ideally, the link is added when starting a span. An optional `links` attribute is added to the `startSpan` options.
52+
SDKs that don't offer span-centric APIs but e.g. transaction APIs, should ensure that their respective `start...` APIs (e.g. `startTransaction`) also offer a possibility to add links.
53+
54+
```ts {tabTitle:Span Options}
55+
function startSpan(options: StartSpanOptions);
56+
57+
interface StartSpanOptions: {
58+
//... other options (name, attributes, etc)
59+
links?: Link[];
60+
}
61+
```
62+
63+
Furthermore, the SDKs need to expose at least an `addLink` method on their respective Span interface. For completeness with OpenTelemetry, ideally they also expose `addLinks`:
64+
65+
```ts {tabTitle:Span API}
66+
interface Span {
67+
// return value can differ depending on platform
68+
addLink(link: Link): this;
69+
addLinks(links: Link[]): this;
70+
}
71+
```
72+
73+
## Envelope Item Payload
74+
75+
Span trees are serialized to transaction event envelopes in all Sentry SDKs. Therefore, the envelope item needs to accommodate span links
76+
in its payload. If the `links` entry is an empty array, it can be omitted from the envelope.
77+
78+
The serialized `links` objects should always contain:
79+
80+
- `span_id: string` - id of the span to link to
81+
- `trace_id: string` - trace id of the span to link to
82+
- `sampled: boolean` - required if sampling decision of the span to link to (corresponds to `traceFlags` in Otel span context converted to `boolean`) is available
83+
- `attributes:` - required if attributes were added to the link
84+
85+
Optionally, the serialized link object can contain further fields from OTel like `traceState`, `isRemote` or `droppedAttributesCount` which will be just forwarded unless we find a use case for them.
86+
87+
The OTel fields `spanId`, `traceId`, and `traceFlags` should be excluded from the links objects in the envelope to avoid duplicate data (e.g. `trace_id` vs. `traceId`).
88+
89+
If the root span (previously known as transaction) has span links, the links are stored in the trace context.
90+
91+
```ts {tabTitle:Example Trace Context}
92+
// event envelope item
93+
{
94+
type: "transaction";
95+
transaction: string;
96+
contexts: {
97+
trace: {
98+
span_id: string;
99+
parent_span_id: string;
100+
trace_id: string;
101+
// new field for links:
102+
links?: Array<{
103+
"span_id": string,
104+
"trace_id": string,
105+
sampled?: boolean, // traceFlags from Otel converted to boolean
106+
attributes?: Record<string, AttributeValue>,
107+
// + potentially more fields 1:1 from Otel. e.g. (traceState, droppedAttributesCount, isRemote)
108+
}>
109+
// ...
110+
}
111+
}
112+
// ...
113+
}
114+
```
115+
116+
Links that are stored in child spans are serialized in `spans[i].links`.
117+
118+
```ts {tabTitle:Example Span Link Data}
119+
// event envelope item
120+
{
121+
type: "transaction";
122+
transaction: string;
123+
spans: Array<{
124+
span_id: string;
125+
parent_span_id: string;
126+
trace_id: string;
127+
// new field for links:
128+
links?: Array<{
129+
"span_id": string,
130+
"trace_id": string,
131+
sampled?: boolean,
132+
attributes?: Record<string, AttributeValue>,
133+
}>
134+
// ...
135+
}>
136+
// ...
137+
}
138+
```
139+
140+
## Link Types
141+
142+
Links don't require a special meaning or type but if necessary (e.g. for identifying special links in the product), set the `sentry.link.type` attribute on the link to define the link type.
143+
Any string can be used, but these types have predefined meanings:
144+
145+
| `sentry.link.type` | Usage | UI Implications |
146+
|--------------------|----------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
147+
| "previous_trace" | Linking e.g. a navigation span to the previous page load span. | Used to query linked traces. Shows a button to go to linked previous trace in the trace explorer. |
148+
| "next_trace" | Linking e.g. a page load span to the next navigation span. | Used to query linked traces. Shows a button to go to linked next trace in the trace explorer. |
149+
150+
### `previous_trace`
151+
152+
Frontend traces can be linked by adding span links between root spans. For example, a navigation span includes a link to the previous page load span.
153+
154+
The span context inside the link object should be stored in a storage mechanism of choice (e.g. in-memory or `sessionStorage` in the browser).
155+
156+
Therefore, on root span start:
157+
- Check if there is a previous span context stored. If yes, add the span link with the `'sentry.link.type': 'previous_trace'` attribute
158+
- Store the root span context as the previous root span in a storage mechanism of choice (e.g. in-memory or `sessionStorage` in the browser)
159+
160+
SDKs are free to implement heuristics around how long a previous trace span context should be considered (max time) and store additional necessary data.
161+
162+
![](./span-links-previous-trace-100.png)
163+
164+
#### Negatively Sampled Traces
165+
166+
In many cases, with lower sample rates, we will not be able to provide a full trace link chain, due to some or many traces being negatively sampled.
167+
168+
- Sampled root spans should still include a link to the previous, negatively sampled root span (`traceFlags` on the spanContext() carry
169+
the information that the previous trace root span was negatively sampled).
170+
171+
This helps our product to hint that there would have been a previous trace, but it was negatively sampled.
172+
173+
We will not link to the previous positively sampled trace if a negatively sampled trace is in-between (see Traces 2-4 in the diagram below).
174+
Furthermore, we will not show how many traces were negatively sampled in between two trace chains; only that there was at least one trace in between (see Trace 5-8).
175+
176+
![](./span-links-previous-trace-negative-sample.png)
177+
178+
## Usage Example
179+
180+
Adding span links should be possible at span start time, as well as when holding a reference to the span.
181+
182+
In the example below, by adding span links, we can link from the last navigation trace all the way back to the initial pageload trace.
183+
By passing the `'sentry.link.type': 'previous_trace'` attribute, we can identify the link as a previous trace link in Sentry and display the spans accordingly.
184+
185+
```ts {tabTitle:TypeScript}
186+
// 1st trace starts
187+
const pageloadSpan = startInactiveSpan(...)
188+
189+
// 2nd trace starts
190+
const navigation1Span = startInactiveSpan({
191+
name: '/users',
192+
links: [{
193+
context: pageloadSpan.spanContext(),
194+
attributes: {
195+
'sentry.link.type': 'previous_trace'
196+
}
197+
}]
198+
});
199+
200+
// 3rd trace starts
201+
const navigation2Span = startSpan({name: '/users/:id'}, (span) => {
202+
span.addLink({
203+
context: navigation1Span.spanContext(),
204+
attributes: {
205+
'sentry.link.type': 'previous_trace'
206+
}
207+
})
208+
})
209+
```
210+
211+
## Ingest/Relay
212+
213+
Relay forwards the span links in the format that is required for further processing and storage.
214+
Importantly, Relay doesn't require span links to be defined. They are completely optional.
215+
Relay handles passing span links in the root span as well as in any child span (see [envelope item payload](#envelope-item-payload)).
216+
217+
The expected type and structure of the links array and its contents is [specified in Relay](https://github.com/getsentry/relay/blob/master/relay-event-schema/src/protocol/span.rs#L753).

develop-docs/self-hosted/experimental/errors-only.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This is our default version of self-hosted Sentry. It includes most of the featu
3030
3. [Replays](https://docs.sentry.io/product/explore/session-replay/)
3131
4. [Insights](https://docs.sentry.io/product/insights/) (Requests, Queries, Assets, etc)
3232
5. [User Feedback](https://docs.sentry.io/product/user-feedback/)
33-
6. [Performance](https://docs.sentry.io/product/performance/)
33+
6. [Insights](https://docs.sentry.io/product/insights/)
3434
7. [Crons](https://docs.sentry.io/product/crons/)
3535
8. [Metrics](https://docs.sentry.io/product/explore/metrics/)
3636

develop-docs/self-hosted/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ sudo ./install.sh
4141

4242
## Required Minimum System Resources
4343

44-
We require at least Docker 19.03.6 and Compose 2.23.2.
44+
We require at least Docker 19.03.6 and Compose 2.32.2.
4545

4646
These are the minimum requirements:
4747
- 4 CPU Cores

docs/concepts/key-terms/key-terms.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Each of these key features have their own page (or set of pages) in the [sentry.
5858

5959
- **Insights** - Sentry surfaces insights that can help you identify opportunities at the service-level to improve various parts of your app's performance, including requests, assets, caches, queues, and more. Modules living under the Insights heading provide an overview of how your project is performing in that category, as well as the ability to review sample events and their traces to help you diagnose potential problems.
6060

61-
- **Performance** - The main view in [sentry.io](http://sentry.io) where you can search or browse for transaction data. The page displays graphs that visualize transactions or trends, as well as a table where you can view relevant transactions and drill down to more information about them. Learn more in the full [performance monitoring documentation](/product/performance/).
61+
- **Insights Overview** - The main view in [sentry.io](http://sentry.io) where you can search or browse for transaction data. The page displays graphs that visualize transactions or trends, as well as a table where you can view relevant transactions and drill down to more information about them. Learn more in the full [performance monitoring documentation](/product/insights/overview/).
6262

6363
- **Alerts** - Where you can create new alert rules and manage existing ones. Learn more in the full [Alerts documentation](/product/alerts/).
6464

0 commit comments

Comments
 (0)