Sentry
Open-source error tracking, Performance Monitoring, Session Replay — integracja z React, Node.js i Python, alerty i self-hosting.
6 narzędzi error tracking
Od darmowego Sentry po enterprise Datadog — każde rozwiązanie optymalizuje inny aspekt: DX, koszt, możliwości i integracje.
| Narzędzie | Typ | Open-source | Self-host | Cena | Najlepsze na |
|---|---|---|---|---|---|
| Sentry | Error tracking + APM + Session Replay | Tak (BUSL) | Tak | Free 5K/mo, od $26/mo | DX, open-source, React/Python/Go |
| Datadog APM | Full observability (APM + logs + metrics) | Nie | Nie | Od $31/host/mo | Enterprise, all-in-one platform |
| New Relic | Full observability platform | Nie | Nie | Free 100GB/mo, pay-per-GB | Full APM, flexible pricing |
| Rollbar | Error tracking | Nie | Nie | Free 5K/mo, od $12/mo | Proste error tracking |
| Bugsnag | Error tracking + crash reporting | Nie | Nie | Od $29/mo | Mobile (iOS/Android) |
| GlitchTip | Error tracking (Sentry-compatible) | Tak (MIT) | Tak | Free self-hosted | Cost-sensitive, Sentry API compat |
Często zadawane pytania
Co to jest Sentry i jak różni się od logowania?
Sentry: platforma error tracking i application monitoring (open-source + SaaS). Przechwytuje wyjątki i błędy automatycznie ze stacktrace, breadcrumbs i kontekstem. Różnica Sentry vs logging: Logging — rejestruje zdarzenia (tekstowo). Musisz sam przeszukiwać logi. Sentry — automatycznie grupuje podobne błędy. Dodaje context (user, request, environment). Alert przy nowym błędzie. Śledzi regresje. Grupowanie (fingerprinting): Sentry łączy podobne błędy w jeden Issue. Fingerprint na podstawie stacktrace. Jeden Issue = wiele Occurrences. Możesz śledzić: ile użytkowników dotknęło błąd. Kiedy pierwszy raz pojawił się. Czy błąd jest regresją (pojawił się po deploymencie). Kluczowe funkcje: Error Tracking — wyjątki z kontekstem. Performance Monitoring — transakcje, slow operations. Session Replay — nagrania sesji użytkownika przy błędzie. Profiling — CPU profiling w produkcji. Crons Monitoring — śledzenie zadań cron. Alerts — konfigurowalnie po warunkach. Release tracking — błędy per wersja/deployment. Platformy: JavaScript (React, Vue, Angular, Node). Python, Ruby, Java, Go, PHP, Rust, .NET. Mobile (iOS, Android, React Native, Flutter). Sentry Self-hosted: docker-compose lub Kubernetes (helm chart). Darmowy. Wymaga ~4GB RAM, 20GB disk.
Sentry SDK — integracja z React, Node.js, Python?
Sentry React: Sentry.init({dsn: 'https://...@sentry.io/...', integrations: [Sentry.browserTracingIntegration()], tracesSampleRate: 0.1, replaysSessionSampleRate: 0.01, replaysOnErrorSampleRate: 1.0}). ErrorBoundary: <Sentry.ErrorBoundary fallback={ErrorFallback}>. Automatyczne przechwytywanie: nieobsłużone Promise rejections. Nieobsłużone wyjątki. Console.error. Manualnie: Sentry.captureException(error). Sentry.captureMessage('Something went wrong'). User context: Sentry.setUser({id: userId, email: userEmail}). Tags: Sentry.setTag('feature', 'checkout'). Extra context: Sentry.setExtra('order_id', orderId). Sentry Node.js: Sentry.init w pierwszej linii (przed innymi imports). Express integration — automatyczne request tracking. Uncaught exceptions i unhandled rejections. Sentry Python: sentry-sdk. Django integration — automatyczne request tracking. Flask, FastAPI, Celery integrations. Breadcrumbs: automatyczna historia działań przed błędem. console.log, fetch, navigation events. Własne breadcrumbs: Sentry.addBreadcrumb({message: 'Checkout started', category: 'commerce'}). Source Maps: wgraj source maps dla czytelnych stacktrace. Sentry CLI lub Webpack plugin. Automatycznie przy CI/CD deploy.
Sentry Performance Monitoring — jak śledzić wolne operacje?
Performance Monitoring: Sentry śledzi transakcje (web requests, API calls, tasks). Transaction = root span + child spans. Spans: DB queries, HTTP calls, cache reads. Metryki: Apdex score. p50/p75/p95/p99 latencja. Throughput (req/s). Error rate. Slow transactions (outliers). Web Vitals: LCP (Largest Contentful Paint) — core web vital. FID/INP (Interaction to Next Paint) — core web vital. CLS (Cumulative Layout Shift). TTFB (Time to First Byte). Sentry integruje z browser performance API. Performance dashboard: Transaction list z p95 latencją. Summary per transaction. Span breakdown — co zajmuje czas. DB Query Analysis: slow queries z stacktrace. N+1 query detection. Query plan hints. Profiles: CPU profiling. Flame graph view. Identyfikacja hotspots. Konfiguracja sample rate: tracesSampleRate: 0.1 — 10% transakcji. tracesSampler — custom sampling function. Wysyłaj 100% dla błędów, 1% dla sukcesu. Sentry Relay: lokalny proxy. Redukuje latencję (lokalne SDK -> Relay -> Sentry cloud). Filtrowanie i transformacja eventów. PII scrubbing przed wysłaniem. Sentry Quotas: limit eventów per miesiąc. Dynamic sampling (auto-reduce przy przekroczeniu limitu). Priority processing dla errors vs transactions.
Jak skonfigurować alerty i powiadomienia w Sentry?
Sentry Alert Rules: Issue Alerts — alert gdy nowy błąd lub regresja. Metric Alerts — alert gdy metryka przekroczy threshold. Warunki (Issues): First time an issue is seen. Regression (issue resolved, potem wraca). High frequency (> 100 occurrences/min). Assigned to user. Filters: issue level (error/warning/info). Environment (production, staging). Tags (feature, component). Akcje: Send email (team lub specific users). Send Slack notification. Send PagerDuty alert. Create Jira ticket. Send Discord notification. Webhook. Metric Alerts: e.g. Transaction Duration p95 > 2000ms przez 5 minut. Error Rate > 5% przez 10 minut. Apdex < 0.8. On-call integration: PagerDuty — automatyczny incident przy alert. OpsGenie — rotacja on-call. Alert routing per projekt/team. Noise reduction: Issue grouping — jeden alert per Issue (nie per occurrence). Muted issues — wycisz znane problemy. Ignored issues — permanent ignore. Uptime monitoring (Sentry Crons): monitoruje że cron job się uruchomił. Alert jeśli job nie wykonał się w czasie. Integracje: GitHub — link commit do błędu (suspect commits). Jira — auto-create ticket. Slack — thread per issue. Linear — create issue. Unresolved issue workflow: Assign -> Working on it -> Resolve -> Close.
Sentry vs inne narzędzia — Datadog, New Relic, Rollbar, Bugsnag?
Sentry: specjalizacja w error tracking. Najlepszy DX (Developer Experience). Open-source (self-host). Dobry performance monitoring. Session Replay. Ceny: darmowy tier (5K errors/miesiąc). $26/miesiąc team. Datadog: pełna platforma APM (Application Performance Monitoring). Logi + metryki + traces + error tracking. Drozszy ale wszystko w jednym. Bez open-source opcji. New Relic: podobne do Datadog. Full observability platform. Free tier (100GB/miesiąc). Rollbar: error tracking, mniej funkcji niż Sentry. Dobry dla mniejszych teamów. Bugsnag: mobile-first error tracking. Dobry dla iOS/Android. Raygun: error tracking + APM. Crash reporting. Highlight.io: open-source Sentry alternative z Session Replay. GlitchTip: open-source, Sentry-compatible API. Tańszy self-host. Choosing: start-up, open-source fan -> Sentry. Full APM + logs -> Datadog lub New Relic. Mobile-first -> Bugsnag lub Raygun. Cost-sensitive -> Sentry free tier lub GlitchTip self-hosted. Error tracking only -> Sentry lub Rollbar. Best practices: filtruj zszumowane błędy (browser extensions errors). Ustaw sample rate dla performance. Ustaw proper release tracking. Skonfiguruj source maps. Przypisz błędy do właściwych teams.
Powiązane artykuły
Skontaktuj się z nami
Porozmawiajmy o Twoim projekcie. Bezpłatna wycena w ciągu 24 godzin.
Wyślij zapytanie
Telefon
+48 790 814 814
Pon-Pt: 9:00 - 18:00
adam@fotz.pl
Odpowiadamy w ciągu 24h
Adres
Plac Wolności 16
61-739 Poznań
Godziny pracy
Wolisz porozmawiać?
Zadzwoń teraz i porozmawiaj z naszym specjalistą o Twoim projekcie.
Zadzwoń teraz