diff --git a/docs/platforms/go/common/configuration/options.mdx b/docs/platforms/go/common/configuration/options.mdx
index f423347fbed3f..dbfce439fda7b 100644
--- a/docs/platforms/go/common/configuration/options.mdx
+++ b/docs/platforms/go/common/configuration/options.mdx
@@ -20,7 +20,7 @@ Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-uti
-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.
+In debug mode, debug information is printed to help you understand what Sentry is doing. It is `false` by default and generally not recommended in production, though it is safe to use.
@@ -72,7 +72,7 @@ As a historical special case, the sample rate `0.0` is treated as if it was `1.0
-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.
+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/envelopes/#size-limits) and any events exceeding that payload size will be dropped.
If MaxBreadcrumbs is given a negative value, breadcrumbs are ignored.
@@ -100,6 +100,11 @@ If you enable this option, be sure to manually remove what you don't want to sen
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.
+
+
+
+
+Default event tags applied to all events. These are overridden by tags set on a scope.
@@ -129,6 +134,14 @@ Set this option to `true` to enable log capturing in Sentry. The SDK will only c
+## Metrics Options
+
+
+
+When set to `true`, the SDK does not emit metrics. By default, metrics are enabled.
+
+
+
## Tracing Options
@@ -139,7 +152,7 @@ Enables performance tracing. When enabled, the SDK will create transactions and
-A number between `0.0` and `1.0`, controlling the percentage chance a given transaction will be sent to Sentry (`0.0` represents 0% while `1.0` represents 100%.) Applies equally to all transactions created in the app. Either this or `traces-sampler` must be defined to enable tracing.
+A number between `0.0` and `1.0`, controlling the percentage chance a given transaction will be sent to Sentry (`0.0` represents 0% while `1.0` represents 100%.) Applies equally to all transactions created in the app. Either this or `TracesSampler` must be defined to enable tracing.
@@ -153,7 +166,7 @@ Used to customize the sampling of traces, overrides `TracesSampleRate`. This is
Maximum number of spans that can be attached to a transaction.
-See https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits for size limits applied during event ingestion. Events that exceed these limits might get dropped.
+See https://develop.sentry.dev/sdk/envelopes/#size-limits for size limits applied during event ingestion. Events that exceed these limits might get dropped.
@@ -166,6 +179,31 @@ By default, no transactions are ignored.
+
+
+Controls with which URLs trace propagation should be enabled. Does not support regex patterns.
+
+
+
+
+
+When set to `true`, the W3C Trace Context HTTP `traceparent` header is propagated on outgoing HTTP requests.
+
+
+
+
+
+A list of HTTP status codes that should not be traced. Each element can be either:
+
+- A single-element slice `[code]` for a specific status code (for example, `[][]int{{404}}` to ignore 404)
+- A two-element slice `[min, max]` for a range of status codes, inclusive (for example, `[][]int{{400, 405}}` for 400–405)
+
+When an HTTP request results in a status code that matches any of these codes or ranges, the transaction will not be sent to Sentry.
+
+By default, 404 status codes are ignored. To not ignore any status codes, set this option to an empty slice (not `nil`).
+
+
+
## Hooks
These options can be used to hook the SDK in various ways to customize the reporting of events.
@@ -184,6 +222,18 @@ This function is called with a transaction object, and can return a modified tra
+
+
+This function is called before log events are sent to Sentry. You can use it to mutate the log event or return `nil` to discard it.
+
+
+
+
+
+This function is called before metric events are sent to Sentry. You can use it to mutate the metric or return `nil` to discard it.
+
+
+
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.
diff --git a/docs/platforms/go/common/logs/zerolog.mdx b/docs/platforms/go/common/logs/zerolog.mdx
index fc8fe2cf26770..79339677a3c8d 100644
--- a/docs/platforms/go/common/logs/zerolog.mdx
+++ b/docs/platforms/go/common/logs/zerolog.mdx
@@ -139,16 +139,12 @@ func main() {
}
defer sentry.Flush(2 * time.Second)
- // Configure Zerolog to use Sentry as a writer
- sentryWriter, err := sentryzerolog.New(sentryzerolog.Config{
- ClientOptions: sentry.ClientOptions{
- Dsn: "___PUBLIC_DSN___",
- },
- Options: sentryzerolog.Options{
- Levels: []zerolog.Level{zerolog.ErrorLevel, zerolog.FatalLevel, zerolog.PanicLevel},
- WithBreadcrumbs: true,
- FlushTimeout: 3 * time.Second,
- },
+ // Configure Zerolog to use Sentry as a writer,
+ // reusing the already existing client.
+ sentryWriter, err := sentryzerolog.NewWithHub(sentry.CurrentHub(), sentryzerolog.Options{
+ Levels: []zerolog.Level{zerolog.ErrorLevel, zerolog.FatalLevel, zerolog.PanicLevel},
+ WithBreadcrumbs: true,
+ FlushTimeout: 3 * time.Second,
})
if err != nil {
log.Fatal().Err(err).Msg("failed to create sentry writer")
@@ -179,7 +175,7 @@ You can set a custom hubProvider function using the SetHubProvider method:
```go
sentryHook.SetHubProvider(func() *sentry.Hub {
// Create or return a specific Sentry hub
- return sentry.NewHub(sentry.GetCurrentHub().Client(), sentry.NewScope())
+ return sentry.NewHub(sentry.CurrentHub().Client(), sentry.NewScope())
})
```
diff --git a/docs/platforms/go/common/tracing/instrumentation/custom-instrumentation/requests-module.mdx b/docs/platforms/go/common/tracing/instrumentation/custom-instrumentation/requests-module.mdx
index 9f2830bcf41ea..4ccfae808c7a0 100644
--- a/docs/platforms/go/common/tracing/instrumentation/custom-instrumentation/requests-module.mdx
+++ b/docs/platforms/go/common/tracing/instrumentation/custom-instrumentation/requests-module.mdx
@@ -22,12 +22,14 @@ import sentryhttpclient "github.com/getsentry/sentry-go/httpclient"
func main() {
// need to have tracing enabled
_ = sentry.Init(sentry.ClientOptions{
- Dsn: "___PUBLIC_DSN___",
+ Dsn: "___PUBLIC_DSN___",
EnableTracing: true,
TracesSampleRate: 1.0,
})
- client := sentryhttpclient.SentryHTTPClient
+ client := &http.Client{
+ Transport: sentryhttpclient.NewSentryRoundTripper(nil),
+ }
response, err := client.Do(request)
if err != nil {
return