Skip to content

Commit e042ce8

Browse files
committed
Merge branch 'master' into antonis/rn-feedback-button
2 parents 23cbfc7 + a03721e commit e042ce8

File tree

161 files changed

+1731
-1331
lines changed

Some content is hidden

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

161 files changed

+1731
-1331
lines changed

app/api/ip-ranges/ip-ranges.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"data": {
3+
"dashboard": {
4+
"sentry_io": [
5+
"35.186.247.156/32"
6+
],
7+
"us_sentry_io": [
8+
"35.186.247.156/32"
9+
],
10+
"de_sentry_io": [
11+
"34.36.122.224/32",
12+
"34.36.87.148/32"
13+
]
14+
},
15+
"event_ingestion": {
16+
"apex_domain": [
17+
"35.186.247.156/32"
18+
],
19+
"organization_subdomains": {
20+
"us": [
21+
"34.120.195.249/32"
22+
],
23+
"eu": [
24+
"34.120.62.213/32",
25+
"130.211.36.74/32"
26+
]
27+
},
28+
"legacy": [
29+
"34.96.102.34/32"
30+
]
31+
},
32+
"outbound_requests": {
33+
"us": [
34+
"35.184.238.160/32",
35+
"104.155.159.182/32",
36+
"104.155.149.19/32",
37+
"130.211.230.102/32"
38+
],
39+
"eu": [
40+
"34.141.31.19/32",
41+
"34.141.4.162/32",
42+
"35.234.78.236/32"
43+
]
44+
},
45+
"email_delivery": [
46+
"167.89.86.73",
47+
"167.89.84.75",
48+
"167.89.84.14"
49+
],
50+
"uptime_monitoring": [
51+
"34.123.33.225",
52+
"34.41.121.171",
53+
"34.169.179.115",
54+
"35.237.134.233",
55+
"34.85.249.57",
56+
"34.159.197.47",
57+
"35.242.231.10",
58+
"34.107.93.3",
59+
"35.204.169.245"
60+
]
61+
}
62+
}

app/api/ip-ranges/route.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// these ranges are a copy of docs/security-legal-pii/security/ip-ranges.mdx
2+
import ipRanges from './ip-ranges.json';
3+
4+
// 12h
5+
const CACHE_DURATION = 12 * 60 * 60;
6+
7+
export function GET() {
8+
const headers = new Headers({
9+
'Content-Type': 'application/json',
10+
'Cache-Control': `public, max-age=${CACHE_DURATION}`,
11+
'X-Content-Type-Options': 'nosniff',
12+
'X-Frame-Options': 'DENY',
13+
'X-XSS-Protection': '1; mode=block',
14+
});
15+
16+
return Response.json(ipRanges, {status: 200, headers});
17+
}

