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

querier, receiver, sidecar, store: Add gRPC health check endpoints #2008

Merged
merged 10 commits into from
Jan 28, 2020

Conversation

kakkoyun
Copy link
Member

@kakkoyun kakkoyun commented Jan 16, 2020

This PR adds gRPC Health handlers to gRPC servers.
Attempts to fix #1980.

Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com

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

Changes

  • Adds gRPC Health handlers to gRPC servers.

Verification

Tested using https://github.com/grpc-ecosystem/grpc-health-probe

  1. MINIO_ENABLED=1 ./scripts/quickstart.sh
  2. Use health probe to check
grpc-health-probe -addr=localhost:9999 -connect-timeout 250ms -rpc-timeout 100ms
timeout: failed to connect service "localhost:9999" within 250msgrpc-health-probe -addr=localhost:10905 -connect-timeout 250ms -rpc-timeout 100ms
status: SERVINGgrpc-health-probe -addr=localhost:10903 -connect-timeout 250ms -rpc-timeout 100ms
status: SERVINGgrpc-health-probe -addr=localhost:10913 -connect-timeout 250ms -rpc-timeout 100ms
status: SERVING

@kakkoyun
Copy link
Member Author

Another flaky test run. Can someone re-run it?

pkg/server/grpc/grpc.go Outdated Show resolved Hide resolved
@kakkoyun
Copy link
Member Author

@GiedriusS I did another iteration on gRPC health checks. Rather than integrating with prober, I have added grpcHealthServer separately. Not all the components serve gRPC, so they don't use prober. I'm not very sure about API, I'm considering adding additional Resume and Pause methods to grpcserver.Server and not expose health.Server. WDYT?

@squat Also I'd be glad if you can also have a look at this.

@kakkoyun kakkoyun changed the title Add gRPC health endpoints query, receive, sidecar, store: Add gRPC health endpoints Jan 18, 2020
@kakkoyun kakkoyun changed the title query, receive, sidecar, store: Add gRPC health endpoints querier, receiver, sidecar, store: Add gRPC health endpoints Jan 18, 2020
@kakkoyun kakkoyun changed the title querier, receiver, sidecar, store: Add gRPC health endpoints querier, receiver, sidecar, store: Add gRPC health check endpoints Jan 18, 2020
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Awesome, looking good. Some suggestions commented on below.

pkg/server/grpc/grpc.go Outdated Show resolved Hide resolved
pkg/server/grpc/grpc.go Outdated Show resolved Hide resolved
pkg/server/grpc/grpc.go Outdated Show resolved Hide resolved
cmd/thanos/sidecar.go Outdated Show resolved Hide resolved
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
@kakkoyun
Copy link
Member Author

@bwplotka I did another iteration on it. How does it look? Any suggestions?

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Nice I like it 👍

Have one suggestion though.

cmd/thanos/query.go Outdated Show resolved Hide resolved
// Ready sets components status to ready.
func (p *GRPCProbe) Ready() {
p.h.SetServingStatus("", grpc_health.HealthCheckResponse_SERVING)
level.Info(p.logger).Log("msg", "changing probe status", "status", "ready")
Copy link
Member

Choose a reason for hiding this comment

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

Hm, wonder if it's consistent and clean to have log item added to gRPC methods but metrics added to HTTP methods. It's kind of weird. I would either:

  • add single logging/metric prober (so prober responsible only to log/metric) and always combine all to the others
  • add log line and metric to combine prober and use it everywhere. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll find a way to neatly combine observability layer for prober.

kakkoyun and others added 3 commits January 27, 2020 17:23
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Perfecto 👌 Clean and nice, LGTM

@bwplotka bwplotka merged commit c7869d9 into thanos-io:master Jan 28, 2020
@poolski
Copy link

poolski commented Jan 30, 2020

Thank you! 😍

@bwplotka
Copy link
Member

bwplotka commented Jan 30, 2020 via email

@poolski
Copy link

poolski commented Feb 12, 2020

It works perfectly! Thank you 👍

@kakkoyun kakkoyun deleted the grpc_health branch August 31, 2021 16:46
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.

Support the GRPC Health protocol
4 participants