Update prometheus/exporter-toolkit to v0.8.2 and gRPC to 1.47#262
Conversation
bboreham
left a comment
There was a problem hiding this comment.
Can we avoid bumping gRPC?
Also, did you go mod tidy ? Seems like a lot of lines added in go.sum compared to actual change.
| google.golang.org/grpc v1.31.0 | ||
| golang.org/x/net v0.0.0-20220909164309-bea034e7d591 | ||
| golang.org/x/tools v0.1.5 | ||
| google.golang.org/grpc v1.47.0 |
There was a problem hiding this comment.
Can it be done without this update? This is an enormous jump.
If not, someone needs to do forwards/backwards compatibility testing to confirm that old and new clients work against old and new servers.
There was a problem hiding this comment.
Actually mimir has been running with 1.45 grpc since 14th June grafana/mimir#2098
There was a problem hiding this comment.
We've concluded that Mimir's usage of grpc is not proof and I'm going to reuse the server test code (httpgrpc/server_test, with a few additions) to test compatibility of versions:
client using 1.31 grpc -> server 1.47
client 1.47 -> server 1.31
There was a problem hiding this comment.
What I did to test gprc message handling compatibility:
Extracted the client and server sides of the httpgrpc/server/server.go and httpgrpc/server/server_test.go` files into https://github.com/krajorama/weaveworks-common-testclient and https://github.com/krajorama/weaveworks-common-testserver .
Added a test to return the OrgId extracted on the server side in the body . And another to test sending a method different then GET.
To run a test I execute the server and copied the URL it listened on, then run the client tests with:
weaveworks-common-testclient$ SERVER_URL=direct://127.0.0.1:35635 go test -count 1 -v ./...
The baseline was using the latest weaveworks/common at v0.0.0-20221125125352-88dcecd133b1, where:
require (
...
github.com/weaveworks/common v0.0.0-20221125125352-88dcecd133b1
google.golang.org/grpc v1.31.0
)
Then doing a go.mod replace to get:
replace github.com/weaveworks/common v0.0.0-20221125125352-88dcecd133b1 => github.com/rabenhorst/common v0.0.0-20221130173339-6d74945c9349
require (
...
github.com/weaveworks/common v0.0.0-20221125125352-88dcecd133b1
google.golang.org/grpc v1.47.0
)
I've run the test with all combinations: client version x server version. All tests passed.
|
Thanks for the PR, by the way. |
|
Looks like the chain of dependencies that updates gRPC is: github.com/prometheus/exporter-toolkit@v0.8.1 I don't see a way to break that, except larger-scale copy-paste. |
|
This is actually needed for native historgrams work as well in mimir-prometheus. |
krajorama
left a comment
There was a problem hiding this comment.
Please run make protos and add the result to the PR, thanks
Actually this lead to errors for Mimir, so let's forget it for now. I'm trying to figure out what happened. |
|
We should merge #264 first. Fixes the |
9eb1f14 to
20964de
Compare
I rebased on master, ran Any idea how to fix this? |
|
Drive-by: |
Put the path to gogoproto/gogo.proto in the -I include path of E.g. in mimir: But since you're not using vendoring, you might have to do like in prometheus/alertmanager: And possibly add a tools.go to make Background: we found that |
Thx. It worked and there is no change in generated files. Is this expected? Also I updated exporter-toolkit to v0.8.2. |
Signed-off-by: Sebastian Rabenhorst <sebastian.rabenhorst@shopify.com>
Yes, that's expected, we just wanted to get to a reproducable build where make protos does not result in diffs in git. |
bboreham
left a comment
There was a problem hiding this comment.
As noted in individual comments, this is a big jump in gRPC version, and the stats say something has changed on the wire, but I'm very grateful to @krajorama for testing backwards and forwards compatibility.
| received_payload_bytes_bucket{method="gRPC",route="/middleware.EchoServer/Process",le="2.62144e+08"} 5 | ||
| received_payload_bytes_bucket{method="gRPC",route="/middleware.EchoServer/Process",le="+Inf"} 5 | ||
| received_payload_bytes_sum{method="gRPC",route="/middleware.EchoServer/Process"} 1.5728664e+07 | ||
| received_payload_bytes_sum{method="gRPC",route="/middleware.EchoServer/Process"} 1.5728689e+07 |
There was a problem hiding this comment.
Noting this difference suggests to me the code is seeing 5 bytes more on the wire.
There was a problem hiding this comment.
This turned out to be an artifact from this fix in grpc: grpc/grpc-go#3886 , the old code was reporting wrong wirelength to the statistics callback actually.
…mmon` (#8125) Not needed after weaveworks/common#254 and weaveworks/common#262 More rationale on the issue. Fixes #8085 Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Updated prometheus/exporter-toolkit to v0.8.2 to make it work with Prometheus v0.40.1.