클라이언트 앱 모니터링 가이드
작성일: 2026-04-06 Last Updated: 2026-04-06 대상: Browser Extension, Tauri Desktop, Flutter Mobile
목차
1. 크래시 리포트
1.1 Sentry 기반 통합 구성
| 플랫폼 | SDK | 패키지 |
|---|---|---|
| Browser Extension | @sentry/browser | npm install @sentry/browser |
| Tauri (Rust) | sentry crate | cargo add sentry |
| Tauri (Frontend) | @sentry/browser | npm install @sentry/browser |
| Flutter | sentry_flutter | flutter pub add sentry_flutter |
1.2 초기화 코드
Browser Extension
import * as Sentry from '@sentry/browser';
Sentry.init({
dsn: CONFIG.SENTRY_DSN,
environment: CONFIG.ENV, // dev, staging, prod
release: `browser-ext@${CONFIG.VERSION}`,
integrations: [
Sentry.breadcrumbsIntegration({
console: true,
dom: true,
fetch: true,
xhr: true,
}),
],
// 프로덕션에서만 100% 샘플링, 개발 중에는 비활성화
sampleRate: CONFIG.ENV === 'prod' ? 1.0 : 0,
// PII 전송 방지
beforeSend(event) {
// 이메일, IP 등 개인정보 제거
if (event.user) {
delete event.user.email;
delete event.user.ip_address;
}
return event;
},
});
Tauri (Rust 백엔드)
fn main() {
let _guard = sentry::init((
env!("SENTRY_DSN"),
sentry::ClientOptions {
release: sentry::release_name!(),
environment: Some(env!("APP_ENV").into()),
sample_rate: 1.0,
..Default::default()
},
));
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Flutter
Future<void> main() async {
await SentryFlutter.init(
(options) {
options.dsn = Config.sentryDsn;
options.environment = Config.env;
options.release = 'flutter@${Config.version}';
options.tracesSampleRate = 0.2;
options.attachScreenshot = true;
options.attachViewHierarchy = true;
// PII 제거
options.beforeSend = (event, hint) {
event = event.copyWith(
user: event.user?.copyWith(email: null, ipAddress: null),
);
return event;
};
},
appRunner: () => runApp(const MyApp()),
);
}
1.3 소스맵/디버그 심볼 업로드
| 플랫폼 | 도구 | CI 명령 |
|---|---|---|
| Browser Extension | @sentry/cli | sentry-cli sourcemaps upload --release=X.Y.Z dist/ |
| Tauri (Rust) | sentry-cli | sentry-cli debug-files upload target/release/ |
| Flutter (Android) | Sentry Gradle plugin | 자동 (build.gradle 설정) |
| Flutter (iOS) | sentry-cli | sentry-cli debug-files upload build/ios/ |
# GitHub Actions - 소스맵 업로드
- name: Upload source maps to Sentry
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
run: |
npx sentry-cli releases new "$VERSION"
npx sentry-cli sourcemaps upload --release="$VERSION" dist/
npx sentry-cli releases finalize "$VERSION"