Skip to content

Commit 07b44be

Browse files
committed
docs(self-hosted): reference architectures
1 parent d9c1147 commit 07b44be

File tree

3 files changed

+122
-0
lines changed

3 files changed

+122
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Self-Hosted Reference Architectures
3+
sidebar_title: Reference Architectures
4+
sidebar_order: 3
5+
---
6+
7+
This section contains reference architectures for self-hosted Sentry. These are not meant to be used as-is, but as a reference for how to deploy self-hosted Sentry around your existing infrastructure. This section can be used as a scaling strategy if you have higher traffic loads over time.
8+
9+
Please note that these reference architectures does not take into account external data storage dependencies such as Kafka, Postgres, Redis, S3 or other services. If you wish to do so, refer to the [Experimental Configurations](/self-hosted/experimental/) section
10+
<PageGrid />
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Separate Ingest Box
3+
sidebar_title: Separate Ingest Box
4+
sidebar_order: 2
5+
---
6+
7+
Other than having a [separate domain](/self-hosted/experimental/reverse-proxy/#expose-only-ingest-endpoint-publicly) to view the web UI and ingest data, you can also put a separate box (or server) for ingesting data, and have it relay data to the main box. This setup is recommended for high-traffic installations, and environment where you have multiple data centers.
8+
9+
Using this setup also prevents DDOS attacks, since we assume your main box can only be accessed using some kind of VPN. If there are any invalid payload being sent to your Relay instance, it will be dropped immediately. If your main box is not reachable, your Relay will keep retrying to send the data.
10+
11+
Please note that you don't need to have multiple data centers in different countries/regions. The region naming on the diagram is to make it easier to understand.
12+
13+
```mermaid
14+
graph TB
15+
subgraph main [Main Sentry Server]
16+
direction TB
17+
nginx[External Nginx]
18+
sentry[Self-Hosted Sentry]
19+
20+
nginx --> sentry
21+
end
22+
23+
subgraph "US Ingest Server"
24+
direction TB
25+
internet1[Public Internet]
26+
relay1[Sentry Relay]
27+
end
28+
29+
30+
subgraph "Asia Ingest Server"
31+
direction TB
32+
internet2[Public Internet]
33+
relay2[Sentry Relay]
34+
end
35+
36+
subgraph "Europe Ingest Server"
37+
direction TB
38+
internet3[Public Internet]
39+
relay3[Sentry Relay]
40+
end
41+
42+
internet1 --> relay1 -- Through VPN tunnel --> main
43+
internet2 --> relay2 -- Through VPN tunnel --> main
44+
internet3 --> relay3 -- Through VPN tunnel --> main
45+
```
46+
47+
To configure the relay, you can install Sentry Relay on your machine through the [Relay Getting Started Guide](https://docs.sentry.io/product/relay/getting-started/). You should configure the Relay to run on `proxy` mode, and point it to the main Sentry server. You can also configure it to use a different port, or a different protocol (HTTP or HTTPS).
48+
49+
A simple configuration for the relay would be:
50+
51+
```yaml
52+
# Please see the relevant documentation.
53+
# Performance tuning: https://docs.sentry.io/product/relay/operating-guidelines/
54+
# All config options: https://docs.sentry.io/product/relay/options/
55+
relay:
56+
mode: proxy
57+
instance: default
58+
upstream: https://sentry.yourcompany.com/
59+
host: 0.0.0.0
60+
port: 3000
61+
62+
limits:
63+
max_concurrent_requests: 20
64+
65+
# To avoid having Out Of Memory issues,
66+
# it's recommended to enable the envelope spooler.
67+
spool:
68+
envelopes:
69+
path: /var/lib/sentry-relay/spool.db # make sure this path exists
70+
max_memory_size: 200MB
71+
max_disk_size: 1000MB
72+
73+
# metrics:
74+
# statsd: "100.100.123.123:8125"
75+
76+
sentry:
77+
enabled: true
78+
dsn: "https://[email protected]/1"
79+
```
80+
81+
82+
<Alert level="info" title="Fun Fact">
83+
Sentry SaaS use this similar setup for their ingestion servers, behind Google Anycast IP address.
84+
</Alert>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Simple Single Node
3+
sidebar_title: Simple Single Node
4+
sidebar_order: 1
5+
---
6+
7+
This is the simplest setup for self-hosted Sentry. It is recommended for small to medium-sized installations. This setup follows [the minimum requirements](/self-hosted/#required-minimum-system-resources) for running Sentry.
8+
9+
It is highly recommended to put an external load balancer (or reverse proxy) in front of your self-hosted Sentry deployment. That way, you can tweak on rate limiting, TLS termination, and other features that does not change the built-in nginx configuration file. It is recommended to install the load balancer on your host machine instead of as a Docker container. Doing this way helps you in the event of Docker engine failure.
10+
11+
If using external load balancer is not possible, you can put it as a Docker container, pointing to the `nginx` service at port `80`. Whatever value you put on your `SENTRY_BIND` environment variable won't matter.
12+
13+
```mermaid
14+
graph TB
15+
subgraph Server
16+
direction TB
17+
nginx[External Nginx]
18+
sentry[Self-Hosted Sentry]
19+
20+
nginx --> sentry
21+
end
22+
23+
internet[Public Internet]
24+
25+
internet--> Server
26+
```
27+
28+
For more information regarding configuring your external load balancer, please refer to the [External Load Balancer](/self-hosted/experimental/reverse-proxy/) section.

0 commit comments

Comments
 (0)