-
Notifications
You must be signed in to change notification settings - Fork 191
Open
Labels
C-coreComponent: core functionality such as traits, etc.Component: core functionality such as traits, etc.C-exporterComponent: exporters such as Prometheus, TCP, etc.Component: exporters such as Prometheus, TCP, etc.S-needs-reproStatus: awaiting a reproduction to continue investgation.Status: awaiting a reproduction to continue investgation.T-ergonomicsType: ergonomics.Type: ergonomics.
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;
Metadata
Metadata
Assignees
Labels
C-coreComponent: core functionality such as traits, etc.Component: core functionality such as traits, etc.C-exporterComponent: exporters such as Prometheus, TCP, etc.Component: exporters such as Prometheus, TCP, etc.S-needs-reproStatus: awaiting a reproduction to continue investgation.Status: awaiting a reproduction to continue investgation.T-ergonomicsType: ergonomics.Type: ergonomics.