Skip to content

Commit f275487

Browse files
authored
APM for isar (#1726)
1 parent f649a83 commit f275487

Some content is hidden

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

46 files changed

+4954
-7
lines changed

.craft.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ targets:
2424
pub:sentry_sqflite:
2525
pub:sentry_drift:
2626
pub:sentry_hive:
27+
# Initial release on pub.dev needed first before uncommenting
28+
# pub:sentry_isar:

.github/workflows/dart.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "sqflite/**"
1414
- "hive/**"
1515
- "drift/**"
16+
- "isar/**"
1617

1718
jobs:
1819
cancel-previous-workflow:

.github/workflows/diagrams.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
working-directory: ./hive
4848
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg
4949

50+
- name: isar
51+
working-directory: ./isar
52+
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg
53+
5054
# Source: https://stackoverflow.com/a/58035262
5155
- name: Extract branch name
5256
shell: bash

.github/workflows/dio.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "sqflite/**"
1414
- "hive/**"
1515
- "drift/**"
16+
- "isar/**"
1617

1718
jobs:
1819
cancel-previous-workflow:

.github/workflows/drift.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
- "dio/**"
1313
- "file/**"
1414
- "sqflite/**"
15+
- "hive/**"
16+
- "isar/**"
1517

1618
jobs:
1719
cancel-previous-workflow:

.github/workflows/e2e_dart.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- "sqflite/**"
1515
- "hive/**"
1616
- "drift/**"
17+
- "isar/**"
1718

1819
env:
1920
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

.github/workflows/file.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "sqflite/**"
1414
- "hive/**"
1515
- "drift/**"
16+
- "isar/**"
1617

1718
jobs:
1819
cancel-previous-workflow:

.github/workflows/flutter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "sqflite/**"
1414
- "hive/**"
1515
- "drift/**"
16+
- "isar/**"
1617

1718
jobs:
1819
cancel-previous-workflow:

.github/workflows/hive.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
- "dio/**"
1313
- "file/**"
1414
- "sqflite/**"
15+
- "drift/**"
16+
- "isar/**"
1517

1618
jobs:
1719
cancel-previous-workflow:

.github/workflows/isar.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: sentry-isar
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- release/**
7+
pull_request:
8+
paths-ignore:
9+
- "**/*.md"
10+
- "logging/**"
11+
- "flutter/**"
12+
- "dio/**"
13+
- "file/**"
14+
- "sqflite/**"
15+
- "hive/**"
16+
- "drift/**"
17+
18+
jobs:
19+
cancel-previous-workflow:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Cancel Previous Runs
23+
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # [email protected]
24+
with:
25+
access_token: ${{ github.token }}
26+
27+
build:
28+
name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}
29+
runs-on: ${{ matrix.os }}
30+
timeout-minutes: 30
31+
defaults:
32+
run:
33+
shell: bash
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
os: [ubuntu-latest, macos-latest, windows-latest]
38+
target: ["ios", "android", "macos", "linux", "windows"]
39+
sdk: ["stable", "beta"]
40+
exclude:
41+
- os: ubuntu-latest
42+
target: ios
43+
- os: ubuntu-latest
44+
target: macos
45+
- os: ubuntu-latest
46+
target: windows
47+
- os: windows-latest
48+
target: ios
49+
- os: windows-latest
50+
target: android
51+
- os: windows-latest
52+
target: macos
53+
- os: windows-latest
54+
target: linux
55+
# macos-latest is taking hours due to limited resources
56+
- os: macos-latest
57+
target: android
58+
- os: macos-latest
59+
target: linux
60+
- os: macos-latest
61+
target: windows
62+
# Bad CPU type in executable
63+
- os: macos-latest
64+
sdk: beta
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- uses: actions/setup-java@v3
70+
if: ${{ matrix.target == 'android' }}
71+
with:
72+
java-version: "11"
73+
distribution: "adopt"
74+
75+
# Install required dependencies for Flutter on Linux on Ubuntu
76+
- name: "Setup Linux"
77+
run: |
78+
sudo apt update
79+
sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb
80+
sudo apt install -y network-manager upower
81+
if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux'
82+
83+
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # [email protected]
84+
with:
85+
channel: ${{ matrix.sdk }}
86+
87+
- run: flutter upgrade
88+
89+
- name: Pub Get
90+
run: |
91+
cd isar
92+
flutter pub get
93+
94+
- name: Test VM with coverage
95+
run: |
96+
cd isar
97+
flutter test -j 1 --coverage --test-randomize-ordering-seed=random
98+
99+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3
100+
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
101+
with:
102+
name: sentry_isar
103+
file: ./isar/coverage/lcov.info
104+
functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600
105+
106+
- uses: VeryGoodOpenSource/very_good_coverage@e5c91bc7ce9843e87c800b3bcafdfb86fbe28491 # [email protected]
107+
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
108+
with:
109+
path: "./isar/coverage/lcov.info"
110+
min_coverage: 55
111+
112+
analyze:
113+
uses: ./.github/workflows/analyze.yml
114+
with:
115+
package: isar
116+
sdk: flutter

