diff --git a/docs/platforms/rust/common/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/rust/common/tracing/instrumentation/automatic-instrumentation.mdx index 90d2ba410ba47..28e4364436722 100644 --- a/docs/platforms/rust/common/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/rust/common/tracing/instrumentation/automatic-instrumentation.mdx @@ -24,7 +24,7 @@ fn main() { .with(sentry::integrations::tracing::layer()) .init(); - let _sentry = sentry::init(sentry::ClientOptions { + let _guard = sentry::init(sentry::ClientOptions { release: sentry::release_name!(), traces_sample_rate: 1.0, // Capture user IPs and potentially sensitive headers when using HTTP server integrations @@ -55,7 +55,7 @@ The Rust SDK offers an integration for the OpenTelemetry ecosystem. The integration can automatically capture Sentry [spans/transactions](/concepts/key-terms/tracing/distributed-tracing/#traces-transactions-and-spans) for every span created through the OpenTelemetry API, with support for [distributed tracing](/concepts/key-terms/tracing/distributed-tracing/). The integration also captures errors with the correct span and trace associations. -For this integration to work as intended, only the OpenTelemetry tracing API should be used to manage spans. +For this integration to work as intended, only the OpenTelemetry tracing API should be used to manage spans. Mixing it with the Sentry tracing API will result in incorrectly nested spans. To get started using the OpenTelemetry integration for the Sentry Rust SDK, add the necessary dependencies to your `Cargo.toml`: diff --git a/platform-includes/configuration/sample-rate/rust.mdx b/platform-includes/configuration/sample-rate/rust.mdx index fefe66c8209a2..4411478eabc14 100644 --- a/platform-includes/configuration/sample-rate/rust.mdx +++ b/platform-includes/configuration/sample-rate/rust.mdx @@ -1,5 +1,5 @@ ```rust -let _sentry = sentry::init(sentry::ClientOptions { +let _guard = sentry::init(sentry::ClientOptions { sample_rate: 1.0, ..Default::default() }); diff --git a/platform-includes/performance/configure-sample-rate/rust.mdx b/platform-includes/performance/configure-sample-rate/rust.mdx index f92a090774c60..845c8653ab77f 100644 --- a/platform-includes/performance/configure-sample-rate/rust.mdx +++ b/platform-includes/performance/configure-sample-rate/rust.mdx @@ -1,5 +1,5 @@ ```rust -let _sentry = sentry::init(sentry::ClientOptions { +let _guard = sentry::init(sentry::ClientOptions { release: sentry::release_name!(), // To set a uniform sample rate traces_sample_rate: 0.2, diff --git a/platform-includes/performance/traces-sample-rate/rust.mdx b/platform-includes/performance/traces-sample-rate/rust.mdx index 6a1373435ce30..7a8266dde9945 100644 --- a/platform-includes/performance/traces-sample-rate/rust.mdx +++ b/platform-includes/performance/traces-sample-rate/rust.mdx @@ -1,5 +1,5 @@ ```rust -let _sentry = sentry::init(sentry::ClientOptions { +let _guard = sentry::init(sentry::ClientOptions { release: sentry::release_name!(), traces_sample_rate: 1.0, ..Default::default()