Skip to content

Commit ff4f76e

Browse files
committed
Merge branch 'master' into abhi-logs-sdk-developer-documentation
2 parents 60c3bdc + 2168c58 commit ff4f76e

File tree

537 files changed

+8511
-3380
lines changed

Some content is hidden

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

537 files changed

+8511
-3380
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# /src/wizard/android/ @getsentry/team-mobile-core
1313
# /src/platforms/apple/ @getsentry/team-mobile-core
1414
# /src/wizard/apple/ @getsentry/team-mobile-core
15-
# /src/platforms/flutter/ @getsentry/team-mobile-cross-platform
15+
# /src/platforms/dart/guides/flutter/ @getsentry/team-mobile-cross-platform
1616
# /src/wizard/flutter/ @getsentry/team-mobile-cross-platform
1717
# /src/platforms/dart/ @getsentry/team-mobile-cross-platform
1818
# /src/wizard/dart/ @getsentry/team-mobile-cross-platform

.github/ISSUE_TEMPLATE/issue-content-01-sdks.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: "📝 SDK Documentation"
2-
labels: ["Type: Content", "SDKs"]
1+
name: '📝 SDK Documentation'
2+
labels: ['Type: Content', 'SDKs']
33
description: Missing, incorrect, or unclear documentation of SDKs.
4+
type: Improvement
45
body:
56
- type: markdown
67
attributes:

.github/ISSUE_TEMPLATE/issue-content-02-product.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: "📝 Product Documentation"
2-
labels: ["Type: Content", "Product"]
1+
name: '📝 Product Documentation'
2+
labels: ['Type: Content', 'Product']
33
description: Missing, incorrect, or unclear documentation of product features.
4+
type: Improvement
45
body:
56
- type: markdown
67
attributes:

.github/ISSUE_TEMPLATE/issue-content-03-develop.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: "📝 Documentation on develop.sentry.dev"
2-
labels: ["Type: Content", "Develop"]
1+
name: '📝 Documentation on develop.sentry.dev'
2+
labels: ['Type: Content', 'Develop']
33
description: Missing, incorrect, or unclear developer documentation.
4+
type: Improvement
45
body:
56
- type: markdown
67
attributes:
@@ -35,4 +36,3 @@ body:
3536
value: |-
3637
## Thanks 🙏
3738
Check our [triage docs](https://open.sentry.io/triage/) for what to expect next.
38-

.github/ISSUE_TEMPLATE/issue-platform-404.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: "💻 Docs Platform: 🔗 404 Error"
2-
labels: "Type: Platform,404"
1+
name: '💻 Docs Platform: 🔗 404 Error'
2+
labels: 'Type: Platform,404'
33
description: Broken links, missing pages, and other 404 errors.
4-
4+
type: Bug
55
body:
66
- type: textarea
77
id: url

.github/ISSUE_TEMPLATE/issue-platform-bug.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
name: "💻 Docs Platform: 🐞 Bug"
2-
labels: "Type: Platform,Bug"
1+
name: '💻 Docs Platform: 🐞 Bug'
2+
labels: 'Type: Platform'
3+
type: Bug
34
description: Problems with the technical platform of our docs.
45
body:
56
- type: textarea

.github/ISSUE_TEMPLATE/issue-platform-improvement.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: "💻 Docs Platform: ✨ Improvement"
2-
labels: "Type: Platform,Improvement"
1+
name: '💻 Docs Platform: ✨ Improvement'
2+
labels: 'Type: Platform'
33
description: Ideas on how we can improve the technical capabilities of our docs platform.
4+
type: Improvement
45
body:
56
- type: textarea
67
id: problem

apps/changelog/package.json

Lines changed: 2 additions & 2 deletions
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.3.0",
28+
"@sentry/nextjs": "9.7.0-alpha.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:types-react@19.0.0-rc.1",
6969
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1"
7070
}
71-
}
71+
}

develop-docs/application-architecture/feedback-architecture.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ In Relay v24.5.1, we migrated feedback to its own kafka topic + consumer,
9393

9494
### Attachments
9595

