relay_server/constants.rs
1#[cfg(feature = "processing")]
2use std::time::Duration;
3
4include!(concat!(env!("OUT_DIR"), "/constants.gen.rs"));
5
6/// Name of the custom tag in the crash user data for Sentry event payloads.
7#[cfg(feature = "processing")]
8pub const SENTRY_CRASH_PAYLOAD_KEY: &str = "__sentry";
9
10/// Name of the event attachment.
11///
12/// This is a special attachment that can contain a sentry event payload encoded as message pack.
13pub const ITEM_NAME_EVENT: &str = "__sentry-event";
14
15/// Name of the breadcrumb attachment (1).
16///
17/// This is a special attachment that can contain breadcrumbs encoded as message pack. There can be
18/// two attachments that the SDK may use as swappable buffers. Both attachments will be merged and
19/// truncated to the maxmimum number of allowed attachments.
20pub const ITEM_NAME_BREADCRUMBS1: &str = "__sentry-breadcrumb1";
21
22/// Name of the breadcrumb attachment (2).
23///
24/// This is a special attachment that can contain breadcrumbs encoded as message pack. There can be
25/// two attachments that the SDK may use as swappable buffers. Both attachments will be merged and
26/// truncated to the maxmimum number of allowed attachments.
27pub const ITEM_NAME_BREADCRUMBS2: &str = "__sentry-breadcrumb2";
28
29/// Envelope header used to store the UE4 user id.
30pub const UNREAL_USER_HEADER: &str = "unreal_user_id";
31
32/// The default retention for events if the server does not specify a value in project
33/// configurations.
34pub const DEFAULT_EVENT_RETENTION: u16 = 90;
35
36/// Maximum size of JSON request bodies.
37pub const MAX_JSON_SIZE: usize = 262_144;
38
39/// The default client used for check ins whenever the incoming request has no client set.
40pub const DEFAULT_CHECK_IN_CLIENT: &str = "relay-http";
41
42/// The default retention for attachment, which defaults to 30 days currently.
43#[cfg(feature = "processing")]
44pub const DEFAULT_ATTACHMENT_RETENTION: Duration = Duration::from_hours(24 * 30);
45
46/// Magic number indicating the dying message file is encoded by sentry-switch SDK.
47pub const NNSWITCH_SENTRY_MAGIC: &[u8] = b"sntr";
48
49/// The file name that Nintendo uses to in the events they forward.
50pub const NNSWITCH_DYING_MESSAGE_FILENAME: &str = "dying_message.dat";