Open
Description
Somehow, the set_global_recorder
call inside the PrometheusBuilder.install()
is not working for me, so I am trying to get the recorder via the PrometheusBuilder.build()
and trying to set the global recorder myself. But I get the error stating that the PrometheusRecorder
doesn't implement Recorder
trait. Code I use and the error below:
let (recorder, exporter): (PrometheusRecorder, ExporterFuture) = PrometheusBuilder::new()
.build()
.unwrap();
metrics::set_global_recorder(recorder).unwrap();
error[E0277]: the trait bound `PrometheusRecorder: Recorder` is not satisfied
--> enforcer/main.rs:131:34
|
131 | metrics::set_global_recorder(recorder).unwrap();
| ---------------------------- ^^^^^^^^ the trait `Recorder` is not implemented for `PrometheusRecorder`
| |
| required by a bound introduced by this call
May be the Recorder impl for PrometheusRecorder
should be pub
or part of a module that users can import?
I also have the following imports:
use metrics_exporter_prometheus::{ExporterFuture, PrometheusBuilder, PrometheusRecorder};
use metrics::Recorder;