.github/workflows/logging.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "sqflite/**"
1414
- "hive/**"
1515
- "drift/**"
16+
- "isar/**"
1617

1718
jobs:
1819
cancel-previous-workflow:

.github/workflows/min_version_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "sqflite/**"
1212
- "hive/**"
1313
- "drift/**"
14+
- "isar/**"
1415

1516
jobs:
1617
cancel-previous-workflow:

.github/workflows/sqflite.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "file/**"
1414
- "hive/**"
1515
- "drift/**"
16+
- "isar/**"
1617

1718
jobs:
1819
cancel-previous-workflow:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ flutter/coverage/*
2424
sqflite/coverage/*
2525
drift/coverage/*
2626
hive/coverage/*
27+
isar/coverage/*
2728

2829
pubspec.lock
2930
Podfile.lock

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66

77
- Add `ConnectivityIntegration` for web ([#1765](https://github.com/getsentry/sentry-dart/pull/1765))
88
- We only get the info if online/offline on web platform. The added breadcrumb is set to either `wifi` or `none`.
9+
- APM for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726))
910

1011
## 7.14.0
1112

13+
- Add option to opt out of fatal level for automatically collected errors ([#1738](https://github.com/getsentry/sentry-dart/pull/1738))
14+
1215
### Fixes
1316

1417
- Add debug_meta to all events ([#1756](https://github.com/getsentry/sentry-dart/pull/1756))

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ Sentry SDK for Dart and Flutter
2424
| sentry_sqflite | [![build](https://github.com/getsentry/sentry-dart/workflows/sentry-sqflite/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-sqflite) | [![pub package](https://img.shields.io/pub/v/sentry_sqflite.svg)](https://pub.dev/packages/sentry_sqflite) | [![likes](https://img.shields.io/pub/likes/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![pub points](https://img.shields.io/pub/points/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score)
2525
| sentry_drift | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/drift.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-drift) | [![pub package](https://img.shields.io/pub/v/sentry_drift.svg)](https://pub.dev/packages/sentry_drift) | [![likes](https://img.shields.io/pub/likes/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![pub points](https://img.shields.io/pub/points/sentry_drift)](https://pub.dev/packages/sentry_drift/score)
2626
| sentry_hive | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/hive.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-hive) | [![pub package](https://img.shields.io/pub/v/sentry_hive.svg)](https://pub.dev/packages/sentry_hive) | [![likes](https://img.shields.io/pub/likes/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![pub points](https://img.shields.io/pub/points/sentry_hive)](https://pub.dev/packages/sentry_hive/score)
27+
| sentry_isar | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/isar.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-isar) | [![pub package](https://img.shields.io/pub/v/sentry_isar.svg)](https://pub.dev/packages/sentry_isar) | [![likes](https://img.shields.io/pub/likes/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![pub points](https://img.shields.io/pub/points/sentry_isar)](https://pub.dev/packages/sentry_isar/score)
2728

2829
##### Usage
2930

30-
For detailed usage, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/dart), [flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter), [logging](https://github.com/getsentry/sentry-dart/tree/main/logging), [dio](https://github.com/getsentry/sentry-dart/tree/main/dio), [file](https://github.com/getsentry/sentry-dart/tree/main/file), [sqflite](https://github.com/getsentry/sentry-dart/tree/main/sqflite), [drift](https://github.com/getsentry/sentry-dart/tree/main/drift) and [hive](https://github.com/getsentry/sentry-dart/tree/main/hive) `README's` or our `Resources` section below.
31+
For detailed usage, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/dart), [flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter), [logging](https://github.com/getsentry/sentry-dart/tree/main/logging), [dio](https://github.com/getsentry/sentry-dart/tree/main/dio), [file](https://github.com/getsentry/sentry-dart/tree/main/file), [sqflite](https://github.com/getsentry/sentry-dart/tree/main/sqflite), [drift](https://github.com/getsentry/sentry-dart/tree/main/drift), [hive](https://github.com/getsentry/sentry-dart/tree/main/hive) and [isar](https://github.com/getsentry/sentry-dart/tree/main/isar) `README's` or our `Resources` section below.
3132

3233
#### Blog posts
3334

dart/lib/src/sentry_trace_origins.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class SentryTraceOrigins {
1818
'auto.db.sqflite.database_executor';
1919
static const autoDbSqfliteDatabaseFactory =
2020
'auto.db.sqflite.database_factory';
21+
static const autoDbIsar = 'auto.db.isar';
22+
static const autoDbIsarCollection = 'auto.db.isar.collection';
2123
static const autoDbHive = 'auto.db.hive';
2224
static const autoDbHiveBoxBase = 'auto.db.hive.box_base';
2325
static const autoDbHiveLazyBox = 'auto.db.hive.lazy_box';

flutter/example/lib/isar/user.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:isar/isar.dart';
2+
3+
part 'user.g.dart';
4+
5+
@collection
6+
class User {
7+
Id id = Isar.autoIncrement;
8+
9+
String? name;
10+
11+
int? age;
12+
}

0 commit comments

Comments
 (0)