File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ version = "0.2.1"
371371
372372# Async runtime
373373[workspace .dependencies .tokio ]
374- version = " 1.44.2 "
374+ version = " 1.45.0 "
375375features = [" full" ]
376376
377377[workspace .dependencies .tokio-stream ]
Original file line number Diff line number Diff line change @@ -126,7 +126,6 @@ pub fn observe(metrics: RuntimeMetrics) {
126126 . build ( ) ;
127127 }
128128
129- #[ cfg( tokio_unstable) ]
130129 {
131130 let metrics = metrics. clone ( ) ;
132131 METER
@@ -144,6 +143,19 @@ pub fn observe(metrics: RuntimeMetrics) {
144143 . build ( ) ;
145144 }
146145
146+ #[ cfg( tokio_unstable) ]
147+ {
148+ let metrics = metrics. clone ( ) ;
149+ METER
150+ . u64_observable_counter ( "tokio_runtime.spawned_tasks_count" )
151+ . with_description ( "The number of tasks spawned in this runtime since it was created." )
152+ . with_unit ( "{task}" )
153+ . with_callback ( move |instrument| {
154+ instrument. observe ( metrics. spawned_tasks_count ( ) , & [ ] ) ;
155+ } )
156+ . build ( ) ;
157+ }
158+
147159 #[ cfg( tokio_unstable) ]
148160 {
149161 let metrics = metrics. clone ( ) ;
@@ -163,7 +175,6 @@ pub fn observe(metrics: RuntimeMetrics) {
163175 . build ( ) ;
164176 }
165177
166- #[ cfg( tokio_unstable) ]
167178 {
168179 let metrics = metrics. clone ( ) ;
169180 METER
@@ -247,7 +258,6 @@ pub fn observe(metrics: RuntimeMetrics) {
247258 . build ( ) ;
248259 }
249260
250- #[ cfg( tokio_unstable) ]
251261 {
252262 let metrics = metrics. clone ( ) ;
253263 METER
@@ -416,7 +426,6 @@ pub fn observe(metrics: RuntimeMetrics) {
416426}
417427
418428/// Helper to construct a [`KeyValue`] with the worker index.
419- #[ allow( dead_code) ]
420429fn worker_idx ( i : usize ) -> KeyValue {
421430 KeyValue :: new ( "worker_idx" , i. try_into ( ) . unwrap_or ( i64:: MAX ) )
422431}
You can’t perform that action at this time.
0 commit comments