@@ -31,7 +31,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
3131 let meter = global:: meter ( "mylibraryname" ) ;
3232
3333 // Create a Counter Instrument.
34- let counter = meter. u64_counter ( "my_counter" ) . init ( ) ;
34+ let counter = meter. u64_counter ( "my_counter" ) . build ( ) ;
3535
3636 // Record measurements using the Counter instrument.
3737 counter. add (
@@ -56,10 +56,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
5656 ] ,
5757 )
5858 } )
59- . init ( ) ;
59+ . build ( ) ;
6060
6161 // Create a UpCounter Instrument.
62- let updown_counter = meter. i64_up_down_counter ( "my_updown_counter" ) . init ( ) ;
62+ let updown_counter = meter. i64_up_down_counter ( "my_updown_counter" ) . build ( ) ;
6363
6464 // Record measurements using the UpCounter instrument.
6565 updown_counter. add (
@@ -84,7 +84,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
8484 ] ,
8585 )
8686 } )
87- . init ( ) ;
87+ . build ( ) ;
8888
8989 // Create a Histogram Instrument.
9090 let histogram = meter
@@ -93,7 +93,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
9393 // Setting boundaries is optional. By default, the boundaries are set to
9494 // [0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 7500.0, 10000.0]
9595 . with_boundaries ( vec ! [ 0.0 , 5.0 , 10.0 , 15.0 , 20.0 , 25.0 ] )
96- . init ( ) ;
96+ . build ( ) ;
9797
9898 // Record measurements using the histogram instrument.
9999 histogram. record (
@@ -111,7 +111,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
111111 . f64_gauge ( "my_gauge" )
112112 . with_description ( "A gauge set to 1.0" )
113113 . with_unit ( "myunit" )
114- . init ( ) ;
114+ . build ( ) ;
115115
116116 gauge. record (
117117 1.0 ,
@@ -135,7 +135,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
135135 ] ,
136136 )
137137 } )
138- . init ( ) ;
138+ . build ( ) ;
139139
140140 // Metrics are exported by default every 30 seconds when using stdout exporter,
141141 // however shutting down the MeterProvider here instantly flushes
0 commit comments