Skip to content

Commit 81b0f0e

Browse files
committed
update
1 parent a0a67c9 commit 81b0f0e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/platforms/rust/guides/axum/index.mdx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ The integration actually supports any crate based on [tower](https://github.com/
1212

1313
## Install
1414

15+
<OnboardingOptionButtons
16+
options={["error-monitoring", "performance"]}
17+
/>
18+
1519
To add Sentry with the `axum` integration to your Rust project, add a new dependency to your `Cargo.toml`:
1620

17-
```toml {filename:Cargo.toml}
21+
```toml {filename:Cargo.toml}
1822
[dependencies]
1923
axum = "0.8.4"
2024
tower = "0.5.2"
@@ -27,6 +31,8 @@ sentry = { version = "{{@inject packages.version('sentry.rust') }}", features =
2731
Initialize and configure the Sentry client. This will enable a set of default integrations, such as panic reporting.
2832
Then, initialize `axum` with the Sentry middleware.
2933

34+
This snippet sets up a service that always panics, so you can test that everything is working as soon as you set it up.
35+
3036
<Alert level="warning">
3137

3238
Macros like `#[tokio::main]` are not supported. The Sentry client must be initialized before the async runtime is started, as shown below.
@@ -48,8 +54,10 @@ fn main() -> io::Result<()> {
4854
"___PUBLIC_DSN___",
4955
sentry::ClientOptions {
5056
release: sentry::release_name!(),
57+
# ___PRODUCT_OPTION_START___ performance
5158
// Capture all traces and spans. Set to a lower value in production
5259
traces_sample_rate: 1.0,
60+
# ___PRODUCT_OPTION_END___ performance
5361
// Capture user IPs and potentially sensitive headers when using HTTP server integrations
5462
// see https://docs.sentry.io/platforms/rust/data-management/data-collected for more info
5563
send_default_pii: true,
@@ -61,7 +69,9 @@ fn main() -> io::Result<()> {
6169
ServiceBuilder::new()
6270
// If you're binding the layers directly on the `Router`, bind them in the opposite order, otherwise you might run into a memory leak
6371
.layer(NewSentryLayer::<Request<Body>>::new_from_top()) // Bind a new Hub per request, to ensure correct error <> request correlation
72+
# ___PRODUCT_OPTION_START___ performance
6473
.layer(SentryHttpLayer::new().enable_transaction()), // Start a transaction (Sentry root span) for each request
74+
# ___PRODUCT_OPTION_END___ performance
6575
);
6676

6777
tokio::runtime::Builder::new_multi_thread()
@@ -82,8 +92,6 @@ fn main() -> io::Result<()> {
8292

8393
## Verify
8494

85-
The snippet above sets up a service that always panics, so you can test that everything is working as soon as you set it up.
86-
8795
Send a request to the application. The panic will be captured by Sentry.
8896

8997
```bash
@@ -96,4 +104,4 @@ Learn more about manually capturing an error or message in our <PlatformLink to=
96104

97105
</Alert>
98106

99-
To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
107+
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.

0 commit comments

Comments
 (0)