-
Notifications
You must be signed in to change notification settings - Fork 703
cmd/contour: add a Kubernetes debug logging flag #2838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2838 +/- ##
==========================================
- Coverage 76.57% 75.80% -0.78%
==========================================
Files 79 80 +1
Lines 5866 5923 +57
==========================================
- Hits 4492 4490 -2
- Misses 1283 1342 +59
Partials 91 91
|
stevesloka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some errors testing through this:
ERRO[0000] Error while reading from Writer: bufio.Scanner: token too long context=kubernetes
Good find. This looks like logrus is using |
I rewrote this, so the logs now look like this: |
edc9633 to
5476fc4
Compare
youngnick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with one nit.
|
@stevesloka Can you please re-review? |
|
I don't have that error any more which is great @jpeach! Do you know if there's a way to keep each message together? What I see is each line of the log is a different log message. It would be nice to have each log from k8s be a single log in the output, but could always improve this later on. Example: |
There's no way to do that, since you can only get an untyped stream of log messages. The klog format is google log format which is line-oriented and each line has a header. |
youngnick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, seems like the best we can get, and clearly better than now, where kubernetes client lines are not formatted at all.
Add a `--kubernetes-debug` flag that enables verbose client-go logging in the `klog` package. The logs are piped through `logrus` so that the output format is consistent. Signed-off-by: James Peach <[email protected]>
There are quite a few places in Contour that call a local check helper that prints to standard error and exits. This approach loses error context and makes it difficult for aggregated log collectors to recognize that this is a fatal error message. Fixes #2811, #2838. Signed-off-by: Shailesh Suryawanshi <[email protected]>
Add a
--kubernetes-debugflag that enables verbose client-go loggingin the
klogpackage. The logs are piped throughlogrusso that theoutput format is consistent.
Signed-off-by: James Peach [email protected]