Skip to content

Commit 3ec1e9d

Browse files
author
Karl Heinz Struggl
committed
Merge branch 'master' into kahest/android-sdk-overhead
2 parents ab948bc + 648f05d commit 3ec1e9d

File tree

41 files changed

+712
-39
lines changed

Some content is hidden

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

41 files changed

+712
-39
lines changed

develop-docs/api-server/application-domains/database-migrations/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Extra care is needed here if the table is referenced as a foreign key in other t
287287

288288
- Make a pull request to remove all uses of the model in the codebase in a separate pull request. This mostly helps with code cleanliness. This should be merged ahead of the migration pull requests, but we don't need to worry about whether it is deployed first.
289289
- Make another pull request to:
290-
- Remove any database level foreign key constraints from this table to other tables by setting `db_constraint=False` on the columns.
290+
- Remove any database level foreign key constraints from this table to other tables by setting `db_constraint=False` on the columns. If it's a hybrid cloud foreign key, set `null=True` instead.
291291
- Remove the model and in the generated migration use `SafeDeleteModel(..., deletion_action=DeletionAction.MOVE_TO_PENDING)` to replace `DeleteModel(...)`. This only marks the state for the model as removed.
292292
- Deploy. It's important that all previous pull requests are in production before we remove the actual table.
293293
- Make a pull request that creates a new migration that has the same `SafeDeleteModel` operation as before, but set `deletion_action=DeletionAction.DELETE` instead. This deletes the actual table from Postgres.

develop-docs/engineering-practices/rust.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,26 @@ During migration you may need normal functions which return futures, for their s
5050

5151
### Async Traits
5252

53-
In **traits** you can not yet use `async fn` ([see this blog post](https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/)).
54-
In this case, functions should return `-> Pin<Box<dyn Future<Output = ...> + Send>>`:
53+
Support for async in **traits** has [landed in Rust](https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html)
54+
and should generally be preferred now.
5555

5656
```rust
57-
trait Database {
58-
fn get_user(&self) -> Pin<Box<dyn Future<Output = User> + Send + '_>>;
57+
pub trait Database {
58+
fn get_user(&self) -> impl Future<Output = User> + Send;
5959
}
6060

61-
impl Database for MyDB {
62-
fn get_user(&self) -> Pin<Box<dyn Future<Output = User> + Send + '_>> {
63-
Box::pin(async {
64-
// ...
65-
})
66-
}
61+
impl Database for MyDatabase {
62+
async fn get_user(&self) -> User {
63+
todo!()
64+
}
6765
}
6866
```
6967

7068
Note that the returned future type is `Send`, to ensure that it can run on a multi-threaded runtime.
7169

