File tree 3 files changed +455
-3
lines changed
3 files changed +455
-3
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,17 @@ impl sentry::TransportFactory for SentryTransportFactory {
50
50
}
51
51
52
52
fn main ( ) -> anyhow:: Result < ExitCode > {
53
- let runtime = tokio:: runtime:: Builder :: new_multi_thread ( )
54
- . enable_all ( )
55
- . build ( ) ?;
53
+ let mut builder = tokio:: runtime:: Builder :: new_multi_thread ( ) ;
54
+ builder. enable_all ( ) ;
55
+
56
+ #[ cfg( tokio_unstable) ]
57
+ builder
58
+ . enable_metrics_poll_time_histogram ( )
59
+ . metrics_poll_time_histogram_configuration ( tokio:: runtime:: HistogramConfiguration :: log (
60
+ tokio:: runtime:: LogHistogram :: default ( ) ,
61
+ ) ) ;
62
+
63
+ let runtime = builder. build ( ) ?;
56
64
57
65
runtime. block_on ( async_main ( ) )
58
66
}
Original file line number Diff line number Diff line change 4
4
// SPDX-License-Identifier: AGPL-3.0-only
5
5
// Please see LICENSE in the repository root for full details.
6
6
7
+ mod tokio;
8
+
7
9
use std:: sync:: { LazyLock , OnceLock } ;
8
10
9
11
use anyhow:: Context as _;
@@ -60,6 +62,9 @@ pub fn setup(config: &TelemetryConfig) -> anyhow::Result<()> {
60
62
init_tracer ( & config. tracing ) . context ( "Failed to configure traces exporter" ) ?;
61
63
init_meter ( & config. metrics ) . context ( "Failed to configure metrics exporter" ) ?;
62
64
65
+ let handle = :: tokio:: runtime:: Handle :: current ( ) ;
66
+ self :: tokio:: observe ( handle. metrics ( ) ) ;
67
+
63
68
Ok ( ( ) )
64
69
}
65
70
You can’t perform that action at this time.
0 commit comments