Skip to content

Commit ae36ca5

Browse files
authored
docs(profiling): add rust profiling alpha doc (#5844)
* Add rust profiling alpha doc
1 parent 0e800d4 commit ae36ca5

File tree

3 files changed

+67
-3
lines changed

3 files changed

+67
-3
lines changed

src/docs/product/profiling/getting-started.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ Profiling depends on Sentry's performance monitoring product being enabled befor
2626
- Mobile
2727
- [Android](/platforms/android/profiling/)
2828
- [iOS](/platforms/apple/guides/ios/profiling/)
29-
- [Python](/platforms/python/profiling/)
3029
- [Node.js](/platforms/node/profiling)
30+
- [Python](/platforms/python/profiling/)
31+
- [Rust](/platforms/rust/profiling)

src/docs/product/profiling/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ Profiling is currently in beta. Beta features are still in-progress and may have
1414

1515
* Android (Java and Kotlin only)
1616
* iOS (Swift and Objective-C only)
17-
* Python
1817
* Node.js
18+
* Python
19+
* Rust
1920

2021
</Note>
2122

src/platforms/common/profiling/index.mdx

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ supported:
55
- android
66
- apple
77
- python
8+
- rust
89
notSupported:
910
- unity
1011
- dart
1112
- flutter
12-
- rust
1313
- native
1414
- php
1515
- ruby
@@ -50,6 +50,16 @@ Python profiling is currently in alpha. Alpha features are still in-progress and
5050

5151
</PlatformSection>
5252

53+
<PlatformSection supported={["rust"]}>
54+
55+
<Note>
56+
57+
Rust Profiling is currently in alpha. Alpha features are still in-progress and may have bugs. We recognize the irony. If you have any questions or feedback, please email us at [[email protected]](mailto:[email protected]).
58+
59+
</Note>
60+
61+
</PlatformSection>
62+
5363
With [profiling](/product/profiling/), Sentry allows you to collect and analyze performance profiles from real user devices in production to give you a complete picture of how your application performs in a variety of environments.
5464

5565
## Enable Performance Monitoring
@@ -91,6 +101,20 @@ sentry_sdk.init(
91101

92102
</PlatformSection>
93103

104+
<PlatformSection supported={["rust"]}>
105+
106+
```rust
107+
sentry::init((
108+
"___DSN___",
109+
sentry::ClientOptions {
110+
traces_sample_rate: 1.0,
111+
..Default::default()
112+
},
113+
));
114+
```
115+
116+
</PlatformSection>
117+
94118
Check out the <PlatformLink to="/performance/">performance setup documentation</PlatformLink> for more detailed information on how to configure sampling. Setting the sample rate to 1.0 means all transactions will be captured. By default, some transactions will be created automatically for common operations like loading a view controller/activity and app startup.
95119

96120
## Enable Profiling
@@ -159,6 +183,44 @@ The <PlatformIdentifier name="profiles_sample_rate" /> setting is *relative* to
159183

160184
</PlatformSection>
161185

186+
187+
<PlatformSection supported={["rust"]}>
188+
189+
<Note>
190+
191+
Rust Profiling alpha is available starting in SDK version `0.29.0`.
192+
193+
</Note>
194+
195+
In order to use Profiling, you first need to enable the `profiling` feature in the `sentry` dependency inside the project `Cargo.toml`:
196+
197+
```cargo
198+
[dependencies]
199+
sentry = { version = "0.29.0", features = ["profiling"] }
200+
```
201+
202+
Once you've completed the step above, you can proceed by enabling it in the SDK:
203+
204+
```rust
205+
sentry::init((
206+
"___DSN___",
207+
sentry::ClientOptions {
208+
traces_sample_rate: 1.0,
209+
enable_profiling: true,
210+
profiles_sample_rate: 1.0,
211+
..Default::default()
212+
},
213+
));
214+
```
215+
216+
<Note>
217+
218+
The <PlatformIdentifier name="profiles_sample_rate" /> setting is *relative* to the <PlatformIdentifier name="traces_sample_rate" /> setting.
219+
220+
</Note>
221+
222+
</PlatformSection>
223+
162224
## Troubleshooting
163225

164226
If you don't see any profiling data in [sentry.io](https://sentry.io), you can try the following:

0 commit comments

Comments
 (0)