-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
enhancementNew feature or requestNew feature or requestergonomicsEase of use, developer friendlinessEase of use, developer friendliness
Description
Describe the bug
When trying to work with tracing and other libraries, most Pingora types do not implement Debug, making the library difficult to instrument.
Pingora info
Please include the following information about your environment:
Pingora version: 0.6.0
Rust version: All
Operating system version: All
Steps to reproduce
This will fail to compile
type MyProxy;
impl pingora_proxy::ProxyHttp for MyProxy {
#[tracing::instrument]
async fn upstream_peer(
&self,
session: &mut Session,
ctx: &mut Self::CTX,
) -> pingora_error::Result<Box<HttpPeer>> {
todo!()
}
}Expected results
There would be a derived or default implementation of Debug for types surrounding the ProxyHttp interface.
Observed results
error[E0277]: `pingora_proxy::Session` doesn't implement `Debug`
--> crates/libucm/src/core.rs:72:5
|
72 | #[instrument]
| ^^^^^^^^^^^^^ the trait `Debug` is not implemented for `pingora_proxy::Session`
|
= help: the trait `tracing::Value` is implemented for `DebugValue<T>`
= note: required for `&mut pingora_proxy::Session` to implement `Debug`
= note: 1 redundant requirement hidden
= note: required for `&&mut pingora_proxy::Session` to implement `Debug`
= note: required for `DebugValue<&&mut pingora_proxy::Session>` to implement `tracing::Value`
= note: required for the cast from `&DebugValue<&&mut pingora_proxy::Session>` to `&dyn tracing::Value`
= note: this error originates in the macro `$crate::valueset` which comes from the expansion of the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)
Additional context
I'm open to doing the work myself and submitting a PR, I just want to make sure it's alright ahead of time. While limited to implementing Debug, it will be a fairly pervasive PR.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestergonomicsEase of use, developer friendlinessEase of use, developer friendliness