Skip to content

Instantly share code, notes, and snippets.

View kurojishi's full-sized avatar

Francesco Berni kurojishi

View GitHub Profile
// All request will be intercepted and metrics and log injected
fn call(&mut self, mut req: hyper::Request<Body>) -> Self::Future {
// This is necessary because tonic internally uses `tower::buffer::Buffer`.
// See https://github.com/tower-rs/tower/issues/547#issuecomment-767629149
// for details on why this is necessary
let now = Instant::now();
let clone = self.inner.clone();
let mut inner = std::mem::replace(&mut self.inner, clone);
let (operation_name, metric_label) = operation_name_and_label_from_uri(req.uri());
req.headers_mut()
### Keybase proof
I hereby claim:
* I am kurojishi on github.
* I am kurojishi (https://keybase.io/kurojishi) on keybase.
* I have a public key ASC_f1cbjdGRhfY9ScsSgW2yOifrJses0LTD8_VBCUyp-Qo
To claim this, I am signing this object: