Skip to content

Commit 312960b

Browse files
docs(elixir-sdk): refactor config options page (#12621)
1 parent ccb7d8a commit 312960b

File tree

2 files changed

+43
-39
lines changed

2 files changed

+43
-39
lines changed

docs/platforms/elixir/configuration/options.mdx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,110 +6,112 @@ sidebar_order: 1
66

77
<PlatformContent includePath="configuration/config-intro" />
88

9+
## Available Options
10+
11+
<TableOfContents ignoreIds={["available-options"]} />
12+
913
## Core Options
1014

1115
Options that can be read from an environment variable (`SENTRY_DSN`, `SENTRY_ENVIRONMENT`, `SENTRY_RELEASE`) are read automatically.
1216

13-
<ConfigKey name="dsn">
17+
<SdkOption name="dsn" type='string' envVar='SENTRY_DSN'>
1418

1519
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.
1620

17-
In runtimes without a process environment (such as the browser) that fallback does not apply.
18-
1921
Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization).
2022

21-
</ConfigKey>
23+
</SdkOption>
2224

23-
<ConfigKey name="release">
25+
<SdkOption name="release" type='string' envVar='SENTRY_RELEASE'>
2426

2527
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 <SandboxLink scenario="releases">sandbox</SandboxLink>.
2628

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.
2830

29-
</ConfigKey>
31+
</SdkOption>
3032

31-
<ConfigKey name="environment">
33+
<SdkOption name="environment" type='string' envVar='SENTRY_ENVIRONMENT'>
3234

3335
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).
3436

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.
3638

37-
</ConfigKey>
39+
</SdkOption>
3840

39-
<ConfigKey name="sample-rate">
41+
<SdkOption name="sample_rate" type='float' defaultValue='1.0'>
4042

4143
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.
4244

43-
</ConfigKey>
45+
</SdkOption>
4446

45-
<ConfigKey name="max-breadcrumbs">
47+
<SdkOption name="max_breadcrumbs" type='integer' defaultValue='100'>
4648

4749
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.
4850

49-
</ConfigKey>
51+
</SdkOption>
5052

51-
<ConfigKey name="server-name">
53+
<SdkOption name="server_name" type='string'>
5254

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.
5456

5557
Most SDKs will attempt to auto-discover this value.
5658

57-
</ConfigKey>
59+
</SdkOption>
5860

5961
## Hooks
6062

6163
These options can be used to hook the SDK in various ways to customize the reporting of events.
6264

63-
<ConfigKey name="before-send">
65+
<SdkOption name="before_send" type='function'>
6466

6567
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.
6668

67-
By the time <PlatformIdentifier name="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 <PlatformIdentifier name="before_send" /> is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect.
6870

69-
</ConfigKey>
71+
</SdkOption>
7072

71-
<ConfigKey name="after-send-event">
73+
<SdkOption name="after_send_event" type='function'>
7274

7375
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.
7476

75-
</ConfigKey>
77+
</SdkOption>
7678

7779
## Transport Options
7880

7981
Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments.
8082

81-
<ConfigKey name="send-result">
83+
<SdkOption name="send_result" defaultValue=':none'>
8284

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`).
8486

85-
</ConfigKey>
87+
</SdkOption>
8688

87-
<ConfigKey name="send-max-attempts">
89+
<SdkOption name="send_max_attempts" type='integer' defaultValue='4'>
8890

89-
The maximum number of attempts to send an event to Sentry. Defaults to `4`.
91+
The maximum number of attempts to send an event to Sentry.
9092

91-
</ConfigKey>
93+
</SdkOption>
9294

93-
<ConfigKey name="client">
95+
<SdkOption name="client" defaultValue='Sentry.HackneyClient'>
9496

9597
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.
9698

97-
</ConfigKey>
99+
</SdkOption>
98100

99-
<ConfigKey name="hackney-opts">
101+
<SdkOption name="hackney_opts" defaultValue='[pool: :sentry_pool]'>
100102

101-
Options to be passed to Hackney. Only applied if `client` is set to `Sentry.HackneyClient`. Defaults to `[pool: :sentry_pool]`.
103+
Options to be passed to Hackney. Only applied if `client` is set to `Sentry.HackneyClient`.
102104

103-
</ConfigKey>
105+
</SdkOption>
104106

105-
<ConfigKey name="hackney-pool-max-connections">
107+
<SdkOption name="hackney_pool_max_connections" type='integer' defaultValue='50'>
106108

107-
The maximum number of connections to keep in the pool. Only applied if `client` is set to `Sentry.HackneyClient`. Defaults to `50`.
109+
The maximum number of connections to keep in the pool. Only applied if `client` is set to `Sentry.HackneyClient`.
108110

109-
</ConfigKey>
111+
</SdkOption>
110112

111-
<ConfigKey name="hackney-pool-timeout">
113+
<SdkOption name="hackney_pool_timeout" type='integer' defaultValue='5000'>
112114

113-
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`.
114116

115-
</ConfigKey>
117+
</SdkOption>

docs/platforms/elixir/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sdk: sentry.elixir
55
caseStyle: snake_case
66
supportLevel: production
77
showIntegrationsInSearch: true
8+
categories:
9+
- server
810
---
911

1012
On this page, we get you up and running with Sentry's SDK.

0 commit comments

Comments
 (0)