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
suppress noisy logs #3917
suppress noisy logs #3917
Conversation
supressLoggingOfEndpoints := []string{"GetConfiguredPlugins"} | ||
var level klogv2.Level | ||
|
||
// level=3 is default logging level |
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.
The default log level is 3 if the user hasn't set a -v
option on the cli... don't we need to default to whatever the user has specified (which will be 3 if nothing was specified)?
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 don't think we should complicate more by using the user settings (--v).
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.
Sorry, I confused this in my head with something it is not... I was thinking we were deciding here what the default log level would be for the app, but it's not, it's just the level that will be used for the interceptor. Carry on :)
|
||
// level=3 is default logging level | ||
level = 3 | ||
for i := 0; i < len(supressLoggingOfEndpoints); i++ { |
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.
It's useful having suppressLoggingOfEndpoints
as a string slice if it's something configurable or we have more than one endpoint being hit for liveness/readiness... but otherwise, why not just do a single string comparison here?
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.
Today, we have only one endpoint to suppress. I guess as we test the code more, we might have a few more endpoints.
I kept it as a string slice so that In the future, we can add more names to suppress.
This will be a one-time change and I don't think we need any configurable option for now.
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.
Yep, fine either way.
// Serve is the root command that is run when no other sub-commands are present. | ||
// It runs the gRPC service, registering the configured plugins. | ||
func Serve(serveOpts core.ServeOptions) error { | ||
// Create the grpc server and register the reflection server (for now, useful for discovery | ||
// using grpcurl) or similar. | ||
logRequest := CreateRequestLogger() |
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.
We need to delete the CreateRequestLogger()
function to, don't we?
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.
Yes. We can delete the CreateRequestLogger() as it is not used.
I left it unused. If you want we can remove it.
Please let me know.
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.
Yes please... we generally remove any unused code (it's just more code to maintain).
Thanks Satya! Just a couple of thoughts - otherwise +1 |
supressLoggingOfEndpoints := []string{"GetConfiguredPlugins"} | ||
var level klogv2.Level | ||
|
||
// level=3 is default logging level |
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.
Sorry, I confused this in my head with something it is not... I was thinking we were deciding here what the default log level would be for the app, but it's not, it's just the level that will be used for the interceptor. Carry on :)
|
||
// level=3 is default logging level | ||
level = 3 | ||
for i := 0; i < len(supressLoggingOfEndpoints); i++ { |
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.
Yep, fine either way.
// Serve is the root command that is run when no other sub-commands are present. | ||
// It runs the gRPC service, registering the configured plugins. | ||
func Serve(serveOpts core.ServeOptions) error { | ||
// Create the grpc server and register the reflection server (for now, useful for discovery | ||
// using grpcurl) or similar. | ||
logRequest := CreateRequestLogger() |
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.
Yes please... we generally remove any unused code (it's just more code to maintain).
Description of the change
Kubeapps-api is using "httpGet probe" for livenessProbe & readinessProbe every 10secs.
values.yaml
This is causing noisy logs of probe endpoint
/kubeappsapis.core.plugins.v1alpha1.PluginsService/GetConfiguredPlugins
as mentioned in PR#3780
Solution:
Option-1:
We can probably use "GRPC Health Checking Protocol" as mentioned in health-checking-grpc-servers-on-kubernetes
Adding “grpc-health-probe” needs to implement standard health check "protocol" as in health-checking and bundle health check utility "tool" with the kubeapps-api binary.
But this still does not solve the noisy logging of RPC calls.
Option-2:
Suppress the endpoints in the grpc interceptor call.
The commit implements
Benefits
no noisy endpoints logs
Possible drawbacks
N/A
Applicable issues
Additional information