An breif introduction on self-hosted sentry
2021-09-09 / modified at 2022-06-30 / 456 words / 2 mins
️This article has been over 1 years since the last update.

Sentry is an open source Application Monitoring Service for app crashes. It’s also free self-hosted available.

When need self-hosted

  • You have machines on private cloud with deep pockets.
  • You believe you can implement a cheaper solution than the official price.
  • Someone can maintain following PaaS/IaaS/SaaS service
  • Someone can maintain the complex components.

What is BSL(Business Source License) license

Why BSL?

See here since Nov 7, 2019

These businesses are not using Sentry to improve how they develop software; they’re lifting its code and assets to build their closed-source products to compete directly with us.

And see twitter

Nearly 100% of Sentry is written by full time employees of Sentry. It’s not a typical open source project.

What you can do

The BSL lets us hit our goals in a clean and low-impact way: it won’t change anyone’s ability to run Sentry at their company

Here is a summary

$2SentryClient SDK(MIT/Apache licensed)Server-side(BSL licensed)CanInternal use(employees/contractors)Can'tAWS stealing sentry source-codedirectly repack and sell as SaaSBundling APM for its customersNot sureA hotel-reserve app bundle Sentry with SaaS?A hotel-reserve app bundle Sentry with on-premise?

It’s highly recommended to bundle your business product with vendor neutrral SDK such as OpenTelemetry/Prometheus.

GDPR?

Yes

APM Comparison

Click to show

Compared at Sep 10, 2021

APMSentrySigNoz
Self-hostedYY
standardsOpen-sourcedOpenTelemetry
Server LicenseBSLMIT
SDK LicenseApache2.0Apache2.0
backendpythongo
ClickHouseYY
distributed tracingYY
loggingYNot all
CommunityWidely & stableStartup
Team size100+<10
RBACYN
ComplexityHighLow
Custom MetricOut of the boxBy Raw Query

All you need to do is to find a balance between the complexity and out-of-the-box features.

Architecture

https://develop.sentry.dev/architecture/

Here is the requirement when self-hosted

$2SentryServicesentry(Django)WebCron/Workerrelay(event digest)snuba(wrapper for clickhouse)symbolicator(optional)(reverse stacktrace)ThirdPaaSClickHouse/Tabix(for event storage)PostgreSQL(project/user data)Kafka/zk(for event digest)Redis(transactional/Celery)RabbitMQ(Optional)(for Celery broker)ThirdIaaSFileStorage(S3/PV/NFS/MinIO)ALB/Nginx/TraefikThirdSaaSSSO/Mail

What is Sentry

  • Web App
  • Asynchronous/Cron Workers

What is Relay

It mostly acts like as a event digest, reads HTTP requests and sends events to kafka.

see flow site

Architecture see at here

What is Snuba

https://getsentry.github.io/snuba/

Similar to Apache Phoenix/Redash/Tabix, a CRUD wrapper for clickhouse

Scalability & High availability Operations

Here is what we need to concert when deployed.

$2HAQuotasRate LimitsBigger RedisHot updateevent not losedweb avaliabeBackupproject and user dataFilesCheckHealth ProbePrometheus

https://develop.sentry.dev/self-hosted/backup/