-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(go): refactor options page #15123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 12.38kB (0.05%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! There are some things to be improved in terms of wording, but I'll let the docs folks chime in here.
|
||
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. | ||
|
||
Most SDKs will attempt to auto-discover this value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most SDKs will attempt to auto-discover this value. |
remove?
|
||
<SdkOption name="IgnoreErrors" type="[]string"> | ||
|
||
A list of regexp strings that will be used to match against event's message and if applicable, caught errors type and value. If the match is found, then a whole event will be dropped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A list of regexp strings that will be used to match against event's message and if applicable, caught errors type and value. If the match is found, then a whole event will be dropped. | |
A list of regexp strings that will be used to match against an event's message and, if applicable, the caught error's type and value. If a match is found, then the whole event will be dropped. |
|
||
<SdkOption name="TracesSampler" type="TracesSampler"> | ||
|
||
Used to customize the sampling of traces, overrides TracesSampleRate. A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or `TracesSampleRate` must be defined to enable tracing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used to customize the sampling of traces, overrides TracesSampleRate. A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or `TracesSampleRate` must be defined to enable tracing. | |
Used to customize the sampling of traces, overrides `TracesSampleRate`. This is a function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or `TracesSampleRate` must be defined to enable tracing. |
<SdkOption name="ProfilesSampleRate" type="float64" defaultValue="0.0"> | ||
|
||
A number between `0.0` and `1.0`, controlling the percentage chance a given sampled transaction will be profiled. (`0.0` represents 0% while `1.0` represents 100%.) Applies equally to all transactions created in the app. This is relative to the tracing sample rate - e.g. `0.5` means 50% of sampled transactions will be profiled. | ||
|
||
</SdkOption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<SdkOption name="ProfilesSampleRate" type="float64" defaultValue="0.0"> | |
A number between `0.0` and `1.0`, controlling the percentage chance a given sampled transaction will be profiled. (`0.0` represents 0% while `1.0` represents 100%.) Applies equally to all transactions created in the app. This is relative to the tracing sample rate - e.g. `0.5` means 50% of sampled transactions will be profiled. | |
</SdkOption> |
Is this still applicable?
|
||
<SdkOption name="BeforeSend" type="func(event *Event, hint *EventHint) *Event"> | ||
|
||
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `nil` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `nil` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending. | |
This function is called with an event object, and can return a modified event object, or `nil` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending. |
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When `nil` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. | ||
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When `nil` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. | |
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like. | |
This function is called with a breadcrumb object before the breadcrumb is added to the scope. When `nil` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. | |
The callback gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like. |
|
||
<SdkOption name="DebugWriter" type="io.Writer"> | ||
|
||
io.Writer implementation that should be used with the Debug mode. This allows you to redirect debug output to a custom writer instead of stdout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
io.Writer implementation that should be used with the Debug mode. This allows you to redirect debug output to a custom writer instead of stdout. | |
`io.Writer` implementation that should be used with the Debug mode. This allows you to redirect debug output to a custom writer instead of stdout. |
|
||
<SdkOption name="Transport" type="Transport"> | ||
|
||
The transport to use. Defaults to HTTPTransport. Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transport to use. Defaults to HTTPTransport. Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication. | |
The transport to use. Defaults to `HTTPTransport`. Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication. |
|
||
<SdkOption name="HTTPClient" type="*http.Client"> | ||
|
||
An optional pointer to http.Client that will be used with a default HTTPTransport. Using your own client will make HTTPTransport, HTTPProxy, HTTPSProxy and CaCerts options ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An optional pointer to http.Client that will be used with a default HTTPTransport. Using your own client will make HTTPTransport, HTTPProxy, HTTPSProxy and CaCerts options ignored. | |
An optional pointer to `http.Client` that will be used with a default HTTPTransport. Using your own client will make HTTPTransport, HTTPProxy, HTTPSProxy and CaCerts options ignored. |
|
||
<SdkOption name="HTTPProxy" type="string" envVar="HTTP_PROXY"> | ||
|
||
When set, a proxy can be configured that should be used for outbound requests. This is also used for HTTPS requests unless a separate `HTTPSProxy` is configured. However, not all SDKs support a separate HTTPS proxy. SDKs will attempt to default to the system-wide configured proxy, if possible. For instance, on Unix systems, the `HTTP_PROXY` environment variable will be picked up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When set, a proxy can be configured that should be used for outbound requests. This is also used for HTTPS requests unless a separate `HTTPSProxy` is configured. However, not all SDKs support a separate HTTPS proxy. SDKs will attempt to default to the system-wide configured proxy, if possible. For instance, on Unix systems, the `HTTP_PROXY` environment variable will be picked up. | |
When set, a proxy can be configured that should be used for outbound requests. This is also used for HTTPS requests unless a separate `HTTPSProxy` is configured. |
|
||
<SdkOption name="Dsn" type="string" envVar="SENTRY_DSN"> | ||
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | |
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's also missing, no events will be sent. |
|
||
<SdkOption name="Debug" type="bool" defaultValue="false"> | ||
|
||
If debug is enabled, the SDK will attempt to print out useful debugging information if something goes wrong while sending the event. The default is always `false`. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If debug is enabled, the SDK will attempt to print out useful debugging information if something goes wrong while sending the event. The default is always `false`. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns. | |
If debug is enabled, the SDK will attempt to print out useful debugging information if something goes wrong while sending the event. It's always `false` by default and generally not recommended in production environments, though it's safe to use. |
|
||
<SdkOption name="Release" type="string" envVar="SENTRY_RELEASE"> | ||
|
||
Sets the release. Some Sentry features are built around releases, and, thus, reporting events with a non-empty release improves the product experience. See [the releases documentation](/product/releases/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sets the release. Some Sentry features are built around releases, and, thus, reporting events with a non-empty release improves the product experience. See [the releases documentation](/product/releases/). | |
Sets the release. Some Sentry features are built around release info, so reporting releases can help improve the overall experience. See [the releases documentation](/product/releases/). |
|
||
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. | ||
|
||
As a historical special case, the sample rate `0.0` is treated as if it was `1.0`. To drop all events, set the DSN to the empty string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a historical special case, the sample rate `0.0` is treated as if it was `1.0`. To drop all events, set the DSN to the empty string. | |
As a historical special case, the sample rate `0.0` is treated as if it was `1.0`. To drop all events, set the DSN to an empty string. |
|
||
This variable controls the total amount of breadcrumbs that should be captured. 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. | ||
|
||
When MaxBreadcrumbs is negative then breadcrumbs are ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When MaxBreadcrumbs is negative then breadcrumbs are ignored. | |
If MaxBreadcrumbs is given a negative value, breadcrumbs are ignored. |
|
||
<SdkOption name="ServerName" type="string"> | ||
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | |
Supplies 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. |
|
||
<SdkOption name="IgnoreErrors" type="[]string"> | ||
|
||
A list of regexp strings that will be used to match against event's message and if applicable, caught errors type and value. If the match is found, then a whole event will be dropped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A list of regexp strings that will be used to match against event's message and if applicable, caught errors type and value. If the match is found, then a whole event will be dropped. | |
A list of regular expression strings used to match an event’s message, and, when applicable, the type or value of a caught error. If a match is found, the entire event is dropped. |
|
||
This is the maximum number of errors reported in a chain of errors. This protects the SDK from an arbitrarily long chain of wrapped errors. | ||
|
||
An additional consideration is that arguably reporting a long chain of errors is of little use when debugging production errors with Sentry. The Sentry UI is not optimized for long chains either. The top-level error together with a stack trace is often the most useful information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An additional consideration is that arguably reporting a long chain of errors is of little use when debugging production errors with Sentry. The Sentry UI is not optimized for long chains either. The top-level error together with a stack trace is often the most useful information. | |
In practice, reporting very long chains usually provides little value when debugging production issues, as the Sentry UI isn’t optimized for them. The top-level error and its stack trace usually contain the most relevant information. |
|
||
<SdkOption name="EnableLogs" type="bool" defaultValue="false"> | ||
|
||
Set this option to `true` to enable log capturing in Sentry. Only when this is enabled will the SDK capture log messages and send them to Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this option to `true` to enable log capturing in Sentry. Only when this is enabled will the SDK capture log messages and send them to Sentry. | |
Set this option to `true` to enable log capturing in Sentry. The SDK will only capture and send log messages to Sentry if this option is enabled. |
|
||
<SdkOption name="EnableTracing" type="bool" defaultValue="false"> | ||
|
||
Enable performance tracing. When enabled, the SDK will create transactions and spans to measure performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable performance tracing. When enabled, the SDK will create transactions and spans to measure performance. | |
Enables performance tracing. When enabled, the SDK will create transactions and spans to measure performance. |
<SdkOption name="BeforeBreadcrumb" type="func(breadcrumb *Breadcrumb, hint *BreadcrumbHint) *Breadcrumb"> | ||
|
||
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When `nil` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. | ||
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like. | |
The callback typically gets a second argument (called a "hint") that provides the original object used to create the breadcrumb. You can use this to further customize the breadcrumb’s content or appearance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a big lift! 💪 Thanks for updating
DESCRIBE YOUR PR
Refactor the go options page to follow the format from other SDKs:
SdkOption
element for config options, along with the default values.