From 726a563cd584b3288353c617c9b99f1a4b7e0495 Mon Sep 17 00:00:00 2001 From: Benedikt Bongartz Date: Sat, 12 Oct 2024 00:09:48 +0200 Subject: [PATCH] tempo-query: register gRPC health server Signed-off-by: Benedikt Bongartz --- CHANGELOG.md | 1 + cmd/tempo-query/main.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe8c57a51d1..de1e0048236 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## main / unreleased +* [ENHANCEMENT] Register gRPC health server to tempo-query [#4178](https://github.com/grafana/tempo/pull/4178) (@frzifus) * [ENHANCEMENT] Pushdown collection of results from generators in the querier [#4119](https://github.com/grafana/tempo/pull/4119) (@electron0zero) * [ENHANCEMENT] Send semver version in api/stattus/buildinfo for cloud deployments [#4110](https://github.com/grafana/tempo/pull/4110) [@Aki0x137] * [ENHANCEMENT] Speedup tempo-query trace search by allowing parallel queries [#4159](https://github.com/grafana/tempo/pull/4159) (@pavolloffay) diff --git a/cmd/tempo-query/main.go b/cmd/tempo-query/main.go index cb03386ff2c..8071152eef7 100644 --- a/cmd/tempo-query/main.go +++ b/cmd/tempo-query/main.go @@ -15,6 +15,8 @@ import ( "go.uber.org/zap/zapcore" google_grpc "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/health" + "google.golang.org/grpc/health/grpc_health_v1" "github.com/grafana/tempo/cmd/tempo-query/tempo" ) @@ -72,6 +74,10 @@ func main() { storage_v1.RegisterDependenciesReaderPluginServer(srv, backend) storage_v1.RegisterSpanWriterPluginServer(srv, backend) + healthServer := health.NewServer() + grpc_health_v1.RegisterHealthServer(srv, healthServer) + healthServer.SetServingStatus("", grpc_health_v1.HealthCheckResponse_SERVING) + lis, err := net.Listen("tcp", cfg.Address) if err != nil { logger.Error("failed to listen", zap.Error(err))