Comments (3)
This can be done by making LogRequest
a Layer that also logs the response.
from kube.
#540 replaces LogRequest
with TraceLayer
from tower-http
.
A rough equivalent can be implemented with something like this:
TraceLayer::new_for_http()
.on_request(|req: &Request<Body>, _span: &Span| {
tracing::trace!("{}", as_curl_command(req))
})
.on_response(|res: &Response<Body>, latency: Duration, _span: &Span| {
tracing::trace!(
"{} in {}ms\nResponse Headers:\n{}\nResponse Body:\n{}",
res.status(), // `Display` includes canonical reason. e.g., "200 OK"
latency.as_millis(),
format_headers(res.headers()),
format_body(res.body())
)
})
from kube.
Closing because we switched to TraceLayer
and users can customize it.
from kube.
Related Issues (20)
- Add method to WatchStreamExt to get object that event type is deleted HOT 1
- Using customized Kubeconfig struct not working as per documentation HOT 2
- Websocket upgrade error messages are discarded
- Allow resourceVersion to be specified when creating a watcher HOT 1
- Access Kubelet exec/logs/portforward endpoints HOT 8
- Make it easier to get an `Api` for a `DynamicObject` HOT 4
- missing field `certificate-authority-data` when exec credential plugins
- Release Note Sketch for 0.89.0 HOT 2
- kube::client::Body::empty() is private and cannot be used in unit tests HOT 3
- Cannot compile due to chrono issue HOT 7
- upgrade `rustls` to 0.23 and `hyper-rustls` 0.27
- release plan for 0.90 HOT 1
- Can List support sorting? HOT 2
- Improve shared streams interfaces
- Change Controller concurrency defaults based on available CPU
- Why is the schema of the api server url fixed to HTTPS,can it support configurable features? HOT 6
- Expose scheduler metrics from runtime
- Breaking api changes between minor versions of json-patch dependency HOT 3
- Reduce buffering between `watcher` and `Store` HOT 1
- Unchecked add of instant + duration is causing a panic. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube.