From b321e93ef9913c1f25f63460af4a4614b6de9ffa Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 26 Jan 2025 18:55:09 -0400 Subject: [PATCH] Delete gRPC MetricsQueryService, metricsquery.proto and related code (#6616) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Which problem is this PR solving? - No code in Jaeger was dependent on having a gRPC endpoint for reading metrics. UI's Monitor tab uses JSON endpoint. - This code is just a pass-through proxy to the underlying metrics storage with which we communicate using OpenMetrics API. ## Description of the changes - Delete unnecessary code and proto-gen types. - 🛑 This is a breaking change: the gRPC `MetricsQueryService` endpoint is removed. ## How was this change tested? - CI --------- Signed-off-by: Yuri Shkuro --- .github/workflows/ci-lint-checks.yaml | 4 +- Makefile.Protobuf.mk | 2 - cmd/anonymizer/app/query/query_test.go | 5 +- .../extension/jaegerquery/server_test.go | 1 - cmd/query/app/grpc_handler.go | 161 +- cmd/query/app/grpc_handler_test.go | 386 +-- cmd/query/app/server.go | 9 +- cmd/query/app/server_test.go | 1 - model/proto/metrics/metricsquery.proto | 137 -- model/proto/metrics/otelmetric.proto | 658 ------ proto-gen/api_v2/metrics/metricsquery.pb.go | 2067 ----------------- 11 files changed, 38 insertions(+), 3393 deletions(-) delete mode 100644 model/proto/metrics/metricsquery.proto delete mode 100644 model/proto/metrics/otelmetric.proto delete mode 100644 proto-gen/api_v2/metrics/metricsquery.pb.go diff --git a/.github/workflows/ci-lint-checks.yaml b/.github/workflows/ci-lint-checks.yaml index 77d9b6d80d5..f9cd7c1804e 100644 --- a/.github/workflows/ci-lint-checks.yaml +++ b/.github/workflows/ci-lint-checks.yaml @@ -86,10 +86,10 @@ jobs: go-version: 1.23.x - name: Verify Protobuf types are up to date - run: make proto && git diff --name-status --exit-code + run: make proto && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } - name: Verify Thrift types are up to date - run: make thrift && git diff --name-status --exit-code + run: make thrift && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } - name: Verify Mockery types are up to date run: make generate-mocks && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } diff --git a/Makefile.Protobuf.mk b/Makefile.Protobuf.mk index 88f53838a59..536977d5da7 100644 --- a/Makefile.Protobuf.mk +++ b/Makefile.Protobuf.mk @@ -98,8 +98,6 @@ patch-api-v2: proto-openmetrics: $(call print_caption, Processing OpenMetrics Protos) $(foreach file,$(OPENMETRICS_PROTO_FILES),$(call proto_compile, proto-gen/api_v2/metrics, $(file))) - @# TODO why is this file included in model/proto/metrics/ in the first place? - rm proto-gen/api_v2/metrics/otelmetric.pb.go .PHONY: proto-storage-v1 proto-storage-v1: diff --git a/cmd/anonymizer/app/query/query_test.go b/cmd/anonymizer/app/query/query_test.go index 0a85c974422..6cba0d8bda0 100644 --- a/cmd/anonymizer/app/query/query_test.go +++ b/cmd/anonymizer/app/query/query_test.go @@ -18,7 +18,6 @@ import ( "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" "github.com/jaegertracing/jaeger/cmd/query/app" "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" - "github.com/jaegertracing/jaeger/plugin/metricstore/disabled" "github.com/jaegertracing/jaeger/storage/spanstore" spanstoremocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks" dependencyStoreMocks "github.com/jaegertracing/jaeger/storage_v2/depstore/mocks" @@ -58,15 +57,13 @@ type testServer struct { func newTestServer(t *testing.T) *testServer { spanReader := &spanstoremocks.Reader{} traceReader := v1adapter.NewTraceReader(spanReader) - metricsReader, err := disabled.NewMetricsReader() - require.NoError(t, err) q := querysvc.NewQueryService( traceReader, &dependencyStoreMocks.Reader{}, querysvc.QueryServiceOptions{}, ) - h := app.NewGRPCHandler(q, metricsReader, app.GRPCHandlerOptions{}) + h := app.NewGRPCHandler(q, app.GRPCHandlerOptions{}) server := grpc.NewServer() api_v2.RegisterQueryServiceServer(server, h) diff --git a/cmd/jaeger/internal/extension/jaegerquery/server_test.go b/cmd/jaeger/internal/extension/jaegerquery/server_test.go index 1a5effd21e1..9b27d3cc2d1 100644 --- a/cmd/jaeger/internal/extension/jaegerquery/server_test.go +++ b/cmd/jaeger/internal/extension/jaegerquery/server_test.go @@ -245,7 +245,6 @@ func TestServerStart(t *testing.T) { ExpectedServices: []string{ "jaeger.api_v2.QueryService", "jaeger.api_v3.QueryService", - "jaeger.api_v2.metrics.MetricsQueryService", "grpc.health.v1.Health", }, }.Execute(t) diff --git a/cmd/query/app/grpc_handler.go b/cmd/query/app/grpc_handler.go index 1add9b8499c..d05937bb8bd 100644 --- a/cmd/query/app/grpc_handler.go +++ b/cmd/query/app/grpc_handler.go @@ -17,9 +17,6 @@ import ( "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration "github.com/jaegertracing/jaeger/pkg/jtracer" - "github.com/jaegertracing/jaeger/plugin/metricstore/disabled" - "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" - "github.com/jaegertracing/jaeger/storage/metricstore" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -30,20 +27,16 @@ const ( ) var ( - errGRPCMetricsQueryDisabled = status.Error(codes.Unimplemented, "metrics querying is currently disabled") - errNilRequest = status.Error(codes.InvalidArgument, "a nil argument is not allowed") - errUninitializedTraceID = status.Error(codes.InvalidArgument, "uninitialized TraceID is not allowed") - errMissingServiceNames = status.Error(codes.InvalidArgument, "please provide at least one service name") - errMissingQuantile = status.Error(codes.InvalidArgument, "please provide a quantile between (0, 1]") + errNilRequest = status.Error(codes.InvalidArgument, "a nil argument is not allowed") + errUninitializedTraceID = status.Error(codes.InvalidArgument, "uninitialized TraceID is not allowed") ) // GRPCHandler implements the gRPC endpoint of the query service. type GRPCHandler struct { - queryService *querysvc.QueryService - metricsQueryService querysvc.MetricsQueryService - logger *zap.Logger - tracer *jtracer.JTracer - nowFn func() time.Time + queryService *querysvc.QueryService + logger *zap.Logger + tracer *jtracer.JTracer + nowFn func() time.Time } // GRPCHandlerOptions contains optional members of GRPCHandler. @@ -55,7 +48,6 @@ type GRPCHandlerOptions struct { // NewGRPCHandler returns a GRPCHandler. func NewGRPCHandler(queryService *querysvc.QueryService, - metricsQueryService querysvc.MetricsQueryService, options GRPCHandlerOptions, ) *GRPCHandler { if options.Logger == nil { @@ -71,11 +63,10 @@ func NewGRPCHandler(queryService *querysvc.QueryService, } return &GRPCHandler{ - queryService: queryService, - metricsQueryService: metricsQueryService, - logger: options.Logger, - tracer: options.Tracer, - nowFn: options.NowFn, + queryService: queryService, + logger: options.Logger, + tracer: options.Tracer, + nowFn: options.NowFn, } } @@ -248,135 +239,3 @@ func (g *GRPCHandler) GetDependencies(ctx context.Context, r *api_v2.GetDependen return &api_v2.GetDependenciesResponse{Dependencies: dependencies}, nil } - -// GetLatencies is the gRPC handler to fetch latency metrics. -func (g *GRPCHandler) GetLatencies(ctx context.Context, r *metrics.GetLatenciesRequest) (*metrics.GetMetricsResponse, error) { - bqp, err := g.newBaseQueryParameters(r) - if err := g.handleErr("failed to build parameters", err); err != nil { - return nil, err - } - // Check for cases where clients do not provide the Quantile, which defaults to the float64's zero value. - if r.Quantile == 0 { - return nil, errMissingQuantile - } - queryParams := metricstore.LatenciesQueryParameters{ - BaseQueryParameters: bqp, - Quantile: r.Quantile, - } - m, err := g.metricsQueryService.GetLatencies(ctx, &queryParams) - if err := g.handleErr("failed to fetch latencies", err); err != nil { - return nil, err - } - return &metrics.GetMetricsResponse{Metrics: *m}, nil -} - -// GetCallRates is the gRPC handler to fetch call rate metrics. -func (g *GRPCHandler) GetCallRates(ctx context.Context, r *metrics.GetCallRatesRequest) (*metrics.GetMetricsResponse, error) { - bqp, err := g.newBaseQueryParameters(r) - if err := g.handleErr("failed to build parameters", err); err != nil { - return nil, err - } - queryParams := metricstore.CallRateQueryParameters{ - BaseQueryParameters: bqp, - } - m, err := g.metricsQueryService.GetCallRates(ctx, &queryParams) - if err := g.handleErr("failed to fetch call rates", err); err != nil { - return nil, err - } - return &metrics.GetMetricsResponse{Metrics: *m}, nil -} - -// GetErrorRates is the gRPC handler to fetch error rate metrics. -func (g *GRPCHandler) GetErrorRates(ctx context.Context, r *metrics.GetErrorRatesRequest) (*metrics.GetMetricsResponse, error) { - bqp, err := g.newBaseQueryParameters(r) - if err := g.handleErr("failed to build parameters", err); err != nil { - return nil, err - } - queryParams := metricstore.ErrorRateQueryParameters{ - BaseQueryParameters: bqp, - } - m, err := g.metricsQueryService.GetErrorRates(ctx, &queryParams) - if err := g.handleErr("failed to fetch error rates", err); err != nil { - return nil, err - } - return &metrics.GetMetricsResponse{Metrics: *m}, nil -} - -// GetMinStepDuration is the gRPC handler to fetch the minimum step duration supported by the underlying metrics store. -func (g *GRPCHandler) GetMinStepDuration(ctx context.Context, _ *metrics.GetMinStepDurationRequest) (*metrics.GetMinStepDurationResponse, error) { - minStep, err := g.metricsQueryService.GetMinStepDuration(ctx, &metricstore.MinStepDurationQueryParameters{}) - if err := g.handleErr("failed to fetch min step duration", err); err != nil { - return nil, err - } - return &metrics.GetMinStepDurationResponse{MinStep: minStep}, nil -} - -func (g *GRPCHandler) handleErr(msg string, err error) error { - if err == nil { - return nil - } - g.logger.Error(msg, zap.Error(err)) - - // Avoid wrapping "expected" errors with an "Internal Server" error. - if errors.Is(err, disabled.ErrDisabled) { - return errGRPCMetricsQueryDisabled - } - if _, ok := status.FromError(err); ok { - return err - } - - // Received an "unexpected" error. - return status.Errorf(codes.Internal, "%s: %v", msg, err) -} - -func (g *GRPCHandler) newBaseQueryParameters(r any) (bqp metricstore.BaseQueryParameters, err error) { - if r == nil { - return bqp, errNilRequest - } - var baseRequest *metrics.MetricsQueryBaseRequest - switch v := r.(type) { - case *metrics.GetLatenciesRequest: - baseRequest = v.BaseRequest - case *metrics.GetCallRatesRequest: - baseRequest = v.BaseRequest - case *metrics.GetErrorRatesRequest: - baseRequest = v.BaseRequest - } - if baseRequest == nil || len(baseRequest.ServiceNames) == 0 { - return bqp, errMissingServiceNames - } - - // Copy non-nullable params. - bqp.GroupByOperation = baseRequest.GroupByOperation - bqp.ServiceNames = baseRequest.ServiceNames - - // Initialize nullable params with defaults. - defaultEndTime := g.nowFn() - bqp.EndTime = &defaultEndTime - bqp.Lookback = &defaultMetricsQueryLookbackDuration - bqp.RatePer = &defaultMetricsQueryRateDuration - bqp.SpanKinds = defaultMetricsSpanKinds - bqp.Step = &defaultMetricsQueryStepDuration - - // ... and override defaults with any provided request params. - if baseRequest.EndTime != nil { - bqp.EndTime = baseRequest.EndTime - } - if baseRequest.Lookback != nil { - bqp.Lookback = baseRequest.Lookback - } - if baseRequest.Step != nil { - bqp.Step = baseRequest.Step - } - if baseRequest.RatePer != nil { - bqp.RatePer = baseRequest.RatePer - } - if len(baseRequest.SpanKinds) > 0 { - spanKinds := make([]string, len(baseRequest.SpanKinds)) - for i, v := range baseRequest.SpanKinds { - spanKinds[i] = v.String() - } - bqp.SpanKinds = spanKinds - } - return bqp, nil -} diff --git a/cmd/query/app/grpc_handler_test.go b/cmd/query/app/grpc_handler_test.go index 756b13a3836..8827257bcab 100644 --- a/cmd/query/app/grpc_handler_test.go +++ b/cmd/query/app/grpc_handler_test.go @@ -26,10 +26,6 @@ import ( "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" "github.com/jaegertracing/jaeger/pkg/jtracer" "github.com/jaegertracing/jaeger/pkg/tenancy" - "github.com/jaegertracing/jaeger/plugin/metricstore/disabled" - "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" - "github.com/jaegertracing/jaeger/storage/metricstore" - metricsmocks "github.com/jaegertracing/jaeger/storage/metricstore/mocks" "github.com/jaegertracing/jaeger/storage/spanstore" spanstoremocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks" "github.com/jaegertracing/jaeger/storage_v2/depstore" @@ -120,22 +116,20 @@ var ( ) type grpcServer struct { - server *grpc.Server - lisAddr net.Addr - spanReader *spanstoremocks.Reader - depReader *depsmocks.Reader - metricsQueryService querysvc.MetricsQueryService - archiveSpanReader *spanstoremocks.Reader - archiveSpanWriter *spanstoremocks.Writer + server *grpc.Server + lisAddr net.Addr + spanReader *spanstoremocks.Reader + depReader *depsmocks.Reader + archiveSpanReader *spanstoremocks.Reader + archiveSpanWriter *spanstoremocks.Writer } type grpcClient struct { api_v2.QueryServiceClient - metrics.MetricsQueryServiceClient conn *grpc.ClientConn } -func newGRPCServer(t *testing.T, q *querysvc.QueryService, mq querysvc.MetricsQueryService, logger *zap.Logger, tracer *jtracer.JTracer, tenancyMgr *tenancy.Manager) (*grpc.Server, net.Addr) { +func newGRPCServer(t *testing.T, q *querysvc.QueryService, logger *zap.Logger, tracer *jtracer.JTracer, tenancyMgr *tenancy.Manager) (*grpc.Server, net.Addr) { lis, _ := net.Listen("tcp", ":0") var grpcOpts []grpc.ServerOption if tenancyMgr.Enabled { @@ -145,7 +139,7 @@ func newGRPCServer(t *testing.T, q *querysvc.QueryService, mq querysvc.MetricsQu ) } grpcServer := grpc.NewServer(grpcOpts...) - grpcHandler := NewGRPCHandler(q, mq, GRPCHandlerOptions{ + grpcHandler := NewGRPCHandler(q, GRPCHandlerOptions{ Logger: logger, Tracer: tracer, NowFn: func() time.Time { @@ -153,7 +147,6 @@ func newGRPCServer(t *testing.T, q *querysvc.QueryService, mq querysvc.MetricsQu }, }) api_v2.RegisterQueryServiceServer(grpcServer, grpcHandler) - metrics.RegisterMetricsQueryServiceServer(grpcServer, grpcHandler) go func() { err := grpcServer.Serve(lis) @@ -168,28 +161,13 @@ func newGRPCClient(t *testing.T, addr string) *grpcClient { require.NoError(t, err) return &grpcClient{ - QueryServiceClient: api_v2.NewQueryServiceClient(conn), - MetricsQueryServiceClient: metrics.NewMetricsQueryServiceClient(conn), - conn: conn, + QueryServiceClient: api_v2.NewQueryServiceClient(conn), + conn: conn, } } -type testOption func(*testQueryService) - -type testQueryService struct { - // metricsQueryService is used when creating a new GRPCHandler. - metricsQueryService querysvc.MetricsQueryService -} - -func withMetricsQuery() testOption { - reader := &metricsmocks.Reader{} - return func(ts *testQueryService) { - ts.metricsQueryService = reader - } -} - -func withServerAndClient(t *testing.T, actualTest func(server *grpcServer, client *grpcClient), options ...testOption) { - server := initializeTenantedTestServerGRPCWithOptions(t, &tenancy.Manager{}, options...) +func withServerAndClient(t *testing.T, actualTest func(server *grpcServer, client *grpcClient)) { + server := initializeTenantedTestServerGRPC(t, &tenancy.Manager{}) client := newGRPCClient(t, server.lisAddr.String()) defer server.server.Stop() defer client.conn.Close() @@ -636,318 +614,12 @@ func TestSendSpanChunksError(t *testing.T) { require.EqualError(t, err, expectedErr.Error()) } -func TestGetMetricsSuccessGRPC(t *testing.T) { - withServerAndClient(t, func(server *grpcServer, client *grpcClient) { - baseQueryParam := &metrics.MetricsQueryBaseRequest{ - ServiceNames: []string{"foo"}, - } - for _, tc := range []struct { - mockMethod string - mockParamType string - testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) - }{ - { - mockMethod: "GetLatencies", - mockParamType: "*metricstore.LatenciesQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95, BaseRequest: baseQueryParam}) - }, - }, - { - mockMethod: "GetCallRates", - mockParamType: "*metricstore.CallRateQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{BaseRequest: baseQueryParam}) - }, - }, - { - mockMethod: "GetErrorRates", - mockParamType: "*metricstore.ErrorRateQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{BaseRequest: baseQueryParam}) - }, - }, - } { - t.Run(tc.mockMethod, func(t *testing.T) { - expectedMetrics := &metrics.MetricFamily{Name: "foo"} - m := server.metricsQueryService.(*metricsmocks.Reader) - m.On(tc.mockMethod, mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType(tc.mockParamType)). - Return(expectedMetrics, nil).Once() - - res, err := tc.testFn(client) - require.NoError(t, err) - assert.Equal(t, expectedMetrics, &res.Metrics) - }) - } - }, withMetricsQuery()) -} - -func TestGetMetricsReaderDisabledGRPC(t *testing.T) { - withServerAndClient(t, func(_ *grpcServer, client *grpcClient) { - baseQueryParam := &metrics.MetricsQueryBaseRequest{ - ServiceNames: []string{"foo"}, - } - for _, tc := range []struct { - name string - testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) - }{ - { - name: "GetLatencies", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95, BaseRequest: baseQueryParam}) - }, - }, - { - name: "GetCallRates", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{BaseRequest: baseQueryParam}) - }, - }, - { - name: "GetErrorRates", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{BaseRequest: baseQueryParam}) - }, - }, - } { - t.Run(tc.name, func(t *testing.T) { - res, err := tc.testFn(client) - require.Error(t, err) - assert.Nil(t, res) - - assertGRPCError(t, err, codes.Unimplemented, "metrics querying is currently disabled") - }) - } - }) -} - -func TestGetMetricsUseDefaultParamsGRPC(t *testing.T) { - withServerAndClient(t, func(server *grpcServer, client *grpcClient) { - baseQueryParam := &metrics.MetricsQueryBaseRequest{ - ServiceNames: []string{"foo"}, - } - request := &metrics.GetCallRatesRequest{ - BaseRequest: baseQueryParam, - } - expectedMetrics := &metrics.MetricFamily{Name: "foo"} - expectedParams := &metricstore.CallRateQueryParameters{ - BaseQueryParameters: metricstore.BaseQueryParameters{ - ServiceNames: []string{"foo"}, - EndTime: &now, - Lookback: &defaultMetricsQueryLookbackDuration, - Step: &defaultMetricsQueryStepDuration, - RatePer: &defaultMetricsQueryRateDuration, - SpanKinds: defaultMetricsSpanKinds, - }, - } - m := server.metricsQueryService.(*metricsmocks.Reader) - m.On("GetCallRates", mock.AnythingOfType("*context.valueCtx"), expectedParams). - Return(expectedMetrics, nil).Once() - - res, err := client.GetCallRates(context.Background(), request) - require.NoError(t, err) - assert.Equal(t, expectedMetrics, &res.Metrics) - }, withMetricsQuery()) -} - -func TestGetMetricsOverrideDefaultParamsGRPC(t *testing.T) { - loc, _ := time.LoadLocation("UTC") - endTime := time.Now().In(loc) - lookback := time.Minute - step := time.Second - ratePer := time.Hour - spanKinds := []metrics.SpanKind{metrics.SpanKind_SPAN_KIND_CONSUMER} - expectedSpanKinds := []string{metrics.SpanKind_SPAN_KIND_CONSUMER.String()} - withServerAndClient(t, func(server *grpcServer, client *grpcClient) { - baseQueryParam := &metrics.MetricsQueryBaseRequest{ - ServiceNames: []string{"foo"}, - EndTime: &endTime, - Lookback: &lookback, - Step: &step, - RatePer: &ratePer, - SpanKinds: spanKinds, - } - request := &metrics.GetCallRatesRequest{ - BaseRequest: baseQueryParam, - } - expectedMetrics := &metrics.MetricFamily{Name: "foo"} - expectedParams := &metricstore.CallRateQueryParameters{ - BaseQueryParameters: metricstore.BaseQueryParameters{ - ServiceNames: baseQueryParam.ServiceNames, - EndTime: &endTime, - Lookback: &lookback, - Step: &step, - RatePer: &ratePer, - SpanKinds: expectedSpanKinds, - }, - } - m := server.metricsQueryService.(*metricsmocks.Reader) - m.On("GetCallRates", mock.AnythingOfType("*context.valueCtx"), expectedParams). - Return(expectedMetrics, nil).Once() - - res, err := client.GetCallRates(context.Background(), request) - require.NoError(t, err) - assert.Equal(t, expectedMetrics, &res.Metrics) - }, withMetricsQuery()) -} - -func TestGetMetricsFailureGRPC(t *testing.T) { - withServerAndClient(t, func(server *grpcServer, client *grpcClient) { - baseQueryParam := &metrics.MetricsQueryBaseRequest{ - ServiceNames: []string{"foo"}, - } - for _, tc := range []struct { - mockMethod string - mockParamType string - testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) - wantErr string - }{ - { - mockMethod: "GetLatencies", - mockParamType: "*metricstore.LatenciesQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95, BaseRequest: baseQueryParam}) - }, - wantErr: "failed to fetch latencies: storage error", - }, - { - mockMethod: "GetCallRates", - mockParamType: "*metricstore.CallRateQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{BaseRequest: baseQueryParam}) - }, - wantErr: "failed to fetch call rates: storage error", - }, - { - mockMethod: "GetErrorRates", - mockParamType: "*metricstore.ErrorRateQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{BaseRequest: baseQueryParam}) - }, - wantErr: "failed to fetch error rates: storage error", - }, - } { - t.Run(tc.mockMethod, func(t *testing.T) { - m := server.metricsQueryService.(*metricsmocks.Reader) - m.On(tc.mockMethod, mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType(tc.mockParamType)). - Return(nil, errStorageGRPC).Once() - - res, err := tc.testFn(client) - require.Nil(t, res) - require.Error(t, err) - - assertGRPCError(t, err, codes.Internal, tc.wantErr) - }) - } - }, withMetricsQuery()) -} - -func TestGetMinStepDurationSuccessGRPC(t *testing.T) { - withServerAndClient(t, func(server *grpcServer, client *grpcClient) { - m := server.metricsQueryService.(*metricsmocks.Reader) - m.On("GetMinStepDuration", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*metricstore.MinStepDurationQueryParameters")). - Return(time.Hour, nil).Once() - - res, err := client.GetMinStepDuration(context.Background(), &metrics.GetMinStepDurationRequest{}) - require.NoError(t, err) - require.Equal(t, time.Hour, res.MinStep) - }, withMetricsQuery()) -} - -func TestGetMinStepDurationFailureGRPC(t *testing.T) { - withServerAndClient(t, func(server *grpcServer, client *grpcClient) { - m := server.metricsQueryService.(*metricsmocks.Reader) - m.On("GetMinStepDuration", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*metricstore.MinStepDurationQueryParameters")). - Return(time.Duration(0), errStorageGRPC).Once() - - res, err := client.GetMinStepDuration(context.Background(), &metrics.GetMinStepDurationRequest{}) - require.Nil(t, res) - require.Error(t, err) - - assertGRPCError(t, err, codes.Internal, "failed to fetch min step duration: storage error") - }, withMetricsQuery()) -} - -func TestGetMetricsInvalidParametersGRPC(t *testing.T) { - withServerAndClient(t, func(server *grpcServer, client *grpcClient) { - for _, tc := range []struct { - name string - mockMethod string - mockParamType string - testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) - wantErr string - }{ - { - name: "GetLatencies missing service names", - mockMethod: "GetLatencies", - mockParamType: "*metricstore.LatenciesQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95}) - }, - wantErr: "please provide at least one service name", - }, - { - name: "GetLatencies missing quantile", - mockMethod: "GetLatencies", - mockParamType: "*metricstore.LatenciesQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{ - BaseRequest: &metrics.MetricsQueryBaseRequest{ - ServiceNames: []string{"foo"}, - }, - }) - }, - wantErr: "please provide a quantile between (0, 1]", - }, - { - name: "GetCallRates missing service names", - mockMethod: "GetCallRates", - mockParamType: "*metricstore.CallRateQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{}) // Test - }, - wantErr: "please provide at least one service name", - }, - { - name: "GetErrorRates nil request", - mockMethod: "GetErrorRates", - mockParamType: "*metricstore.ErrorRateQueryParameters", - testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { - return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{}) - }, - wantErr: "please provide at least one service name", - }, - } { - t.Run(tc.name, func(t *testing.T) { - m := server.metricsQueryService.(*metricsmocks.Reader) - m.On(tc.mockMethod, mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType(tc.mockParamType)). - Times(0) - - res, err := tc.testFn(client) - require.Nil(t, res) - require.Error(t, err) - - assertGRPCError(t, err, codes.InvalidArgument, tc.wantErr) - }) - } - }, withMetricsQuery()) -} - -func TestMetricsQueryNilRequestGRPC(t *testing.T) { - grpcHandler := &GRPCHandler{} - bqp, err := grpcHandler.newBaseQueryParameters(nil) - assert.Empty(t, bqp) - require.EqualError(t, err, errNilRequest.Error()) -} - -func initializeTenantedTestServerGRPCWithOptions(t *testing.T, tm *tenancy.Manager, options ...testOption) *grpcServer { +func initializeTenantedTestServerGRPC(t *testing.T, tm *tenancy.Manager) *grpcServer { archiveSpanReader := &spanstoremocks.Reader{} archiveSpanWriter := &spanstoremocks.Writer{} spanReader := &spanstoremocks.Reader{} dependencyReader := &depsmocks.Reader{} - disabledReader, err := disabled.NewMetricsReader() - require.NoError(t, err) q := querysvc.NewQueryService( v1adapter.NewTraceReader(spanReader), @@ -957,32 +629,23 @@ func initializeTenantedTestServerGRPCWithOptions(t *testing.T, tm *tenancy.Manag ArchiveSpanWriter: archiveSpanWriter, }) - tqs := &testQueryService{ - // Disable metrics query by default. - metricsQueryService: disabledReader, - } - for _, opt := range options { - opt(tqs) - } - logger := zap.NewNop() tracer := jtracer.NoOp() - server, addr := newGRPCServer(t, q, tqs.metricsQueryService, logger, tracer, tm) + server, addr := newGRPCServer(t, q, logger, tracer, tm) return &grpcServer{ - server: server, - lisAddr: addr, - spanReader: spanReader, - depReader: dependencyReader, - metricsQueryService: tqs.metricsQueryService, - archiveSpanReader: archiveSpanReader, - archiveSpanWriter: archiveSpanWriter, + server: server, + lisAddr: addr, + spanReader: spanReader, + depReader: dependencyReader, + archiveSpanReader: archiveSpanReader, + archiveSpanWriter: archiveSpanWriter, } } -func withTenantedServerAndClient(t *testing.T, tm *tenancy.Manager, actualTest func(server *grpcServer, client *grpcClient), options ...testOption) { - server := initializeTenantedTestServerGRPCWithOptions(t, tm, options...) +func withTenantedServerAndClient(t *testing.T, tm *tenancy.Manager, actualTest func(server *grpcServer, client *grpcClient)) { + server := initializeTenantedTestServerGRPC(t, tm) client := newGRPCClient(t, server.lisAddr.String()) defer server.server.Stop() defer client.conn.Close() @@ -1210,15 +873,12 @@ func TestTenancyContextFlowGRPC(t *testing.T) { } func TestNewGRPCHandlerWithEmptyOptions(t *testing.T) { - disabledReader, err := disabled.NewMetricsReader() - require.NoError(t, err) - q := querysvc.NewQueryService( v1adapter.NewTraceReader(&spanstoremocks.Reader{}), &depsmocks.Reader{}, querysvc.QueryServiceOptions{}) - handler := NewGRPCHandler(q, disabledReader, GRPCHandlerOptions{}) + handler := NewGRPCHandler(q, GRPCHandlerOptions{}) assert.NotNil(t, handler.logger) assert.NotNil(t, handler.tracer) diff --git a/cmd/query/app/server.go b/cmd/query/app/server.go index a61f63703fb..a2b02d3ba11 100644 --- a/cmd/query/app/server.go +++ b/cmd/query/app/server.go @@ -36,7 +36,6 @@ import ( "github.com/jaegertracing/jaeger/pkg/recoveryhandler" "github.com/jaegertracing/jaeger/pkg/telemetry" "github.com/jaegertracing/jaeger/pkg/tenancy" - "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" ) // Server runs HTTP, Mux and a grpc server @@ -83,7 +82,7 @@ func NewServer( if err != nil { return nil, err } - registerGRPCHandlers(grpcServer, querySvc, v2QuerySvc, metricsQuerySvc, telset) + registerGRPCHandlers(grpcServer, querySvc, v2QuerySvc, telset) httpServer, err := createHTTPServer(ctx, querySvc, v2QuerySvc, metricsQuerySvc, options, tm, telset) if err != nil { return nil, err @@ -103,17 +102,13 @@ func registerGRPCHandlers( server *grpc.Server, querySvc *querysvc.QueryService, v2QuerySvc *v2querysvc.QueryService, - metricsQuerySvc querysvc.MetricsQueryService, telset telemetry.Settings, ) { reflection.Register(server) - handler := NewGRPCHandler(querySvc, metricsQuerySvc, GRPCHandlerOptions{ - Logger: telset.Logger, - }) + handler := NewGRPCHandler(querySvc, GRPCHandlerOptions{Logger: telset.Logger}) healthServer := health.NewServer() api_v2.RegisterQueryServiceServer(server, handler) - metrics.RegisterMetricsQueryServiceServer(server, handler) api_v3.RegisterQueryServiceServer(server, &apiv3.Handler{QueryService: v2QuerySvc}) healthServer.SetServingStatus("jaeger.api_v2.QueryService", grpc_health_v1.HealthCheckResponse_SERVING) diff --git a/cmd/query/app/server_test.go b/cmd/query/app/server_test.go index 9b287293966..a92b2d7ddc4 100644 --- a/cmd/query/app/server_test.go +++ b/cmd/query/app/server_test.go @@ -742,7 +742,6 @@ func TestServerHandlesPortZero(t *testing.T) { ExpectedServices: []string{ "jaeger.api_v2.QueryService", "jaeger.api_v3.QueryService", - "jaeger.api_v2.metrics.MetricsQueryService", "grpc.health.v1.Health", }, }.Execute(t) diff --git a/model/proto/metrics/metricsquery.proto b/model/proto/metrics/metricsquery.proto deleted file mode 100644 index a3b2d8d4601..00000000000 --- a/model/proto/metrics/metricsquery.proto +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2021 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax="proto3"; - -package jaeger.api_v2.metrics; - -import "openmetrics.proto"; -import "otelspankind.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "metrics"; -option java_package = "io.jaegertracing.api_v2.metrics"; - -// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). -// Enable custom Marshal method. -option (gogoproto.marshaler_all) = true; -// Enable custom Unmarshal method. -option (gogoproto.unmarshaler_all) = true; -// Enable custom Size method (Required by Marshal and Unmarshal). -option (gogoproto.sizer_all) = true; - -// MetricsQueryBaseRequest is the base request parameter accompanying a MetricsQueryService RPC call. -message MetricsQueryBaseRequest { - // service_names are the service names to fetch metrics from. - // The results will be grouped by service_name. - // Required. At least one service name must be provided. - repeated string service_names = 1; - - // groupByOperation determines if the metrics returned should be grouped by operation. - // Optional. Default = false. - bool groupByOperation = 2; - - // end_time is the ending time of the time series query range. - // Optional. Default = now. - google.protobuf.Timestamp end_time = 3 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = true - ]; - - // lookback is the duration from the end_time to look back on for metrics data points. - // For example, if set to 1h, the query would span from end_time-1h to end_time. - // Optional. Default = 1h. - google.protobuf.Duration lookback = 4 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = true - ]; - - // step size is the duration between data points of the query results. - // For example, if set to 5s, the results would produce a data point every 5 seconds - // from the start_time to end_time. - // Optional. Default = 5s. - google.protobuf.Duration step = 5 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = true - ]; - - // ratePer is the duration in which the per-second rate of change is calculated for a cumulative counter metric. - // Optional. Default = 10m. - google.protobuf.Duration ratePer = 6 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = true - ]; - - // spanKinds is the list of span kinds to include (logical OR) in the resulting metrics aggregation. - // Optional. Default = [SPAN_KIND_SERVER]. - repeated SpanKind spanKinds = 7; -} - -// GetLatenciesRequest contains parameters for the GetLatencies RPC call. -message GetLatenciesRequest { - MetricsQueryBaseRequest baseRequest = 1; - // quantile is the quantile to compute from latency histogram metrics. - // Valid range: (0, 1] - // - // e.g. 0.99 will return the 99th percentile or P99 which is the worst latency - // observed from 99% of all spans for the given service (and operation). - // - // Required. - double quantile = 2; -} - -// GetCallRatesRequest contains parameters for the GetCallRates RPC call. -message GetCallRatesRequest { - MetricsQueryBaseRequest baseRequest = 1; -} - -// GetErrorRatesRequest contains parameters for the GetErrorRates RPC call. -message GetErrorRatesRequest { - MetricsQueryBaseRequest baseRequest = 1; -} - -message GetMinStepDurationRequest{}; - -message GetMinStepDurationResponse { - google.protobuf.Duration minStep = 1 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = false - ]; -} - -message GetMetricsResponse { - MetricFamily metrics = 1 [ - (gogoproto.nullable) = false - ]; -} - -service MetricsQueryService { - // GetMinStepDuration gets the min time resolution supported by the backing metrics store, - // e.g. 10s means the backend can only return data points that are at least 10s apart, not closer. - rpc GetMinStepDuration(GetMinStepDurationRequest) returns (GetMinStepDurationResponse); - - // GetLatencies gets the latency metrics for a given list of services grouped by service - // and optionally grouped by operation. - rpc GetLatencies(GetLatenciesRequest) returns (GetMetricsResponse); - - // GetCallRates gets the call rate metrics for a given list of services grouped by service - // and optionally grouped by operation. - rpc GetCallRates(GetCallRatesRequest) returns (GetMetricsResponse); - - // GetErrorRates gets the error rate metrics for a given list of services grouped by service - // and optionally grouped by operation. - rpc GetErrorRates(GetErrorRatesRequest) returns (GetMetricsResponse); -} diff --git a/model/proto/metrics/otelmetric.proto b/model/proto/metrics/otelmetric.proto deleted file mode 100644 index 35ad6733f13..00000000000 --- a/model/proto/metrics/otelmetric.proto +++ /dev/null @@ -1,658 +0,0 @@ -// Copyright (c) 2021 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Based on: https://github.com/open-telemetry/opentelemetry-proto/blob/v0.8.0/opentelemetry/proto/metrics/v1/metrics.proto - -syntax="proto3"; - -package jaeger.api_v2.metrics; - -import "gogoproto/gogo.proto"; - -option go_package = "metrics"; -option java_package = "io.jaegertracing.api_v2.metrics"; - -// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). -// Enable custom Marshal method. -option (gogoproto.marshaler_all) = true; -// Enable custom Unmarshal method. -option (gogoproto.unmarshaler_all) = true; -// Enable custom Size method (Required by Marshal and Unmarshal). -option (gogoproto.sizer_all) = true; - -// StringKeyValue is a pair of key/value strings. This is the simpler (and faster) version -// of KeyValue that only supports string values. -message StringKeyValue { - string key = 1; - string value = 2; -} - -// Defines a Metric which has one or more timeseries. -// -// The data model and relation between entities is shown in the -// diagram below. Here, "DataPoint" is the term used to refer to any -// one of the specific data point value types, and "points" is the term used -// to refer to any one of the lists of points contained in the Metric. -// -// - Metric is composed of a metadata and data. -// - Metadata part contains a name, description, unit. -// - Data is one of the possible types (Gauge, Sum, Histogram, etc.). -// - DataPoint contains timestamps, labels, and one of the possible value type -// fields. -// -// Metric -// +------------+ -// |name | -// |description | -// |unit | +------------------------------------+ -// |data |---> |Gauge, Sum, Histogram, Summary, ... | -// +------------+ +------------------------------------+ -// -// Data [One of Gauge, Sum, Histogram, Summary, ...] -// +-----------+ -// |... | // Metadata about the Data. -// |points |--+ -// +-----------+ | -// | +---------------------------+ -// | |DataPoint 1 | -// v |+------+------+ +------+ | -// +-----+ ||label |label |...|label | | -// | 1 |-->||value1|value2|...|valueN| | -// +-----+ |+------+------+ +------+ | -// | . | |+-----+ | -// | . | ||value| | -// | . | |+-----+ | -// | . | +---------------------------+ -// | . | . -// | . | . -// | . | . -// | . | +---------------------------+ -// | . | |DataPoint M | -// +-----+ |+------+------+ +------+ | -// | M |-->||label |label |...|label | | -// +-----+ ||value1|value2|...|valueN| | -// |+------+------+ +------+ | -// |+-----+ | -// ||value| | -// |+-----+ | -// +---------------------------+ -// -// All DataPoint types have three common fields: -// - Labels zero or more key-value pairs associated with the data point. -// - StartTimeUnixNano MUST be set to the start of the interval when the data's -// type includes an AggregationTemporality. This field is not set otherwise. -// - TimeUnixNano MUST be set to: -// - the moment when an aggregation is reported (independent of the -// aggregation temporality). -// - the instantaneous time of the event. -message Metric { - // name of the metric, including its DNS name prefix. It must be unique. - string name = 1; - - // description of the metric, which can be used in documentation. - string description = 2; - - // unit in which the metric value is reported. Follows the format - // described by http://unitsofmeasure.org/ucum.html. - string unit = 3; - - // TODO: Decide if support for RawMeasurements (measurements recorded using - // the synchronous instruments) is necessary. It can be used to delegate the - // aggregation from the application to the agent/collector. See - // https://github.com/open-telemetry/opentelemetry-specification/issues/617 - - // Data determines the aggregation type (if any) of the metric, what is the - // reported value type for the data points, as well as the relationship to - // the time interval over which they are reported. - oneof data { - // IntGauge and IntSum are deprecated and will be removed soon. - // 1. Old senders and receivers that are not aware of this change will - // continue using the `int_gauge` and `int_sum` fields. - // 2. New senders, which are aware of this change MUST send only `gauge` - // and `sum` fields. - // 3. New receivers, which are aware of this change MUST convert these into - // `gauge` and `sum` by using the provided as_int field in the oneof values. - // This field will be removed in ~3 months, on July 1, 2021. - IntGauge int_gauge = 4 [deprecated = true]; - Gauge gauge = 5; - // This field will be removed in ~3 months, on July 1, 2021. - IntSum int_sum = 6 [deprecated = true]; - Sum sum = 7; - - // IntHistogram is deprecated and will be removed soon. - // 1. Old senders and receivers that are not aware of this change will - // continue using the `int_histogram` field. - // 2. New senders, which are aware of this change MUST send only `histogram`. - // 3. New receivers, which are aware of this change MUST convert this into - // `histogram` by simply converting all int64 values into float. - // This field will be removed in ~3 months, on July 1, 2021. - IntHistogram int_histogram = 8 [deprecated = true]; - Histogram histogram = 9; - Summary summary = 11; - } -} - -// IntGauge is deprecated. Use Gauge with an integer value in NumberDataPoint. -// -// IntGauge represents the type of a int scalar metric that always exports the -// "current value" for every data point. It should be used for an "unknown" -// aggregation. -// -// A Gauge does not support different aggregation temporalities. Given the -// aggregation is unknown, points cannot be combined using the same -// aggregation, regardless of aggregation temporalities. Therefore, -// AggregationTemporality is not included. Consequently, this also means -// "StartTimeUnixNano" is ignored for all data points. -message IntGauge { - option deprecated = true; - - repeated IntDataPoint data_points = 1; -} - -// Gauge represents the type of a double scalar metric that always exports the -// "current value" for every data point. It should be used for an "unknown" -// aggregation. -// -// A Gauge does not support different aggregation temporalities. Given the -// aggregation is unknown, points cannot be combined using the same -// aggregation, regardless of aggregation temporalities. Therefore, -// AggregationTemporality is not included. Consequently, this also means -// "StartTimeUnixNano" is ignored for all data points. -message Gauge { - repeated NumberDataPoint data_points = 1; -} - -// IntSum is deprecated. Use Sum with an integer value in NumberDataPoint. -// -// IntSum represents the type of a numeric int scalar metric that is calculated as -// a sum of all reported measurements over a time interval. -message IntSum { - option deprecated = true; - - repeated IntDataPoint data_points = 1; - - // aggregation_temporality describes if the aggregator reports delta changes - // since last report time, or cumulative changes since a fixed start time. - AggregationTemporality aggregation_temporality = 2; - - // If "true" means that the sum is monotonic. - bool is_monotonic = 3; -} - -// Sum represents the type of a numeric double scalar metric that is calculated -// as a sum of all reported measurements over a time interval. -message Sum { - repeated NumberDataPoint data_points = 1; - - // aggregation_temporality describes if the aggregator reports delta changes - // since last report time, or cumulative changes since a fixed start time. - AggregationTemporality aggregation_temporality = 2; - - // If "true" means that the sum is monotonic. - bool is_monotonic = 3; -} - -// IntHistogram is deprecated, replaced by Histogram points using double- -// valued exemplars. -// -// This represents the type of a metric that is calculated by aggregating as a -// Histogram of all reported int measurements over a time interval. -message IntHistogram { - option deprecated = true; - - repeated IntHistogramDataPoint data_points = 1; - - // aggregation_temporality describes if the aggregator reports delta changes - // since last report time, or cumulative changes since a fixed start time. - AggregationTemporality aggregation_temporality = 2; -} - -// Histogram represents the type of a metric that is calculated by aggregating as a -// Histogram of all reported double measurements over a time interval. -message Histogram { - repeated HistogramDataPoint data_points = 1; - - // aggregation_temporality describes if the aggregator reports delta changes - // since last report time, or cumulative changes since a fixed start time. - AggregationTemporality aggregation_temporality = 2; -} - -// Summary metric data are used to convey quantile summaries, -// a Prometheus (see: https://prometheus.io/docs/concepts/metric_types/#summary) -// and OpenMetrics (see: https://github.com/OpenObservability/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45) -// data type. These data points cannot always be merged in a meaningful way. -// While they can be useful in some applications, histogram data points are -// recommended for new applications. -message Summary { - repeated SummaryDataPoint data_points = 1; -} - -// AggregationTemporality defines how a metric aggregator reports aggregated -// values. It describes how those values relate to the time interval over -// which they are aggregated. -enum AggregationTemporality { - // UNSPECIFIED is the default AggregationTemporality, it MUST not be used. - AGGREGATION_TEMPORALITY_UNSPECIFIED = 0; - - // DELTA is an AggregationTemporality for a metric aggregator which reports - // changes since last report time. Successive metrics contain aggregation of - // values from continuous and non-overlapping intervals. - // - // The values for a DELTA metric are based only on the time interval - // associated with one measurement cycle. There is no dependency on - // previous measurements like is the case for CUMULATIVE metrics. - // - // For example, consider a system measuring the number of requests that - // it receives and reports the sum of these requests every second as a - // DELTA metric: - // - // 1. The system starts receiving at time=t_0. - // 2. A request is received, the system measures 1 request. - // 3. A request is received, the system measures 1 request. - // 4. A request is received, the system measures 1 request. - // 5. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0 to - // t_0+1 with a value of 3. - // 6. A request is received, the system measures 1 request. - // 7. A request is received, the system measures 1 request. - // 8. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0+1 to - // t_0+2 with a value of 2. - AGGREGATION_TEMPORALITY_DELTA = 1; - - // CUMULATIVE is an AggregationTemporality for a metric aggregator which - // reports changes since a fixed start time. This means that current values - // of a CUMULATIVE metric depend on all previous measurements since the - // start time. Because of this, the sender is required to retain this state - // in some form. If this state is lost or invalidated, the CUMULATIVE metric - // values MUST be reset and a new fixed start time following the last - // reported measurement time sent MUST be used. - // - // For example, consider a system measuring the number of requests that - // it receives and reports the sum of these requests every second as a - // CUMULATIVE metric: - // - // 1. The system starts receiving at time=t_0. - // 2. A request is received, the system measures 1 request. - // 3. A request is received, the system measures 1 request. - // 4. A request is received, the system measures 1 request. - // 5. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0 to - // t_0+1 with a value of 3. - // 6. A request is received, the system measures 1 request. - // 7. A request is received, the system measures 1 request. - // 8. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0 to - // t_0+2 with a value of 5. - // 9. The system experiences a fault and loses state. - // 10. The system recovers and resumes receiving at time=t_1. - // 11. A request is received, the system measures 1 request. - // 12. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_1 to - // t_0+1 with a value of 1. - // - // Note: Even though, when reporting changes since last report time, using - // CUMULATIVE is valid, it is not recommended. This may cause problems for - // systems that do not use start_time to determine when the aggregation - // value was reset (e.g. Prometheus). - AGGREGATION_TEMPORALITY_CUMULATIVE = 2; -} - -// IntDataPoint is a single data point in a timeseries that describes the -// time-varying values of a int64 metric. -message IntDataPoint { - option deprecated = true; - - // The set of labels that uniquely identify this timeseries. - repeated StringKeyValue labels = 1; - - // start_time_unix_nano is the last time when the aggregation value was reset - // to "zero". For some metric types this is ignored, see data types for more - // details. - // - // The aggregation value is over the time interval (start_time_unix_nano, - // time_unix_nano]. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - // - // Value of 0 indicates that the timestamp is unspecified. In that case the - // timestamp may be decided by the backend. - fixed64 start_time_unix_nano = 2; - - // time_unix_nano is the moment when this aggregation value was reported. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - fixed64 time_unix_nano = 3; - - // value itself. - sfixed64 value = 4; - - // (Optional) List of exemplars collected from - // measurements that were used to form the data point - repeated IntExemplar exemplars = 5; -} - -// NumberDataPoint is a single data point in a timeseries that describes the -// time-varying value of a double metric. -message NumberDataPoint { - // The set of labels that uniquely identify this timeseries. - repeated StringKeyValue labels = 1; - - // start_time_unix_nano is the last time when the aggregation value was reset - // to "zero". For some metric types this is ignored, see data types for more - // details. - // - // The aggregation value is over the time interval (start_time_unix_nano, - // time_unix_nano]. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - // - // Value of 0 indicates that the timestamp is unspecified. In that case the - // timestamp may be decided by the backend. - fixed64 start_time_unix_nano = 2; - - // time_unix_nano is the moment when this aggregation value was reported. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - fixed64 time_unix_nano = 3; - - // The value itself. A point is considered invalid when one of the recognized - // value fields is not present inside this oneof. - oneof value { - double as_double = 4; - sfixed64 as_int = 6; - } - - // (Optional) List of exemplars collected from - // measurements that were used to form the data point - repeated Exemplar exemplars = 5; -} - -// IntHistogramDataPoint is deprecated; use HistogramDataPoint. -// -// This is a single data point in a timeseries that describes -// the time-varying values of a Histogram of int values. A Histogram contains -// summary statistics for a population of values, it may optionally contain -// the distribution of those values across a set of buckets. -// -// If the histogram contains the distribution of values, then both -// "explicit_bounds" and "bucket counts" fields must be defined. -// If the histogram does not contain the distribution of values, then both -// "explicit_bounds" and "bucket_counts" must be omitted and only "count" and -// "sum" are known. -message IntHistogramDataPoint { - option deprecated = true; - - // The set of labels that uniquely identify this timeseries. - repeated StringKeyValue labels = 1; - - // start_time_unix_nano is the last time when the aggregation value was reset - // to "zero". For some metric types this is ignored, see data types for more - // details. - // - // The aggregation value is over the time interval (start_time_unix_nano, - // time_unix_nano]. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - // - // Value of 0 indicates that the timestamp is unspecified. In that case the - // timestamp may be decided by the backend. - fixed64 start_time_unix_nano = 2; - - // time_unix_nano is the moment when this aggregation value was reported. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - fixed64 time_unix_nano = 3; - - // count is the number of values in the population. Must be non-negative. This - // value must be equal to the sum of the "count" fields in buckets if a - // histogram is provided. - fixed64 count = 4; - - // sum of the values in the population. If count is zero then this field - // must be zero. This value must be equal to the sum of the "sum" fields in - // buckets if a histogram is provided. - sfixed64 sum = 5; - - // bucket_counts is an optional field contains the count values of histogram - // for each bucket. - // - // The sum of the bucket_counts must equal the value in the count field. - // - // The number of elements in bucket_counts array must be by one greater than - // the number of elements in explicit_bounds array. - repeated fixed64 bucket_counts = 6; - - // explicit_bounds specifies buckets with explicitly defined bounds for values. - // - // This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for - // bucket at index i are: - // - // (-infinity, explicit_bounds[i]] for i == 0 - // (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1 - // (explicit_bounds[i], +infinity) for i == N-1 - // - // The values in the explicit_bounds array must be strictly increasing. - // - // Histogram buckets are inclusive of their upper boundary, except the last - // bucket where the boundary is at infinity. This format is intentionally - // compatible with the OpenMetrics histogram definition. - repeated double explicit_bounds = 7; - - // (Optional) List of exemplars collected from - // measurements that were used to form the data point - repeated IntExemplar exemplars = 8; -} - -// HistogramDataPoint is a single data point in a timeseries that describes the -// time-varying values of a Histogram of double values. A Histogram contains -// summary statistics for a population of values, it may optionally contain the -// distribution of those values across a set of buckets. -// -// If the histogram contains the distribution of values, then both -// "explicit_bounds" and "bucket counts" fields must be defined. -// If the histogram does not contain the distribution of values, then both -// "explicit_bounds" and "bucket_counts" must be omitted and only "count" and -// "sum" are known. -message HistogramDataPoint { - // The set of labels that uniquely identify this timeseries. - repeated StringKeyValue labels = 1; - - // start_time_unix_nano is the last time when the aggregation value was reset - // to "zero". For some metric types this is ignored, see data types for more - // details. - // - // The aggregation value is over the time interval (start_time_unix_nano, - // time_unix_nano]. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - // - // Value of 0 indicates that the timestamp is unspecified. In that case the - // timestamp may be decided by the backend. - fixed64 start_time_unix_nano = 2; - - // time_unix_nano is the moment when this aggregation value was reported. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - fixed64 time_unix_nano = 3; - - // count is the number of values in the population. Must be non-negative. This - // value must be equal to the sum of the "count" fields in buckets if a - // histogram is provided. - fixed64 count = 4; - - // sum of the values in the population. If count is zero then this field - // must be zero. This value must be equal to the sum of the "sum" fields in - // buckets if a histogram is provided. - double sum = 5; - - // bucket_counts is an optional field contains the count values of histogram - // for each bucket. - // - // The sum of the bucket_counts must equal the value in the count field. - // - // The number of elements in bucket_counts array must be by one greater than - // the number of elements in explicit_bounds array. - repeated fixed64 bucket_counts = 6; - - // explicit_bounds specifies buckets with explicitly defined bounds for values. - // - // This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for - // bucket at index i are: - // - // (-infinity, explicit_bounds[i]] for i == 0 - // (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1 - // (explicit_bounds[i], +infinity) for i == N-1 - // - // The values in the explicit_bounds array must be strictly increasing. - // - // Histogram buckets are inclusive of their upper boundary, except the last - // bucket where the boundary is at infinity. This format is intentionally - // compatible with the OpenMetrics histogram definition. - repeated double explicit_bounds = 7; - - // (Optional) List of exemplars collected from - // measurements that were used to form the data point - repeated Exemplar exemplars = 8; -} - -// SummaryDataPoint is a single data point in a timeseries that describes the -// time-varying values of a Summary metric. -message SummaryDataPoint { - // The set of labels that uniquely identify this timeseries. - repeated StringKeyValue labels = 1; - - // start_time_unix_nano is the last time when the aggregation value was reset - // to "zero". For some metric types this is ignored, see data types for more - // details. - // - // The aggregation value is over the time interval (start_time_unix_nano, - // time_unix_nano]. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - // - // Value of 0 indicates that the timestamp is unspecified. In that case the - // timestamp may be decided by the backend. - fixed64 start_time_unix_nano = 2; - - // time_unix_nano is the moment when this aggregation value was reported. - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - fixed64 time_unix_nano = 3; - - // count is the number of values in the population. Must be non-negative. - fixed64 count = 4; - - // sum of the values in the population. If count is zero then this field - // must be zero. - double sum = 5; - - // Represents the value at a given quantile of a distribution. - // - // To record Min and Max values following conventions are used: - // - The 1.0 quantile is equivalent to the maximum value observed. - // - The 0.0 quantile is equivalent to the minimum value observed. - // - // See the following issue for more context: - // https://github.com/open-telemetry/opentelemetry-proto/issues/125 - message ValueAtQuantile { - // The quantile of a distribution. Must be in the interval - // [0.0, 1.0]. - double quantile = 1; - - // The value at the given quantile of a distribution. - double value = 2; - } - - // (Optional) list of values at different quantiles of the distribution calculated - // from the current snapshot. The quantiles must be strictly increasing. - repeated ValueAtQuantile quantile_values = 6; -} - -// A representation of an exemplar, which is a sample input int measurement. -// Exemplars also hold information about the environment when the measurement -// was recorded, for example the span and trace ID of the active span when the -// exemplar was recorded. -message IntExemplar { - option deprecated = true; - - // The set of labels that were filtered out by the aggregator, but recorded - // alongside the original measurement. Only labels that were filtered out - // by the aggregator should be included - repeated StringKeyValue filtered_labels = 1; - - // time_unix_nano is the exact time when this exemplar was recorded - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - fixed64 time_unix_nano = 2; - - // Numerical int value of the measurement that was recorded. - sfixed64 value = 3; - - // (Optional) Span ID of the exemplar trace. - // span_id may be missing if the measurement is not recorded inside a trace - // or if the trace is not sampled. - bytes span_id = 4; - - // (Optional) Trace ID of the exemplar trace. - // trace_id may be missing if the measurement is not recorded inside a trace - // or if the trace is not sampled. - bytes trace_id = 5; -} - -// A representation of an exemplar, which is a sample input measurement. -// Exemplars also hold information about the environment when the measurement -// was recorded, for example the span and trace ID of the active span when the -// exemplar was recorded. -message Exemplar { - // The set of labels that were filtered out by the aggregator, but recorded - // alongside the original measurement. Only labels that were filtered out - // by the aggregator should be included - repeated StringKeyValue filtered_labels = 1; - - // time_unix_nano is the exact time when this exemplar was recorded - // - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - // 1970. - fixed64 time_unix_nano = 2; - - // Numerical value of the measurement that was recorded. An exemplar is - // considered invalid when one of the recognized value fields is not present - // inside this oneof. - oneof value { - double as_double = 3; - sfixed64 as_int = 6; - } - - // (Optional) Span ID of the exemplar trace. - // span_id may be missing if the measurement is not recorded inside a trace - // or if the trace is not sampled. - bytes span_id = 4; - - // (Optional) Trace ID of the exemplar trace. - // trace_id may be missing if the measurement is not recorded inside a trace - // or if the trace is not sampled. - bytes trace_id = 5; -} \ No newline at end of file diff --git a/proto-gen/api_v2/metrics/metricsquery.pb.go b/proto-gen/api_v2/metrics/metricsquery.pb.go deleted file mode 100644 index 6725a182733..00000000000 --- a/proto-gen/api_v2/metrics/metricsquery.pb.go +++ /dev/null @@ -1,2067 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: metricsquery.proto - -package metrics - -import ( - context "context" - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MetricsQueryBaseRequest is the base request parameter accompanying a MetricsQueryService RPC call. -type MetricsQueryBaseRequest struct { - // service_names are the service names to fetch metrics from. - // The results will be grouped by service_name. - // Required. At least one service name must be provided. - ServiceNames []string `protobuf:"bytes,1,rep,name=service_names,json=serviceNames,proto3" json:"service_names,omitempty"` - // groupByOperation determines if the metrics returned should be grouped by operation. - // Optional. Default = false. - GroupByOperation bool `protobuf:"varint,2,opt,name=groupByOperation,proto3" json:"groupByOperation,omitempty"` - // end_time is the ending time of the time series query range. - // Optional. Default = now. - EndTime *time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty"` - // lookback is the duration from the end_time to look back on for metrics data points. - // For example, if set to 1h, the query would span from end_time-1h to end_time. - // Optional. Default = 1h. - Lookback *time.Duration `protobuf:"bytes,4,opt,name=lookback,proto3,stdduration" json:"lookback,omitempty"` - // step size is the duration between data points of the query results. - // For example, if set to 5s, the results would produce a data point every 5 seconds - // from the start_time to end_time. - // Optional. Default = 5s. - Step *time.Duration `protobuf:"bytes,5,opt,name=step,proto3,stdduration" json:"step,omitempty"` - // ratePer is the duration in which the per-second rate of change is calculated for a cumulative counter metric. - // Optional. Default = 10m. - RatePer *time.Duration `protobuf:"bytes,6,opt,name=ratePer,proto3,stdduration" json:"ratePer,omitempty"` - // spanKinds is the list of span kinds to include (logical OR) in the resulting metrics aggregation. - // Optional. Default = [SPAN_KIND_SERVER]. - SpanKinds []SpanKind `protobuf:"varint,7,rep,packed,name=spanKinds,proto3,enum=jaeger.api_v2.metrics.SpanKind" json:"spanKinds,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricsQueryBaseRequest) Reset() { *m = MetricsQueryBaseRequest{} } -func (m *MetricsQueryBaseRequest) String() string { return proto.CompactTextString(m) } -func (*MetricsQueryBaseRequest) ProtoMessage() {} -func (*MetricsQueryBaseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_212ad953da609219, []int{0} -} -func (m *MetricsQueryBaseRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricsQueryBaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricsQueryBaseRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MetricsQueryBaseRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricsQueryBaseRequest.Merge(m, src) -} -func (m *MetricsQueryBaseRequest) XXX_Size() int { - return m.Size() -} -func (m *MetricsQueryBaseRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MetricsQueryBaseRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricsQueryBaseRequest proto.InternalMessageInfo - -func (m *MetricsQueryBaseRequest) GetServiceNames() []string { - if m != nil { - return m.ServiceNames - } - return nil -} - -func (m *MetricsQueryBaseRequest) GetGroupByOperation() bool { - if m != nil { - return m.GroupByOperation - } - return false -} - -func (m *MetricsQueryBaseRequest) GetEndTime() *time.Time { - if m != nil { - return m.EndTime - } - return nil -} - -func (m *MetricsQueryBaseRequest) GetLookback() *time.Duration { - if m != nil { - return m.Lookback - } - return nil -} - -func (m *MetricsQueryBaseRequest) GetStep() *time.Duration { - if m != nil { - return m.Step - } - return nil -} - -func (m *MetricsQueryBaseRequest) GetRatePer() *time.Duration { - if m != nil { - return m.RatePer - } - return nil -} - -func (m *MetricsQueryBaseRequest) GetSpanKinds() []SpanKind { - if m != nil { - return m.SpanKinds - } - return nil -} - -// GetLatenciesRequest contains parameters for the GetLatencies RPC call. -type GetLatenciesRequest struct { - BaseRequest *MetricsQueryBaseRequest `protobuf:"bytes,1,opt,name=baseRequest,proto3" json:"baseRequest,omitempty"` - // quantile is the quantile to compute from latency histogram metrics. - // Valid range: (0, 1] - // - // e.g. 0.99 will return the 99th percentile or P99 which is the worst latency - // observed from 99% of all spans for the given service (and operation). - // - // Required. - Quantile float64 `protobuf:"fixed64,2,opt,name=quantile,proto3" json:"quantile,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetLatenciesRequest) Reset() { *m = GetLatenciesRequest{} } -func (m *GetLatenciesRequest) String() string { return proto.CompactTextString(m) } -func (*GetLatenciesRequest) ProtoMessage() {} -func (*GetLatenciesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_212ad953da609219, []int{1} -} -func (m *GetLatenciesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetLatenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetLatenciesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetLatenciesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetLatenciesRequest.Merge(m, src) -} -func (m *GetLatenciesRequest) XXX_Size() int { - return m.Size() -} -func (m *GetLatenciesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetLatenciesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetLatenciesRequest proto.InternalMessageInfo - -func (m *GetLatenciesRequest) GetBaseRequest() *MetricsQueryBaseRequest { - if m != nil { - return m.BaseRequest - } - return nil -} - -func (m *GetLatenciesRequest) GetQuantile() float64 { - if m != nil { - return m.Quantile - } - return 0 -} - -// GetCallRatesRequest contains parameters for the GetCallRates RPC call. -type GetCallRatesRequest struct { - BaseRequest *MetricsQueryBaseRequest `protobuf:"bytes,1,opt,name=baseRequest,proto3" json:"baseRequest,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetCallRatesRequest) Reset() { *m = GetCallRatesRequest{} } -func (m *GetCallRatesRequest) String() string { return proto.CompactTextString(m) } -func (*GetCallRatesRequest) ProtoMessage() {} -func (*GetCallRatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_212ad953da609219, []int{2} -} -func (m *GetCallRatesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetCallRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetCallRatesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetCallRatesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCallRatesRequest.Merge(m, src) -} -func (m *GetCallRatesRequest) XXX_Size() int { - return m.Size() -} -func (m *GetCallRatesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetCallRatesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCallRatesRequest proto.InternalMessageInfo - -func (m *GetCallRatesRequest) GetBaseRequest() *MetricsQueryBaseRequest { - if m != nil { - return m.BaseRequest - } - return nil -} - -// GetErrorRatesRequest contains parameters for the GetErrorRates RPC call. -type GetErrorRatesRequest struct { - BaseRequest *MetricsQueryBaseRequest `protobuf:"bytes,1,opt,name=baseRequest,proto3" json:"baseRequest,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetErrorRatesRequest) Reset() { *m = GetErrorRatesRequest{} } -func (m *GetErrorRatesRequest) String() string { return proto.CompactTextString(m) } -func (*GetErrorRatesRequest) ProtoMessage() {} -func (*GetErrorRatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_212ad953da609219, []int{3} -} -func (m *GetErrorRatesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetErrorRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetErrorRatesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetErrorRatesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetErrorRatesRequest.Merge(m, src) -} -func (m *GetErrorRatesRequest) XXX_Size() int { - return m.Size() -} -func (m *GetErrorRatesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetErrorRatesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetErrorRatesRequest proto.InternalMessageInfo - -func (m *GetErrorRatesRequest) GetBaseRequest() *MetricsQueryBaseRequest { - if m != nil { - return m.BaseRequest - } - return nil -} - -type GetMinStepDurationRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetMinStepDurationRequest) Reset() { *m = GetMinStepDurationRequest{} } -func (m *GetMinStepDurationRequest) String() string { return proto.CompactTextString(m) } -func (*GetMinStepDurationRequest) ProtoMessage() {} -func (*GetMinStepDurationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_212ad953da609219, []int{4} -} -func (m *GetMinStepDurationRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetMinStepDurationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetMinStepDurationRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetMinStepDurationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMinStepDurationRequest.Merge(m, src) -} -func (m *GetMinStepDurationRequest) XXX_Size() int { - return m.Size() -} -func (m *GetMinStepDurationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetMinStepDurationRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetMinStepDurationRequest proto.InternalMessageInfo - -type GetMinStepDurationResponse struct { - MinStep time.Duration `protobuf:"bytes,1,opt,name=minStep,proto3,stdduration" json:"minStep"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetMinStepDurationResponse) Reset() { *m = GetMinStepDurationResponse{} } -func (m *GetMinStepDurationResponse) String() string { return proto.CompactTextString(m) } -func (*GetMinStepDurationResponse) ProtoMessage() {} -func (*GetMinStepDurationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_212ad953da609219, []int{5} -} -func (m *GetMinStepDurationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetMinStepDurationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetMinStepDurationResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetMinStepDurationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMinStepDurationResponse.Merge(m, src) -} -func (m *GetMinStepDurationResponse) XXX_Size() int { - return m.Size() -} -func (m *GetMinStepDurationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetMinStepDurationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetMinStepDurationResponse proto.InternalMessageInfo - -func (m *GetMinStepDurationResponse) GetMinStep() time.Duration { - if m != nil { - return m.MinStep - } - return 0 -} - -type GetMetricsResponse struct { - Metrics MetricFamily `protobuf:"bytes,1,opt,name=metrics,proto3" json:"metrics"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetMetricsResponse) Reset() { *m = GetMetricsResponse{} } -func (m *GetMetricsResponse) String() string { return proto.CompactTextString(m) } -func (*GetMetricsResponse) ProtoMessage() {} -func (*GetMetricsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_212ad953da609219, []int{6} -} -func (m *GetMetricsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetMetricsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetMetricsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetMetricsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMetricsResponse.Merge(m, src) -} -func (m *GetMetricsResponse) XXX_Size() int { - return m.Size() -} -func (m *GetMetricsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetMetricsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetMetricsResponse proto.InternalMessageInfo - -func (m *GetMetricsResponse) GetMetrics() MetricFamily { - if m != nil { - return m.Metrics - } - return MetricFamily{} -} - -func init() { - proto.RegisterType((*MetricsQueryBaseRequest)(nil), "jaeger.api_v2.metrics.MetricsQueryBaseRequest") - proto.RegisterType((*GetLatenciesRequest)(nil), "jaeger.api_v2.metrics.GetLatenciesRequest") - proto.RegisterType((*GetCallRatesRequest)(nil), "jaeger.api_v2.metrics.GetCallRatesRequest") - proto.RegisterType((*GetErrorRatesRequest)(nil), "jaeger.api_v2.metrics.GetErrorRatesRequest") - proto.RegisterType((*GetMinStepDurationRequest)(nil), "jaeger.api_v2.metrics.GetMinStepDurationRequest") - proto.RegisterType((*GetMinStepDurationResponse)(nil), "jaeger.api_v2.metrics.GetMinStepDurationResponse") - proto.RegisterType((*GetMetricsResponse)(nil), "jaeger.api_v2.metrics.GetMetricsResponse") -} - -func init() { proto.RegisterFile("metricsquery.proto", fileDescriptor_212ad953da609219) } - -var fileDescriptor_212ad953da609219 = []byte{ - // 593 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x4f, 0x6f, 0xd3, 0x3c, - 0x18, 0x7f, 0xf3, 0x76, 0xac, 0x9d, 0xb7, 0x21, 0xf0, 0x86, 0xc8, 0x82, 0xd4, 0x56, 0xdd, 0xa5, - 0x0c, 0x29, 0x83, 0x22, 0xc1, 0x69, 0x42, 0xea, 0x80, 0x1e, 0x60, 0x30, 0x52, 0x2e, 0xc0, 0xa1, - 0x72, 0xdb, 0x87, 0x60, 0x9a, 0xd8, 0xa9, 0xed, 0x4c, 0xea, 0x99, 0x2f, 0xc0, 0x91, 0x3b, 0x1f, - 0x86, 0x1d, 0xf9, 0x04, 0x80, 0xfa, 0x49, 0x50, 0x62, 0xa7, 0xeb, 0xda, 0xa5, 0xac, 0x87, 0xdd, - 0xe2, 0xc7, 0xcf, 0xef, 0xcf, 0xe3, 0xe7, 0x17, 0x84, 0x43, 0x50, 0x82, 0xf6, 0xe4, 0x30, 0x06, - 0x31, 0x72, 0x23, 0xc1, 0x15, 0xc7, 0xb7, 0x3e, 0x13, 0xf0, 0x41, 0xb8, 0x24, 0xa2, 0x9d, 0x93, - 0x86, 0x6b, 0x3a, 0x9c, 0x9b, 0x3c, 0x02, 0x66, 0x0e, 0xba, 0xd3, 0xc1, 0x5c, 0x41, 0x20, 0x23, - 0xc2, 0x06, 0x94, 0xf5, 0x4d, 0x6d, 0xdb, 0xe7, 0x3e, 0x4f, 0x3f, 0xf7, 0x93, 0x2f, 0x53, 0xad, - 0xf8, 0x9c, 0xfb, 0x01, 0xec, 0xa7, 0xa7, 0x6e, 0xfc, 0x71, 0x5f, 0xd1, 0x10, 0xa4, 0x22, 0x61, - 0x64, 0x1a, 0xca, 0xb3, 0x0d, 0xfd, 0x58, 0x10, 0x45, 0x39, 0xd3, 0xf7, 0xb5, 0xef, 0x05, 0x74, - 0xfb, 0x48, 0x8b, 0xbf, 0x49, 0xbc, 0x36, 0x89, 0x04, 0x0f, 0x86, 0x31, 0x48, 0x85, 0x77, 0xd1, - 0xa6, 0x04, 0x71, 0x42, 0x7b, 0xd0, 0x61, 0x24, 0x04, 0x69, 0x5b, 0xd5, 0x42, 0x7d, 0xcd, 0xdb, - 0x30, 0xc5, 0x57, 0x49, 0x0d, 0xef, 0xa1, 0x1b, 0xbe, 0xe0, 0x71, 0xd4, 0x1c, 0xbd, 0x8e, 0x40, - 0x53, 0xdb, 0xff, 0x57, 0xad, 0x7a, 0xc9, 0x9b, 0xab, 0xe3, 0x27, 0xa8, 0x04, 0xac, 0xdf, 0x49, - 0x3c, 0xda, 0x85, 0xaa, 0x55, 0x5f, 0x6f, 0x38, 0xae, 0xf6, 0xe7, 0x66, 0xfe, 0xdc, 0xb7, 0xd9, - 0x00, 0xcd, 0xd2, 0xe9, 0xaf, 0x8a, 0xf5, 0xf5, 0x77, 0xc5, 0xf2, 0x8a, 0xc0, 0xfa, 0x49, 0x3d, - 0x21, 0x08, 0x38, 0x1f, 0x74, 0x49, 0x6f, 0x60, 0xaf, 0xa4, 0x04, 0x3b, 0x73, 0x04, 0x4f, 0xcd, - 0x80, 0x1a, 0xff, 0x2d, 0xc1, 0x4f, 0x40, 0xf8, 0x31, 0x5a, 0x91, 0x0a, 0x22, 0xfb, 0xda, 0xe5, - 0xc1, 0x29, 0x00, 0x1f, 0xa0, 0xa2, 0x20, 0x0a, 0x8e, 0x41, 0xd8, 0xab, 0x97, 0xc7, 0x66, 0x18, - 0x7c, 0x80, 0xd6, 0x92, 0x7d, 0xbe, 0xa0, 0xac, 0x2f, 0xed, 0x62, 0xb5, 0x50, 0xbf, 0xde, 0xa8, - 0xb8, 0x17, 0xe6, 0xc1, 0x6d, 0x9b, 0x3e, 0xef, 0x0c, 0x51, 0xfb, 0x62, 0xa1, 0xad, 0x16, 0xa8, - 0x97, 0x44, 0x01, 0xeb, 0x51, 0x90, 0xd9, 0x86, 0x8e, 0xd1, 0x7a, 0xf7, 0x6c, 0x61, 0xb6, 0x95, - 0x3a, 0x73, 0x73, 0x88, 0x73, 0xd6, 0xec, 0x4d, 0x53, 0x60, 0x07, 0x95, 0x86, 0x31, 0x61, 0x8a, - 0x06, 0x90, 0xae, 0xd1, 0xf2, 0x26, 0xe7, 0x9a, 0x9f, 0x9a, 0x38, 0x24, 0x41, 0xe0, 0x11, 0x75, - 0x85, 0x26, 0x6a, 0x9f, 0xd0, 0x76, 0x0b, 0xd4, 0x33, 0x21, 0xb8, 0xb8, 0x62, 0xa5, 0x3b, 0x68, - 0xa7, 0x05, 0xea, 0x88, 0xb2, 0xb6, 0x82, 0x28, 0x5b, 0x60, 0x76, 0xf9, 0x01, 0x39, 0x17, 0x5d, - 0xca, 0x88, 0x33, 0x09, 0x49, 0x22, 0x42, 0x7d, 0x65, 0x8c, 0xfc, 0x23, 0x11, 0xff, 0xe9, 0x44, - 0x18, 0x4c, 0xed, 0x1d, 0xc2, 0x09, 0xb9, 0x36, 0x39, 0x21, 0x3d, 0x44, 0x45, 0xe3, 0xdf, 0x90, - 0xee, 0x2e, 0x9c, 0xee, 0x39, 0x09, 0x69, 0x30, 0x6a, 0xae, 0x24, 0xf4, 0x5e, 0x86, 0x6c, 0xfc, - 0x28, 0xa0, 0xad, 0xe9, 0xe9, 0xdb, 0xfa, 0x7f, 0xc5, 0x23, 0x2d, 0x79, 0x7e, 0x1e, 0x7c, 0x3f, - 0x47, 0x21, 0xf7, 0x5d, 0x9c, 0x07, 0x4b, 0x20, 0xcc, 0x5c, 0x80, 0x36, 0xa6, 0xf3, 0x8b, 0xf7, - 0xf2, 0x29, 0x66, 0x43, 0xee, 0xdc, 0x5d, 0x20, 0x37, 0xf3, 0x7c, 0x5a, 0x66, 0x92, 0xd0, 0x45, - 0x32, 0xb3, 0x31, 0x5e, 0x46, 0xc6, 0x47, 0x9b, 0xe7, 0xf2, 0x89, 0xef, 0xe5, 0x63, 0xe7, 0x52, - 0xbc, 0x84, 0x50, 0xf3, 0xd1, 0xe9, 0xb8, 0x6c, 0xfd, 0x1c, 0x97, 0xad, 0x3f, 0xe3, 0xb2, 0x85, - 0x2a, 0x94, 0x1b, 0xa8, 0x12, 0xa4, 0x47, 0x99, 0x3f, 0xc3, 0xf0, 0x3e, 0x4b, 0x40, 0x77, 0x35, - 0x8d, 0xe0, 0xc3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x22, 0x5c, 0x1d, 0xae, 0x87, 0x06, 0x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MetricsQueryServiceClient is the client API for MetricsQueryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetricsQueryServiceClient interface { - // GetMinStepDuration gets the min time resolution supported by the backing metrics store, - // e.g. 10s means the backend can only return data points that are at least 10s apart, not closer. - GetMinStepDuration(ctx context.Context, in *GetMinStepDurationRequest, opts ...grpc.CallOption) (*GetMinStepDurationResponse, error) - // GetLatencies gets the latency metrics for a given list of services grouped by service - // and optionally grouped by operation. - GetLatencies(ctx context.Context, in *GetLatenciesRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) - // GetCallRates gets the call rate metrics for a given list of services grouped by service - // and optionally grouped by operation. - GetCallRates(ctx context.Context, in *GetCallRatesRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) - // GetErrorRates gets the error rate metrics for a given list of services grouped by service - // and optionally grouped by operation. - GetErrorRates(ctx context.Context, in *GetErrorRatesRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) -} - -type metricsQueryServiceClient struct { - cc *grpc.ClientConn -} - -func NewMetricsQueryServiceClient(cc *grpc.ClientConn) MetricsQueryServiceClient { - return &metricsQueryServiceClient{cc} -} - -func (c *metricsQueryServiceClient) GetMinStepDuration(ctx context.Context, in *GetMinStepDurationRequest, opts ...grpc.CallOption) (*GetMinStepDurationResponse, error) { - out := new(GetMinStepDurationResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.metrics.MetricsQueryService/GetMinStepDuration", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricsQueryServiceClient) GetLatencies(ctx context.Context, in *GetLatenciesRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) { - out := new(GetMetricsResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.metrics.MetricsQueryService/GetLatencies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricsQueryServiceClient) GetCallRates(ctx context.Context, in *GetCallRatesRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) { - out := new(GetMetricsResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.metrics.MetricsQueryService/GetCallRates", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricsQueryServiceClient) GetErrorRates(ctx context.Context, in *GetErrorRatesRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) { - out := new(GetMetricsResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.metrics.MetricsQueryService/GetErrorRates", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MetricsQueryServiceServer is the server API for MetricsQueryService service. -type MetricsQueryServiceServer interface { - // GetMinStepDuration gets the min time resolution supported by the backing metrics store, - // e.g. 10s means the backend can only return data points that are at least 10s apart, not closer. - GetMinStepDuration(context.Context, *GetMinStepDurationRequest) (*GetMinStepDurationResponse, error) - // GetLatencies gets the latency metrics for a given list of services grouped by service - // and optionally grouped by operation. - GetLatencies(context.Context, *GetLatenciesRequest) (*GetMetricsResponse, error) - // GetCallRates gets the call rate metrics for a given list of services grouped by service - // and optionally grouped by operation. - GetCallRates(context.Context, *GetCallRatesRequest) (*GetMetricsResponse, error) - // GetErrorRates gets the error rate metrics for a given list of services grouped by service - // and optionally grouped by operation. - GetErrorRates(context.Context, *GetErrorRatesRequest) (*GetMetricsResponse, error) -} - -// UnimplementedMetricsQueryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedMetricsQueryServiceServer struct { -} - -func (*UnimplementedMetricsQueryServiceServer) GetMinStepDuration(ctx context.Context, req *GetMinStepDurationRequest) (*GetMinStepDurationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMinStepDuration not implemented") -} -func (*UnimplementedMetricsQueryServiceServer) GetLatencies(ctx context.Context, req *GetLatenciesRequest) (*GetMetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatencies not implemented") -} -func (*UnimplementedMetricsQueryServiceServer) GetCallRates(ctx context.Context, req *GetCallRatesRequest) (*GetMetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCallRates not implemented") -} -func (*UnimplementedMetricsQueryServiceServer) GetErrorRates(ctx context.Context, req *GetErrorRatesRequest) (*GetMetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetErrorRates not implemented") -} - -func RegisterMetricsQueryServiceServer(s *grpc.Server, srv MetricsQueryServiceServer) { - s.RegisterService(&_MetricsQueryService_serviceDesc, srv) -} - -func _MetricsQueryService_GetMinStepDuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMinStepDurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricsQueryServiceServer).GetMinStepDuration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.metrics.MetricsQueryService/GetMinStepDuration", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricsQueryServiceServer).GetMinStepDuration(ctx, req.(*GetMinStepDurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricsQueryService_GetLatencies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLatenciesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricsQueryServiceServer).GetLatencies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.metrics.MetricsQueryService/GetLatencies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricsQueryServiceServer).GetLatencies(ctx, req.(*GetLatenciesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricsQueryService_GetCallRates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCallRatesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricsQueryServiceServer).GetCallRates(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.metrics.MetricsQueryService/GetCallRates", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricsQueryServiceServer).GetCallRates(ctx, req.(*GetCallRatesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricsQueryService_GetErrorRates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetErrorRatesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricsQueryServiceServer).GetErrorRates(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.metrics.MetricsQueryService/GetErrorRates", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricsQueryServiceServer).GetErrorRates(ctx, req.(*GetErrorRatesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _MetricsQueryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "jaeger.api_v2.metrics.MetricsQueryService", - HandlerType: (*MetricsQueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetMinStepDuration", - Handler: _MetricsQueryService_GetMinStepDuration_Handler, - }, - { - MethodName: "GetLatencies", - Handler: _MetricsQueryService_GetLatencies_Handler, - }, - { - MethodName: "GetCallRates", - Handler: _MetricsQueryService_GetCallRates_Handler, - }, - { - MethodName: "GetErrorRates", - Handler: _MetricsQueryService_GetErrorRates_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "metricsquery.proto", -} - -func (m *MetricsQueryBaseRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MetricsQueryBaseRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricsQueryBaseRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.SpanKinds) > 0 { - dAtA2 := make([]byte, len(m.SpanKinds)*10) - var j1 int - for _, num := range m.SpanKinds { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintMetricsquery(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x3a - } - if m.RatePer != nil { - n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.RatePer, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.RatePer):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintMetricsquery(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x32 - } - if m.Step != nil { - n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Step, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Step):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintMetricsquery(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x2a - } - if m.Lookback != nil { - n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Lookback, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Lookback):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintMetricsquery(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x22 - } - if m.EndTime != nil { - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintMetricsquery(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x1a - } - if m.GroupByOperation { - i-- - if m.GroupByOperation { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.ServiceNames) > 0 { - for iNdEx := len(m.ServiceNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ServiceNames[iNdEx]) - copy(dAtA[i:], m.ServiceNames[iNdEx]) - i = encodeVarintMetricsquery(dAtA, i, uint64(len(m.ServiceNames[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *GetLatenciesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetLatenciesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetLatenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Quantile != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantile)))) - i-- - dAtA[i] = 0x11 - } - if m.BaseRequest != nil { - { - size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetricsquery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetCallRatesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetCallRatesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetCallRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.BaseRequest != nil { - { - size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetricsquery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetErrorRatesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetErrorRatesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetErrorRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.BaseRequest != nil { - { - size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetricsquery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetMinStepDurationRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetMinStepDurationRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetMinStepDurationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *GetMinStepDurationResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetMinStepDurationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetMinStepDurationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MinStep, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MinStep):]) - if err10 != nil { - return 0, err10 - } - i -= n10 - i = encodeVarintMetricsquery(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *GetMetricsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetMetricsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetMetricsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - { - size, err := m.Metrics.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetricsquery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintMetricsquery(dAtA []byte, offset int, v uint64) int { - offset -= sovMetricsquery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MetricsQueryBaseRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ServiceNames) > 0 { - for _, s := range m.ServiceNames { - l = len(s) - n += 1 + l + sovMetricsquery(uint64(l)) - } - } - if m.GroupByOperation { - n += 2 - } - if m.EndTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime) - n += 1 + l + sovMetricsquery(uint64(l)) - } - if m.Lookback != nil { - l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Lookback) - n += 1 + l + sovMetricsquery(uint64(l)) - } - if m.Step != nil { - l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Step) - n += 1 + l + sovMetricsquery(uint64(l)) - } - if m.RatePer != nil { - l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.RatePer) - n += 1 + l + sovMetricsquery(uint64(l)) - } - if len(m.SpanKinds) > 0 { - l = 0 - for _, e := range m.SpanKinds { - l += sovMetricsquery(uint64(e)) - } - n += 1 + sovMetricsquery(uint64(l)) + l - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetLatenciesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseRequest != nil { - l = m.BaseRequest.Size() - n += 1 + l + sovMetricsquery(uint64(l)) - } - if m.Quantile != 0 { - n += 9 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetCallRatesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseRequest != nil { - l = m.BaseRequest.Size() - n += 1 + l + sovMetricsquery(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetErrorRatesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseRequest != nil { - l = m.BaseRequest.Size() - n += 1 + l + sovMetricsquery(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetMinStepDurationRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetMinStepDurationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MinStep) - n += 1 + l + sovMetricsquery(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetMetricsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Metrics.Size() - n += 1 + l + sovMetricsquery(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovMetricsquery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMetricsquery(x uint64) (n int) { - return sovMetricsquery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MetricsQueryBaseRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricsQueryBaseRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricsQueryBaseRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceNames = append(m.ServiceNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupByOperation", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.GroupByOperation = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EndTime == nil { - m.EndTime = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Lookback", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Lookback == nil { - m.Lookback = new(time.Duration) - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.Lookback, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Step == nil { - m.Step = new(time.Duration) - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.Step, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RatePer", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RatePer == nil { - m.RatePer = new(time.Duration) - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(m.RatePer, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType == 0 { - var v SpanKind - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= SpanKind(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SpanKinds = append(m.SpanKinds, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.SpanKinds) == 0 { - m.SpanKinds = make([]SpanKind, 0, elementCount) - } - for iNdEx < postIndex { - var v SpanKind - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= SpanKind(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SpanKinds = append(m.SpanKinds, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field SpanKinds", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipMetricsquery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetLatenciesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetLatenciesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetLatenciesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BaseRequest == nil { - m.BaseRequest = &MetricsQueryBaseRequest{} - } - if err := m.BaseRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Quantile", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Quantile = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipMetricsquery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCallRatesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetCallRatesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCallRatesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BaseRequest == nil { - m.BaseRequest = &MetricsQueryBaseRequest{} - } - if err := m.BaseRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetricsquery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetErrorRatesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetErrorRatesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetErrorRatesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BaseRequest == nil { - m.BaseRequest = &MetricsQueryBaseRequest{} - } - if err := m.BaseRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetricsquery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetMinStepDurationRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetMinStepDurationRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetMinStepDurationRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipMetricsquery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetMinStepDurationResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetMinStepDurationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetMinStepDurationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStep", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MinStep, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetricsquery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetMetricsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetMetricsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetMetricsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricsquery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricsquery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Metrics.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetricsquery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMetricsquery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMetricsquery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMetricsquery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMetricsquery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMetricsquery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMetricsquery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMetricsquery = fmt.Errorf("proto: unexpected end of group") -)