-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into enha/debug-enabled-by-default
- Loading branch information
Showing
70 changed files
with
2,017 additions
and
684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: sentry-link | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release/** | ||
pull_request: | ||
paths: | ||
- '!**/*.md' | ||
- '!**/class-diagram.svg' | ||
- '.github/workflows/link.yml' | ||
- '.github/workflows/analyze.yml' | ||
- '.github/actions/dart-test/**' | ||
- '.github/actions/coverage/**' | ||
- 'dart/**' | ||
- 'link/**' | ||
|
||
jobs: | ||
cancel-previous-workflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # [email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
build: | ||
name: '${{ matrix.os }} | ${{ matrix.sdk }}' | ||
runs-on: ${{ matrix.os }}-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos, ubuntu, windows] | ||
sdk: [stable, beta] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/dart-test | ||
with: | ||
directory: link | ||
web: false | ||
|
||
# TODO: don't set coverage for now to finish publishing it | ||
# - uses: ./.github/actions/coverage | ||
# if: runner.os == 'Linux' && matrix.sdk == 'stable' | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# directory: link | ||
# coverage: sentry_link | ||
# min-coverage: 55 | ||
|
||
analyze: | ||
uses: ./.github/workflows/analyze.yml | ||
with: | ||
package: link | ||
panaThreshold: 90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # [email protected] | ||
- run: xcodes select 15.0.1 | ||
- uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # pin@v1.204.0 | ||
- uses: ruby/setup-ruby@28c4deda893d5a96a6b2d958c5b47fc18d65c9d3 # pin@v1.213.0 | ||
with: | ||
ruby-version: '2.7.5' | ||
bundler-cache: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import 'package:meta/meta.dart'; | ||
|
||
import '../client_reports/discard_reason.dart'; | ||
import '../event_processor.dart'; | ||
import '../hint.dart'; | ||
import '../protocol/sentry_event.dart'; | ||
import '../protocol/sentry_level.dart'; | ||
import '../protocol/sentry_transaction.dart'; | ||
import '../sentry_options.dart'; | ||
import '../transport/data_category.dart'; | ||
|
||
@internal | ||
Future<SentryEvent?> runEventProcessors( | ||
SentryEvent event, | ||
Hint hint, | ||
List<EventProcessor> eventProcessors, | ||
SentryOptions options, | ||
) async { | ||
int spanCountBeforeEventProcessors = | ||
event is SentryTransaction ? event.spans.length : 0; | ||
|
||
SentryEvent? processedEvent = event; | ||
for (final processor in eventProcessors) { | ||
try { | ||
final e = processor.apply(processedEvent!, hint); | ||
processedEvent = e is Future<SentryEvent?> ? await e : e; | ||
} catch (exception, stackTrace) { | ||
options.logger( | ||
SentryLevel.error, | ||
'An exception occurred while processing event by a processor', | ||
exception: exception, | ||
stackTrace: stackTrace, | ||
); | ||
if (options.automatedTestMode) { | ||
rethrow; | ||
} | ||
} | ||
|
||
final discardReason = DiscardReason.eventProcessor; | ||
if (processedEvent == null) { | ||
options.recorder.recordLostEvent(discardReason, _getCategory(event)); | ||
if (event is SentryTransaction) { | ||
// We dropped the whole transaction, the dropped count includes all child spans + 1 root span | ||
options.recorder.recordLostEvent( | ||
discardReason, | ||
DataCategory.span, | ||
count: spanCountBeforeEventProcessors + 1, | ||
); | ||
} | ||
options.logger(SentryLevel.debug, 'Event was dropped by a processor'); | ||
break; | ||
} else if (event is SentryTransaction && | ||
processedEvent is SentryTransaction) { | ||
// If event processor removed only some spans we still report them as dropped | ||
final spanCountAfterEventProcessors = processedEvent.spans.length; | ||
final droppedSpanCount = | ||
spanCountBeforeEventProcessors - spanCountAfterEventProcessors; | ||
if (droppedSpanCount > 0) { | ||
options.recorder.recordLostEvent( | ||
discardReason, | ||
DataCategory.span, | ||
count: droppedSpanCount, | ||
); | ||
} | ||
} | ||
} | ||
|
||
return processedEvent; | ||
} | ||
|
||
DataCategory _getCategory(SentryEvent event) { | ||
if (event is SentryTransaction) { | ||
return DataCategory.transaction; | ||
} | ||
return DataCategory.error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.