app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
3333
return (
3434
<html lang="en" suppressHydrationWarning>
3535
<head>
36-
<PlausibleProvider domain="docs.sentry.io,rollup.sentry.io" />
36+
<PlausibleProvider taggedEvents domain="docs.sentry.io,rollup.sentry.io" />
3737
</head>
3838
<body className={rubik.variable} suppressHydrationWarning>
3939
<ThemeProvider
@@ -58,6 +58,7 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
5858
data-font-family="var(--font-rubik)"
5959
data-modal-disclaimer="Please note: This is a tool that searches publicly available sources. Do not include any sensitive or personal information in your queries. For more on how Sentry handles your data, see our [Privacy Policy](https://sentry.io/privacy/)."
6060
data-modal-example-questions="How to set up Sentry for Next.js?,What are tracePropagationTargets?"
61+
data-user-analytics-cookie-enabled="false"
6162
/>
6263
</body>
6364
</html>

develop-docs/backend/api/design.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,24 @@ POST /resources/{id}
119119

120120
### Batch Operations
121121

122-
Resources can get complicated when you need to expose batch operations vs single resource operations. For batch operations it is preferred to expose them as a `POST` request on the collection when possible.
122+
Resources can get complicated when you need to expose batch operations vs single resource operations. For batch operations it is preferred to expose them as a `PUT` request on the collection when possible.
123123

124124
Let's say for example we have an endpoint that mutates an issue:
125125

126126
```
127-
POST /api/0/organizations/{org}/issues/{issue}/
127+
PUT /api/0/organizations/{org}/issues/{issue}/
128128
```
129129

130130
When designing a batch interface, we simply expose it on the collection instead of the individual resource:
131131

132132
```
133-
POST /api/0/organizations/{org}/issues/
133+
PUT /api/0/organizations/{org}/issues/
134134
```
135135

136136
You may also need to expose selectors on batch resources, which can be done through normal request parameters:
137137

138138
```
139-
POST /api/0/organizations/{org}/issues/
139+
PUT /api/0/organizations/{org}/issues/
140140
{
141141
"issues": [1, 2, 3]
142142
}
@@ -237,7 +237,7 @@ Expanding responses allow us to include relational information on a resource wit
237237

238238
In general, endpoints should expose the fewest fields that will make the API usable in the general scenario. Doing one SQL request per API request is a good rule of thumb. To return information on a bounded relationship, endpoints should rely on the `expand` parameter. To return an unbounded relationship, it should be another endpoint.
239239

240-
To take an example, let's talk about the projects list endpoint. A project belongs to an organizations but could be on multiple teams.
240+
To take an example, let's talk about the projects list endpoint. A project belongs to an organization but could be on multiple teams.
241241

242242
By default, here's what the project endpoint should look like
243243

develop-docs/backend/application-domains/kafka.mdx

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,34 @@ title: Kafka consumers
33
sidebar_order: 60
44
---
55

6-
## Creating a new consumer in Sentry
6+
## Create a new Kafka topic
77

8-
WIP! This is currently just a checklist.
8+
1. Add the topic to the `KAFKA_TOPIC_TO_CLUSTER` in [src/sentry/conf/server.py](https://github.com/getsentry/sentry/blob/master/src/sentry/conf/server.py):
9+
* e.g. `subscription-results-eap-items`
10+
2. Add the topic to `Topic` in [src/sentry/conf/types/kafka_definition.py](https://github.com/getsentry/sentry/blob/master/src/sentry/conf/types/kafka_definition.py)
11+
12+
## Define or re-use a processing strategy
13+
14+
In most cases a [Streaming Factory](https://getsentry.github.io/arroyo/getstarted.html#create-a-streaming-consumer) is what you want to when defining a consumer (see next section). You can find examples of it in [Sentry's code base](https://github.com/search?q=repo%3Agetsentry%2Fsentry+%28ProcessingStrategyFactory&type=code).
15+
16+
## Define a new Kafka consumer
917

1018
1. Add a new entry in the `KAFKA_CONSUMERS` key in
11-
`src/sentry/consumers/__init__.py`.
19+
[src/sentry/consumers/__init__.py](https://github.com/getsentry/sentry/blob/master/src/sentry/consumers/__init__.py):
20+
```python
21+
KAFKA_CONSUMERS = {
22+
"<your_topic_str_here>": {
23+
"topic": Topic.YOUR_TOPIC,
24+
"strategy_factory": "sentry_package_defining_your_strategy_factory_class",
25+
}
26+
}
27+
```
28+
2. You may need optional properties (e.g. `click_options`, you will need to research them by looking at [ConsumerDefinition](https://github.com/getsentry/sentry/blob/master/src/sentry/conf/types/kafka_definition.py)'s code.
29+
30+
3. Make sure you can run it: `sentry run consumer <your_topic>`
31+
4. You may need to add some devserver options [here](https://github.com/getsentry/sentry/blob/master/src/sentry/runner/commands/devserver.py).
32+
4. Add tests for your consumer
1233

13-
2. Create ops PR for adding your consumer to
14-
`k8s/services/getsentry/consumer-deployment.yaml`.
34+
## Deployment
1535

16-
3. In the Sentry Consumers metrics dashboard, add a new saved view for your
17-
consumer.
36+
Visit the Ops repo and search for `shared_config/kafka/README.md` for a full, in-depth step-by-step guide.

develop-docs/sdk/data-model/envelope-items.mdx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -146,39 +146,6 @@ details.
146146

147147
_None_
148148

149-
### Statsd (deprecated)
150-
151-
Item type `"statsd"` contains metrics emissions in a superset of the statsd format.
152-
153-
See the <Link to="/sdk/metrics/">metrics</Link> documentation for the payload
154-
details.
155-
156-
**Constraints:**
157-
158-
- This Item may occur multiple times per Envelope.
159-
- Ingestion may limit the maximum number of Items per Envelope, see _Ingestion_.
160-
161-
**Additional Item Headers:**
162-
163-
_None_
164-
165-
### Metric Meta (deprecated)
166-
167-
Item type `"metric_meta"` contains per-metric meta data which is persisted alongside
168-
metrics in the system.
169-
170-
See the <Link to="/sdk/metrics/">metrics</Link> documentation for the payload
171-
details.
172-
173-
**Constraints:**
174-
175-
- This Item may occur multiple times per Envelope.
176-
- Ingestion may limit the maximum number of Items per Envelope, see _Ingestion_.
177-
178-
**Additional Item Headers:**
179-
180-
_None_
181-
182149
### User Feedback
183150

184151
Item type `"feedback"` contains an event with a feedback context in the payload encoded in JSON.

develop-docs/sdk/expected-features/rate-limiting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ While these [data categories](https://github.com/getsentry/relay/blob/master/rel
8888
- `error`: Error events.
8989
- `transaction`: Transaction type events.
9090
- `span`: Span type events.
91-
- `security`: Events with event_type `csp`, `hpkp`, `expectct`, `expectstaple`
91+
- `security`: Events with event_type `csp`
9292
- `attachment`: Attachment bytes stored (unused for rate limiting)
9393
- `session`: Session update events
9494
- `profile`: Profiling events

develop-docs/sdk/expected-features/setup-wizards/index.mdx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,22 @@ For instance:
5353
Related to this, wizards should [check the git status](#1-check-preconditions) of the project and warn users if they're not in a clean state.
5454
This ensures that users can revert the changes easily if something goes wrong.
5555

56-
### Cater to the 80%
56+
### Respect Users' decisions
57+
58+
Wizards should allow users to select the high-level Sentry features (e.g. tracing, replay, profiling) they want to install.
59+
The SDK setup should be minimal, may be opinionated ("whatever makes sense for the platform") but
60+
must respect users' decisions.
5761

58-
Wizards should be opinionated in which SDK options are set and cater to the 80% use case.
59-
The SDK setup doesn't necessarily have to be minimal.
60-
For example, it can include optional but recommended integrations (e.g. session replay or profiling) or options (e.g. sample rates).
62+
Some examples:
63+
- We should not enable a feature that users previously declined (e.g. set `tracesSampleRate` if users previously declined to enable tracing)
64+
- We may set additional options, like the `tunnelRoute` option in Next.Js, but we should ask for consent whenever reasonable. In this example, consent is important because setting this option potentially increases users' traffic and hence their infrastructure bill.
65+
- We may set additional options like `tracePropagationTargets` or `sendDefaultPii` as comments, if we think that these are options users should be aware of.
66+
67+
### Cater to the 80%
6168

6269
Given that most wizards will actively modify code or config files, there is a chance that they might fail or break something.
63-
That's okay and expected as long as we're transparent about it and we tell users upfront that we're touching their files.
64-
We cannot possibly cover all edge cases but we should try to cover the 80% so that typical projects can be set up with the wizard.
70+
That's okay and expected as long as we're transparent about it and we tell users upfront that we're modifying their files.
71+
We cannot possibly cover all edge cases but we should try to cover the 80% so that typical projects can be set up successfully.
6572

6673
### Support Self-Hosted Sentry
6774

develop-docs/sdk/telemetry/logs.mdx

Lines changed: 89 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -268,33 +268,39 @@ An SDK should implement [Tracing without Performance](/sdk/telemetry/traces/trac
268268

269269
### Default Attributes
270270

271-
By default the SDK should set the following attributes:
271+
By default the SDK should attach the following attributes to a log:
272272

273-
1. `sentry.message.template`: The parameterized template string
274-
2. `sentry.message.parameter.X`: The parameters to the template string. X can either be the number that represent the parameter's position in the template string (`sentry.message.parameter.0`, `sentry.message.parameter.1`, etc) or the parameter's name (`sentry.message.parameter.item_id`, `sentry.message.parameter.user_id`, etc)
275-
3. `sentry.environment`: The environment set in the SDK
276-
4. `sentry.release`: The release set in the SDK
277-
5. `sentry.trace.parent_span_id`: The span id of the span that was active when the log was collected. This should not be set if there was no active span.
278-
6. `sentry.sdk.name`: The name of the SDK that sent the log
279-
7. `sentry.sdk.version`: The version of the SDK that sent the log
280-
8. [BACKEND SDKS ONLY] `server.address`: The address of the server that sent the log. Equivalent to `server_name` we attach to errors and transactions.
281-
282-
Example:
273+
1. `sentry.environment`: The environment set in the SDK if defined.
274+
2. `sentry.release`: The release set in the SDK if defined.
275+
3. `sentry.trace.parent_span_id`: The span id of the span that was active when the log was collected. This should not be set if there was no active span.
276+
4. `sentry.sdk.name`: The name of the SDK that sent the log
277+
5. `sentry.sdk.version`: The version of the SDK that sent the log
283278

284279
```json
285280
{
286-
"sentry.message.template": "Adding item %s for user %s",
287-
"sentry.message.parameter.0": "item_id",
288-
"sentry.message.parameter.1": "user_id",
289281
"sentry.environment": "production",
290282
"sentry.release": "1.0.0",
291283
"sentry.trace.parent_span_id": "b0e6f15b45c36b12",
292284
"sentry.sdk.name": "sentry.javascript.node",
293-
"sentry.sdk.version": "9.11.0",
294-
"server.address": "foo.example.com"
285+
"sentry.sdk.version": "9.11.0"
295286
}
296287
```
297288

289+
If the log was paramaterized the SDK should attach the following
290+
291+
1. `sentry.message.template`: The parameterized template string
292+
2. `sentry.message.parameter.X`: The parameters to the template string. X can either be the number that represent the parameter's position in the template string (`sentry.message.parameter.0`, `sentry.message.parameter.1`, etc) or the parameter's name (`sentry.message.parameter.item_id`, `sentry.message.parameter.user_id`, etc)
293+
294+
```json
295+
{
296+
"sentry.message.template": "Adding item %s for user %s",
297+
"sentry.message.parameter.0": "item_id",
298+
"sentry.message.parameter.1": "user_id"
299+
}
300+
```
301+
302+
#### SDK Integration Attributes
303+
298304
If a log is generated by an SDK integration, the SDK should also set the `sentry.origin` attribute, as per the [Trace Origin](/sdk/telemetry/traces/trace-origin/) documentation. It is assumed that logs without a `sentry.origin` attribute are manually created by the user.
299305

300306
```json
@@ -303,7 +309,73 @@ If a log is generated by an SDK integration, the SDK should also set the `sentry
303309
}
304310
```
305311

306-
Beyond these attributes, we are exploring if the SDK should also send OS, user, and device information automatically (via reading the appropriate contexts from the scope). Given this behaviour can easily be added as a new feature to the SDK, it does not have to be part of the initial SDK implementation until we make a finalized decision.
312+
#### User Attributes
313+
314+
If `sendDefaultPii`/`send_default_pii` is set to `true` in the SDK, the SDK should attach the following user data if available:
315+
316+
1. `user.id`: The user ID. Maps to `id` in the [User](/sdk/data-model/event-payloads/user/) payload.
317+
2. `user.name`: The username. Maps to `username` in the [User](/sdk/data-model/event-payloads/user/) payload.
318+
3. `user.email`: The email address. Maps to `email` in the [User](/sdk/data-model/event-payloads/user/) payload.
319+
320+
```json
321+
{
322+
"user.id": "123",
323+
"user.name": "john.doe",
324+
"user.email": "[email protected]"
325+
}
326+
```
327+
328+
#### User Agent Parsing
329+
330+
By default, Relay should parse the user agent attached to an incoming log envelope to parse `browser` and `os` information for logs. These attributes should be attached by Relay, but SDKs can attach them if they do not forward a user agent when sending logs to Sentry.
331+
332+
1. `browser.name`: Display name of the browser application. Maps to `name` in the [Contexts](/sdk/data-model/event-payloads/contexts/#browser-context) payload.
333+
2. `browser.version`: Version string of the browser. Maps to `version` in the [Contexts](/sdk/data-model/event-payloads/contexts/#browser-context) payload.
334+
335+
```json
336+
{
337+
"browser.name": "Chrome",
338+
"browser.version": "120.0"
339+
}
340+
```
341+
342+
#### Backend SDKs
343+
344+
For backend SDKs (Node.js, Python, PHP, etc.), the SDKs should attach the following:
345+
346+
1. `server.address`: The address of the server that sent the log. Equivalent to [`server_name`](sdk/data-model/event-payloads/#optional-attributes) we attach to errors and transactions.
347+
348+
```json
349+
{
350+
"server.address": "foo.example.com"
351+
}
352+
```
353+
354+
#### Mobile, Desktop, and Native SDKs
355+
356+
For mobile, desktop, and native SDKs (Android, Apple, Electron, etc.), the SDKs should attach the following:
357+
358+
1. `os.name`: The name of the operating system. Maps to `name` in the [Contexts](/sdk/data-model/event-payloads/contexts/#os-context) payload.
359+
2. `os.version`: The version of the operating system. Maps to `version` in the [Contexts](/sdk/data-model/event-payloads/contexts/#os-context) payload.
360+
3. `device.brand`: The brand of the device. Maps to `brand` in the [Contexts](/sdk/data-model/event-payloads/contexts/#device-context) payload.
361+
4. `device.model`: The model of the device. Maps to `model` in the [Contexts](/sdk/data-model/event-payloads/contexts/#device-context) payload.
362+
5. `device.family`: The family of the device. Maps to `family` in the [Contexts](/sdk/data-model/event-payloads/contexts/#device-context) payload.
363+
364+
```json
365+
{
366+
"os.name": "iOS",
367+
"os.version": "17.0",
368+
"device.brand": "Apple",
369+
"device.model": "iPhone 15 Pro Max",
370+
"device.family": "iPhone"
371+
}
372+
```
373+
374+
#### Future Default Attributes
375+
376+
The SDKs should aim to minimize the number of default attributes attached to a log. Logs are intended to be lightweight, and we want to try to keep the average byte size of a log as small as possible as users will be charged per byte size of logs sent.
377+
378+
We are trying to settle on a balance of debuggability vs. smaller byte size for logs which is why new default attributes should only be added after significant feedback from users and discussion internally with the SDK and ingest teams. There is no hard rule about what exact attributes are allowed, every proposed new attribute will be evaluated on a case-by-case basis.
307379

308380
### Data Category and Rate Limiting
309381

0 commit comments

Comments
 (0)