Skip to content

Commit

Permalink
APM for isar (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase authored Dec 19, 2023
1 parent f649a83 commit f275487
Show file tree
Hide file tree
Showing 46 changed files with 4,954 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ targets:
pub:sentry_sqflite:
pub:sentry_drift:
pub:sentry_hive:
# Initial release on pub.dev needed first before uncommenting
# pub:sentry_isar:
1 change: 1 addition & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "sqflite/**"
- "hive/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/diagrams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
working-directory: ./hive
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg

- name: isar
working-directory: ./isar
run: lakos . -i "{test/**,example/**}" | dot -Tsvg -o class-diagram.svg

# Source: https://stackoverflow.com/a/58035262
- name: Extract branch name
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "sqflite/**"
- "hive/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- "dio/**"
- "file/**"
- "sqflite/**"
- "hive/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e_dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- "sqflite/**"
- "hive/**"
- "drift/**"
- "isar/**"

env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "sqflite/**"
- "hive/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "sqflite/**"
- "hive/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- "dio/**"
- "file/**"
- "sqflite/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/isar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: sentry-isar
on:
push:
branches:
- main
- release/**
pull_request:
paths-ignore:
- "**/*.md"
- "logging/**"
- "flutter/**"
- "dio/**"
- "file/**"
- "sqflite/**"
- "hive/**"
- "drift/**"

jobs:
cancel-previous-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # pin@0.12.0
with:
access_token: ${{ github.token }}

build:
name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
target: ["ios", "android", "macos", "linux", "windows"]
sdk: ["stable", "beta"]
exclude:
- os: ubuntu-latest
target: ios
- os: ubuntu-latest
target: macos
- os: ubuntu-latest
target: windows
- os: windows-latest
target: ios
- os: windows-latest
target: android
- os: windows-latest
target: macos
- os: windows-latest
target: linux
# macos-latest is taking hours due to limited resources
- os: macos-latest
target: android
- os: macos-latest
target: linux
- os: macos-latest
target: windows
# Bad CPU type in executable
- os: macos-latest
sdk: beta

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
if: ${{ matrix.target == 'android' }}
with:
java-version: "11"
distribution: "adopt"

# Install required dependencies for Flutter on Linux on Ubuntu
- name: "Setup Linux"
run: |
sudo apt update
sudo apt install -y cmake dbus libblkid-dev libgtk-3-dev liblzma-dev ninja-build pkg-config xvfb
sudo apt install -y network-manager upower
if: matrix.os == 'ubuntu-latest' && matrix.target == 'linux'

- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
with:
channel: ${{ matrix.sdk }}

- run: flutter upgrade

- name: Pub Get
run: |
cd isar
flutter pub get
- name: Test VM with coverage
run: |
cd isar
flutter test -j 1 --coverage --test-randomize-ordering-seed=random
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
with:
name: sentry_isar
file: ./isar/coverage/lcov.info
functionalities: "search" # remove after https://github.com/codecov/codecov-action/issues/600

- uses: VeryGoodOpenSource/very_good_coverage@e5c91bc7ce9843e87c800b3bcafdfb86fbe28491 # pin@v2.1.0
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
with:
path: "./isar/coverage/lcov.info"
min_coverage: 55

analyze:
uses: ./.github/workflows/analyze.yml
with:
package: isar
sdk: flutter
1 change: 1 addition & 0 deletions .github/workflows/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "sqflite/**"
- "hive/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/min_version_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "sqflite/**"
- "hive/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sqflite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "file/**"
- "hive/**"
- "drift/**"
- "isar/**"

jobs:
cancel-previous-workflow:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ flutter/coverage/*
sqflite/coverage/*
drift/coverage/*
hive/coverage/*
isar/coverage/*

pubspec.lock
Podfile.lock
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

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

## 7.14.0

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

### Fixes

- Add debug_meta to all events ([#1756](https://github.com/getsentry/sentry-dart/pull/1756))
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ Sentry SDK for Dart and Flutter
| 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)
| 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)
| 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)
| 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)

##### Usage

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

#### Blog posts

Expand Down
2 changes: 2 additions & 0 deletions dart/lib/src/sentry_trace_origins.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class SentryTraceOrigins {
'auto.db.sqflite.database_executor';
static const autoDbSqfliteDatabaseFactory =
'auto.db.sqflite.database_factory';
static const autoDbIsar = 'auto.db.isar';
static const autoDbIsarCollection = 'auto.db.isar.collection';
static const autoDbHive = 'auto.db.hive';
static const autoDbHiveBoxBase = 'auto.db.hive.box_base';
static const autoDbHiveLazyBox = 'auto.db.hive.lazy_box';
Expand Down
12 changes: 12 additions & 0 deletions flutter/example/lib/isar/user.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:isar/isar.dart';

part 'user.g.dart';

@collection
class User {
Id id = Isar.autoIncrement;

String? name;

int? age;
}
Loading

0 comments on commit f275487

Please sign in to comment.