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)
- RUSTSEC-2023-0052: webpki: CPU denial of service in certificate path building HOT 1
- `ApiGroup::recommended_kind` returns `None` while I expected `Some(_)` HOT 1
- Check HTTP status code in `request_stream` HOT 3
- Watch not triggering reconciliation HOT 9
- Authentication fails with custom kubectl plugin HOT 3
- developer meeting experiment HOT 6
- Controller concurrency appears to cause reconciliations to be skipped HOT 4
- Simplify `kubecl get --raw` style custom queries with `Request` HOT 2
- Support for ProvideClusterInfo in exec HOT 2
- 0.87 release planned 🎃 HOT 12
- Minimum supported rustls version is `0.21.4` not `0.21.0`
- Dependency upgrades for `hyper` and `http` 1.0 HOT 11
- HTTP proxy support HOT 1
- Refactoring Version Dependencies
- Better support for `x-kubernetes` properties in schemas HOT 1
- set controller reconciliation period HOT 1
- 404 Not Found HOT 2
- Discovery fails when ApiResourceList is not apiVersion v1 HOT 5
- release planned 0.87.2
- More ergonomic ListParams::labels HOT 2
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.