Add request URI to API error debug logs#1973
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1973 +/- ##
=======================================
+ Coverage 75.6% 75.9% +0.4%
=======================================
Files 89 89
Lines 8666 8774 +108
=======================================
+ Hits 6544 6654 +110
+ Misses 2122 2120 -2
🚀 New features to boost your workflow:
|
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
47a7d77 to
f15bf03
Compare
|
Resolved the merge conflicts by rebasing onto current |
|
Thanks for fix,
Curious what others think though. |
| fn with_base_uri(self, base_uri: Uri) -> Self { | ||
| ClientBuilder { | ||
| service: self.service, | ||
| default_ns: self.default_ns, | ||
| base_uri: Some(base_uri), | ||
| valid_until: self.valid_until, | ||
| } | ||
| } |
There was a problem hiding this comment.
This does leave a gap in custom clients (see custom_ examples), and it's a bit awkward to have to make this method to be public just for debug logs.
Does it make sense to hook into the existing BaseUri system we have for tower for this same pupose (we support rancher style cluster url there already) rather than have a special system for it just for logs?
|
Hi @AkashKumar7902! I was working on a parallel take for #949 and @doxxx93 kindly pointed me to your PR. First off, brilliant work on utilizing the Looking through your implementation in
I'd love to collaborate and help you polish this up if you need any assistance with tests or refactoring. |
Motivation
Closes #949.
When the API server returns a 4xx or 5xx response, the client debug log currently prints the parsed or reconstructed
Statuswithout the request target. That makes missing API-resource errors harder to diagnose.Solution
uri: ...in the parsed and reconstructed unsuccessful API debug messages.Error::Api(Status)value unchanged.Validation:
cargo test -p kube-client error_uri --libcargo test -p kube-client --libcargo test -p kube-client --doccargo clippy -p kube-client --lib -- -D warningscargo +nightly fmt --all -- --checkgit diff --check