Skip to content

Commit c44f5aa

Browse files
authored
Merge branch 'main' into dependabot/pip/pip-8177a8837a
2 parents 08bbc6c + 1461c30 commit c44f5aa

File tree

211 files changed

+8489
-943
lines changed

Some content is hidden

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

211 files changed

+8489
-943
lines changed

.claude/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)",
5+
"Bash(ls:*)",
6+
"Bash(git:*)",
7+
"Bash(git status:*)",
8+
"Bash(git log:*)",
9+
"Bash(git diff:*)",
10+
"Bash(git show:*)",
11+
"Bash(git branch:*)",
12+
"Bash(git remote:*)",
13+
"Bash(git tag:*)",
14+
"Bash(git stash list:*)",
15+
"Bash(git rev-parse:*)",
16+
"Bash(gh pr view:*)",
17+
"Bash(gh pr list:*)",
18+
"Bash(gh pr checks:*)",
19+
"Bash(gh pr diff:*)",
20+
"Bash(gh issue view:*)",
21+
"Bash(gh issue list:*)",
22+
"Bash(gh run view:*)",
23+
"Bash(gh run list:*)",
24+
"Bash(gh run logs:*)",
25+
"Bash(gh repo view:*)",
26+
"WebFetch(domain:github.com)",
27+
"WebFetch(domain:docs.sentry.io)",
28+
"WebFetch(domain:develop.sentry.dev)",
29+
"Bash(grep:*)",
30+
"Bash(mv:*)"
31+
],
32+
"deny": []
33+
}
34+
}

.cursor/rules/feature_flags.mdc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,35 @@ There is a scope based and a span based API for tracking feature flag evaluation
1010

1111
The `addFeatureFlag` method can be used to track feature flag evaluations. It exists on `Sentry` static API as well as `IScopes` and `IScope`.
1212

13+
When using static API, `IScopes` or COMBINED scope type, Sentry will also invoke `addFeatureFlag` on the current span. This does not happen, when directly invoking `addFeatureFlag` on `IScope` (except for COMBINED scope type).
14+
1315
The `maxFeatureFlags` option controls how many flags are tracked per scope and also how many are sent to Sentry as part of events.
1416
Scope based feature flags can also be disabled by setting the value to 0. Defaults to 100 feature flag evaluations.
1517

1618
Order of feature flag evaluations is important as we only keep track of the last {maxFeatureFlag} items.
1719

18-
When a feature flag evluation with the same name is added, the previous one is removed and the new one is stored so that it'll be dropped last.
20+
When a feature flag evaluation with the same name is added, the previous one is removed and the new one is stored so that it'll be dropped last.
21+
Refer to `FeatureFlagBuffer` fore more details. `FeatureFlagBuffer` has been optimized for storing scope based feature flag evaluations, especially clone performance.
1922

20-
When sending out an error event, feature flag buffers from all three scope types (global, isolation and current scope) are merged, chosing the newest {maxFeatureFlag} entries across all scope types. Feature flags are sent as part of the `flags` context.
23+
When sending out an error event, feature flag buffers from all three scope types (global, isolation and current scope) are merged, choosing the newest {maxFeatureFlag} entries across all scope types. Feature flags are sent as part of the `flags` context.
2124

2225
## Span Based API
2326

24-
tbd
27+
It's also possible to use the `addFeatureFlag` method on `ISpan` (and by extension `ITransaction`). Feature flag evaluations tracked this way
28+
will not be added to the scope and thus won't be added to error events.
29+
30+
Each span has its own `SpanFeatureFlagBuffer`. When starting a child span, feature flag evaluations are NOT copied from the parent. Each span starts out with an empty buffer and has its own limit.
31+
`SpanFeatureFlagBuffer` has been optimized for storing feature flag evaluations on spans.
32+
33+
Spans have a hard coded limit of 10 feature flag evaluations. When full, new entries are rejected. Updates to existing entries are still allowed even if full.
34+
35+
## Integrations
36+
37+
We offer integrations that automatically track feature flag evaluations.
38+
39+
Android:
40+
- LaunchDarkly (`SentryLaunchDarklyAndroidHook`)
41+
42+
JVM (non Android):
43+
- LaunchDarkly (`SentryLaunchDarklyServerHook`)
44+
- OpenFeature (`SentryOpenFeatureHook`)