72-
This corresponds to what the [async-trait crate](https://crates.io/crates/async-trait) does.
70+
When you need dynamic dispatch or have to support Rust versions older than 1.75 consider using the
71+
[`async-trait`](https://docs.rs/async-trait/) crate.
72+
7373

7474
### Avoid `.unwrap()`
7575

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,17 @@ To summarize:
261261

262262
: _Optional_. An unprocessed description string obtained by the operating system. For some well-known runtimes, Sentry will attempt to parse `name` and `version` from this string, if they are not explicitly given.
263263

264-
`distribution`
264+
`distribution_name`
265265

266-
: _Optional_. An object that provides meta-data for Linux distributions. The values correspond to entries from the [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#Options) configuration. Contains the following keys:
266+
: _Optional_. A stable name for each distribution. This maps to `ID` in [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#ID=) (examples: `ubuntu`, `rhel`, `alpine`; a full list of tested identifiers is available in the [Native SDK repository](https://github.com/getsentry/sentry-native/blob/master/tests/fixtures/os_releases/distribution_names.txt))
267267

268+
`distribution_version`
268269

269-
- `name`: A stable name for each distribution. This maps to `ID` in `/etc/os-release` (examples: `ubuntu`, `rhel`, `alpine`; a full list of tested identifiers is available in the [Native SDK repository](https://github.com/getsentry/sentry-native/blob/feat/add_linux_distros_to_os_context/tests/fixtures/os_releases/distribution_names.txt).
270-
- `version`: _Optional_. Typically identifies at least the major release version number. This maps to `VERSION_ID` in `/etc/os-release`. Distributions with rolling releases only, will not provide a version.
271-
- `pretty_name`: _Optional_. Typically provides the full name, full version, and release alias. This maps to `PRETTY_NAME` in `/etc/os-release` (examples: `Ubuntu 22.04.4 LTS`, `Raspian GNU/Linux 10 (buster)`).
270+
: _Optional_. Typically identifies at least the major release version number. This maps to `VERSION_ID` in [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#VERSION_ID=). Distributions with rolling releases only, will not provide a version.
271+
272+
`distribution_pretty_name`
273+
274+
: _Optional_. Typically provides the full name, full version, and release alias. This maps to `PRETTY_NAME` in [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#PRETTY_NAME=) (examples: `Ubuntu 22.04.4 LTS`, `Raspian GNU/Linux 10 (buster)`).
272275

273276
### Example OS Context
274277

@@ -293,10 +296,9 @@ The OS Context for the 3 major OSs should look like this:
293296
"type": "os",
294297
"name": "Linux",
295298
"version": "6.1.82(99.168.amzn2023.x86_64)",
296-
"distribution": {
297-
"name": "amzn",
298-
"version": "2023",
299-
"pretty_name": "Amazon Linux 2023.4.20240401"
299+
"distribution_name": "amzn",
300+
"distribution_version": "2023",
301+
"distribution_pretty_name": "Amazon Linux 2023.4.20240401"
300302
}
301303
}
302304
}
@@ -628,7 +630,7 @@ Additional information that allows Sentry to connect multiple transactions, span
628630

629631
`span_id`
630632

631-
: _Required_. The ID of the span.
633+
: _Required_. The ID of the span or transaction. For non-transaction events, and if performance monitoring is disabled, it may still be desired to attach events to a trace via a trace ID. In these cases, you still need to provide a span ID. This span ID can effectively be entirely random and doesn't need to relate to an actual span, however, it is recommended to consider using the same span ID for multiple events within the same unit-of-execution (e.g. a request). [See the TwP docs](/sdk/telemetry/traces/tracing-without-performance/#attaching-trace-data-to-events-and-envelopes) for more details.
632634

633635
- Example: `"bb8f278130535c3c"`
634636

develop-docs/sdk/processes/releases.mdx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Nice!
8484

8585
This file is used to trigger the release from the GitHub UI.
8686

87-
You'll notice it uses `secrets.GH_RELEASE_PAT` -- this should already be
87+
You'll notice it uses `vars.SENTRY_RELEASE_BOT_CLIENT_ID` and `secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY` -- these should be
8888
available to your repository automatically!
8989

9090
```yaml
@@ -105,14 +105,20 @@ jobs:
105105
runs-on: ubuntu-latest
106106
name: "Release a new version"
107107
steps:
108+
- name: Get auth token
109+
id: token
110+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
111+
with:
112+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
113+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
108114
- uses: actions/checkout@v3
109115
with:
110-
token: ${{ secrets.GH_RELEASE_PAT }}
116+
token: ${{ steps.token.outputs.token }}
111117
fetch-depth: 0
112118
- name: Prepare release
113119
uses: getsentry/action-prepare-release@v1
114120
env:
115-
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
121+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
116122
with:
117123
version: ${{ github.event.inputs.version }}
118124
force: ${{ github.event.inputs.force }}
@@ -132,11 +138,16 @@ Here's [an example PR] and the [follow-up to fix `fetch-depth`].
132138
Give the following teams access to your repository:
133139

134140
- `engineering` -> `write`
135-
- `release-bot` -> `elevated bot`
136141

137142
You can do this self-service via the settings page of your repository:
138143
`https://github.com/getsentry/REPONAME_HERE/settings/access`
139144

145+
## Create Ruleset for the Repo
146+
147+
Download and save the [default ruleset template](/json/Default_ruleset.json) as a JSON file.
148+
149+
Visit the ruleset setting page of your repository: `https://github.com/getsentry/REPONAME_HERE/settings/rules`, click on the green **New ruleset** button, choose **Import a ruleset**, and select the JSON file you just downloaded. You can tweak the ruleset settings, but please don't remove the App in the Bypass List.
150+
140151
## Making Your First Release!
141152

142153
Navigate to the actions tab of your repository, locate the release workflow,

develop-docs/self-hosted/troubleshooting.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ CSRF_TRUSTED_ORIGINS = ["https://sentry.example.com", "http://10.100.10.10", "ht
2323

2424
See [Django's documentation on CSRF](https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS) for further detail.
2525

26+
### `sentry-data` volume not being cleaned up
27+
28+
You may see the `sentry-data` taking too much disk space. You can clean it manually (or putting the cleanup cronjob in place).
29+
30+
Find the Docker mountpoint for the volume by executing:
31+
```bash
32+
docker volume inspect sentry-data
33+
34+
# Or if you prefer to do it directly (assuming you have `jq` on your system):
35+
docker volume inspect sentry-data | jq -r .[0].Mountpoint
36+
```
37+
38+
Then run the following command to remove the contents of the volume for the last 30 days (change the `30` to whatever you want, it's in days):
39+
```bash
40+
# `/var/lib/docker/volumes/sentry-data/_data` refers to the mountpoint of the volume
41+
# from the output of the previous command. Change it if it's different.
42+
find /var/lib/docker/volumes/sentry-data/_data -type f -mtime +30 -delete
43+
```
44+
2645
## Kafka
2746

2847
One of the most likely things to cause issues is Kafka. The most commonly reported error is
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Sample Rates
3+
sidebar_order: 11
4+
description: Learn how to manage the amount of data you send and are billed for in Sentry by adjusting the sample rates of various Sentry products including Traces and Session Replays.
5+
---
6+
7+
## Overview
8+
9+
### What Is a Sample Rate?
10+
11+
Adding Sentry to your app gives you a lot of valuable information about errors and performance you wouldn't otherwise get. And lots of information is good -- as long as it's the right information, at a reasonable volume. You can use sample rates to capture only a specified percentage of events like errors and traces.
12+
13+
14+
### Why Not Capture All Events?
15+
16+
We recommend sampling your transactions for two reasons:
17+
18+
1. Capturing a single trace involves minimal overhead, but capturing traces for every page load or API request may add an undesirable load to your system.
19+
20+
1. Enabling sampling allows you to better manage the number of events sent to Sentry, so you can tailor your volume to your organization's needs and budget.
21+
22+
Choose a sampling rate that balances data accuracy with performance and storage concerns. You should aim to collect enough data to get meaningful insights without overloading resources. If unsure, start with a low rate and gradually increase it as you understand your traffic patterns better.
23+
24+
## Sampling Rate Options
25+
26+
<Note>
27+
Some of the options below aren't available in every SDK; check out our platform-specific docs for more info.
28+
</Note>
29+
30+
### Error Events
31+
32+
- **SampleRate** - Configures the sample rate for error events, in the range of 0.0 to 1.0. The default is 1.0, which means that 100% of error events will be sent. If set to 0.1, only 10% of error events will be sent. Events are picked randomly.
33+
34+
### Tracing
35+
36+
- **tracesSampleRate** - A number between 0 and 1, controlling the percentage chance a given transaction will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies equally to all transactions created in the app. Either this or `tracesSampler` must be defined to enable tracing.
37+
38+
- **tracesSampler** - A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between 0 (0% chance of being sent) and 1 (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or `tracesSampleRate` must be defined to enable tracing.
39+
40+
Learn more about [tracing](/product/tracing/) in Sentry.
41+
### Session Replay
42+
43+
- **replaysSessionSampleRate** - The sample rate for replays that begin recording immediately and last the entirety of the user's session. 1.0 collects all replays, and 0 collects none.
44+
45+
- **replaysOnErrorSampleRate** - The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends. 1.0 captures all sessions with an error, and 0 captures none.
46+
47+
Learn more about [session replay](/product/explore/session-replay/) in Sentry.

docs/concepts/search/searchable-properties/events.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,18 @@ The independent kernel version string. This is typically the entire output of th
472472

473473
- **Type:** string
474474

475+
### `os.distribution_name`
476+
477+
The Linux distribution name. This maps to `ID` in [`/etc/os-release/`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html).
478+
479+
- **Type:** string
480+
481+
### `os.distribution_version`
482+
483+
The Linux distribution version. This maps to `VERSION_ID` in [`/etc/os-release/`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html).
484+
485+
- **Type:** string
486+
475487
### `percentile(field,level)`
476488

477489
Returns results with an approximate percentile of the field to the level. The level can be between `0` and `1`. For example, if you wanted to find the 50th percentile of transaction durations, you would enter `percentile(transaction.duration, 0.5)`.

docs/concepts/search/searchable-properties/issues.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,18 @@ The independent kernel version string. This is typically the entire output of th
292292

293293
- **Type:** string
294294

295+
### `os.distribution_name`
296+
297+
The Linux distribution name. This maps to `ID` in [`/etc/os-release/`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html).
298+
299+
- **Type:** string
300+
301+
### `os.distribution_version`
302+
303+
The Linux distribution version. This maps to `VERSION_ID` in [`/etc/os-release/`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html).
304+
305+
- **Type:** string
306+
295307
### `platform.name`
296308

297309
Name of the platform
149 KB
Loading

docs/organization/integrations/feature-flag/launchdarkly/index.mdx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
11
---
22
title: LaunchDarkly
33
sidebar_order: 1
4-
description: Learn about Sentry's LaunchDarkly integration. LaunchDarkly enables organizations to use Sentry errors as a metric in their LaunchDarkly experiments.
4+
description: Learn about Sentry's LaunchDarkly integrations.
55
---
66

7+
## Evaluation Tracking
8+
9+
Sentry can track flag evaluations as they happen within your application. Flag evaluations will appear in the "Feature Flag" section of Issue Details page as a table, with "suspect" flag predictions highlighted in yellow. Learn more about how to interact with feature flag insights within the Sentry UI by reading the [Issue Details page documentation](/product/issues/issue-details/#feature-flags).
10+
11+
### Set Up Evaluation Tracking
12+
13+
To set up evaluation tracking visit one of our supported languages pages:
14+
* [JavaScript](/platforms/javascript/configuration/integrations/launchdarkly/)
15+
* [Python](/platforms/python/integrations/launchdarkly/)
16+
17+
## Change Tracking
18+
19+
Sentry can track changes to feature flag definitions and report suspicious feature flag edits.
20+
21+
### Set Up Change Tracking
22+
23+
Enabling Change Tracking is a three step process. To get started visit the [feature-flags settings page](https://sentry.io/orgredirect/organizations/:orgslug/settings/feature-flags) in a new tab. Then follow the steps listed below.
24+
25+
1. **Click the "Add New Provider" button.
26+
- One webhook secret can be registered per provider type.
27+
2. **Register the webhook URL**.
28+
- Copy the provided Sentry webhook URL and paste it into LaunchDarkly within their [webhook integration UI](https://app.launchdarkly.com/settings/integrations/webhooks/new).
29+
3. **Set the Signing Secret**.
30+
- In the LaunchDarkly webhook UI check the box that says "Sign this webhook".
31+
- Copy the signing secret in the revealed input box and paste it into the input box labeled "Secret" in Sentry.
32+
- Save the secret by clicking "Save Secret" in the Sentry fly out.
33+
- Save the webhook by clicking "Save Settings" in LaunchDarkly.
34+
35+
Once saved Sentry will now accept and authenticate all inbound hooks to your organization's feature flag webhook endpoint.
36+
37+
## Metrics Integration
38+
739
This integration is maintained and supported by the company that created it. For more details or questions, feel free to contact [email protected].
840

9-
## Install and Configure
41+
### Install and Configure
1042

1143
<Note>
1244

0 commit comments

Comments
 (0)