File tree Expand file tree Collapse file tree 3 files changed +455
-3
lines changed Expand file tree Collapse file tree 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 {
5050}
5151
5252fn 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 ( ) ?;
5664
5765 runtime. block_on ( async_main ( ) )
5866}
Original file line number Diff line number Diff line change 44// SPDX-License-Identifier: AGPL-3.0-only
55// Please see LICENSE in the repository root for full details.
66
7+ mod tokio;
8+
79use std:: sync:: { LazyLock , OnceLock } ;
810
911use anyhow:: Context as _;
@@ -60,6 +62,9 @@ pub fn setup(config: &TelemetryConfig) -> anyhow::Result<()> {
6062 init_tracer ( & config. tracing ) . context ( "Failed to configure traces exporter" ) ?;
6163 init_meter ( & config. metrics ) . context ( "Failed to configure metrics exporter" ) ?;
6264
65+ let handle = :: tokio:: runtime:: Handle :: current ( ) ;
66+ self :: tokio:: observe ( handle. metrics ( ) ) ;
67+
6368 Ok ( ( ) )
6469}
6570
You can’t perform that action at this time.
0 commit comments