File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use opentelemetry::{
66} ;
77use opentelemetry_otlp:: { Protocol , WithExportConfig as _} ;
88use opentelemetry_resource_detectors:: { OsResourceDetector , ProcessResourceDetector } ;
9- use opentelemetry_sdk:: { Resource , error:: OTelSdkResult } ;
9+ use opentelemetry_sdk:: { Resource , error:: OTelSdkResult , metrics :: PeriodicReader } ;
1010use std:: { sync:: Arc , time:: Duration } ;
1111use tracing:: info;
1212
@@ -40,7 +40,11 @@ pub(crate) fn get_meter_provider(config: &Config) -> Result<AnyMeterProvider> {
4040 . build ( ) ?;
4141
4242 let provider = opentelemetry_sdk:: metrics:: SdkMeterProvider :: builder ( )
43- . with_periodic_exporter ( exporter)
43+ . with_reader (
44+ PeriodicReader :: builder ( exporter)
45+ . with_interval ( Duration :: from_secs ( 10 ) )
46+ . build ( ) ,
47+ )
4448 . with_resource (
4549 Resource :: builder ( )
4650 . with_detector ( Box :: new ( OsResourceDetector ) )
You can’t perform that action at this time.
0 commit comments