Skip to content

Commit 1b2c34e

Browse files
author
Shannon Anahata
committed
Merge remote-tracking branch 'origin/master' into monitors-alerts-EA
Resolving merge conflict
2 parents 7c31959 + 86f173d commit 1b2c34e

File tree

132 files changed

+4625
-746
lines changed

Some content is hidden

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

132 files changed

+4625
-746
lines changed

.github/workflows/algolia-index.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
index:
88
name: Update Algolia index
99
runs-on: ubuntu-latest
10+
env:
11+
NODE_OPTIONS: '--max-old-space-size=6144'
1012
steps:
1113
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1214

@@ -28,6 +30,15 @@ jobs:
2830
- 'platform-includes/**'
2931
dev-docs:
3032
- 'develop-docs/**'
33+
34+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
35+
with:
36+
path: |
37+
${{ github.workspace }}/.next/cache
38+
key: nextjs-${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
restore-keys: |
40+
nextjs-${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-
41+
3142
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
3243
with:
3344
bun-version: '1.1.34'
@@ -38,7 +49,7 @@ jobs:
3849
# without introducing another dependency like ts-node or tsx for everyone else
3950

4051
- name: Build index for user docs
41-
run: pnpm build && bun ./scripts/algolia.ts
52+
run: pnpm enforce-redirects && pnpm generate-og-images && pnpm generate-doctree && pnpm next build && bun ./scripts/algolia.ts
4253
if: steps.filter.outputs.docs == 'true'
4354
env:
4455
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
@@ -50,7 +61,7 @@ jobs:
5061
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
5162

5263
- name: Build index for developer docs
53-
run: pnpm build:developer-docs && bun ./scripts/algolia.ts
64+
run: git submodule init && git submodule update && pnpm enforce-redirects && pnpm generate-doctree && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm next build && bun ./scripts/algolia.ts
5465
if: steps.filter.outputs.dev-docs == 'true'
5566
env:
5667
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}

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

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ by the client yet, three systems start operating:
3333
the special `{{ default }}` value.
3434

3535
It's important to know that the grouping algorithm can produce more than one fingerprint hash. These hashes
36-
are collected and associated with issues. There are two types of hashes that can be created:
37-
38-
* flat hashes: these are traditional hashes where all hashes are equal. If any of these hashes exists in a group
39-
it is associated with it and any hash not yet associated with the group is added.
40-
* hierarchical hashes: these are secondary hashes that can be used to subdivide a group in the grouping tab.
36+
are collected and associated with issues via the `GroupHash` model. If any of these hashes exists in a group
37+
the event is associated with it, and any hash not yet associated with the group is added. In practice this
38+
means an event may produce both an "app" hash (using only in-app frames) and a "system" hash (using all frames),
39+
and either one matching an existing group is sufficient.
4140

4241
# Issue / Group Creation
4342

@@ -56,9 +55,40 @@ event as it flows further through the system to make it's way towards snuba, is
5655
which also means that the group is persisted in snuba along with the event.
5756

5857
Upon group creation, additional code runs such as the triggering of alerts, regression detection and more.
59-
It is thus relatively expensively to create a group due to the number of additional actions that can be
58+
It is thus relatively expensive to create a group due to the number of additional actions that can be
6059
triggered from it.
6160

61+
# AI Grouping
62+
63+
In addition to fingerprint-based grouping, Sentry uses AI to further improve issue grouping accuracy.
64+
This system identifies issues with similar stacktraces and error messages that might have different fingerprints
65+
due to minor code variations. AI grouping works alongside traditional fingerprinting, occurring *after* hash-based lookup
66+
and *before* new group creation:
67+
68+
1. The event's hashes are computed via the standard grouping algorithm.
69+
2. Sentry checks whether any of those hashes already belong to an existing group via the hash-based lookup.
70+
3. If no existing group is found, and the event is eligible, Sentry generates an embedding
71+
of the error's message and in-app stack frames, compares this embedding against existing
72+
error embeddings for that project, and merges the new error into an existing issue if a similar
73+
issue is found within the configured threshold.
74+
4. If no match is found (or the event is ineligible), a new group is created as before.
75+
76+
Eligibility is determined by [`should_call_seer_for_grouping`](https://github.com/getsentry/sentry/blob/master/src/sentry/grouping/ingest/seer.py)
77+
in `src/sentry/grouping/ingest/seer.py`. Beyond the fingerprint check above, it also considers:
78+
79+
- Whether the event has a usable stacktrace
80+
- Whether the event's platform is supported
81+
- Whether the project has AI-enhanced grouping enabled
82+
- Rate limits (both global and per-project)
83+
- A circuit breaker that trips if error rates are too high
84+
- Stacktrace size limits
85+
86+
Results — including the matched grouphash, match distance, and model version — are
87+
persisted in the [`GroupHashMetadata`](https://github.com/getsentry/sentry/blob/master/src/sentry/models/grouphashmetadata.py)
88+
model alongside the event's hash-based grouping metadata.
89+
90+
More details on the AI grouping process can be found on the public facing docs [here](https://docs.sentry.io/concepts/data-management/event-grouping/#ai-enhanced-grouping).
91+
6292
# Merges and Splits
6393

6494
The system does not cope particularly well with merges and splits because the events in Snuba are generally
@@ -148,8 +178,7 @@ existing group.
148178
Sentry at the moment feeds the entire stack into the group. There is a way to limit the number of frames
149179
contributed down to a smaller set by setting a maximum number of frames that should be considered. This
150180
has a hypothetical advantage when working with different paths that lead to a bug but have the consequence
151-
that very large groups can be created. Creating larger groups is tricker in Sentry as without hierarchical
152-
grouping there are no good ways to dive into the different stacks in an issue.
181+
that very large groups can be created.
153182

154183
## Fallback Grouping
155184

@@ -171,37 +200,28 @@ think of grouping as a problem of the source of the error. At any point the que
171200
source of the error is "how we call a function" (caller error) or "in the function" (callee error). Making
172201
this decision is impossible to make in a general sense, but over time it can be easier to make this call.
173202

174-
Sentry has an experimental grouping system called "hierarchical" grouping where we allow diving into the
175-
different paths towards a bug by preferring to over-group and then provide a grouping tab that can show
176-
the different paths by which we came to the error. However the limitation of this with the current group
177-
system is that since the group has been created, there is now way to split out, you can end up with a much
178-
larger group than you desired.
179-
180203
# Paths Forward
181204

182-
The grouping system as implemented relates very close to the work flow that is established with the groups
183-
that are created. It is the creator of the groups and as the creator, it drives a big part of the user
184-
experience that derives from it. If it were to create a single issue per event, or a single issue for all
185-
events nothing in Sentry would properly function any more. It is thus our first point of balancing the
186-
quality of the workflow. Unfortunately with the tools available today there we are sitting in a pretty
187-
tough spot at the time of grouping. If we get it wrong, the user is likely stuck.
205+
The grouping system is tightly coupled to the workflow that issues drive. It is the creator of the groups
206+
and as the creator, it drives a big part of the user experience. If it were to create a single issue per
207+
event, or a single issue for all events, nothing in Sentry would properly function. It is thus our first
208+
point of balancing the quality of the workflow.
188209

189-
The following general paths forward are current envisioned:
210+
## Improving AI-Enhanced Grouping
211+
212+
The introduction of AI-enhanced grouping has already improved the caller-vs-callee problem described
213+
above, but there is ongoing work to improve model accuracy, expand platform support, and reduce latency.
214+
Key areas include better handling of hybrid fingerprints, improving confidence thresholds, and training on
215+
broader datasets.
190216

191217
## Groups of Groups
192218

193219
The consequences of making too many groups today are alert spam and the inability to work with multiple
194220
issues at once. If Sentry were to no longer be alerting on all new groups and tools existed to work
195-
across multiple groups more opportunities arise. In particular the grouping algorithm could continue to
221+
across multiple groups, more opportunities arise. In particular the grouping algorithm could continue to
196222
just fingerprint the stack trace but a secondary process could come in periodically and sweep up related
197223
fingerprints into a larger group. If we take the `get_current_user` example the creation of 50 independent
198-
groups is not much of an issue if no alerts are fired. If after 5 minute the system detected that they are
224+
groups is not much of an issue if no alerts are fired. If after 5 minutes the system detected that they are
199225
in fact all very related (eg: the bug is "in `get_current_user`") it could leave the 50 generated groups
200226
alone but create a new group that links the other 50 groups, hide/deemphasize the individual 50 groups in
201227
the UI and let the user work with the larger group instead.
202-
203-
## Evaluate Hierarchical Grouping
204-
205-
We also have the hierarchical grouping prototype which tries to group on fewer inputs. This system has
206-
some limitations but it's less likely to create many groups. Unfortunately the user experience is
207-
not fleshed out as working with parts of the group is not an option.

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You have the ability to only run a frontend development server that will proxy a
1212
pnpm dev-ui
1313
```
1414

15-
The development server can be viewed at [https://dev.getsentry.net:7999](https://dev.getsentry.net:7999). `dev.getsentry.net` is an alias for `localhost` and it's preferred because it supports subdomains. You can also create your own domain alias, as with ngrok, if you like.
15+
The development server can be viewed at [https://dev.getsentry.net:7999](https://dev.getsentry.net:7999). `dev.getsentry.net` supports subdomains and is the preferred domain for development. It's just an alias of localhost, you can also create your own domain alias, as with ngrok, if you like. If that domain is not resolving then it could be an issue with your DNS settings (or with your home network DNS settings), then add `127.0.0.1 dev.getsentry.net` to your `/etc/hosts` file.
1616

1717
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.
1818

@@ -21,6 +21,8 @@ While the SSO-login flow will not work, cookies from an existing logged-in sessi
2121
- [Get Cookie Sync for Chrome](https://chrome.google.com/webstore/detail/sentry-cookie-sync/kchlmkcdfohlmobgojmipoppgpedhijh)
2222
- [Get Cookie Sync for Firefox](https://addons.mozilla.org/en-US/firefox/addon/sentry-cookie-sync/)
2323

24+
**Note**: If the Cookie Sync extension is not working, make sure to log in to production first (https://sentry.sentry.io), then open the dev server domain in a new tab. (https://sentry.dev.getsentry.net:7999).
25+
2426
## Admin UI
2527

2628
To access the admin UI (files under `gsAdmin`), you can run:
@@ -39,15 +41,15 @@ Make sure you have cookies synced (see above), as authentication is required to
3941

4042
If you see an error similar to the below when accessing the development server:
4143

42-
![your connection is not private example](../img/connectionNotPrivate.png)
44+
![your connection is not private example =700x](../img/connectionNotPrivate.png)
4345

4446
You can either grant a temporary exception in your browser, or create and install a local certificate and use your OS to mark them as "trusted". TLS is required for the frontend development service, since the production API is served over https.
4547

4648
Follow the steps [To Enable HTTPS for your devserver](/development/environment/#enabling-https).
4749

48-
You can now run the dev server with `pnpm dev-ui` and open [https://localhost:7999](https://localhost:7999). There should not see a warning about your connection not being private. You should also see a lock or similar icon in the address bar of your browser.
50+
You can now run the dev server with `pnpm dev-ui` and open [https://dev.getsentry.net:7999](https://dev.getsentry.net:7999). There should not see a warning about your connection not being private. You should also see a lock or similar icon in the address bar of your browser.
4951

50-
![lock icon in address bar](../img/addressBarLockIcon.png)
52+
![lock icon in address bar =322x](../img/addressBarDevDomain.png)
5153

5254
**NOTE**: For Firefox users that use the master password you will be prompted for it with this message: "Enter Password or Pin for "NSS Certificate DB":"
5355

develop-docs/engineering-practices/commit-messages.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The header has a special format that includes a type, a scope and a subject:
4545
<footer>
4646
```
4747

48-
The **header** is mandatory and the **scope** of the header is optional. If you have a Jira issue to link to, add the **jira-id** the commit belongs to. This helps to connect changes back to Jira tickets.
48+
The **header** is mandatory and the **scope** of the header is optional. If you have a Linear issue to link to, add the **linear-id** the commit belongs to. This helps to connect changes back to Liner tickets.
4949

5050
Any line of the commit message should not be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
5151

20.1 KB
Loading
-25.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)