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

Update go-grpc-middleware to v2.0.0 #6651

Merged
merged 19 commits into from
May 27, 2024

Conversation

coleenquadros
Copy link
Contributor

@coleenquadros coleenquadros commented Aug 24, 2023

  • Update go_grpc_middleware to v2.0.0.
  • Remove Tags Interceptor from Thanos. Tags interceptor is removed from v2.0.0 go-grpc-middleware.
  • Tracing interceptor directory from go_grpc_middleware(v2.0.0 rc 2,3,4) moved to Thanos(v2.0.0 makes use of otel). Tracing interceptor was removed in version v2.0.0. The follow up in Thanos would be to migrate to otel.
  • Logging middleware migrated to use v2.0.0 logging interceptors. Trace ID is now logged as a part of GRPC request logging(output below).
    (PR for adding trace ID to HTTP logging middleware - add trace id to http logging middleware #6611)
ts=2023-10-20T11:34:12.98939Z caller=grpc.go:107 level=debug name=store service=gRPC/server component=store msg="started call" traceID=5ee8eb9e1b05437670f2d311252aa755 requestID=01HD6DTJQXHWXEHBS7YE7QVJ22 protocol=grpc grpc.component=server grpc.service=thanos.info.Info grpc.method=Info grpc.method_type=unary peer.address=127.0.0.1:52802 grpc.start_time=2023-10-20T13:34:12+02:00 grpc.request.deadline=2023-10-20T13:34:17+02:00 grpc.time_ms=0.145
ts=2023-10-20T11:34:12.989388Z caller=grpc.go:107 level=debug name=store service=gRPC/server component=store msg="started call" traceID=d25ad23a02c034c84fc856a4d6a59fdb requestID=01HD6DTJQX368WC3KT5R45H4WY protocol=grpc grpc.component=server grpc.service=thanos.info.Info grpc.method=Info grpc.method_type=unary peer.address=127.0.0.1:52801 grpc.start_time=2023-10-20T13:34:12+02:00 grpc.request.deadline=2023-10-20T13:34:17+02:00 grpc.time_ms=0.137
ts=2023-10-20T11:34:12.989441Z caller=grpc.go:107 level=debug name=store service=gRPC/server component=store msg="finished call" traceID=5ee8eb9e1b05437670f2d311252aa755 requestID=01HD6DTJQXHWXEHBS7YE7QVJ22 protocol=grpc grpc.component=server grpc.service=thanos.info.Info grpc.method=Info grpc.method_type=unary peer.address=127.0.0.1:52802 grpc.start_time=2023-10-20T13:34:12+02:00 grpc.request.deadline=2023-10-20T13:34:17+02:00 grpc.code=OK grpc.time_ms=0.2
ts=2023-10-20T11:34:12.989445Z caller=grpc.go:107 level=debug name=store service=gRPC/server component=store msg="finished call" traceID=d25ad23a02c034c84fc856a4d6a59fdb requestID=01HD6DTJQX368WC3KT5R45H4WY protocol=grpc grpc.component=server grpc.service=thanos.info.Info grpc.method=Info grpc.method_type=unary peer.address=127.0.0.1:52801 grpc.start_time=2023-10-20T13:34:12+02:00 grpc.request.deadline=2023-10-20T13:34:17+02:00 grpc.code=OK grpc.time_ms=0.199

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

@coleenquadros coleenquadros changed the title remove tags interceptor Remove tags options in Thanos grpc logging middleware Aug 24, 2023
@coleenquadros coleenquadros marked this pull request as ready for review August 24, 2023 14:55
@coleenquadros coleenquadros marked this pull request as draft August 31, 2023 15:33
@coleenquadros coleenquadros force-pushed the update_grpc_mw branch 3 times, most recently from 861b8cf to a66c22e Compare August 31, 2023 16:56
@pull-request-size pull-request-size bot added size/M and removed size/L labels Aug 31, 2023
@coleenquadros coleenquadros marked this pull request as ready for review August 31, 2023 17:10
@coleenquadros coleenquadros changed the title Remove tags options in Thanos grpc logging middleware Update grpc logging middleware to v2.0.0 Sep 4, 2023
@coleenquadros coleenquadros changed the title Update grpc logging middleware to v2.0.0 Update go-grpc-middleware to v2.0.0 Sep 4, 2023
Copy link
Contributor

@moadz moadz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this :) Please fix linting failures. I believe the e2e failure is a flake.

go.mod Outdated
github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the source of the 1.3.0 import from?

Copy link
Member

Choose a reason for hiding this comment

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

It might be some dependency that uses old grpc-middleware (likely)

pkg/logging/grpc.go Outdated Show resolved Hide resolved
pkg/logging/options.go Outdated Show resolved Hide resolved
@@ -0,0 +1,82 @@
// Copyright 2016 Michal Witkowski. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for clarification:

We are doing this temporarily until we migrate Thanos Tracing to OTEL provider, instead of OpenTracing. I do believe most of them are OTEL compatible now, but it was a good idea to split it up.

@moadz
Copy link
Contributor

moadz commented Sep 27, 2023

@yeya24, @matej-g any chance we could get a review to try to unblock go-grpc-middleware upgrade?

Copy link
Contributor

@douglascamata douglascamata left a comment

Choose a reason for hiding this comment

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

Some comments from a 1st pass

CONTRIBUTING.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
pkg/logging/grpc.go Outdated Show resolved Hide resolved
pkg/tracing/tracing_middleware/server.go Outdated Show resolved Hide resolved
@coleenquadros coleenquadros force-pushed the update_grpc_mw branch 2 times, most recently from c56eba3 to f0792ac Compare September 30, 2023 11:55
/*
This was copied over from https://github.com/grpc-ecosystem/go-grpc-middleware/tree/v2.0.0-rc.3
and modified to support tracing in Thanos till migration to Otel is supported.
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this directory was copied from go-grpc-middleware repo. I was not sure how to handle the licensing.

Copy link
Contributor

@douglascamata douglascamata left a comment

Choose a reason for hiding this comment

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

LGTM ✅ :shipit:

CHANGELOG.md Outdated Show resolved Hide resolved
@yeya24
Copy link
Contributor

yeya24 commented Oct 17, 2023

It would be great if we can move this forward. I am kind of blocked by this right now.

yeya24
yeya24 previously approved these changes Oct 17, 2023
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

LGTM. I tried this branch locally and fixed conflicts. It worked for me.
I didn't test all the features changed though, like logging and tracing.

@fpetkovski
Copy link
Contributor

Looks like unit tests are still failing.

@douglascamata
Copy link
Contributor

Could we get another round of reviews, please? 🥺

fpetkovski
fpetkovski previously approved these changes Apr 23, 2024
@fpetkovski
Copy link
Contributor

@coleenquadros would you mind rebasing and we can merge this PR.

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
…grpc middleware

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
@coleenquadros
Copy link
Contributor Author

@fpetkovski @pedro-stanaka I have rebased the changes. Sorry for the delay in response.

Copy link
Contributor

@pedro-stanaka pedro-stanaka left a comment

Choose a reason for hiding this comment

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

Thx for your work, this will unblock a lot of nice improvements around metric instrumentation for thanos.

Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

Let's merge before we run into another conflict.

@fpetkovski fpetkovski merged commit c03e70f into thanos-io:main May 27, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants