Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: drift apm #1709

Merged
merged 75 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
eff8bd0
draft impl
buenaflor Nov 2, 2023
210f306
improve code
buenaflor Nov 2, 2023
3caa4cd
Add open span
buenaflor Nov 2, 2023
a035435
Refactor to extend lazy database
buenaflor Nov 2, 2023
ea9e2d6
Update
buenaflor Nov 2, 2023
64652a4
SentryTransactionExecutor
buenaflor Nov 3, 2023
dcabe06
Implement tracing batch and transactions
buenaflor Nov 3, 2023
a3a5fb9
Update tests
buenaflor Nov 6, 2023
d3a65b4
update changelog
buenaflor Nov 6, 2023
9e54500
Formatting
buenaflor Nov 6, 2023
92c56f4
Merge branch 'main' into feat/drift-apm
buenaflor Nov 6, 2023
51f8041
Update workflows
buenaflor Nov 6, 2023
f089dde
Update deps
buenaflor Nov 6, 2023
4c41212
Fix analyze issues
buenaflor Nov 6, 2023
8d24a36
Format
buenaflor Nov 6, 2023
eeea299
Add example
buenaflor Nov 6, 2023
2a108fe
Update descriptions
buenaflor Nov 7, 2023
3ae85fe
Fix deps
buenaflor Nov 7, 2023
f077e06
Update run commands
buenaflor Nov 7, 2023
084503a
Update workflow
buenaflor Nov 7, 2023
36bc1fa
Update example
buenaflor Nov 7, 2023
a598fdb
Update workflow
buenaflor Nov 7, 2023
9f93206
Format
buenaflor Nov 7, 2023
f92816a
Fix dart analyze
buenaflor Nov 7, 2023
b6b8650
Try changing deps
buenaflor Nov 7, 2023
3e7f989
Add to craft
buenaflor Nov 7, 2023
8443c42
Change to flutter test
buenaflor Nov 7, 2023
a2fa7bc
Revert flutter test mock
buenaflor Nov 7, 2023
c4da2d3
change dir manually
buenaflor Nov 7, 2023
46dfa08
download and extract sqlite.dll for windows
buenaflor Nov 7, 2023
63439aa
Try downloading sqlite3
buenaflor Nov 7, 2023
5e513f9
set up dart
buenaflor Nov 7, 2023
87ad6dd
fix path to file
buenaflor Nov 7, 2023
e7308e0
use pub get
buenaflor Nov 7, 2023
38cae39
Use flutter pub get
buenaflor Nov 7, 2023
cbc8b43
fix
buenaflor Nov 7, 2023
4ffeb6c
skip windows test
buenaflor Nov 7, 2023
a1e638e
fix analyze
buenaflor Nov 7, 2023
ebd8dd5
fix drift.yml
buenaflor Nov 7, 2023
ae7dd70
format
buenaflor Nov 7, 2023
ddc6bad
Remove redundant test
buenaflor Nov 7, 2023
3df9151
Remove debug print
buenaflor Nov 7, 2023
d0a18eb
update trace origin
buenaflor Nov 7, 2023
df27999
Improvements
buenaflor Nov 7, 2023
d83844f
Improvements
buenaflor Nov 8, 2023
8d68a84
Add to flutter example
buenaflor Nov 13, 2023
40082e0
Skip web in examples
buenaflor Nov 13, 2023
76065c7
Update comment
buenaflor Nov 14, 2023
908d619
Fix web build
buenaflor Nov 14, 2023
bf5c20e
Try and set sqlite on windows
buenaflor Nov 14, 2023
8b02069
trigger
buenaflor Nov 14, 2023
9577c11
maybe fix workflow
buenaflor Nov 14, 2023
984f88a
fix
buenaflor Nov 14, 2023
9132516
trigger
buenaflor Nov 14, 2023
0a58ba9
trigger
buenaflor Nov 14, 2023
8b3928f
maybe trigger
buenaflor Nov 14, 2023
42e88d3
maybe trigger
buenaflor Nov 14, 2023
8b54152
maybe trigger
buenaflor Nov 14, 2023
4f0af71
fix
buenaflor Nov 14, 2023
78e56fc
try trigger
buenaflor Nov 14, 2023
13e67e7
Merge branch 'main' into feat/drift-apm
buenaflor Nov 14, 2023
6fb54e5
Merge branch 'main' into feat/drift-apm
buenaflor Nov 14, 2023
9b0244b
update workflow
buenaflor Nov 14, 2023
70910b3
try github_env
buenaflor Nov 14, 2023
55a5f4e
try
buenaflor Nov 14, 2023
0ffb3fa
try
buenaflor Nov 14, 2023
ee97635
try
buenaflor Nov 14, 2023
467d970
try
buenaflor Nov 14, 2023
26da22f
add to path
buenaflor Nov 14, 2023
bb3840a
skip windows
buenaflor Nov 14, 2023
4b98cc8
formatting
buenaflor Nov 14, 2023
d9e12a6
try with embedded dll
buenaflor Nov 14, 2023
921bf08
improvements
buenaflor Nov 14, 2023
52cec3b
Formatting
buenaflor Nov 14, 2023
8bb5fae
gitignore
buenaflor Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ targets:
dio:
file:
sqflite:
drift:
- name: github
- name: registry
sdks:
Expand All @@ -20,3 +21,5 @@ targets:
pub:sentry_dio:
pub:sentry_file:
pub:sentry_sqflite:
# This needs to be added to the Sentry registry before uncommenting
# pub:sentry_drift:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably also need this for the hive PR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we need to do an initial release first and afterwards add it to the registry so the integration can be retrieved in the docs etc.

1 change: 1 addition & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "dio/**"
- "file/**"
- "sqflite/**"
- "drift/**"

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

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

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:
# skipping Windows for now since it requires sqlite3.dll to get working
os: [ubuntu-latest, macos-latest]
target: ["ios", "android", "macos", "linux"]
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 drift
flutter pub get

- name: Test VM with coverage
run: |
cd drift
flutter test --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_drift
file: ./drift/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: "./drift/coverage/lcov.info"
min_coverage: 80

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

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 @@ -11,6 +11,7 @@ on:
- "flutter/**"
- "dio/**"
- "sqflite/**"
- "drift/**"

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 @@ -11,6 +11,7 @@ on:
- "dio/**"
- "file/**"
- "sqflite/**"
- "drift/**"

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

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 @@ -9,6 +9,7 @@ on:
- "**/*.md"
- "file/**"
- "sqflite/**"
- "drift/**"

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 @@ -11,6 +11,7 @@ on:
- "flutter/**"
- "dio/**"
- "file/**"
- "drift/**"

jobs:
cancel-previous-workflow:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features

- Add APM integration for Drift ([#1709](https://github.com/getsentry/sentry-dart/pull/1709))
- Breadcrumbs for database operations ([#1656](https://github.com/getsentry/sentry-dart/pull/1656))

### Dependencies
Expand Down
3 changes: 3 additions & 0 deletions dart/lib/src/sentry_trace_origins.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ class SentryTraceOrigins {
'auto.db.sqflite.database_executor';
static const autoDbSqfliteDatabaseFactory =
'auto.db.sqflite.database_factory';
static const autoDbDriftQueryExecutor = 'auto.db.drift.query.executor';
static const autoDbDriftTransactionExecutor =
'auto.db.drift.transaction.executor';
}
14 changes: 14 additions & 0 deletions drift/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Omit committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
Loading
Loading