96-
We only use attachments for the widget’s screenshot feature, which allows users
97-
to submit **at most 1 screenshot per feedback**. Attachments are another [item type](/sdk/data-model/envelopes/#attachment)
98-
in an envelope.
96+
Attachments are another [item type](/sdk/data-model/envelopes/#attachment)
97+
in an envelope. We use attachments for the widget’s screenshot feature.
9998

10099
- SDK v8.0.0+, Relay v24.5.1+: Sends the feedback and attachment items in the same envelope.
101100
- SDK < v8, all Relay versions: Sends a separate envelope for each item.

develop-docs/development-infrastructure/analytics.mdx

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: This guide steps you through instrumenting your code with Sentry's
44
sidebar_order: 90
55
---
66

7-
87
## Big Query
98

109
[BigQuery](https://cloud.google.com/bigquery/) is a Google data warehouse that a lot of our data calls home. This includes all our analytics data and some (not all) production data that might be of interest when joins are necessary for answering richer, more complex questions. From sentry/getsentry, our data goes through [reload](https://github.com/getsentry/reload), our ETL for BigQuery.
@@ -103,6 +102,7 @@ analytics.record(
103102
Run the tests that touch the endpoint to ensure everything is Gucci.
104103

105104
### Step 3:
105+
106106
By default, a new event type is aggregated and sent to Amplitude as long as there is a user_id sent along with the event. If you would like to send events unaggregated, refer to [our Amplitude aggregation docs](https://github.com/getsentry/etl/blob/master/documentation/amplitude_analytics.md)
107107

108108
## Route-Based Frontend Analytics
@@ -180,7 +180,7 @@ Example:
180180
<RestartButton
181181
analyticsEventName="Growth: Guided Tour Restart"
182182
analyticsEventKey="growth.guided_tour_restart"
183-
analyticsParams={{tour: 'issues'}}
183+
analyticsParams={{ tour: "issues" }}
184184
/>
185185
```
186186
@@ -198,10 +198,10 @@ First, add the Typescript definition of the event to an analytics event file ins
198198
199199
```tsx
200200
export type ExampleTutorialEventParameters = {
201-
'example_tutorial.created': {
201+
"example_tutorial.created": {
202202
source: string;
203203
};
204-
'example_tutorial.viewed': {
204+
"example_tutorial.viewed": {
205205
source: string;
206206
};
207207
};
@@ -214,8 +214,8 @@ export const exampleTutorialEventMap: Record<
214214
keyof ExampleTutorialEventParameters,
215215
string | null
216216
> = {
217-
'example_tutorial.created': 'Example Tutorial Created',
218-
'example_tutorial.viewed': null, // don't send to Amplitude
217+
"example_tutorial.created": "Example Tutorial Created",
218+
"example_tutorial.viewed": null, // don't send to Amplitude
219219
};
220220
```
221221
@@ -242,21 +242,23 @@ Our current naming convention for Reload events is `descriptor.action` e.g. what
242242
243243
### Testing your Analytics Event
244244
245+
It's important to test analytic events to ensure the data you are looking at is accurate. Any additional analytic event should be tested before merging to make sure that the events are firing correctly (with the correct values at the right times). A common issue we see when testing gets overlooked is events firing multiple times when they should only fire once.
246+
245247
When developing locally, analytics events will not be sent to Reload or Amplitude. To test to see if your event is sending as expected and with the correct data, you can set "DEBUG_ANALYTICS" to "1" in local storage on your browser. Then it will log the analytics event data to your console, whenever it would've sent an analytics event, allowing to check your analytics locally.
246248
247249
**getsentry**
248250
249251
```jsx
250-
import React from 'react';
252+
import React from "react";
251253

252-
import { trackAnalytics } from 'getsentry/utils/analytics';
254+
import { trackAnalytics } from "getsentry/utils/analytics";
253255

254256
class ExampleComponent extends React.Component {
255257
componentDidMount() {
256-
trackAnalytics('example_tutorial.created', {
258+
trackAnalytics("example_tutorial.created", {
257259
organization,
258260
subscription,
259-
source: 'wakanda',
261+
source: "wakanda",
260262
});
261263
}
262264

@@ -271,15 +273,15 @@ class ExampleComponent extends React.Component {
271273
All you'll actually need is to import analytics from utils and call it wherever you need. Keep in mind the effect of React lifecycles on your data. In this case, we only want to send one event when the component mounts so we place it in `componentDidMount` .
272274
273275
```jsx
274-
import React from 'react';
276+
import React from "react";
275277

276-
import { trackAnalytics } from 'getsentry/utils/analytics';
278+
import { trackAnalytics } from "getsentry/utils/analytics";
277279

278280
class ExampleComponent extends React.Component {
279281
componentDidMount() {
280-
trackAnalytics('example_tutorial.deleted', {
282+
trackAnalytics("example_tutorial.deleted", {
281283
organization,
282-
source: 'wakanda',
284+
source: "wakanda",
283285
});
284286
}
285287
render() {
@@ -288,6 +290,18 @@ class ExampleComponent extends React.Component {
288290
}
289291
```
290292
293+
After deploying your changes, you can open the Dev Tools in your browser and in the "Network" tab, search for the `event/` request. This will show the events being sent to Reload and Amplitude.
294+
295+
## Debugging
296+
297+
If your analytics aren't showing up after you added it, you can't find an event you expect to be there, or something else goes wrong, there are a few troubleshooting steps you can try:
298+
299+
- Follow the steps [above](https://docs.sentry.io/development-infrastructure/analytics/#testing-your-analytics-event) to confirm that your analytics event is sending correctly, with the correct parameters.
300+
- Check Amplitude for blocked events: In Amplitude, go to the "Data" section in the sidebar. From there, navigate to "Events" and search for your event name. It will show up with status "Blocked" if blocked, which means events won't show up. Some events may be blocked in favor of automatic route or button analytics.
301+
- For route analytics, confirm that the analytic event isn't being blocked with `useDisableRouteAnalytics`. Some components already had an analytic event so the route analytics were disabled.
302+
- Check the types of the data you are sending. Arrays aren't recommended data types to send (they can be hard to query and produce some unexpected behavior). Try to remove those if you are using them.
303+
- Remember there will always be some discrepency. Ad-blockers, for example, can block events from being sent. This could be a cause of why some numbers aren't adding up.
304+
291305
## Metrics
292306
293307
Track aggregrate stats with [Metrics](/backend/metrics/). For example, this can be used to track aggregate response codes for an endpoint.

develop-docs/frontend/index.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ description: How we write frontend code at Sentry.
44
sidebar_order: 60
55
---
66

7-
This guide specifically focuses on the frontend part of the [Sentry](https://github.com/getsentry/sentry) and [Getsentry](https://github.com/getsentry/getsentry) codebases. It assumes you are using the eslint rules outlined by [eslint-config-sentry](https://github.com/getsentry/eslint-config-sentry); hence code style enforced by these linting rules will not be discussed here.
7+
This guide specifically focuses on the frontend part of the [Sentry](https://github.com/getsentry/sentry).
88

99
## Directory structure
1010

11-
The frontend codebase is currently located under `static/app` in sentry and `static/getsentry` in getsentry.
11+
The frontend codebase is currently located under `static/app`.
12+
13+
As of March 2025 `static/gsApp` and `static/gsAdmin` have been open-sourced and merged into [Sentry](https://github.com/getsentry/sentry). If you are looking for earlier git history of those folders you need to have access to [Getsentry](https://github.com/getsentry/getsentry).
1214

1315
## Folder & File structure
1416

develop-docs/frontend/network-requests.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Reusable queries like this can be placed in `/sentry/actionsCreators`.
142142
There are many situations where your query data becomes out of date and needs to be updated or refetched. This is usually because of some user input (e.g. creating/deleting/editing a record). If you already know what the new data should look like, you can (and should) immediately update the cache using the query client:
143143

144144
```tsx
145-
import {setQueryData, queryClient} from 'utils/queryClient'
145+
import {setQueryData, useQueryClient} from 'utils/queryClient'
146146

147147
const queryClient = useQueryClient();
148148

develop-docs/sdk/data-model/event-payloads/exception.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ the root exception (the last to be listed in the exception values).
111111

112112
: An optional flag indicating that this exception is part of an exception group type specific to the platform or language.
113113

114+
`source`
115+
116+
: An optional string value describing the source of the exception. The SDK should populate this with the name of the property or attribute of the parent exception that this exception was acquired from. In the case of an array, it should include the zero-based array index as well.
117+
118+
- Python Examples: `"__context__"`, `"__cause__"`, `"exceptions[0]"`, `"exceptions[1]"`
119+
- .NET Examples: `"InnerException"`, `"InnerExceptions[0]"`, `"InnerExceptions[1]"`
120+
- JavaScript Examples: `"cause"`, `"errors[0]"`, `"errors[1]"`
121+
114122
`meta`
115123

116124
: Optional information from the operating system or runtime on the exception

develop-docs/sdk/data-model/event-payloads/index.mdx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,7 @@ Fingerprints](https://docs.sentry.io/data-management/event-grouping/).
304304
## Size Limits
305305

306306
Event ingestion imposes limits on the size of events.
307-
These limits are subject to future change and defined currently as:
308-
309-
- *1MB* decompressed (and `200KB` compressed) for events of type `error`
310-
- *1MB* decompressed (and `200KB` compressed) for events of type `transaction`
311-
312-
Sessions, client reports, replays, check-ins, and profiles are not events and have different size limits. See [Envelope Size Limits](/sdk/data-model/envelopes/#size-limits).
307+
See [Envelope Size Limits](/sdk/data-model/envelopes/#size-limits) for futher details.
313308

314309
## Core Interfaces
315310

develop-docs/sdk/data-model/event-payloads/message.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ help to group similar messages into the same issue.
1414
: **Required**. The fully formatted message. If missing, Sentry will try to
1515
interpolate the message.
1616

17-
It must not exceed 8192 characters. Longer messages will be truncated. Sentry
18-
also accepts a message where this is not set to support legacy SDKs.
17+
A limit of 8192 characters is exposed in Relay and longer messages will be truncated.
18+
SDKs should not enforce this limit.
19+
Sentry also accepts a message where this is not set to support legacy SDKs.
1920

2021
`message`
2122

2223
: _Optional_. The raw message string (uninterpolated).
2324

24-
It must not exceed 8192 characters. Longer messages will be truncated.
25+
A limit of 8192 characters is exposed in Relay and longer messages will be truncated.
26+
SDKs should not enforce this limit.
2527

2628
`params`
2729

develop-docs/sdk/overview.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ happens immediately that may result in a different response code (and message).
294294

295295
## Handling Errors
296296

297+
### Server Errors
298+
297299
We **highly encourage** that your SDK handle failures from the Sentry server
298300
gracefully. Specifically, SDKs must honor the `429` status code and not attempt
299301
sending until the `Retry-After` kicks in. SDKs should drop events if Sentry is
@@ -328,6 +330,20 @@ Retrying too often may cause further rate limiting or blocking by the Sentry
328330
server.
329331
</Alert>
330332

333+
### SDK Errors
334+
335+
We try our best to make our SDKs error-free. We are an exception monitoring service after all
336+
and throwing our own exceptions is awkward. However, if our SDKs do throw exceptions, we have to make
337+
sure we swallow them gracefully and emit an error level log describing the failure.
338+
339+
As a **design principle**, we never capture Sentry events for exceptions happening within our SDKs, including within user-defined callbacks and hooks such as `before_send` or `traces_sampler`.
340+
341+
The reason we avoid capturing internal SDK exceptions is that we are already in an event capturing flow
342+
where the scope has been applied and capturing another event at that point in the lifecycle
343+
would lead to undefined behavior. In the worst case, we could create a busy loop of creating and sending events repeatedly until the system crashes.
344+
345+
In mobile SDKs, unhandled crashes will still make it to Sentry via the crash handlers. See [SDK Crash Detection](https://github.com/getsentry/sentry/tree/master/src/sentry/utils/sdk_crashes#sdk-crash-detection) for more details.
346+
331347
## Concurrency (Scope and Hubs)
332348

333349
SDKs are supposed to provide standardized concurrency handling through the

0 commit comments

Comments
 (0)