.cursor/rules/metrics.mdc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
alwaysApply: false
3+
description: Metrics API
4+
---
5+
# Java SDK Metrics API
6+
7+
Metrics are enabled by default.
8+
9+
API has been namespaced under `Sentry.metrics()` and `IScopes.metrics()` using the `IMetricsApi` interface and `MetricsApi` implementation.
10+
11+
Options are namespaced under `SentryOptions.getMetrics()`.
12+
13+
Three different APIs exist:
14+
- `count`: Counters are one of the more basic types of metrics and can be used to count certain event occurrences.
15+
- `distribution`: Distributions help you get the most insights from your data by allowing you to obtain aggregations such as p90, min, max, and avg.
16+
- `gauge`: Gauges let you obtain aggregates like min, max, avg, sum, and count. They can be represented in a more space-efficient way than distributions, but they can't be used to get percentiles. If percentiles aren't important to you, we recommend using gauges.
17+
18+
Refer to `SentryMetricsEvent` for details about available fields.
19+
20+
`MetricsBatchProcessor` handles batching (`MAX_BATCH_SIZE`), automatic sending of metrics after a timeout (`FLUSH_AFTER_MS`) and rejecting if `MAX_QUEUE_SIZE` has been hit.
21+
22+
The flow is `IMetricsApi` -> `IMetricsBatchProcessor` -> `SentryClient.captureBatchedMetricsEvents` -> `ITransport`.
23+
24+
Each `SentryMetricsEvent` goes through `SentryOptions.metrics.beforeSend` (if configured) and can be modified or dropped.
25+
26+
For sending, a batch of `SentryMetricsEvent` objects is sent inside a `SentryMetricsEvents` object.

.cursor/rules/overview_dev.mdc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,21 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
3737
- **`feature_flags`**: Use when working with:
3838
- Feature flag tracking and evaluation
3939
- `addFeatureFlag()`, `getFeatureFlags()` methods
40-
- `FeatureFlagBuffer`, `FeatureFlag` protocol
40+
- `FeatureFlagBuffer`, `SpanFeatureFlagBuffer`, `FeatureFlag` protocol
4141
- `maxFeatureFlags` option and buffer management
4242
- Feature flag merging across scope types
4343
- Scope-based vs span-based feature flag APIs
44+
- Scope-based API: `Sentry`, `IScopes`, `IScope` APIs
45+
- Span-based API: `ISpan`, `ITransaction` APIs
46+
- Integrations: LaunchDarkly (Android/JVM), OpenFeature (JVM)
47+
48+
- **`metrics`**: Use when working with:
49+
- Metrics API (`Sentry.metrics()`, `IScopes.metrics()`)
50+
- `IMetricsApi`, `MetricsApi` implementation
51+
- Metrics types: `count`, `distribution`, `gauge`
52+
- `MetricsBatchProcessor`, batching and queue management
53+
- `SentryMetricsEvent`, `SentryMetricsEvents`
54+
- `SentryOptions.getMetrics()`, `beforeSend` callback
4455

4556
### Integration & Infrastructure
4657
- **`opentelemetry`**: Use when working with:
@@ -72,3 +83,4 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
7283
- Cache/offline/network → `offline`
7384
- System test/e2e/sample → `e2e_tests`
7485
- Feature flag/addFeatureFlag/flag evaluation → `feature_flags`
86+
- Metrics/count/distribution/gauge → `metrics`

.cursor/rules/scopes.mdc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ Data is also passed on to newly forked child scopes but not to parents.
4949

5050
Current scope can be retrieved from `Scopes` via `getScope`.
5151

52+
### Combined Scope
53+
54+
This is a special scope type that combines global, isolation and current scope.
55+
56+
Refer to `CombinedScopeView` for each field of interest to see whether values from the three individual scopes are merged,
57+
whether a specific one is used or whether we're simply using the first one that has a value.
58+
59+
Also see the section about `defaultScopeType` further down.
60+
5261
## Storage of `Scopes`
5362

5463
`Scopes` are stored in a `ThreadLocal` by default (NOTE: this is different for OpenTelemetry, see opentelemetry.mdc).

.envrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
export VIRTUAL_ENV=".venv"
2-
layout python3
1+
export VIRTUAL_ENV="${PWD}/.venv"
2+
devenv sync
3+
PATH_add "${PWD}/.venv/bin"

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
* text eol=lf
22
*.png binary
33
*.jpg binary
4+
*.pb binary
5+
*.gz binary
46

57
# These are explicitly windows files and should use crlf
68
*.bat text eol=crlf

.github/workflows/agp-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
sudo udevadm trigger --name-match=kvm
5151
5252
- name: AVD cache
53-
uses: actions/cache@v4
53+
uses: actions/cache@v5
5454
id: avd-cache
5555
with:
5656
path: |

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
# Workaround for https://github.com/gradle/actions/issues/21 to use config cache
3333
- name: Cache buildSrc
34-
uses: actions/cache@v4
34+
uses: actions/cache@v5
3535
with:
3636
path: buildSrc/build
3737
key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Changelog Preview
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
- edited
9+
- labeled
10+
- unlabeled
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
statuses: write
15+
16+
jobs:
17+
changelog-preview:
18+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@v2
19+
secrets: inherit

0 commit comments

Comments
 (0)