You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DSN tells the SDK where to send the events. If this value is not provided, the SDK will try to read it from the `SENTRY_DSN` environment variable. If that variable also does not exist, the SDK will just not send any events.
16
20
17
-
In runtimes without a process environment (such as the browser) that fallback does not apply.
18
-
19
21
Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization).
Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it to guarantee that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the <SandboxLinkscenario="releases">sandbox</SandboxLink>.
26
28
27
-
By default the SDK will try to read this value from the `SENTRY_RELEASE` environment variable (in the browser SDK, this will be read off of the `window.SENTRY_RELEASE.id` if available).
29
+
By default the SDK will try to read this value from the `SENTRY_RELEASE` environment variable.
Sets the environment. This string is freeform and not set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar).
34
36
35
-
By default the SDK will try to read this value from the `SENTRY_ENVIRONMENT` environment variable (except for the browser SDK where this is not applicable).
37
+
By default the SDK will try to read this value from the `SENTRY_ENVIRONMENT` environment variable.
Configures the sample rate for error events, in the range of `0.0` to `1.0`. The default is `1.0`, which means that 100% of error events will be sent. If set to `0.1`, only 10% of error events will be sent. Events are picked randomly.
This variable controls the total amount of breadcrumbs that should be captured. This defaults to `100`, but you can set this to any number. However, you should be aware that Sentry has a [maximum payload size](https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits) and any events exceeding that payload size will be dropped.
48
50
49
-
</ConfigKey>
51
+
</SdkOption>
50
52
51
-
<ConfigKeyname="server-name">
53
+
<SdkOptionname="server_name"type='string'>
52
54
53
-
This option can be used to supply a "server name." When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server.
55
+
This option can be used to supply a server name. When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server.
54
56
55
57
Most SDKs will attempt to auto-discover this value.
56
58
57
-
</ConfigKey>
59
+
</SdkOption>
58
60
59
61
## Hooks
60
62
61
63
These options can be used to hook the SDK in various ways to customize the reporting of events.
62
64
63
-
<ConfigKeyname="before-send">
65
+
<SdkOptionname="before_send"type='function'>
64
66
65
67
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `null` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
66
68
67
-
By the time <PlatformIdentifiername="before-send" /> is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect.
69
+
By the time <PlatformIdentifiername="before_send" /> is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect.
68
70
69
-
</ConfigKey>
71
+
</SdkOption>
70
72
71
-
<ConfigKeyname="after-send-event">
73
+
<SdkOptionname="after_send_event"type='function'>
72
74
73
75
This function is called with an event and the result of sending that event. This is useful to log send results, instrument Sentry calls, and so on.
74
76
75
-
</ConfigKey>
77
+
</SdkOption>
76
78
77
79
## Transport Options
78
80
79
81
Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments.
80
82
81
-
<ConfigKeyname="send-result">
83
+
<SdkOptionname="send_result"defaultValue=':none'>
82
84
83
-
Controls whether to report events to Sentry _synchronously_ (if set to `:sync`) or _asynchronously_ (if set to `:none`). Defaults to `:none`.
85
+
Controls whether to report events to Sentry _synchronously_ (if set to `:sync`) or _asynchronously_ (if set to `:none`).
The HTTP client to use for sending events to Sentry. This must be a module that implements the [`Sentry.HTTPClient`](https://hexdocs.pm/sentry/Sentry.HTTPClient.html) behaviour. Defaults to `Sentry.HackneyClient`, which is based on the [Hackney](https://hexdocs.pm/hackney) HTTP client.
The maximum time to wait (in milliseconds) for a connection to become available. Only applied if `client` is set to `Sentry.HackneyClient`. Defaults to `5000`.
115
+
The maximum time to wait (in milliseconds) for a connection to become available. Only applied if `client` is set to `Sentry.HackneyClient`.
0 commit comments