@@ -255,7 +255,7 @@ pub fn configure() -> LogfireConfigBuilder {
255
255
console_mode : ConsoleMode :: Force ,
256
256
additional_span_processors : Vec :: new ( ) ,
257
257
advanced : None ,
258
- metrics : None ,
258
+ metrics : Some ( MetricsOptions :: default ( ) ) ,
259
259
enable_metrics : true ,
260
260
install_panic_handler : false ,
261
261
default_level_filter : None ,
@@ -338,7 +338,7 @@ impl LogfireConfigBuilder {
338
338
339
339
/// Whether to log to the console.
340
340
#[ must_use]
341
- #[ deprecated( note = "use `console_options ()` instead" ) ]
341
+ #[ deprecated( since = "0.4.0" , note = "use `with_console ()` instead" ) ]
342
342
#[ expect( deprecated) ]
343
343
pub fn console_mode ( mut self , console_mode : ConsoleMode ) -> Self {
344
344
// FIXME: remove this API and make it match Python, see `console_options()` below
@@ -392,16 +392,25 @@ impl LogfireConfigBuilder {
392
392
}
393
393
394
394
/// Configure [metrics options](crate::config::MetricsOptions).
395
+ ///
396
+ /// Set to `None` to disable metrics.
395
397
#[ must_use]
398
+ pub fn with_metrics ( mut self , metrics : Option < MetricsOptions > ) -> Self {
399
+ self . metrics = metrics;
400
+ self
401
+ }
402
+
403
+ /// Configure [metrics options](crate::config::MetricsOptions).
404
+ #[ must_use]
405
+ #[ deprecated( since = "0.4.0" , note = "use `with_metrics` instead" ) ]
396
406
pub fn with_metrics_options ( mut self , metrics : MetricsOptions ) -> Self {
397
407
self . metrics = Some ( metrics) ;
398
408
self
399
409
}
400
410
401
411
/// Whether to enable metrics.
402
- ///
403
- /// If set to false, this will override [`with_metrics_options`][Self::with_metrics_options].
404
412
#[ must_use]
413
+ #[ deprecated( since = "0.4.0" , note = "use `with_metrics(None)` to disable metrics" ) ]
405
414
pub fn enable_metrics ( mut self , enable : bool ) -> Self {
406
415
self . enable_metrics = enable;
407
416
self
0 commit comments