Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions docs/platforms/rust/common/tracing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ description: "Learn how to enable tracing in your app and discover valuable perf
sidebar_order: 4000
---

<Alert>

Are you looking for Sentry's integration with the `tracing` crate? You can find it <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/">here</PlatformLink>.

</Alert>

With [tracing](/product/insights/), Sentry tracks your software performance, measuring metrics like throughput and latency, and displaying the impact of errors across multiple systems. Sentry captures distributed traces consisting of transactions and spans, which measure individual services and individual operations within those services. Learn more about our model in [Distributed Tracing](/product/sentry-basics/tracing/distributed-tracing/).

<Alert>
Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/rust/guides/tracing/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
title: tracing
title: tokio-rs/tracing
20 changes: 10 additions & 10 deletions docs/platforms/rust/guides/tracing/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: tracing
description: "Learn about monitoring your Rust application with Sentry's tracing integration."
title: tokio-rs/tracing
description: "Learn about monitoring your Rust application with Sentry's tokio-rs/tracing integration."
---

The Sentry SDK offers an integration for tokio's [tracing](https://github.com/tokio-rs/tracing) ecosystem that supports:
Expand Down Expand Up @@ -65,7 +65,7 @@ fn main() {
.with(tracing_subscriber::fmt::layer())
.with(sentry::integrations::tracing::layer())
.init();

tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?
Expand All @@ -88,11 +88,9 @@ async fn fail() {
}
```

By default, error level events are captured as Sentry events, while anything at or above info is added as a breadcrumb.

{/* ___PRODUCT_OPTION_START___ logs */}
By default, error level events from `tokio-rs/tracing` are captured as Sentry events, while anything at or above info is added as a breadcrumb.

To capture structured logs for `tracing` events instead, you need to set up the Sentry layer with a custom event filter that maps to logs, like so:
To capture structured logs from `tokio-rs/tracing` events instead, you need to pass `enable_logs: true` to `sentry::init`, and set up the Sentry layer with a custom event filter that maps to logs, like so:

```rust
use sentry::integrations::tracing::EventFilter;
Expand All @@ -107,8 +105,6 @@ sentry::integrations::tracing::layer().event_filter(|md| match *md.level() {
});
```

{/* ___PRODUCT_OPTION_END___ logs */}

## Verify

<Alert>
Expand All @@ -117,4 +113,8 @@ Learn more about manually capturing an error or message in our <PlatformLink to=

</Alert>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Select Issues, and then Errors & Outages in the sidebar, where you will find the newly created issue. Clicking on the issue's title will open a page where you can see detailed information and mark it as resolved.
To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Select Issues, and then Errors & Outages in the sidebar, where you will find the newly created issue. Clicking on the issue's title will open a page where you can see detailed information and mark it as resolved.

If you're using tracing (the Sentry feature), you can view the recorded traces and spans by selecting Explore, and then Traces in the sidebar.

If you're using logs, you can view the recorded logs by selecting Explore, and then Logs in the sidebar.
Loading