-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
gcp/observability: filter logging from cloud ops endpoints calls #5765
Conversation
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.
Can you please add a unit test that covers these methods and expects no logging?
You should be able to use the native gRPC API to make it easy to set the method without needing the protos: https://pkg.go.dev/google.golang.org/grpc#ClientConn.Invoke
Added a unit test. Thanks. |
gcp/observability/logging_test.go
Outdated
// calls, as they should be filtered out. | ||
fle.mu.Lock() | ||
if len(fle.entries) != 0 { | ||
fle.mu.Unlock() |
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.
Nit: use a defer
instead to avoid the two unlocks.
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.
Done.
The filtering of logging from the calls to cloud ops endpoints was missed in the new Observability config iteration. This adds it back. Decided not to info log in this scenario to avoid std out log spam.
RELEASE NOTES: N/A