Skip to content

Commit e23d3ec

Browse files
mitsuhikountitaker
authored andcommitted
docs: Ported docs over from old sentry docs (#189)
1 parent b5d3091 commit e23d3ec

File tree

6 files changed

+756
-0
lines changed

6 files changed

+756
-0
lines changed

docs/options.md

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
# Configuration Options
2+
3+
The base configuration for Relay lives in the file `.semaphore/config.yml`. All keys are `snake_case`.
4+
5+
## Relay
6+
7+
General relay settings.
8+
9+
`relay.mode`
10+
11+
: *string, default: `managed`*
12+
13+
Controls the basic communication and configuration mode for this relay.
14+
Allowed values are:
15+
16+
- `managed` *(default)*: Project configurations are managed by Sentry, unless
17+
they are statically overridden via the file system. This requires
18+
credentials to be set up and white listed in Sentry.
19+
- `static`: Projects must be statically configured on the file system. If
20+
configured, PII stripping is also performed on those events. Events for
21+
unknown projects are automatically rejected.
22+
- `proxy`: Relay acts as a proxy for all requests and events. It will not load
23+
project configurations from the upstream or perform PII stripping. All
24+
events are accepted unless overridden on the file system.
25+
26+
For more information on providing or overriding project configurations on the
27+
file system, please refer to [Project Configuration](project-config.md) and
28+
[PII Configuration](pii-config/index.md).
29+
30+
`relay.upstream`
31+
32+
: *string, default: `https://ingest.sentry.io`*
33+
34+
The upstream relay or sentry instance.
35+
36+
**Important**: Relay does not check for cycles. Ensure this option is not set
37+
to an endpoint that will cause events to be cycled back here.
38+
39+
`relay.host`
40+
41+
: *string, default: `127.0.0.1`*
42+
43+
The host the relay should bind to (network interface). Example: `0.0.0.0`
44+
45+
`relay.port`
46+
47+
: *integer, default: `3000`*
48+
49+
The port to bind for the unencrypted relay HTTP server. Example: `3000`
50+
51+
`relay.tls_port`
52+
53+
: *integer, optional*
54+
55+
Optional port to bind for the encrypted relay HTTPS server. Example: `3001`
56+
57+
This is in addition to the `port` option: If you set up a HTTPS server at
58+
`tls_port`, the HTTP server at `port` still exists.
59+
60+
`relay.tls_identity_path`
61+
62+
: *string, optional*
63+
64+
The filesystem path to the identity (DER-encoded PKCS12) to use for the HTTPS
65+
server. Example: `relay_dev.pfx`
66+
67+
`relay.tls_identity_password`
68+
69+
: *string, optional*
70+
71+
Password for the PKCS12 archive in `tls_identity_path`.
72+
73+
## HTTP
74+
75+
Set various network-related settings.
76+
77+
`http.timeout`
78+
79+
: *integer, default: `5`*
80+
81+
Timeout for upstream requests in seconds.
82+
83+
`http.max_retry_interval`
84+
85+
: *integer, default: `60`*
86+
87+
Maximum interval between failed request retries in seconds.
88+
89+
## Caching
90+
91+
Fine-tune caching of project state.
92+
93+
`cache.project_expiry`
94+
95+
: *integer, default: `300` (5 minutes)*
96+
97+
The cache timeout for project configurations in seconds. Irrelevant if you
98+
use the "simple proxy mode", where your project config is stored in a local
99+
file.
100+
101+
`cache.relay_expiry`
102+
103+
: *integer, default: `3600` (1 hour)*
104+
105+
The cache timeout for downstream relay info (public keys) in seconds.
106+
107+
`cache.event_expiry`
108+
109+
: *integer, default: `600` (10 minutes)*
110+
111+
The cache timeout for events (store) before dropping them.
112+
113+
`cache.miss_expiry`
114+
115+
: *integer, default: `60` (1 minute)*
116+
117+
The cache timeout for non-existing entries.
118+
119+
`cache.batch_interval`
120+
121+
: *integer, default: `100` (100 milliseconds)*
122+
123+
The buffer timeout for batched queries before sending them upstream **in
124+
milliseconds**.
125+
126+
`cache.file_interval`
127+
128+
: *integer, default: `10` (10 seconds)*
129+
130+
Interval for watching local cache override files in seconds.
131+
132+
`cache.event_buffer_size`
133+
134+
: *integer, default: `1000`*
135+
136+
The maximum number of events that are buffered in case of network issues or
137+
high rates of incoming events.
138+
139+
## Size Limits
140+
141+
Controls various HTTP-related limits. All values are human-readable strings of a number and a human-readable unit, such as:
142+
143+
- `1KiB`
144+
- `1MB`
145+
- `1MiB`
146+
- `1MiB`
147+
- `1025B`
148+
149+
`limits.max_concurrent_requests`
150+
151+
: *integer, default: `100`*
152+
153+
The maximum number of concurrent connections to the upstream.
154+
155+
`limits.max_event_payload_size`
156+
157+
: *string, default: `256KB`*
158+
159+
The maximum payload size for events.
160+
161+
`limits.max_api_payload_size`
162+
163+
: *string, default: `20MB`*
164+
165+
The maximum payload size for general API requests.
166+
167+
`limits.max_api_file_upload_size`
168+
169+
: *string, default: `40MB`*
170+
171+
The maximum payload size for file uploads and chunks.
172+
173+
`limits.max_api_chunk_upload_size`
174+
175+
: *string, default: `100MB`*
176+
177+
The maximum payload size for chunks
178+
179+
## Logging
180+
181+
`logging.level`
182+
183+
: *string, default: `info`*
184+
185+
The log level for the relay. One of:
186+
187+
- `off`
188+
- `error`
189+
- `warn`
190+
- `info`
191+
- `debug`
192+
- `trace`
193+
194+
`logging.log_failed_payloads`
195+
196+
: *boolean, default: `false`*
197+
198+
If set to true this emits log messages for failed event payloads.
199+
200+
`logging.format`
201+
202+
: *string, default: `auto`*
203+
204+
Controls the log format. One of:
205+
206+
- `auto`: Auto detect (pretty for tty, simplified for other)
207+
- `pretty`: With colors
208+
- `simplified`: Simplified log output
209+
- `json`: Dump out JSON lines
210+
211+
`logging.enable_backtraces`
212+
213+
: *boolean, default: `true`*
214+
215+
When set to true, backtraces are forced on.
216+
217+
## Statsd Metrics
218+
219+
`metrics.statsd`
220+
221+
: *string, optional*
222+
223+
If set to a host/port string then metrics will be reported to this statsd
224+
instance.
225+
226+
`metrics.prefix`
227+
228+
: *string, default: `sentry.relay`*
229+
230+
The prefix that should be added to all metrics.
231+
232+
## Internal Error Reporting
233+
234+
Configures error reporting for errors happening within Sentry. Disabled by
235+
default.
236+
237+
`sentry.enabled`
238+
239+
: *boolean, default: `false`*
240+
241+
Whether to report internal errors to a separate DSN. `false` means no internal
242+
errors are sent (just logged).
243+
244+
`sentry.dsn`
245+
246+
: *string, optional*
247+
248+
DSN to report internal relay failures to.
249+
250+
It is not a good idea to set this to a value that will make the relay send
251+
errors to itself. Ideally this should just send errors to Sentry directly, not
252+
another relay.

docs/pii-config/index.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# PII Configuration
2+
3+
The following document explores the syntax and semantics of PII configs for Relay. To get started with PII configs, it's recommended to use [_Piinguin_](https://getsentry.github.io/piinguin) and refer back to this document when needed.
4+
5+
## A basic example
6+
7+
Say you have an exception message which, unfortunately, contains IP addresses which are not supposed to be there. You'd write:
8+
9+
```json
10+
{
11+
"applications": {
12+
"text": ["@ip:replace"]
13+
}
14+
}
15+
```
16+
17+
It reads as "apply rule `@ip:replace` to all `text` fields.
18+
19+
## Rules
20+
21+
The following rules exist by default:
22+
23+
- `@ip:replace` and `@ip:hash` for pattern-matching IP addresses
24+
- `@imei:replace` and `@imei:hash` for pattern-matching IMEIs
25+
- `@mac:replace`, `@mac:mask` and `@mac:hash` for pattern-matching MAC addresses
26+
- `@email:mask`, `@email:replace` and `@email:hash` for pattern-matching email addresses
27+
- `@creditcard:mask`, `@creditcard:replace` and `@creditcard:hash` for pattern-matching creditcard numbers
28+
- `@userpath:replace` and `@userpath:hash` for pattern-matching local paths (e.g. `C:/Users/foo/`)
29+
- `@password:remove` for pattern matching passwords. In this case we're pattern matching against the field's key, whether it contains `password`, `credentials` or similar strings.
30+
31+
### Writing your own rules
32+
33+
Rules generally consist of two parts:
34+
35+
- *Rule types* describe what to match. See [_PII Rule Types_](types.md) for an exhaustive list.
36+
- *Rule redaction methods* describe what to do with the match. See [_PII Rule Redaction Methods_](methods.md) for a list.
37+
38+
Each page comes with examples. Try those examples out by pasting them into the "PII config" column of [_Piinguin_](https://getsentry.github.io/piinguin) and clicking on fields to get suggestions.

docs/pii-config/methods.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# PII Rule Redaction Methods
2+
3+
#### remove
4+
5+
Remove the entire field. Relay may choose to either set it to `null` or to remove it entirely.
6+
7+
```json
8+
{
9+
"rules": {
10+
"remove_ip": {
11+
"type": "ip",
12+
"redaction": {
13+
"method": "remove"
14+
}
15+
}
16+
},
17+
"applications": {
18+
"text": ["remove_ip"]
19+
}
20+
}
21+
```
22+
23+
#### replace
24+
25+
Replace the key with a static string.
26+
27+
```json
28+
{
29+
"rules": {
30+
"replace_ip": {
31+
"type": "ip",
32+
"redaction": {
33+
"method": "replace",
34+
"text": "[censored]"
35+
}
36+
}
37+
},
38+
"applications": {
39+
"text": ["replace_ip"]
40+
}
41+
}
42+
```
43+
44+
#### mask
45+
46+
Replace every character of the matched string with a "masking" char. Compared to `replace` this preserves the length of the original string.
47+
48+
```javascript
49+
{
50+
"rules": {
51+
"mask_ip": {
52+
"type": "ip",
53+
"redaction": {
54+
"method": "mask",
55+
"mask_char": "0", // The character used for masking. Optional, default "*"
56+
"chars_to_ignore": ".", // Which characters to ignore. Optional, default empty
57+
"range": [0, -1] // Which range of the string to replace. Optional, defaults to full range. Negative indices count from the matches' end.
58+
}
59+
}
60+
},
61+
"applications": {
62+
"text": ["mask_ip"]
63+
}
64+
}
65+
```
66+
67+
#### hash
68+
69+
Replace the string with a hashed version of itself. Equal strings will produce the same hash, so if you, for example, decide to hash the user ID instead of replacing or removing it, you will still have an accurate count of users affected.
70+
71+
```javascript
72+
{
73+
"rules": {
74+
"hash_ip": {
75+
"type": "ip",
76+
"redaction": {
77+
"method": "hash",
78+
"algorithm": "HMAC-SHA1", // One of "HMAC-SHA1", "HMAC-SHA256", "HMAC-SHA512"
79+
"key": "myOverriddenKey" // A key to salt the hash with. Defaults to the default key set in "vars"
80+
}
81+
}
82+
},
83+
"vars": {
84+
"hashKey": "myDefaultKey" // The default key to use
85+
}
86+
"applications": {
87+
"text": ["mask_ip"]
88+
}
89+
}
90+
```

0 commit comments

Comments
 (0)