Skip to content
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

Make gRPC logging optional via a custom interface #299

Merged
merged 8 commits into from
Jul 28, 2023
Merged

Conversation

bboreham
Copy link
Collaborator

@bboreham bboreham commented Jul 25, 2023

If an error returned to gRPC implements Observe, then that will get called and GRPCServerLog will do nothing.

This would replace #293.

E.g. if the error is caused by overload, then we don't want to log it
because that uses more resource.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Patterned after the one for http logging.
Http doesn't have access to the error that caused a failure, so it was
an error to try to change behaviour on them.
It's not used now.
@bboreham bboreham changed the title Make logging optional via a custom interface Make gRPC logging optional via a custom interface Jul 25, 2023
Copy link
Contributor

@colega colega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one small opinionated nit about naming.

middleware/grpc_logging.go Outdated Show resolved Hide resolved
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
56quarters added a commit to grafana/mimir that referenced this pull request Jul 27, 2023
This allows us to decorate them with extra information for gRPC responses
and our logging middleware (to prevent them from being logged, increasing
resource usage).

Related #5581
Related weaveworks/common#299

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
@bboreham bboreham merged commit dd9e68f into master Jul 28, 2023
bboreham added a commit to grafana/mimir that referenced this pull request Jul 28, 2023
Using weaveworks/common#299 which is a more
flexible approach.

Note the check disappeared from `logging.go`, because it was a mistake
to check that error.  It comes from `io.Writer`, it won't be an app-
level error.
bboreham added a commit to grafana/mimir that referenced this pull request Jul 31, 2023
Using weaveworks/common#299 which is a more
flexible approach.

Note the check disappeared from `logging.go`, because it was a mistake
to check that error.  It comes from `io.Writer`, it won't be an app-
level error.
bboreham added a commit to grafana/mimir that referenced this pull request Jul 31, 2023
* Don't log errors that cause OOMs, using interface

Using weaveworks/common#299 which is a more
flexible approach.

Note the check disappeared from `logging.go`, because it was a mistake
to check that error.  It comes from `io.Writer`, it won't be an app-
level error.

* Improved TestIngester_inflightPushRequests

Signed-off-by: Marco Pracucci <marco@pracucci.com>

---------

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Co-authored-by: Marco Pracucci <marco@pracucci.com>
56quarters added a commit to grafana/mimir that referenced this pull request Jul 31, 2023
This allows us to decorate them with extra information for gRPC responses
and our logging middleware (to prevent them from being logged, increasing
resource usage).

Related #5581
Related weaveworks/common#299

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
56quarters added a commit to grafana/mimir that referenced this pull request Aug 3, 2023
This allows us to decorate them with extra information for gRPC responses
and our logging middleware (to prevent them from being logged, increasing
resource usage).

Related #5581
Related weaveworks/common#299

Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
56quarters added a commit to grafana/mimir that referenced this pull request Aug 3, 2023
…gging for them (#5585)

This allows us to decorate them with extra information for gRPC responses
and our logging middleware (to prevent them from being logged which is
expensive).

Related #5581
Related weaveworks/common#299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants