Bug Report
Description
The implementation of MetricsLayer seems subtly incorrect to me. I don't think MetricsLayer should be implementing register_callsite or enabled because these methods determine whether a span or event is globally enabled (as per the docs) — which is not the behaviour I think we want.
impl<S> Layer<S> for MetricsLayer<S> where S: Subscriber + for<'span> LookupSpan<'span> {
...
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest {
self.inner.register_callsite(metadata)
}
fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool {
self.inner.enabled(metadata, ctx)
}
...
}
Am I missing something here? Or should these impls be removed?
Bug Report
Description
The implementation of
MetricsLayerseems subtly incorrect to me. I don't thinkMetricsLayershould be implementingregister_callsiteorenabledbecause these methods determine whether a span or event is globally enabled (as per the docs) — which is not the behaviour I think we want.Am I missing something here? Or should these impls be removed?