From a5974e10da0901ceddb882b1bb65bd5e92d41bf0 Mon Sep 17 00:00:00 2001 From: Loc Mai Date: Wed, 27 Jul 2022 00:21:03 +0700 Subject: [PATCH 01/87] [ingester/fix] Apply sanitizers to avoid panic on span.process=nil (#3819) --- cmd/ingester/app/processor/span_processor.go | 6 +++- .../app/processor/span_processor_test.go | 30 ++++++++++++------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/cmd/ingester/app/processor/span_processor.go b/cmd/ingester/app/processor/span_processor.go index ad1c8aa7479..4817103384b 100644 --- a/cmd/ingester/app/processor/span_processor.go +++ b/cmd/ingester/app/processor/span_processor.go @@ -19,6 +19,7 @@ import ( "fmt" "io" + "github.com/jaegertracing/jaeger/cmd/collector/app/sanitizer" "github.com/jaegertracing/jaeger/plugin/storage/kafka" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -45,6 +46,7 @@ type SpanProcessorParams struct { // KafkaSpanProcessor implements SpanProcessor for Kafka messages type KafkaSpanProcessor struct { unmarshaller kafka.Unmarshaller + sanitizer sanitizer.SanitizeSpan writer spanstore.Writer io.Closer } @@ -54,6 +56,7 @@ func NewSpanProcessor(params SpanProcessorParams) *KafkaSpanProcessor { return &KafkaSpanProcessor{ unmarshaller: params.Unmarshaller, writer: params.Writer, + sanitizer: sanitizer.NewChainedSanitizer(sanitizer.NewStandardSanitizers()...), } } @@ -63,6 +66,7 @@ func (s KafkaSpanProcessor) Process(message Message) error { if err != nil { return fmt.Errorf("cannot unmarshall byte array into span: %w", err) } + // TODO context should be propagated from upstream components - return s.writer.WriteSpan(context.TODO(), span) + return s.writer.WriteSpan(context.TODO(), s.sanitizer(span)) } diff --git a/cmd/ingester/app/processor/span_processor_test.go b/cmd/ingester/app/processor/span_processor_test.go index 0fae62e278f..5df0159b7a6 100644 --- a/cmd/ingester/app/processor/span_processor_test.go +++ b/cmd/ingester/app/processor/span_processor_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" cmocks "github.com/jaegertracing/jaeger/cmd/ingester/app/consumer/mocks" "github.com/jaegertracing/jaeger/model" @@ -33,25 +34,32 @@ func TestNewSpanProcessor(t *testing.T) { } func TestSpanProcessor_Process(t *testing.T) { - writer := &smocks.Writer{} - unmarshallerMock := &umocks.Unmarshaller{} - processor := &KafkaSpanProcessor{ - unmarshaller: unmarshallerMock, - writer: writer, - } + mockUnmarshaller := &umocks.Unmarshaller{} + mockWriter := &smocks.Writer{} + processor := NewSpanProcessor(SpanProcessorParams{ + Unmarshaller: mockUnmarshaller, + Writer: mockWriter, + }) message := &cmocks.Message{} - data := []byte("police") - span := &model.Span{} + data := []byte("irrelevant, mock unmarshaller should return the span") + span := &model.Span{ + Process: nil, // we want to make sure sanitizers will fix this data issue. + } message.On("Value").Return(data) - unmarshallerMock.On("Unmarshal", data).Return(span, nil) - writer.On("WriteSpan", context.Background(), span).Return(nil) + mockUnmarshaller.On("Unmarshal", data).Return(span, nil) + mockWriter.On("WriteSpan", context.Background(), span). + Return(nil). + Run(func(args mock.Arguments) { + span := args[1].(*model.Span) + assert.NotNil(t, span.Process, "sanitizer must fix Process=nil data issue") + }) assert.Nil(t, processor.Process(message)) message.AssertExpectations(t) - writer.AssertExpectations(t) + mockWriter.AssertExpectations(t) } func TestSpanProcessor_ProcessError(t *testing.T) { From 14e54d3a07f5db4c74209f14444db485334298af Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 28 Jul 2022 11:31:27 -0400 Subject: [PATCH 02/87] Add README and docker-compose for tracegen Signed-off-by: Yuri Shkuro --- cmd/tracegen/README.md | 19 +++++++++++++++++++ cmd/tracegen/docker-compose.yml | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 cmd/tracegen/README.md create mode 100644 cmd/tracegen/docker-compose.yml diff --git a/cmd/tracegen/README.md b/cmd/tracegen/README.md new file mode 100644 index 00000000000..906641115e4 --- /dev/null +++ b/cmd/tracegen/README.md @@ -0,0 +1,19 @@ +# tracegen + +`tracegen` is a utility that can generate a steady flow of simple traces useful for performance tuning. +Traces are produced concurrently from one or more worker goroutines. Run with `-h` to see all cli flags. + +The binary is available from the Releases page, as well as a Docker image: + +```sh +$ docker run jaegertracing/jaeger-tracegen -service abcd -traces 10 +``` + +Notice, however, that by default the generator uses the UDP exporter of `jaeger-client-go`, +which sends data to `localhost`, i.e. inside the networking namespace of the container itself, +which obviously doesn't go anywhere. You can use the environment variables supported by +[jaeger-client-go][env] to instruct the SDK where to send the data. + +See example in the included [docker-compose](./docker-compose.yml) file. + +[env]: https://github.com/jaegertracing/jaeger-client-go#environment-variables diff --git a/cmd/tracegen/docker-compose.yml b/cmd/tracegen/docker-compose.yml new file mode 100644 index 00000000000..c43220e573b --- /dev/null +++ b/cmd/tracegen/docker-compose.yml @@ -0,0 +1,16 @@ +version: '2' + +services: + jaeger: + image: jaegertracing/all-in-one:latest + ports: + - '16686:16686' + + tracegen: + image: jaegertracing/jaeger-tracegen:latest + environment: + - JAEGER_AGENT_HOST=jaeger + - JAEGER_AGENT_PORT=6831 + command: ["-duration", "10s", "-workers", "3", "-pause", "250ms"] + depends_on: + - jaeger From 32742d15d2028b92bdd072e6349675f0ef7211ee Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 28 Jul 2022 15:45:03 -0400 Subject: [PATCH 03/87] Indicate how to use HTTP Signed-off-by: Yuri Shkuro --- cmd/tracegen/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tracegen/README.md b/cmd/tracegen/README.md index 906641115e4..b9e8af7466c 100644 --- a/cmd/tracegen/README.md +++ b/cmd/tracegen/README.md @@ -12,7 +12,8 @@ $ docker run jaegertracing/jaeger-tracegen -service abcd -traces 10 Notice, however, that by default the generator uses the UDP exporter of `jaeger-client-go`, which sends data to `localhost`, i.e. inside the networking namespace of the container itself, which obviously doesn't go anywhere. You can use the environment variables supported by -[jaeger-client-go][env] to instruct the SDK where to send the data. +[jaeger-client-go][env] to instruct the SDK where to send the data, for example to switch +to HTTP by setting `JAEGER_ENDPOINT`. See example in the included [docker-compose](./docker-compose.yml) file. From faf4bc976255b9a89622037b35be3a14e604b1b0 Mon Sep 17 00:00:00 2001 From: Adhithya Srinivasan Date: Sun, 31 Jul 2022 22:01:57 +0530 Subject: [PATCH 04/87] Added windows zip file generation (#3817) --- scripts/package-deploy.sh | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/scripts/package-deploy.sh b/scripts/package-deploy.sh index 122122067df..55de936719e 100755 --- a/scripts/package-deploy.sh +++ b/scripts/package-deploy.sh @@ -31,18 +31,26 @@ function stage-platform-files { # package pulls built files for the platform ($1). If you pass in a file # extension ($2) it will be used on the binaries function package { - local PLATFORM=$1 - local FILE_EXTENSION=$2 + + local COMPRESSION=$1 + local PLATFORM=$2 + local FILE_EXTENSION=$3 # script start local PACKAGE_STAGING_DIR=jaeger-$VERSION-$PLATFORM mkdir $PACKAGE_STAGING_DIR stage-platform-files $PLATFORM $PACKAGE_STAGING_DIR $FILE_EXTENSION - - local ARCHIVE_NAME="$PACKAGE_STAGING_DIR.tar.gz" - echo "Packaging into $ARCHIVE_NAME:" - tar -czvf ./deploy/$ARCHIVE_NAME $PACKAGE_STAGING_DIR + if [ "$COMPRESSION" == "zip" ] + then + local ARCHIVE_NAME="$PACKAGE_STAGING_DIR.zip" + echo "Packaging into $ARCHIVE_NAME:" + zip -r ./deploy/$ARCHIVE_NAME $PACKAGE_STAGING_DIR + else + local ARCHIVE_NAME="$PACKAGE_STAGING_DIR.tar.gz" + echo "Packaging into $ARCHIVE_NAME:" + tar -czvf ./deploy/$ARCHIVE_NAME $PACKAGE_STAGING_DIR + fi rm -rf $PACKAGE_STAGING_DIR } @@ -57,10 +65,10 @@ rm -rf deploy $DEPLOY_STAGING_DIR mkdir deploy mkdir $DEPLOY_STAGING_DIR -package linux-amd64 -package darwin-amd64 -package darwin-arm64 -package windows-amd64 .exe -package linux-s390x -package linux-arm64 -package linux-ppc64le +package tar linux-amd64 +package tar darwin-amd64 +package tar darwin-arm64 +package zip windows-amd64 .exe +package tar linux-s390x +package tar linux-arm64 +package tar linux-ppc64le From 97feed991c2c9688a0defc625dbbb4f367d48bdc Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 31 Jul 2022 21:16:32 -0400 Subject: [PATCH 05/87] Refactor gRPC storage plugin for better composability (#3833) --- plugin/storage/grpc/memory/plugin.go | 7 + plugin/storage/grpc/shared/grpc_handler.go | 300 ++++++++++++++++++ ...pc_server_test.go => grpc_handler_test.go} | 49 ++- plugin/storage/grpc/shared/grpc_server.go | 237 -------------- plugin/storage/grpc/shared/plugin.go | 22 +- 5 files changed, 348 insertions(+), 267 deletions(-) create mode 100644 plugin/storage/grpc/shared/grpc_handler.go rename plugin/storage/grpc/shared/{grpc_server_test.go => grpc_handler_test.go} (90%) delete mode 100644 plugin/storage/grpc/shared/grpc_server.go diff --git a/plugin/storage/grpc/memory/plugin.go b/plugin/storage/grpc/memory/plugin.go index b0d3b5c9e0e..bda596e9684 100644 --- a/plugin/storage/grpc/memory/plugin.go +++ b/plugin/storage/grpc/memory/plugin.go @@ -15,11 +15,18 @@ package memory import ( + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" "github.com/jaegertracing/jaeger/plugin/storage/memory" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" ) +var ( + _ shared.StoragePlugin = (*storagePlugin)(nil) + _ shared.ArchiveStoragePlugin = (*storagePlugin)(nil) + _ shared.StreamingSpanWriterPlugin = (*storagePlugin)(nil) +) + type storagePlugin struct { store *memory.Store archiveStore *memory.Store diff --git a/plugin/storage/grpc/shared/grpc_handler.go b/plugin/storage/grpc/shared/grpc_handler.go new file mode 100644 index 00000000000..9534abae2e9 --- /dev/null +++ b/plugin/storage/grpc/shared/grpc_handler.go @@ -0,0 +1,300 @@ +// Copyright (c) 2019 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. + +package shared + +import ( + "context" + "fmt" + "io" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + "github.com/jaegertracing/jaeger/storage/dependencystore" + "github.com/jaegertracing/jaeger/storage/spanstore" +) + +const spanBatchSize = 1000 + +// GRPCHandler implements all methods of Remote Storage gRPC API. +type GRPCHandler struct { + // impl StoragePlugin + // ArchiveImpl ArchiveStoragePlugin + // StreamImpl StreamingSpanWriterPlugin + impl *GRPCHandlerStorageImpl +} + +// GRPCHandlerStorageImpl contains accessors for various storage implementations needed by the handler. +type GRPCHandlerStorageImpl struct { + SpanReader func() spanstore.Reader + SpanWriter func() spanstore.Writer + DependencyReader func() dependencystore.Reader + + ArchiveSpanReader func() spanstore.Reader + ArchiveSpanWriter func() spanstore.Writer + + StreamingSpanWriter func() spanstore.Writer +} + +// NewGRPCHandler creates a handler given individual storage implementations. +func NewGRPCHandler(impl *GRPCHandlerStorageImpl) *GRPCHandler { + return &GRPCHandler{impl: impl} +} + +// NewGRPCHandler creates a handler given implementations grouped by plugin services. +func NewGRPCHandlerWithPlugins( + mainImpl StoragePlugin, + archiveImpl ArchiveStoragePlugin, + streamImpl StreamingSpanWriterPlugin, +) *GRPCHandler { + impl := &GRPCHandlerStorageImpl{ + SpanReader: mainImpl.SpanReader, + SpanWriter: mainImpl.SpanWriter, + DependencyReader: mainImpl.DependencyReader, + + ArchiveSpanReader: func() spanstore.Reader { return nil }, + ArchiveSpanWriter: func() spanstore.Writer { return nil }, + StreamingSpanWriter: func() spanstore.Writer { return nil }, + } + if archiveImpl != nil { + impl.ArchiveSpanReader = archiveImpl.ArchiveSpanReader + impl.ArchiveSpanWriter = archiveImpl.ArchiveSpanWriter + } + if streamImpl != nil { + impl.StreamingSpanWriter = streamImpl.StreamingSpanWriter + } + return NewGRPCHandler(impl) +} + +// Register registers the server as gRPC methods handler. +func (s *GRPCHandler) Register(ss *grpc.Server) error { + storage_v1.RegisterSpanReaderPluginServer(ss, s) + storage_v1.RegisterSpanWriterPluginServer(ss, s) + storage_v1.RegisterArchiveSpanReaderPluginServer(ss, s) + storage_v1.RegisterArchiveSpanWriterPluginServer(ss, s) + storage_v1.RegisterPluginCapabilitiesServer(ss, s) + storage_v1.RegisterDependenciesReaderPluginServer(ss, s) + storage_v1.RegisterStreamingSpanWriterPluginServer(ss, s) + return nil +} + +// GetDependencies returns all interservice dependencies +func (s *GRPCHandler) GetDependencies(ctx context.Context, r *storage_v1.GetDependenciesRequest) (*storage_v1.GetDependenciesResponse, error) { + deps, err := s.impl.DependencyReader().GetDependencies(ctx, r.EndTime, r.EndTime.Sub(r.StartTime)) + if err != nil { + return nil, err + } + return &storage_v1.GetDependenciesResponse{ + Dependencies: deps, + }, nil +} + +// WriteSpanStream receive the span from stream and save it +func (s *GRPCHandler) WriteSpanStream(stream storage_v1.StreamingSpanWriterPlugin_WriteSpanStreamServer) error { + writer := s.impl.StreamingSpanWriter() + if writer == nil { + return status.Error(codes.Unimplemented, "not implemented") + } + for { + in, err := stream.Recv() + if err == io.EOF { + break + } + err = writer.WriteSpan(stream.Context(), in.Span) + if err != nil { + return err + } + } + return stream.SendAndClose(&storage_v1.WriteSpanResponse{}) +} + +// WriteSpan saves the span +func (s *GRPCHandler) WriteSpan(ctx context.Context, r *storage_v1.WriteSpanRequest) (*storage_v1.WriteSpanResponse, error) { + err := s.impl.SpanWriter().WriteSpan(ctx, r.Span) + if err != nil { + return nil, err + } + return &storage_v1.WriteSpanResponse{}, nil +} + +func (s *GRPCHandler) Close(ctx context.Context, r *storage_v1.CloseWriterRequest) (*storage_v1.CloseWriterResponse, error) { + if closer, ok := s.impl.SpanWriter().(io.Closer); ok { + if err := closer.Close(); err != nil { + return nil, err + } + + return &storage_v1.CloseWriterResponse{}, nil + } else { + return nil, status.Error(codes.Unimplemented, "span writer does not support graceful shutdown") + } +} + +// GetTrace takes a traceID and streams a Trace associated with that traceID +func (s *GRPCHandler) GetTrace(r *storage_v1.GetTraceRequest, stream storage_v1.SpanReaderPlugin_GetTraceServer) error { + trace, err := s.impl.SpanReader().GetTrace(stream.Context(), r.TraceID) + if err == spanstore.ErrTraceNotFound { + return status.Errorf(codes.NotFound, spanstore.ErrTraceNotFound.Error()) + } + if err != nil { + return err + } + + err = s.sendSpans(trace.Spans, stream.Send) + if err != nil { + return err + } + + return nil +} + +// GetServices returns a list of all known services +func (s *GRPCHandler) GetServices(ctx context.Context, r *storage_v1.GetServicesRequest) (*storage_v1.GetServicesResponse, error) { + services, err := s.impl.SpanReader().GetServices(ctx) + if err != nil { + return nil, err + } + return &storage_v1.GetServicesResponse{ + Services: services, + }, nil +} + +// GetOperations returns the operations of a given service +func (s *GRPCHandler) GetOperations( + ctx context.Context, + r *storage_v1.GetOperationsRequest, +) (*storage_v1.GetOperationsResponse, error) { + operations, err := s.impl.SpanReader().GetOperations(ctx, spanstore.OperationQueryParameters{ + ServiceName: r.Service, + SpanKind: r.SpanKind, + }) + if err != nil { + return nil, err + } + grpcOperation := make([]*storage_v1.Operation, len(operations)) + for i, operation := range operations { + grpcOperation[i] = &storage_v1.Operation{ + Name: operation.Name, + SpanKind: operation.SpanKind, + } + } + return &storage_v1.GetOperationsResponse{ + Operations: grpcOperation, + }, nil +} + +// FindTraces streams traces that match the traceQuery +func (s *GRPCHandler) FindTraces(r *storage_v1.FindTracesRequest, stream storage_v1.SpanReaderPlugin_FindTracesServer) error { + traces, err := s.impl.SpanReader().FindTraces(stream.Context(), &spanstore.TraceQueryParameters{ + ServiceName: r.Query.ServiceName, + OperationName: r.Query.OperationName, + Tags: r.Query.Tags, + StartTimeMin: r.Query.StartTimeMin, + StartTimeMax: r.Query.StartTimeMax, + DurationMin: r.Query.DurationMin, + DurationMax: r.Query.DurationMax, + NumTraces: int(r.Query.NumTraces), + }) + if err != nil { + return err + } + + for _, trace := range traces { + err = s.sendSpans(trace.Spans, stream.Send) + if err != nil { + return err + } + } + + return nil +} + +// FindTraceIDs retrieves traceIDs that match the traceQuery +func (s *GRPCHandler) FindTraceIDs(ctx context.Context, r *storage_v1.FindTraceIDsRequest) (*storage_v1.FindTraceIDsResponse, error) { + traceIDs, err := s.impl.SpanReader().FindTraceIDs(ctx, &spanstore.TraceQueryParameters{ + ServiceName: r.Query.ServiceName, + OperationName: r.Query.OperationName, + Tags: r.Query.Tags, + StartTimeMin: r.Query.StartTimeMin, + StartTimeMax: r.Query.StartTimeMax, + DurationMin: r.Query.DurationMin, + DurationMax: r.Query.DurationMax, + NumTraces: int(r.Query.NumTraces), + }) + if err != nil { + return nil, err + } + return &storage_v1.FindTraceIDsResponse{ + TraceIDs: traceIDs, + }, nil +} + +func (s *GRPCHandler) sendSpans(spans []*model.Span, sendFn func(*storage_v1.SpansResponseChunk) error) error { + chunk := make([]model.Span, 0, len(spans)) + for i := 0; i < len(spans); i += spanBatchSize { + chunk = chunk[:0] + for j := i; j < len(spans) && j < i+spanBatchSize; j++ { + chunk = append(chunk, *spans[j]) + } + if err := sendFn(&storage_v1.SpansResponseChunk{Spans: chunk}); err != nil { + return fmt.Errorf("grpc plugin failed to send response: %w", err) + } + } + + return nil +} + +func (s *GRPCHandler) Capabilities(ctx context.Context, request *storage_v1.CapabilitiesRequest) (*storage_v1.CapabilitiesResponse, error) { + return &storage_v1.CapabilitiesResponse{ + ArchiveSpanReader: s.impl.ArchiveSpanReader() != nil, + ArchiveSpanWriter: s.impl.ArchiveSpanWriter() != nil, + StreamingSpanWriter: s.impl.StreamingSpanWriter() != nil, + }, nil +} + +func (s *GRPCHandler) GetArchiveTrace(r *storage_v1.GetTraceRequest, stream storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceServer) error { + reader := s.impl.ArchiveSpanReader() + if reader == nil { + return status.Error(codes.Unimplemented, "not implemented") + } + trace, err := reader.GetTrace(stream.Context(), r.TraceID) + if err == spanstore.ErrTraceNotFound { + return status.Errorf(codes.NotFound, spanstore.ErrTraceNotFound.Error()) + } + if err != nil { + return err + } + + err = s.sendSpans(trace.Spans, stream.Send) + if err != nil { + return err + } + + return nil +} + +func (s *GRPCHandler) WriteArchiveSpan(ctx context.Context, r *storage_v1.WriteSpanRequest) (*storage_v1.WriteSpanResponse, error) { + writer := s.impl.ArchiveSpanWriter() + if writer == nil { + return nil, status.Error(codes.Unimplemented, "not implemented") + } + err := writer.WriteSpan(ctx, r.Span) + if err != nil { + return nil, err + } + return &storage_v1.WriteSpanResponse{}, nil +} diff --git a/plugin/storage/grpc/shared/grpc_server_test.go b/plugin/storage/grpc/shared/grpc_handler_test.go similarity index 90% rename from plugin/storage/grpc/shared/grpc_server_test.go rename to plugin/storage/grpc/shared/grpc_handler_test.go index db4c283cb1a..8df0d7c3414 100644 --- a/plugin/storage/grpc/shared/grpc_server_test.go +++ b/plugin/storage/grpc/shared/grpc_handler_test.go @@ -69,7 +69,7 @@ func (plugin *mockStoragePlugin) StreamingSpanWriter() spanstore.Writer { } type grpcServerTest struct { - server *grpcServer + server *GRPCHandler impl *mockStoragePlugin } @@ -91,12 +91,8 @@ func withGRPCServer(fn func(r *grpcServerTest)) { } r := &grpcServerTest{ - server: &grpcServer{ - Impl: impl, - ArchiveImpl: impl, - StreamImpl: impl, - }, - impl: impl, + server: NewGRPCHandlerWithPlugins(impl, impl, impl), + impl: impl, } fn(r) } @@ -324,7 +320,7 @@ func TestGRPCServerGetArchiveTrace_Error(t *testing.T) { func TestGRPCServerGetArchiveTrace_NoImpl(t *testing.T) { withGRPCServer(func(r *grpcServerTest) { - r.server.ArchiveImpl = nil + r.server.impl.ArchiveSpanReader = func() spanstore.Reader { return nil } traceSteam := new(grpcMocks.SpanReaderPlugin_GetTraceServer) r.impl.archiveReader.On("GetTrace", mock.Anything, mockTraceID). @@ -360,7 +356,7 @@ func TestGRPCServerGetArchiveTrace_StreamError(t *testing.T) { func TestGRPCServerWriteArchiveSpan_NoImpl(t *testing.T) { withGRPCServer(func(r *grpcServerTest) { - r.server.ArchiveImpl = nil + r.server.impl.ArchiveSpanWriter = func() spanstore.Writer { return nil } _, err := r.server.WriteArchiveSpan(context.Background(), &storage_v1.WriteSpanRequest{ Span: &mockTraceSpans[0], @@ -404,20 +400,47 @@ func TestGRPCServerCapabilities(t *testing.T) { func TestGRPCServerCapabilities_NoArchive(t *testing.T) { withGRPCServer(func(r *grpcServerTest) { - r.server.ArchiveImpl = nil + r.server.impl.ArchiveSpanReader = func() spanstore.Reader { return nil } + r.server.impl.ArchiveSpanWriter = func() spanstore.Writer { return nil } capabilities, err := r.server.Capabilities(context.Background(), &storage_v1.CapabilitiesRequest{}) assert.NoError(t, err) - assert.Equal(t, &storage_v1.CapabilitiesResponse{ArchiveSpanReader: false, ArchiveSpanWriter: false, StreamingSpanWriter: true}, capabilities) + expected := &storage_v1.CapabilitiesResponse{ + ArchiveSpanReader: false, + ArchiveSpanWriter: false, + StreamingSpanWriter: true, + } + assert.Equal(t, expected, capabilities) }) } func TestGRPCServerCapabilities_NoStreamWriter(t *testing.T) { withGRPCServer(func(r *grpcServerTest) { - r.server.StreamImpl = nil + r.server.impl.StreamingSpanWriter = func() spanstore.Writer { return nil } capabilities, err := r.server.Capabilities(context.Background(), &storage_v1.CapabilitiesRequest{}) assert.NoError(t, err) - assert.Equal(t, &storage_v1.CapabilitiesResponse{ArchiveSpanReader: true, ArchiveSpanWriter: true}, capabilities) + expected := &storage_v1.CapabilitiesResponse{ + ArchiveSpanReader: true, + ArchiveSpanWriter: true, + } + assert.Equal(t, expected, capabilities) }) } + +func TestNewGRPCHandlerWithPlugins_Nils(t *testing.T) { + spanReader := new(spanStoreMocks.Reader) + spanWriter := new(spanStoreMocks.Writer) + depReader := new(dependencyStoreMocks.Reader) + + impl := &mockStoragePlugin{ + spanReader: spanReader, + spanWriter: spanWriter, + depsReader: depReader, + } + + handler := NewGRPCHandlerWithPlugins(impl, nil, nil) + assert.Nil(t, handler.impl.ArchiveSpanReader()) + assert.Nil(t, handler.impl.ArchiveSpanWriter()) + assert.Nil(t, handler.impl.StreamingSpanWriter()) +} diff --git a/plugin/storage/grpc/shared/grpc_server.go b/plugin/storage/grpc/shared/grpc_server.go deleted file mode 100644 index 00c55a770f8..00000000000 --- a/plugin/storage/grpc/shared/grpc_server.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) 2019 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. - -package shared - -import ( - "context" - "fmt" - "io" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/jaegertracing/jaeger/model" - "github.com/jaegertracing/jaeger/proto-gen/storage_v1" - "github.com/jaegertracing/jaeger/storage/spanstore" -) - -const spanBatchSize = 1000 - -// grpcServer implements shared.StoragePlugin and reads/writes spans and dependencies -type grpcServer struct { - Impl StoragePlugin - ArchiveImpl ArchiveStoragePlugin - StreamImpl StreamingSpanWriterPlugin -} - -// GetDependencies returns all interservice dependencies -func (s *grpcServer) GetDependencies(ctx context.Context, r *storage_v1.GetDependenciesRequest) (*storage_v1.GetDependenciesResponse, error) { - deps, err := s.Impl.DependencyReader().GetDependencies(ctx, r.EndTime, r.EndTime.Sub(r.StartTime)) - if err != nil { - return nil, err - } - return &storage_v1.GetDependenciesResponse{ - Dependencies: deps, - }, nil -} - -// WriteSpanStream receive the span from stream and save it -func (s *grpcServer) WriteSpanStream(stream storage_v1.StreamingSpanWriterPlugin_WriteSpanStreamServer) error { - for { - in, err := stream.Recv() - if err == io.EOF { - break - } - err = s.StreamImpl.StreamingSpanWriter().WriteSpan(stream.Context(), in.Span) - if err != nil { - return err - } - } - return stream.SendAndClose(&storage_v1.WriteSpanResponse{}) -} - -// WriteSpan saves the span -func (s *grpcServer) WriteSpan(ctx context.Context, r *storage_v1.WriteSpanRequest) (*storage_v1.WriteSpanResponse, error) { - err := s.Impl.SpanWriter().WriteSpan(ctx, r.Span) - if err != nil { - return nil, err - } - return &storage_v1.WriteSpanResponse{}, nil -} - -func (s *grpcServer) Close(ctx context.Context, r *storage_v1.CloseWriterRequest) (*storage_v1.CloseWriterResponse, error) { - if closer, ok := s.Impl.SpanWriter().(io.Closer); ok { - if err := closer.Close(); err != nil { - return nil, err - } - - return &storage_v1.CloseWriterResponse{}, nil - } else { - return nil, status.Error(codes.Unimplemented, "span writer does not support graceful shutdown") - } -} - -// GetTrace takes a traceID and streams a Trace associated with that traceID -func (s *grpcServer) GetTrace(r *storage_v1.GetTraceRequest, stream storage_v1.SpanReaderPlugin_GetTraceServer) error { - trace, err := s.Impl.SpanReader().GetTrace(stream.Context(), r.TraceID) - if err == spanstore.ErrTraceNotFound { - return status.Errorf(codes.NotFound, spanstore.ErrTraceNotFound.Error()) - } - if err != nil { - return err - } - - err = s.sendSpans(trace.Spans, stream.Send) - if err != nil { - return err - } - - return nil -} - -// GetServices returns a list of all known services -func (s *grpcServer) GetServices(ctx context.Context, r *storage_v1.GetServicesRequest) (*storage_v1.GetServicesResponse, error) { - services, err := s.Impl.SpanReader().GetServices(ctx) - if err != nil { - return nil, err - } - return &storage_v1.GetServicesResponse{ - Services: services, - }, nil -} - -// GetOperations returns the operations of a given service -func (s *grpcServer) GetOperations( - ctx context.Context, - r *storage_v1.GetOperationsRequest, -) (*storage_v1.GetOperationsResponse, error) { - operations, err := s.Impl.SpanReader().GetOperations(ctx, spanstore.OperationQueryParameters{ - ServiceName: r.Service, - SpanKind: r.SpanKind, - }) - if err != nil { - return nil, err - } - grpcOperation := make([]*storage_v1.Operation, len(operations)) - for i, operation := range operations { - grpcOperation[i] = &storage_v1.Operation{ - Name: operation.Name, - SpanKind: operation.SpanKind, - } - } - return &storage_v1.GetOperationsResponse{ - Operations: grpcOperation, - }, nil -} - -// FindTraces streams traces that match the traceQuery -func (s *grpcServer) FindTraces(r *storage_v1.FindTracesRequest, stream storage_v1.SpanReaderPlugin_FindTracesServer) error { - traces, err := s.Impl.SpanReader().FindTraces(stream.Context(), &spanstore.TraceQueryParameters{ - ServiceName: r.Query.ServiceName, - OperationName: r.Query.OperationName, - Tags: r.Query.Tags, - StartTimeMin: r.Query.StartTimeMin, - StartTimeMax: r.Query.StartTimeMax, - DurationMin: r.Query.DurationMin, - DurationMax: r.Query.DurationMax, - NumTraces: int(r.Query.NumTraces), - }) - if err != nil { - return err - } - - for _, trace := range traces { - err = s.sendSpans(trace.Spans, stream.Send) - if err != nil { - return err - } - } - - return nil -} - -// FindTraceIDs retrieves traceIDs that match the traceQuery -func (s *grpcServer) FindTraceIDs(ctx context.Context, r *storage_v1.FindTraceIDsRequest) (*storage_v1.FindTraceIDsResponse, error) { - traceIDs, err := s.Impl.SpanReader().FindTraceIDs(ctx, &spanstore.TraceQueryParameters{ - ServiceName: r.Query.ServiceName, - OperationName: r.Query.OperationName, - Tags: r.Query.Tags, - StartTimeMin: r.Query.StartTimeMin, - StartTimeMax: r.Query.StartTimeMax, - DurationMin: r.Query.DurationMin, - DurationMax: r.Query.DurationMax, - NumTraces: int(r.Query.NumTraces), - }) - if err != nil { - return nil, err - } - return &storage_v1.FindTraceIDsResponse{ - TraceIDs: traceIDs, - }, nil -} - -func (s *grpcServer) sendSpans(spans []*model.Span, sendFn func(*storage_v1.SpansResponseChunk) error) error { - chunk := make([]model.Span, 0, len(spans)) - for i := 0; i < len(spans); i += spanBatchSize { - chunk = chunk[:0] - for j := i; j < len(spans) && j < i+spanBatchSize; j++ { - chunk = append(chunk, *spans[j]) - } - if err := sendFn(&storage_v1.SpansResponseChunk{Spans: chunk}); err != nil { - return fmt.Errorf("grpc plugin failed to send response: %w", err) - } - } - - return nil -} - -func (s *grpcServer) Capabilities(ctx context.Context, request *storage_v1.CapabilitiesRequest) (*storage_v1.CapabilitiesResponse, error) { - return &storage_v1.CapabilitiesResponse{ - ArchiveSpanReader: s.ArchiveImpl != nil, - ArchiveSpanWriter: s.ArchiveImpl != nil, - StreamingSpanWriter: s.StreamImpl != nil, - }, nil -} - -func (s *grpcServer) GetArchiveTrace(r *storage_v1.GetTraceRequest, stream storage_v1.ArchiveSpanReaderPlugin_GetArchiveTraceServer) error { - if s.ArchiveImpl == nil { - return status.Error(codes.Unimplemented, "not implemented") - } - trace, err := s.ArchiveImpl.ArchiveSpanReader().GetTrace(stream.Context(), r.TraceID) - if err == spanstore.ErrTraceNotFound { - return status.Errorf(codes.NotFound, spanstore.ErrTraceNotFound.Error()) - } - if err != nil { - return err - } - - err = s.sendSpans(trace.Spans, stream.Send) - if err != nil { - return err - } - - return nil -} - -func (s *grpcServer) WriteArchiveSpan(ctx context.Context, r *storage_v1.WriteSpanRequest) (*storage_v1.WriteSpanResponse, error) { - if s.ArchiveImpl == nil { - return nil, status.Error(codes.Unimplemented, "not implemented") - } - err := s.ArchiveImpl.ArchiveSpanWriter().WriteSpan(ctx, r.Span) - if err != nil { - return nil, err - } - return &storage_v1.WriteSpanResponse{}, nil -} diff --git a/plugin/storage/grpc/shared/plugin.go b/plugin/storage/grpc/shared/plugin.go index 89347fef5cf..b4a3fabf93e 100644 --- a/plugin/storage/grpc/shared/plugin.go +++ b/plugin/storage/grpc/shared/plugin.go @@ -21,7 +21,6 @@ import ( "google.golang.org/grpc" _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration - "github.com/jaegertracing/jaeger/proto-gen/storage_v1" ) // Ensure plugin.GRPCPlugin API match. @@ -39,27 +38,16 @@ type StorageGRPCPlugin struct { // RegisterHandlers registers the plugin with the server func (p *StorageGRPCPlugin) RegisterHandlers(s *grpc.Server) error { - server := &grpcServer{ - Impl: p.Impl, - ArchiveImpl: p.ArchiveImpl, - StreamImpl: p.StreamImpl, - } - storage_v1.RegisterSpanReaderPluginServer(s, server) - storage_v1.RegisterSpanWriterPluginServer(s, server) - storage_v1.RegisterArchiveSpanReaderPluginServer(s, server) - storage_v1.RegisterArchiveSpanWriterPluginServer(s, server) - storage_v1.RegisterPluginCapabilitiesServer(s, server) - storage_v1.RegisterDependenciesReaderPluginServer(s, server) - storage_v1.RegisterStreamingSpanWriterPluginServer(s, server) - return nil + handler := NewGRPCHandlerWithPlugins(p.Impl, p.ArchiveImpl, p.StreamImpl) + return handler.Register(s) } // GRPCServer implements plugin.GRPCPlugin. It is used by go-plugin to create a grpc plugin server. -func (p *StorageGRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { +func (p *StorageGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error { return p.RegisterHandlers(s) } // GRPCClient implements plugin.GRPCPlugin. It is used by go-plugin to create a grpc plugin client. -func (*StorageGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) { - return NewGRPCClient(c), nil +func (*StorageGRPCPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error) { + return NewGRPCClient(conn), nil } From 0aa2ae7a745cd57565785de88c5ae416dfaa604a Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Mon, 1 Aug 2022 10:47:08 -0400 Subject: [PATCH 06/87] Normalize multi-tenancy flags prefix (#3834) --- cmd/collector/app/flags/flags_test.go | 8 ++++---- pkg/tenancy/flags.go | 21 +++++++++++---------- pkg/tenancy/flags_test.go | 16 ++++++++-------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/cmd/collector/app/flags/flags_test.go b/cmd/collector/app/flags/flags_test.go index 194f600dc79..527f7ea7a52 100644 --- a/cmd/collector/app/flags/flags_test.go +++ b/cmd/collector/app/flags/flags_test.go @@ -120,7 +120,7 @@ func TestCollectorOptionsWithFlags_CheckSimpleTenancy(t *testing.T) { c := &CollectorOptions{} v, command := config.Viperize(AddFlags) command.ParseFlags([]string{ - "--multi_tenancy.enabled=true", + "--multi-tenancy.enabled=true", }) c.InitFromViper(v, zap.NewNop()) @@ -132,9 +132,9 @@ func TestCollectorOptionsWithFlags_CheckFullTenancy(t *testing.T) { c := &CollectorOptions{} v, command := config.Viperize(AddFlags) command.ParseFlags([]string{ - "--multi_tenancy.enabled=true", - "--multi_tenancy.header=custom-tenant-header", - "--multi_tenancy.tenants=acme,hardware-store", + "--multi-tenancy.enabled=true", + "--multi-tenancy.header=custom-tenant-header", + "--multi-tenancy.tenants=acme,hardware-store", }) c.InitFromViper(v, zap.NewNop()) diff --git a/pkg/tenancy/flags.go b/pkg/tenancy/flags.go index 0b757dd8980..cd053c757bc 100644 --- a/pkg/tenancy/flags.go +++ b/pkg/tenancy/flags.go @@ -23,26 +23,27 @@ import ( ) const ( - tenancyEnabled = "multi_tenancy.enabled" - tenancyHeader = "multi_tenancy.header" - validTenants = "multi_tenancy.tenants" + flagPrefix = "multi-tenancy" + flagTenancyEnabled = flagPrefix + ".enabled" + flagTenancyHeader = flagPrefix + ".header" + flagValidTenants = flagPrefix + ".tenants" ) // AddFlags adds flags for tenancy to the FlagSet. func AddFlags(flags *flag.FlagSet) { - flags.Bool(tenancyEnabled, false, "Enable tenancy header when receiving or querying") - flags.String(tenancyHeader, "x-tenant", "HTTP header carrying tenant") - flags.String(validTenants, "", + flags.Bool(flagTenancyEnabled, false, "Enable tenancy header when receiving or querying") + flags.String(flagTenancyHeader, "x-tenant", "HTTP header carrying tenant") + flags.String(flagValidTenants, "", fmt.Sprintf("comma-separated list of allowed values for --%s header. (If not supplied, tenants are not restricted)", - tenancyHeader)) + flagTenancyHeader)) } // InitFromViper creates tenancy.Options populated with values retrieved from Viper. func InitFromViper(v *viper.Viper) (Options, error) { var p Options - p.Enabled = v.GetBool(tenancyEnabled) - p.Header = v.GetString(tenancyHeader) - tenants := v.GetString(validTenants) + p.Enabled = v.GetBool(flagTenancyEnabled) + p.Header = v.GetString(flagTenancyHeader) + tenants := v.GetString(flagValidTenants) if len(tenants) != 0 { p.Tenants = strings.Split(tenants, ",") } else { diff --git a/pkg/tenancy/flags_test.go b/pkg/tenancy/flags_test.go index 425e91c6ff2..ca794264068 100644 --- a/pkg/tenancy/flags_test.go +++ b/pkg/tenancy/flags_test.go @@ -33,8 +33,8 @@ func TestTenancyFlags(t *testing.T) { { name: "one tenant", cmd: []string{ - "--multi_tenancy.enabled=true", - "--multi_tenancy.tenants=acme", + "--multi-tenancy.enabled=true", + "--multi-tenancy.tenants=acme", }, expected: Options{ Enabled: true, @@ -45,8 +45,8 @@ func TestTenancyFlags(t *testing.T) { { name: "two tenants", cmd: []string{ - "--multi_tenancy.enabled=true", - "--multi_tenancy.tenants=acme,country-store", + "--multi-tenancy.enabled=true", + "--multi-tenancy.tenants=acme,country-store", }, expected: Options{ Enabled: true, @@ -57,9 +57,9 @@ func TestTenancyFlags(t *testing.T) { { name: "custom header", cmd: []string{ - "--multi_tenancy.enabled=true", - "--multi_tenancy.header=jaeger-tenant", - "--multi_tenancy.tenants=acme", + "--multi-tenancy.enabled=true", + "--multi-tenancy.header=jaeger-tenant", + "--multi-tenancy.tenants=acme", }, expected: Options{ Enabled: true, @@ -72,7 +72,7 @@ func TestTenancyFlags(t *testing.T) { // "tenant header required, but any value will pass" name: "no_tenants", cmd: []string{ - "--multi_tenancy.enabled=true", + "--multi-tenancy.enabled=true", }, expected: Options{ Enabled: true, From 4d6287423a15c1e1577ff06cb08ba9ae7ed77c00 Mon Sep 17 00:00:00 2001 From: Ben B Date: Mon, 1 Aug 2022 19:11:04 +0200 Subject: [PATCH 07/87] fix: typo in filename (#3837) Signed-off-by: Benedikt Bongartz --- cmd/collector/app/sampling/{gprc_handler.go => grpc_handler.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cmd/collector/app/sampling/{gprc_handler.go => grpc_handler.go} (100%) diff --git a/cmd/collector/app/sampling/gprc_handler.go b/cmd/collector/app/sampling/grpc_handler.go similarity index 100% rename from cmd/collector/app/sampling/gprc_handler.go rename to cmd/collector/app/sampling/grpc_handler.go From ea71bd1d090c942996224ba0e9966c5cd7f12743 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Mon, 1 Aug 2022 14:50:01 -0400 Subject: [PATCH 08/87] Remove error from tenancy.InitFromViper (#3838) --- cmd/collector/app/flags/flags.go | 6 +----- cmd/query/app/flags.go | 6 +----- pkg/tenancy/flags.go | 4 ++-- pkg/tenancy/flags_test.go | 3 +-- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cmd/collector/app/flags/flags.go b/cmd/collector/app/flags/flags.go index bc614348fbe..e9a2daf3d2c 100644 --- a/cmd/collector/app/flags/flags.go +++ b/cmd/collector/app/flags/flags.go @@ -228,11 +228,7 @@ func (opts *GRPCOptions) initFromViper(v *viper.Viper, logger *zap.Logger, cfg s } else { return fmt.Errorf("failed to parse gRPC TLS options: %w", err) } - if tenancy, err := tenancy.InitFromViper(v); err == nil { - opts.Tenancy = tenancy - } else { - return fmt.Errorf("failed to parse Tenancy options: %w", err) - } + opts.Tenancy = tenancy.InitFromViper(v) return nil } diff --git a/cmd/query/app/flags.go b/cmd/query/app/flags.go index 07dd9392a5d..5187335f4a3 100644 --- a/cmd/query/app/flags.go +++ b/cmd/query/app/flags.go @@ -125,11 +125,7 @@ func (qOpts *QueryOptions) InitFromViper(v *viper.Viper, logger *zap.Logger) (*Q } else { qOpts.AdditionalHeaders = headers } - if tenancy, err := tenancy.InitFromViper(v); err == nil { - qOpts.Tenancy = tenancy - } else { - return qOpts, fmt.Errorf("failed to parse Tenancy options: %w", err) - } + qOpts.Tenancy = tenancy.InitFromViper(v) return qOpts, nil } diff --git a/pkg/tenancy/flags.go b/pkg/tenancy/flags.go index cd053c757bc..0a050c4a3ef 100644 --- a/pkg/tenancy/flags.go +++ b/pkg/tenancy/flags.go @@ -39,7 +39,7 @@ func AddFlags(flags *flag.FlagSet) { } // InitFromViper creates tenancy.Options populated with values retrieved from Viper. -func InitFromViper(v *viper.Viper) (Options, error) { +func InitFromViper(v *viper.Viper) Options { var p Options p.Enabled = v.GetBool(flagTenancyEnabled) p.Header = v.GetString(flagTenancyHeader) @@ -50,5 +50,5 @@ func InitFromViper(v *viper.Viper) (Options, error) { p.Tenants = []string{} } - return p, nil + return p } diff --git a/pkg/tenancy/flags_test.go b/pkg/tenancy/flags_test.go index ca794264068..c31240f012d 100644 --- a/pkg/tenancy/flags_test.go +++ b/pkg/tenancy/flags_test.go @@ -93,8 +93,7 @@ func TestTenancyFlags(t *testing.T) { err := command.ParseFlags(test.cmd) require.NoError(t, err) - tenancyCfg, err := InitFromViper(v) - require.NoError(t, err) + tenancyCfg := InitFromViper(v) assert.Equal(t, test.expected, tenancyCfg) }) } From 4daa4e971eb266998dbee7f673112ea2e440a2b8 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 2 Aug 2022 00:54:42 -0400 Subject: [PATCH 09/87] Add remote-storage service (#3836) --- cmd/remote-storage/Dockerfile | 16 + cmd/remote-storage/app/flags.go | 64 ++++ cmd/remote-storage/app/flags_test.go | 47 +++ cmd/remote-storage/app/server.go | 151 +++++++++ cmd/remote-storage/app/server_test.go | 427 ++++++++++++++++++++++++++ cmd/remote-storage/main.go | 121 ++++++++ pkg/tenancy/grpc.go | 17 + pkg/tenancy/grpc_test.go | 20 ++ plugin/storage/grpc/options.go | 2 +- ports/ports.go | 5 + 10 files changed, 869 insertions(+), 1 deletion(-) create mode 100644 cmd/remote-storage/Dockerfile create mode 100644 cmd/remote-storage/app/flags.go create mode 100644 cmd/remote-storage/app/flags_test.go create mode 100644 cmd/remote-storage/app/server.go create mode 100644 cmd/remote-storage/app/server_test.go create mode 100644 cmd/remote-storage/main.go diff --git a/cmd/remote-storage/Dockerfile b/cmd/remote-storage/Dockerfile new file mode 100644 index 00000000000..8ca40ad2ee8 --- /dev/null +++ b/cmd/remote-storage/Dockerfile @@ -0,0 +1,16 @@ +ARG base_image +ARG debug_image + +ARG SVC=remote-storage + +FROM $base_image AS release +ARG TARGETARCH +COPY $SVC-linux-$TARGETARCH /go/bin/$SVC-linux +EXPOSE 16686/tcp +ENTRYPOINT ["/go/bin/$SVC-linux"] + +FROM $debug_image AS debug +ARG TARGETARCH=amd64 +COPY $SVC-debug-linux-$TARGETARCH /go/bin/$SVC-linux +EXPOSE 12345/tcp 16686/tcp +ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/$SVC-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"] diff --git a/cmd/remote-storage/app/flags.go b/cmd/remote-storage/app/flags.go new file mode 100644 index 00000000000..c30426bc19e --- /dev/null +++ b/cmd/remote-storage/app/flags.go @@ -0,0 +1,64 @@ +// Copyright (c) 2022 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. + +package app + +import ( + "flag" + "fmt" + + "github.com/spf13/viper" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/pkg/config/tlscfg" + "github.com/jaegertracing/jaeger/pkg/tenancy" + "github.com/jaegertracing/jaeger/ports" +) + +const ( + flagGRPCHostPort = "grpc.host-port" +) + +var tlsGRPCFlagsConfig = tlscfg.ServerFlagsConfig{ + Prefix: "grpc", +} + +// Options holds configuration for remote-storage service. +type Options struct { + // GRPCHostPort is the host:port address for gRPC server + GRPCHostPort string + // TLSGRPC configures secure transport + TLSGRPC tlscfg.Options + // Tenancy configuration + Tenancy tenancy.Options +} + +// AddFlags adds flags to flag set. +func AddFlags(flagSet *flag.FlagSet) { + flagSet.String(flagGRPCHostPort, ports.PortToHostPort(ports.RemoteStorageGRPC), "The host:port (e.g. 127.0.0.1:17271 or :17271) of the gRPC server") + tlsGRPCFlagsConfig.AddFlags(flagSet) + tenancy.AddFlags(flagSet) +} + +// InitFromViper initializes Options with properties from CLI flags. +func (o *Options) InitFromViper(v *viper.Viper, logger *zap.Logger) (*Options, error) { + o.GRPCHostPort = v.GetString(flagGRPCHostPort) + if tlsGrpc, err := tlsGRPCFlagsConfig.InitFromViper(v); err == nil { + o.TLSGRPC = tlsGrpc + } else { + return o, fmt.Errorf("failed to process gRPC TLS options: %w", err) + } + o.Tenancy = tenancy.InitFromViper(v) + return o, nil +} diff --git a/cmd/remote-storage/app/flags_test.go b/cmd/remote-storage/app/flags_test.go new file mode 100644 index 00000000000..592b70a70a0 --- /dev/null +++ b/cmd/remote-storage/app/flags_test.go @@ -0,0 +1,47 @@ +// Copyright (c) 2022 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. + +package app + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/pkg/config" +) + +func TestFlags(t *testing.T) { + v, command := config.Viperize(AddFlags) + command.ParseFlags([]string{ + "--grpc.host-port=127.0.0.1:8081", + }) + qOpts, err := new(Options).InitFromViper(v, zap.NewNop()) + require.NoError(t, err) + assert.Equal(t, "127.0.0.1:8081", qOpts.GRPCHostPort) +} + +func TestFailedTLSFlags(t *testing.T) { + v, command := config.Viperize(AddFlags) + err := command.ParseFlags([]string{ + "--grpc.tls.enabled=false", + "--grpc.tls.cert=blah", // invalid unless tls.enabled + }) + require.NoError(t, err) + _, err = new(Options).InitFromViper(v, zap.NewNop()) + require.Error(t, err) + assert.Contains(t, err.Error(), "failed to process gRPC TLS options") +} diff --git a/cmd/remote-storage/app/server.go b/cmd/remote-storage/app/server.go new file mode 100644 index 00000000000..1093517c71d --- /dev/null +++ b/cmd/remote-storage/app/server.go @@ -0,0 +1,151 @@ +// Copyright (c) 2020 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. + +package app + +import ( + "fmt" + "net" + + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/reflection" + + "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" + "github.com/jaegertracing/jaeger/pkg/healthcheck" + "github.com/jaegertracing/jaeger/pkg/tenancy" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" + "github.com/jaegertracing/jaeger/storage" + "github.com/jaegertracing/jaeger/storage/dependencystore" + "github.com/jaegertracing/jaeger/storage/spanstore" +) + +// Server runs a gRPC server +type Server struct { + logger *zap.Logger + opts *Options + + grpcConn net.Listener + grpcServer *grpc.Server + unavailableChannel chan healthcheck.Status // used to signal to admin server that gRPC server is unavailable +} + +// NewServer creates and initializes Server. +func NewServer(options *Options, storageFactory storage.Factory, tm *tenancy.TenancyManager, logger *zap.Logger) (*Server, error) { + handler, err := createGRPCHandler(storageFactory, logger) + if err != nil { + return nil, err + } + + grpcServer, err := createGRPCServer(options, tm, handler, logger) + if err != nil { + return nil, err + } + + return &Server{ + logger: logger, + opts: options, + grpcServer: grpcServer, + unavailableChannel: make(chan healthcheck.Status), + }, nil +} + +func createGRPCHandler(f storage.Factory, logger *zap.Logger) (*shared.GRPCHandler, error) { + reader, err := f.CreateSpanReader() + if err != nil { + return nil, err + } + writer, err := f.CreateSpanWriter() + if err != nil { + return nil, err + } + depReader, err := f.CreateDependencyReader() + if err != nil { + return nil, err + } + + impl := &shared.GRPCHandlerStorageImpl{ + SpanReader: func() spanstore.Reader { return reader }, + SpanWriter: func() spanstore.Writer { return writer }, + DependencyReader: func() dependencystore.Reader { return depReader }, + StreamingSpanWriter: func() spanstore.Writer { return nil }, + } + + // borrow code from Query service for archive storage + qOpts := &querysvc.QueryServiceOptions{} + // when archive storage not initialized (returns false), the reader/writer will be nil + _ = qOpts.InitArchiveStorage(f, logger) + impl.ArchiveSpanReader = func() spanstore.Reader { return qOpts.ArchiveSpanReader } + impl.ArchiveSpanWriter = func() spanstore.Writer { return qOpts.ArchiveSpanWriter } + + handler := shared.NewGRPCHandler(impl) + return handler, nil +} + +// HealthCheckStatus returns health check status channel a client can subscribe to +func (s Server) HealthCheckStatus() chan healthcheck.Status { + return s.unavailableChannel +} + +func createGRPCServer(opts *Options, tm *tenancy.TenancyManager, handler *shared.GRPCHandler, logger *zap.Logger) (*grpc.Server, error) { + var grpcOpts []grpc.ServerOption + + if opts.TLSGRPC.Enabled { + tlsCfg, err := opts.TLSGRPC.Config(logger) + if err != nil { + return nil, fmt.Errorf("invalid TLS config: %w", err) + } + creds := credentials.NewTLS(tlsCfg) + grpcOpts = append(grpcOpts, grpc.Creds(creds)) + } + if tm.Enabled { + grpcOpts = append(grpcOpts, + grpc.StreamInterceptor(tenancy.NewGuardingStreamInterceptor(tm)), + grpc.UnaryInterceptor(tenancy.NewGuardingUnaryInterceptor(tm)), + ) + } + + server := grpc.NewServer(grpcOpts...) + reflection.Register(server) + handler.Register(server) + + return server, nil +} + +// Start gRPC server concurrently +func (s *Server) Start() error { + listener, err := net.Listen("tcp", s.opts.GRPCHostPort) + if err != nil { + return err + } + s.logger.Info("Starting GRPC server", zap.Stringer("addr", listener.Addr())) + s.grpcConn = listener + go func() { + if err := s.grpcServer.Serve(s.grpcConn); err != nil { + s.logger.Error("GRPC server exited", zap.Error(err)) + } + s.unavailableChannel <- healthcheck.Unavailable + }() + + return nil +} + +// Close stops http, GRPC servers and closes the port listener. +func (s *Server) Close() error { + s.grpcServer.Stop() + s.grpcConn.Close() + s.opts.TLSGRPC.Close() + return nil +} diff --git a/cmd/remote-storage/app/server_test.go b/cmd/remote-storage/app/server_test.go new file mode 100644 index 00000000000..4a6f43ad0e3 --- /dev/null +++ b/cmd/remote-storage/app/server_test.go @@ -0,0 +1,427 @@ +// Copyright (c) 2022 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. + +package app + +import ( + "context" + "errors" + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zaptest/observer" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" + + "github.com/jaegertracing/jaeger/cmd/flags" + "github.com/jaegertracing/jaeger/internal/grpctest" + "github.com/jaegertracing/jaeger/pkg/config/tlscfg" + "github.com/jaegertracing/jaeger/pkg/healthcheck" + "github.com/jaegertracing/jaeger/pkg/tenancy" + "github.com/jaegertracing/jaeger/ports" + "github.com/jaegertracing/jaeger/proto-gen/storage_v1" + depStoreMocks "github.com/jaegertracing/jaeger/storage/dependencystore/mocks" + factoryMocks "github.com/jaegertracing/jaeger/storage/mocks" + spanStoreMocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks" +) + +var testCertKeyLocation = "../../../pkg/config/tlscfg/testdata" + +func TestNewServer_CreateStorageErrors(t *testing.T) { + factory := new(factoryMocks.Factory) + factory.On("CreateSpanReader").Return(nil, errors.New("no reader")).Once() + factory.On("CreateSpanReader").Return(nil, nil) + factory.On("CreateSpanWriter").Return(nil, errors.New("no writer")).Once() + factory.On("CreateSpanWriter").Return(nil, nil) + factory.On("CreateDependencyReader").Return(nil, errors.New("no deps")).Once() + factory.On("CreateDependencyReader").Return(nil, nil) + + f := func() (*Server, error) { + return NewServer( + &Options{GRPCHostPort: ":0"}, + factory, + tenancy.NewTenancyManager(&tenancy.Options{}), + zap.NewNop(), + ) + } + _, err := f() + require.Error(t, err) + assert.Contains(t, err.Error(), "no reader") + + _, err = f() + require.Error(t, err) + assert.Contains(t, err.Error(), "no writer") + + _, err = f() + require.Error(t, err) + assert.Contains(t, err.Error(), "no deps") + + s, err := f() + require.NoError(t, err) + err = s.Start() + require.NoError(t, err) + validateGRPCServer(t, s.grpcConn.Addr().String(), s.grpcServer) + + s.grpcConn.Close() // causes logged error + <-s.HealthCheckStatus() +} + +func TestServerStart_BadPortErrors(t *testing.T) { + srv := &Server{ + opts: &Options{ + GRPCHostPort: ":-1", + }, + } + assert.Error(t, srv.Start()) +} + +type storageMocks struct { + factory *factoryMocks.Factory + reader *spanStoreMocks.Reader + writer *spanStoreMocks.Writer + depReader *depStoreMocks.Reader +} + +func newStorageMocks() *storageMocks { + reader := new(spanStoreMocks.Reader) + writer := new(spanStoreMocks.Writer) + depReader := new(depStoreMocks.Reader) + + factory := new(factoryMocks.Factory) + factory.On("CreateSpanReader").Return(reader, nil) + factory.On("CreateSpanWriter").Return(writer, nil) + factory.On("CreateDependencyReader").Return(depReader, nil) + + return &storageMocks{ + factory: factory, + reader: reader, + writer: writer, + depReader: depReader, + } +} + +func TestNewServer_TLSConfigError(t *testing.T) { + tlsCfg := tlscfg.Options{ + Enabled: true, + CertPath: "invalid/path", + KeyPath: "invalid/path", + ClientCAPath: "invalid/path", + } + storageMocks := newStorageMocks() + _, err := NewServer( + &Options{GRPCHostPort: ":8081", TLSGRPC: tlsCfg}, + storageMocks.factory, + tenancy.NewTenancyManager(&tenancy.Options{}), + zap.NewNop(), + ) + require.Error(t, err) + assert.Contains(t, err.Error(), "invalid TLS config") +} + +func TestCreateGRPCHandler(t *testing.T) { + storageMocks := newStorageMocks() + h, err := createGRPCHandler(storageMocks.factory, zap.NewNop()) + require.NoError(t, err) + + storageMocks.writer.On("WriteSpan", mock.Anything, mock.Anything).Return(errors.New("writer error")) + _, err = h.WriteSpan(context.Background(), &storage_v1.WriteSpanRequest{}) + require.Error(t, err) + assert.Contains(t, err.Error(), "writer error") + + storageMocks.depReader.On("GetDependencies", mock.Anything, mock.Anything).Return(nil, errors.New("deps error")) + _, err = h.GetDependencies(context.Background(), &storage_v1.GetDependenciesRequest{}) + require.Error(t, err) + assert.Contains(t, err.Error(), "deps error") + + err = h.GetArchiveTrace(nil, nil) + require.Error(t, err) + assert.Contains(t, err.Error(), "not implemented") + + _, err = h.WriteArchiveSpan(context.Background(), nil) + require.Error(t, err) + assert.Contains(t, err.Error(), "not implemented") + + err = h.WriteSpanStream(nil) + require.Error(t, err) + assert.Contains(t, err.Error(), "not implemented") +} + +var testCases = []struct { + name string + TLS tlscfg.Options + clientTLS tlscfg.Options + expectError bool + expectClientError bool + expectServerFail bool +}{ + { + name: "should pass with insecure connection", + TLS: tlscfg.Options{ + Enabled: false, + }, + clientTLS: tlscfg.Options{ + Enabled: false, + }, + expectError: false, + expectClientError: false, + expectServerFail: false, + }, + { + name: "should fail with TLS client to untrusted TLS server", + TLS: tlscfg.Options{ + Enabled: true, + CertPath: testCertKeyLocation + "/example-server-cert.pem", + KeyPath: testCertKeyLocation + "/example-server-key.pem", + }, + clientTLS: tlscfg.Options{ + Enabled: true, + ServerName: "example.com", + }, + expectError: true, + expectClientError: true, + expectServerFail: false, + }, + { + name: "should fail with TLS client to trusted TLS server with incorrect hostname", + TLS: tlscfg.Options{ + Enabled: true, + CertPath: testCertKeyLocation + "/example-server-cert.pem", + KeyPath: testCertKeyLocation + "/example-server-key.pem", + }, + clientTLS: tlscfg.Options{ + Enabled: true, + CAPath: testCertKeyLocation + "/example-CA-cert.pem", + ServerName: "nonEmpty", + }, + expectError: true, + expectClientError: true, + expectServerFail: false, + }, + { + name: "should pass with TLS client to trusted TLS server with correct hostname", + TLS: tlscfg.Options{ + Enabled: true, + CertPath: testCertKeyLocation + "/example-server-cert.pem", + KeyPath: testCertKeyLocation + "/example-server-key.pem", + }, + clientTLS: tlscfg.Options{ + Enabled: true, + CAPath: testCertKeyLocation + "/example-CA-cert.pem", + ServerName: "example.com", + }, + expectError: false, + expectClientError: false, + expectServerFail: false, + }, + { + name: "should fail with TLS client without cert to trusted TLS server requiring cert", + TLS: tlscfg.Options{ + Enabled: true, + CertPath: testCertKeyLocation + "/example-server-cert.pem", + KeyPath: testCertKeyLocation + "/example-server-key.pem", + ClientCAPath: testCertKeyLocation + "/example-CA-cert.pem", + }, + clientTLS: tlscfg.Options{ + Enabled: true, + CAPath: testCertKeyLocation + "/example-CA-cert.pem", + ServerName: "example.com", + }, + expectError: false, + expectServerFail: false, + expectClientError: true, + }, + { + name: "should pass with TLS client with cert to trusted TLS server requiring cert", + TLS: tlscfg.Options{ + Enabled: true, + CertPath: testCertKeyLocation + "/example-server-cert.pem", + KeyPath: testCertKeyLocation + "/example-server-key.pem", + ClientCAPath: testCertKeyLocation + "/example-CA-cert.pem", + }, + clientTLS: tlscfg.Options{ + Enabled: true, + CAPath: testCertKeyLocation + "/example-CA-cert.pem", + ServerName: "example.com", + CertPath: testCertKeyLocation + "/example-client-cert.pem", + KeyPath: testCertKeyLocation + "/example-client-key.pem", + }, + expectError: false, + expectServerFail: false, + expectClientError: false, + }, + { + name: "should fail with TLS client without cert to trusted TLS server requiring cert from a different CA", + TLS: tlscfg.Options{ + Enabled: true, + CertPath: testCertKeyLocation + "/example-server-cert.pem", + KeyPath: testCertKeyLocation + "/example-server-key.pem", + ClientCAPath: testCertKeyLocation + "/wrong-CA-cert.pem", // NB: wrong CA + }, + clientTLS: tlscfg.Options{ + Enabled: true, + CAPath: testCertKeyLocation + "/example-CA-cert.pem", + ServerName: "example.com", + CertPath: testCertKeyLocation + "/example-client-cert.pem", + KeyPath: testCertKeyLocation + "/example-client-key.pem", + }, + expectError: false, + expectServerFail: false, + expectClientError: true, + }, +} + +type grpcClient struct { + storage_v1.SpanReaderPluginClient + + conn *grpc.ClientConn +} + +func newGRPCClient(t *testing.T, addr string, creds credentials.TransportCredentials, tm *tenancy.TenancyManager) *grpcClient { + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) + defer cancel() + + dialOpts := []grpc.DialOption{ + grpc.WithUnaryInterceptor(tenancy.NewClientUnaryInterceptor(tm)), + } + if creds != nil { + dialOpts = append(dialOpts, grpc.WithTransportCredentials(creds)) + } else { + dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) + } + + conn, err := grpc.DialContext(ctx, addr, dialOpts...) + require.NoError(t, err) + + return &grpcClient{ + SpanReaderPluginClient: storage_v1.NewSpanReaderPluginClient(conn), + conn: conn, + } +} + +func TestServerGRPCTLS(t *testing.T) { + for _, test := range testCases { + t.Run(test.name, func(t *testing.T) { + serverOptions := &Options{ + GRPCHostPort: ":0", + TLSGRPC: test.TLS, + } + flagsSvc := flags.NewService(ports.QueryAdminHTTP) + flagsSvc.Logger = zap.NewNop() + + storageMocks := newStorageMocks() + expectedServices := []string{"test"} + storageMocks.reader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) + + tm := tenancy.NewTenancyManager(&tenancy.Options{Enabled: true}) + server, err := NewServer( + serverOptions, + storageMocks.factory, + tm, + flagsSvc.Logger, + ) + assert.Nil(t, err) + assert.NoError(t, server.Start()) + + var wg sync.WaitGroup + wg.Add(1) + once := sync.Once{} + + go func() { + for s := range server.HealthCheckStatus() { + flagsSvc.HC().Set(s) + if s == healthcheck.Unavailable { + once.Do(wg.Done) + } + } + }() + + var clientError error + var client *grpcClient + + if serverOptions.TLSGRPC.Enabled { + clientTLSCfg, err0 := test.clientTLS.Config(zap.NewNop()) + require.NoError(t, err0) + creds := credentials.NewTLS(clientTLSCfg) + client = newGRPCClient(t, server.grpcConn.Addr().String(), creds, tm) + } else { + client = newGRPCClient(t, server.grpcConn.Addr().String(), nil, tm) + } + + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + + ctx = tenancy.WithTenant(ctx, "foo") + res, clientError := client.GetServices(ctx, &storage_v1.GetServicesRequest{}) + + if test.expectClientError { + require.Error(t, clientError) + } else { + require.NoError(t, clientError) + assert.Equal(t, expectedServices, res.Services) + } + require.Nil(t, client.conn.Close()) + server.Close() + wg.Wait() + assert.Equal(t, healthcheck.Unavailable, flagsSvc.HC().Get()) + }) + } +} + +func TestServerHandlesPortZero(t *testing.T) { + flagsSvc := flags.NewService(ports.QueryAdminHTTP) + zapCore, logs := observer.New(zap.InfoLevel) + flagsSvc.Logger = zap.New(zapCore) + storageMocks := newStorageMocks() + + server, err := NewServer( + &Options{GRPCHostPort: ":0"}, + storageMocks.factory, + tenancy.NewTenancyManager(&tenancy.Options{}), + flagsSvc.Logger, + ) + require.Nil(t, err) + require.NoError(t, server.Start()) + defer server.Close() + + const line = "Starting GRPC server" + message := logs.FilterMessage(line) + require.Equal(t, 1, message.Len(), "Expected '%s' log message, actual logs: %+v", line, logs) + + onlyEntry := message.All()[0] + hostPort := onlyEntry.ContextMap()["addr"].(string) + validateGRPCServer(t, hostPort, server.grpcServer) +} + +func validateGRPCServer(t *testing.T, hostPort string, server *grpc.Server) { + grpctest.ReflectionServiceValidator{ + HostPort: hostPort, + Server: server, + ExpectedServices: []string{ + "jaeger.storage.v1.SpanReaderPlugin", + "jaeger.storage.v1.SpanWriterPlugin", + "jaeger.storage.v1.DependenciesReaderPlugin", + "jaeger.storage.v1.PluginCapabilities", + "jaeger.storage.v1.ArchiveSpanReaderPlugin", + "jaeger.storage.v1.ArchiveSpanWriterPlugin", + "jaeger.storage.v1.StreamingSpanWriterPlugin", + // "grpc.health.v1.Health", + }, + }.Execute(t) +} diff --git a/cmd/remote-storage/main.go b/cmd/remote-storage/main.go new file mode 100644 index 00000000000..6a9d797a307 --- /dev/null +++ b/cmd/remote-storage/main.go @@ -0,0 +1,121 @@ +// Copyright (c) 2022 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. + +package main + +import ( + "fmt" + "log" + "os" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + _ "go.uber.org/automaxprocs" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/cmd/docs" + "github.com/jaegertracing/jaeger/cmd/env" + "github.com/jaegertracing/jaeger/cmd/flags" + "github.com/jaegertracing/jaeger/cmd/remote-storage/app" + "github.com/jaegertracing/jaeger/cmd/status" + "github.com/jaegertracing/jaeger/pkg/config" + "github.com/jaegertracing/jaeger/pkg/metrics" + "github.com/jaegertracing/jaeger/pkg/tenancy" + "github.com/jaegertracing/jaeger/pkg/version" + "github.com/jaegertracing/jaeger/plugin/storage" + "github.com/jaegertracing/jaeger/ports" +) + +const serviceName = "jaeger-remote-storage" + +func main() { + svc := flags.NewService(ports.RemoteStorageAdminHTTP) + + if os.Getenv(storage.SpanStorageTypeEnvVar) == "" { + os.Setenv(storage.SpanStorageTypeEnvVar, "memory") + // other storage types default to the same type as SpanStorage + } + storageFactory, err := storage.NewFactory(storage.FactoryConfigFromEnvAndCLI(os.Args, os.Stderr)) + if err != nil { + log.Fatalf("Cannot initialize storage factory: %v", err) + } + + v := viper.New() + command := &cobra.Command{ + Use: serviceName, + Short: serviceName + " allows sharing single-node storage implementations like memstore or Badger.", + Long: serviceName + ` allows sharing single-node storage implementations like memstore or Badger. It implements Jaeger Remote Storage gRPC API.`, + RunE: func(cmd *cobra.Command, args []string) error { + if err := svc.Start(v); err != nil { + return err + } + logger := svc.Logger // shortcut + baseFactory := svc.MetricsFactory.Namespace(metrics.NSOptions{Name: "jaeger"}) + metricsFactory := baseFactory.Namespace(metrics.NSOptions{Name: "remote-storage"}) + version.NewInfoMetrics(metricsFactory) + + opts, err := new(app.Options).InitFromViper(v, logger) + if err != nil { + logger.Fatal("Failed to parse options", zap.Error(err)) + } + + storageFactory.InitFromViper(v, logger) + if err := storageFactory.Initialize(baseFactory, logger); err != nil { + logger.Fatal("Failed to init storage factory", zap.Error(err)) + } + + tm := tenancy.NewTenancyManager(&opts.Tenancy) + server, err := app.NewServer(opts, storageFactory, tm, svc.Logger) + if err != nil { + logger.Fatal("Failed to create server", zap.Error(err)) + } + + go func() { + for s := range server.HealthCheckStatus() { + svc.SetHealthCheckStatus(s) + } + }() + + if err := server.Start(); err != nil { + logger.Fatal("Could not start servers", zap.Error(err)) + } + + svc.RunAndThen(func() { + server.Close() + if err := storageFactory.Close(); err != nil { + logger.Error("Failed to close storage factory", zap.Error(err)) + } + }) + return nil + }, + } + + command.AddCommand(version.Command()) + command.AddCommand(env.Command()) + command.AddCommand(docs.Command(v)) + command.AddCommand(status.Command(v, ports.QueryAdminHTTP)) + + config.AddFlags( + v, + command, + svc.AddFlags, + storageFactory.AddFlags, + app.AddFlags, + ) + + if err := command.Execute(); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } +} diff --git a/pkg/tenancy/grpc.go b/pkg/tenancy/grpc.go index 0d269f59f78..468101fa2a9 100644 --- a/pkg/tenancy/grpc.go +++ b/pkg/tenancy/grpc.go @@ -113,3 +113,20 @@ func NewGuardingUnaryInterceptor(tc *TenancyManager) grpc.UnaryServerInterceptor return handler(WithTenant(ctx, tenant), req) } } + +// NewClientUnaryInterceptor injects tenant header into gRPC request metadata. +func NewClientUnaryInterceptor(tc *TenancyManager) grpc.UnaryClientInterceptor { + return grpc.UnaryClientInterceptor(func( + ctx context.Context, + method string, + req, reply interface{}, + cc *grpc.ClientConn, + invoker grpc.UnaryInvoker, + opts ...grpc.CallOption, + ) error { + if tenant := GetTenant(ctx); tenant != "" { + ctx = metadata.AppendToOutgoingContext(ctx, tc.Header, tenant) + } + return invoker(ctx, method, req, reply, cc, opts...) + }) +} diff --git a/pkg/tenancy/grpc_test.go b/pkg/tenancy/grpc_test.go index 1bdc898f945..94e68dbbb74 100644 --- a/pkg/tenancy/grpc_test.go +++ b/pkg/tenancy/grpc_test.go @@ -16,6 +16,7 @@ package tenancy import ( "context" + "errors" "testing" "github.com/stretchr/testify/assert" @@ -111,3 +112,22 @@ func TestTenancyInterceptors(t *testing.T) { }) } } + +func TestClientUnaryInterceptor(t *testing.T) { + tm := NewTenancyManager(&Options{Enabled: true, Tenants: []string{"acme"}}) + interceptor := NewClientUnaryInterceptor(tm) + var tenant string + fakeErr := errors.New("foo") + invoker := func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, opts ...grpc.CallOption) error { + md, ok := metadata.FromOutgoingContext(ctx) + assert.True(t, ok) + ten, err := tenantFromMetadata(md, tm.Header) + require.NoError(t, err) + tenant = ten + return fakeErr + } + ctx := WithTenant(context.Background(), "acme") + err := interceptor(ctx, "method", "request", "response", nil, invoker) + assert.Equal(t, "acme", tenant) + assert.Same(t, fakeErr, err) +} diff --git a/plugin/storage/grpc/options.go b/plugin/storage/grpc/options.go index bd6d321b735..e1be3eaf46a 100644 --- a/plugin/storage/grpc/options.go +++ b/plugin/storage/grpc/options.go @@ -55,7 +55,7 @@ func (opt *Options) AddFlags(flagSet *flag.FlagSet) { flagSet.String(pluginBinary, "", "The location of the plugin binary") flagSet.String(pluginConfigurationFile, "", "A path pointing to the plugin's configuration file, made available to the plugin with the --config arg") flagSet.String(pluginLogLevel, defaultPluginLogLevel, "Set the log level of the plugin's logger") - flagSet.String(remoteServer, "", "The remote storage gRPC server address") + flagSet.String(remoteServer, "", "The remote storage gRPC server address as host:port") flagSet.Duration(remoteConnectionTimeout, defaultConnectionTimeout, "The remote storage gRPC server connection timeout") } diff --git a/ports/ports.go b/ports/ports.go index b2bd3317813..caf035fc761 100644 --- a/ports/ports.go +++ b/ports/ports.go @@ -49,6 +49,11 @@ const ( // IngesterAdminHTTP is the default admin HTTP port (health check, metrics, etc.) IngesterAdminHTTP = 14270 + + // RemoteStorageGRPC is the default port of GRPC requests for Remote Storage + RemoteStorageGRPC = 17271 + // RemoteStorageHTTP is the default admin HTTP port (health check, metrics, etc.) + RemoteStorageAdminHTTP = 17270 ) // PortToHostPort converts the port into a host:port address string From b92aa3edc5b682ef0afa89463b069630f3c273cc Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 2 Aug 2022 11:07:51 -0400 Subject: [PATCH 10/87] Rename TenancyManager to tenancy.Manager (#3840) --- cmd/all-in-one/main.go | 4 +-- cmd/collector/app/collector.go | 4 +-- cmd/collector/app/collector_test.go | 8 +++--- cmd/collector/app/handler/grpc_handler.go | 6 ++--- .../app/handler/grpc_handler_test.go | 10 +++---- cmd/collector/app/handler/otlp_receiver.go | 6 ++--- .../app/handler/otlp_receiver_test.go | 10 +++---- cmd/collector/app/server/grpc_test.go | 10 +++---- cmd/collector/app/span_handler_builder.go | 2 +- .../app/span_handler_builder_test.go | 4 +-- cmd/collector/main.go | 2 +- cmd/query/app/apiv3/grpc_gateway.go | 2 +- cmd/query/app/apiv3/grpc_gateway_test.go | 8 +++--- cmd/query/app/grpc_handler_test.go | 16 ++++++------ cmd/query/app/http_handler.go | 4 +-- cmd/query/app/http_handler_test.go | 20 +++++++------- cmd/query/app/server.go | 6 ++--- cmd/query/app/server_test.go | 24 ++++++++--------- cmd/query/main.go | 2 +- cmd/remote-storage/app/server.go | 4 +-- cmd/remote-storage/app/server_test.go | 10 +++---- cmd/remote-storage/main.go | 2 +- pkg/tenancy/grpc.go | 8 +++--- pkg/tenancy/grpc_test.go | 18 ++++++------- pkg/tenancy/http.go | 4 +-- pkg/tenancy/http_test.go | 16 ++++++------ .../{config_test.go => manage_test.go} | 2 +- pkg/tenancy/{config.go => manager.go} | 26 +++++++++---------- 28 files changed, 119 insertions(+), 119 deletions(-) rename pkg/tenancy/{config_test.go => manage_test.go} (97%) rename pkg/tenancy/{config.go => manager.go} (86%) diff --git a/cmd/all-in-one/main.go b/cmd/all-in-one/main.go index c3ceb111d77..963b224d5c5 100644 --- a/cmd/all-in-one/main.go +++ b/cmd/all-in-one/main.go @@ -156,7 +156,7 @@ by default uses only in-memory database.`, logger.Fatal("Failed to configure query service", zap.Error(err)) } - tm := tenancy.NewTenancyManager(&cOpts.GRPC.Tenancy) + tm := tenancy.NewManager(&cOpts.GRPC.Tenancy) // collector c := collectorApp.New(&collectorApp.CollectorParams{ @@ -269,7 +269,7 @@ func startQuery( depReader dependencystore.Reader, metricsQueryService querysvc.MetricsQueryService, baseFactory metrics.Factory, - tm *tenancy.TenancyManager, + tm *tenancy.Manager, ) *queryApp.Server { spanReader = storageMetrics.NewReadMetricsDecorator(spanReader, baseFactory.Namespace(metrics.NSOptions{Name: "query"})) qs := querysvc.NewQueryService(spanReader, depReader, *queryOpts) diff --git a/cmd/collector/app/collector.go b/cmd/collector/app/collector.go index 2beff366f01..1d45f9bb58e 100644 --- a/cmd/collector/app/collector.go +++ b/cmd/collector/app/collector.go @@ -53,7 +53,7 @@ type Collector struct { hCheck *healthcheck.HealthCheck spanProcessor processor.SpanProcessor spanHandlers *SpanHandlers - tenancyMgr *tenancy.TenancyManager + tenancyMgr *tenancy.Manager // state, read only hServer *http.Server @@ -74,7 +74,7 @@ type CollectorParams struct { StrategyStore strategystore.StrategyStore Aggregator strategystore.Aggregator HealthCheck *healthcheck.HealthCheck - TenancyMgr *tenancy.TenancyManager + TenancyMgr *tenancy.Manager } // New constructs a new collector component, ready to be started diff --git a/cmd/collector/app/collector_test.go b/cmd/collector/app/collector_test.go index cf951f22e23..a3036cd42ab 100644 --- a/cmd/collector/app/collector_test.go +++ b/cmd/collector/app/collector_test.go @@ -54,7 +54,7 @@ func TestNewCollector(t *testing.T) { baseMetrics := metricstest.NewFactory(time.Hour) spanWriter := &fakeSpanWriter{} strategyStore := &mockStrategyStore{} - tm := &tenancy.TenancyManager{} + tm := &tenancy.Manager{} c := New(&CollectorParams{ ServiceName: "collector", @@ -80,7 +80,7 @@ func TestCollector_StartErrors(t *testing.T) { baseMetrics := metricstest.NewFactory(time.Hour) spanWriter := &fakeSpanWriter{} strategyStore := &mockStrategyStore{} - tm := &tenancy.TenancyManager{} + tm := &tenancy.Manager{} c := New(&CollectorParams{ ServiceName: "collector", @@ -135,7 +135,7 @@ func TestCollector_PublishOpts(t *testing.T) { metricsFactory := fork.New("internal", forkFactory, baseMetrics) spanWriter := &fakeSpanWriter{} strategyStore := &mockStrategyStore{} - tm := &tenancy.TenancyManager{} + tm := &tenancy.Manager{} c := New(&CollectorParams{ ServiceName: "collector", @@ -171,7 +171,7 @@ func TestAggregator(t *testing.T) { spanWriter := &fakeSpanWriter{} strategyStore := &mockStrategyStore{} agg := &mockAggregator{} - tm := &tenancy.TenancyManager{} + tm := &tenancy.Manager{} c := New(&CollectorParams{ ServiceName: "collector", diff --git a/cmd/collector/app/handler/grpc_handler.go b/cmd/collector/app/handler/grpc_handler.go index 1c6d9e79f08..9e23ec602cf 100644 --- a/cmd/collector/app/handler/grpc_handler.go +++ b/cmd/collector/app/handler/grpc_handler.go @@ -36,7 +36,7 @@ type GRPCHandler struct { } // NewGRPCHandler registers routes for this handler on the given router. -func NewGRPCHandler(logger *zap.Logger, spanProcessor processor.SpanProcessor, tenancyMgr *tenancy.TenancyManager) *GRPCHandler { +func NewGRPCHandler(logger *zap.Logger, spanProcessor processor.SpanProcessor, tenancyMgr *tenancy.Manager) *GRPCHandler { return &GRPCHandler{ logger: logger, batchConsumer: newBatchConsumer(logger, @@ -58,10 +58,10 @@ type batchConsumer struct { logger *zap.Logger spanProcessor processor.SpanProcessor spanOptions processor.SpansOptions - tenancyMgr *tenancy.TenancyManager + tenancyMgr *tenancy.Manager } -func newBatchConsumer(logger *zap.Logger, spanProcessor processor.SpanProcessor, transport processor.InboundTransport, spanFormat processor.SpanFormat, tenancyMgr *tenancy.TenancyManager) batchConsumer { +func newBatchConsumer(logger *zap.Logger, spanProcessor processor.SpanProcessor, transport processor.InboundTransport, spanFormat processor.SpanFormat, tenancyMgr *tenancy.Manager) batchConsumer { return batchConsumer{ logger: logger, spanProcessor: spanProcessor, diff --git a/cmd/collector/app/handler/grpc_handler_test.go b/cmd/collector/app/handler/grpc_handler_test.go index 171835e578c..17a8af07e52 100644 --- a/cmd/collector/app/handler/grpc_handler_test.go +++ b/cmd/collector/app/handler/grpc_handler_test.go @@ -98,7 +98,7 @@ func newClient(t *testing.T, addr net.Addr) (api_v2.CollectorServiceClient, *grp func TestPostSpans(t *testing.T) { processor := &mockSpanProcessor{} server, addr := initializeGRPCTestServer(t, func(s *grpc.Server) { - handler := NewGRPCHandler(zap.NewNop(), processor, &tenancy.TenancyManager{}) + handler := NewGRPCHandler(zap.NewNop(), processor, &tenancy.Manager{}) api_v2.RegisterCollectorServiceServer(s, handler) }) defer server.Stop() @@ -133,7 +133,7 @@ func TestPostSpans(t *testing.T) { func TestGRPCCompressionEnabled(t *testing.T) { processor := &mockSpanProcessor{} server, addr := initializeGRPCTestServer(t, func(s *grpc.Server) { - handler := NewGRPCHandler(zap.NewNop(), processor, &tenancy.TenancyManager{}) + handler := NewGRPCHandler(zap.NewNop(), processor, &tenancy.Manager{}) api_v2.RegisterCollectorServiceServer(s, handler) }) defer server.Stop() @@ -171,7 +171,7 @@ func TestPostSpansWithError(t *testing.T) { processor := &mockSpanProcessor{expectedError: test.processorError} logger, logBuf := testutils.NewLogger() server, addr := initializeGRPCTestServer(t, func(s *grpc.Server) { - handler := NewGRPCHandler(logger, processor, &tenancy.TenancyManager{}) + handler := NewGRPCHandler(logger, processor, &tenancy.Manager{}) api_v2.RegisterCollectorServiceServer(s, handler) }) defer server.Stop() @@ -210,7 +210,7 @@ func TestPostTenantedSpans(t *testing.T) { processor := &mockSpanProcessor{} server, addr := initializeGRPCTestServer(t, func(s *grpc.Server) { handler := NewGRPCHandler(zap.NewNop(), processor, - tenancy.NewTenancyManager(&tenancy.Options{ + tenancy.NewManager(&tenancy.Options{ Enabled: true, Header: tenantHeader, Tenants: []string{dummyTenant}, @@ -346,7 +346,7 @@ func TestGetTenant(t *testing.T) { processor := &mockSpanProcessor{} handler := NewGRPCHandler(zap.NewNop(), processor, - tenancy.NewTenancyManager(&tenancy.Options{ + tenancy.NewManager(&tenancy.Options{ Enabled: true, Header: tenantHeader, Tenants: validTenants, diff --git a/cmd/collector/app/handler/otlp_receiver.go b/cmd/collector/app/handler/otlp_receiver.go index 678fdd78b6d..1fbb52134b7 100644 --- a/cmd/collector/app/handler/otlp_receiver.go +++ b/cmd/collector/app/handler/otlp_receiver.go @@ -40,7 +40,7 @@ import ( var _ component.Host = (*otelHost)(nil) // API check // StartOTLPReceiver starts OpenTelemetry OTLP receiver listening on gRPC and HTTP ports. -func StartOTLPReceiver(options *flags.CollectorOptions, logger *zap.Logger, spanProcessor processor.SpanProcessor, tm *tenancy.TenancyManager) (component.TracesReceiver, error) { +func StartOTLPReceiver(options *flags.CollectorOptions, logger *zap.Logger, spanProcessor processor.SpanProcessor, tm *tenancy.Manager) (component.TracesReceiver, error) { otlpFactory := otlpreceiver.NewFactory() return startOTLPReceiver( options, @@ -60,7 +60,7 @@ func startOTLPReceiver( options *flags.CollectorOptions, logger *zap.Logger, spanProcessor processor.SpanProcessor, - tm *tenancy.TenancyManager, + tm *tenancy.Manager, // from here: params that can be mocked in tests otlpFactory component.ReceiverFactory, newTraces func(consume consumer.ConsumeTracesFunc, options ...consumer.Option) (consumer.Traces, error), @@ -140,7 +140,7 @@ func applyTLSSettings(opts *tlscfg.Options) *configtls.TLSServerSetting { } } -func newConsumerDelegate(logger *zap.Logger, spanProcessor processor.SpanProcessor, tm *tenancy.TenancyManager) *consumerDelegate { +func newConsumerDelegate(logger *zap.Logger, spanProcessor processor.SpanProcessor, tm *tenancy.Manager) *consumerDelegate { return &consumerDelegate{ batchConsumer: newBatchConsumer(logger, spanProcessor, diff --git a/cmd/collector/app/handler/otlp_receiver_test.go b/cmd/collector/app/handler/otlp_receiver_test.go index b05b5ef5d0b..4f7d9490fa2 100644 --- a/cmd/collector/app/handler/otlp_receiver_test.go +++ b/cmd/collector/app/handler/otlp_receiver_test.go @@ -49,7 +49,7 @@ func optionsWithPorts(port string) *flags.CollectorOptions { func TestStartOtlpReceiver(t *testing.T) { spanProcessor := &mockSpanProcessor{} logger, _ := testutils.NewLogger() - tm := &tenancy.TenancyManager{} + tm := &tenancy.Manager{} rec, err := StartOTLPReceiver(optionsWithPorts(":0"), logger, spanProcessor, tm) require.NoError(t, err) defer func() { @@ -81,7 +81,7 @@ func TestConsumerDelegate(t *testing.T) { t.Run(test.expectLog, func(t *testing.T) { logger, logBuf := testutils.NewLogger() spanProcessor := &mockSpanProcessor{expectedError: test.expectErr} - consumer := newConsumerDelegate(logger, spanProcessor, &tenancy.TenancyManager{}) + consumer := newConsumerDelegate(logger, spanProcessor, &tenancy.Manager{}) err := consumer.consume(context.Background(), makeTracesOneSpan()) @@ -100,7 +100,7 @@ func TestStartOtlpReceiver_Error(t *testing.T) { spanProcessor := &mockSpanProcessor{} logger, _ := testutils.NewLogger() opts := optionsWithPorts(":-1") - tm := &tenancy.TenancyManager{} + tm := &tenancy.Manager{} _, err := StartOTLPReceiver(opts, logger, spanProcessor, tm) require.Error(t, err) assert.Contains(t, err.Error(), "could not start the OTLP receiver") @@ -109,7 +109,7 @@ func TestStartOtlpReceiver_Error(t *testing.T) { return nil, errors.New("mock error") } f := otlpreceiver.NewFactory() - _, err = startOTLPReceiver(opts, logger, spanProcessor, &tenancy.TenancyManager{}, f, newTraces, f.CreateTracesReceiver) + _, err = startOTLPReceiver(opts, logger, spanProcessor, &tenancy.Manager{}, f, newTraces, f.CreateTracesReceiver) require.Error(t, err) assert.Contains(t, err.Error(), "could not create the OTLP consumer") @@ -118,7 +118,7 @@ func TestStartOtlpReceiver_Error(t *testing.T) { ) (component.TracesReceiver, error) { return nil, errors.New("mock error") } - _, err = startOTLPReceiver(opts, logger, spanProcessor, &tenancy.TenancyManager{}, f, consumer.NewTraces, createTracesReceiver) + _, err = startOTLPReceiver(opts, logger, spanProcessor, &tenancy.Manager{}, f, consumer.NewTraces, createTracesReceiver) require.Error(t, err) assert.Contains(t, err.Error(), "could not create the OTLP receiver") } diff --git a/cmd/collector/app/server/grpc_test.go b/cmd/collector/app/server/grpc_test.go index bdf722a8206..9acc872b5c4 100644 --- a/cmd/collector/app/server/grpc_test.go +++ b/cmd/collector/app/server/grpc_test.go @@ -40,7 +40,7 @@ func TestFailToListen(t *testing.T) { logger, _ := zap.NewDevelopment() server, err := StartGRPCServer(&GRPCServerParams{ HostPort: ":-1", - Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.TenancyManager{}), + Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.Manager{}), SamplingStore: &mockSamplingStore{}, Logger: logger, }) @@ -57,7 +57,7 @@ func TestFailServe(t *testing.T) { logger := zap.New(core) serveGRPC(grpc.NewServer(), lis, &GRPCServerParams{ - Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.TenancyManager{}), + Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.Manager{}), SamplingStore: &mockSamplingStore{}, Logger: logger, OnError: func(e error) { @@ -72,7 +72,7 @@ func TestFailServe(t *testing.T) { func TestSpanCollector(t *testing.T) { logger, _ := zap.NewDevelopment() params := &GRPCServerParams{ - Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.TenancyManager{}), + Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.Manager{}), SamplingStore: &mockSamplingStore{}, Logger: logger, MaxReceiveMessageLength: 1024 * 1024, @@ -97,7 +97,7 @@ func TestSpanCollector(t *testing.T) { func TestCollectorStartWithTLS(t *testing.T) { logger, _ := zap.NewDevelopment() params := &GRPCServerParams{ - Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.TenancyManager{}), + Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.Manager{}), SamplingStore: &mockSamplingStore{}, Logger: logger, TLSConfig: tlscfg.Options{ @@ -116,7 +116,7 @@ func TestCollectorStartWithTLS(t *testing.T) { func TestCollectorReflection(t *testing.T) { logger, _ := zap.NewDevelopment() params := &GRPCServerParams{ - Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.TenancyManager{}), + Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}, &tenancy.Manager{}), SamplingStore: &mockSamplingStore{}, Logger: logger, } diff --git a/cmd/collector/app/span_handler_builder.go b/cmd/collector/app/span_handler_builder.go index dd5dd311702..6f87ab97327 100644 --- a/cmd/collector/app/span_handler_builder.go +++ b/cmd/collector/app/span_handler_builder.go @@ -36,7 +36,7 @@ type SpanHandlerBuilder struct { CollectorOpts *flags.CollectorOptions Logger *zap.Logger MetricsFactory metrics.Factory - TenancyMgr *tenancy.TenancyManager + TenancyMgr *tenancy.Manager } // SpanHandlers holds instances to the span handlers built by the SpanHandlerBuilder diff --git a/cmd/collector/app/span_handler_builder_test.go b/cmd/collector/app/span_handler_builder_test.go index 3f747f83372..9799a2ad25a 100644 --- a/cmd/collector/app/span_handler_builder_test.go +++ b/cmd/collector/app/span_handler_builder_test.go @@ -42,7 +42,7 @@ func TestNewSpanHandlerBuilder(t *testing.T) { builder := &SpanHandlerBuilder{ SpanWriter: spanWriter, CollectorOpts: cOpts, - TenancyMgr: &tenancy.TenancyManager{}, + TenancyMgr: &tenancy.Manager{}, } assert.NotNil(t, builder.logger()) assert.NotNil(t, builder.metricsFactory()) @@ -52,7 +52,7 @@ func TestNewSpanHandlerBuilder(t *testing.T) { CollectorOpts: cOpts, Logger: zap.NewNop(), MetricsFactory: metrics.NullFactory, - TenancyMgr: &tenancy.TenancyManager{}, + TenancyMgr: &tenancy.Manager{}, } spanProcessor := builder.BuildSpanProcessor() diff --git a/cmd/collector/main.go b/cmd/collector/main.go index f92c9482689..290b02401b2 100644 --- a/cmd/collector/main.go +++ b/cmd/collector/main.go @@ -103,7 +103,7 @@ func main() { if err != nil { logger.Fatal("Failed to initialize collector", zap.Error(err)) } - tm := tenancy.NewTenancyManager(&collectorOpts.GRPC.Tenancy) + tm := tenancy.NewManager(&collectorOpts.GRPC.Tenancy) collector := app.New(&app.CollectorParams{ ServiceName: serviceName, diff --git a/cmd/query/app/apiv3/grpc_gateway.go b/cmd/query/app/apiv3/grpc_gateway.go index f563f7158e9..0abc723bbc5 100644 --- a/cmd/query/app/apiv3/grpc_gateway.go +++ b/cmd/query/app/apiv3/grpc_gateway.go @@ -31,7 +31,7 @@ import ( ) // RegisterGRPCGateway registers api_v3 endpoints into provided mux. -func RegisterGRPCGateway(ctx context.Context, logger *zap.Logger, r *mux.Router, basePath string, grpcEndpoint string, grpcTLS tlscfg.Options, tm *tenancy.TenancyManager) error { +func RegisterGRPCGateway(ctx context.Context, logger *zap.Logger, r *mux.Router, basePath string, grpcEndpoint string, grpcTLS tlscfg.Options, tm *tenancy.Manager) error { jsonpb := &runtime.JSONPb{} muxOpts := []runtime.ServeMuxOption{ diff --git a/cmd/query/app/apiv3/grpc_gateway_test.go b/cmd/query/app/apiv3/grpc_gateway_test.go index 92b9ac5a4cf..b950b371408 100644 --- a/cmd/query/app/apiv3/grpc_gateway_test.go +++ b/cmd/query/app/apiv3/grpc_gateway_test.go @@ -66,7 +66,7 @@ func setupGRPCGateway(t *testing.T, basePath string, serverTLS tlscfg.Options, c serverGRPCOpts = append(serverGRPCOpts, grpc.Creds(creds)) } if tenancyOptions.Enabled { - tm := tenancy.NewTenancyManager(&tenancyOptions) + tm := tenancy.NewManager(&tenancyOptions) serverGRPCOpts = append(serverGRPCOpts, grpc.StreamInterceptor(tenancy.NewGuardingStreamInterceptor(tm)), grpc.UnaryInterceptor(tenancy.NewGuardingUnaryInterceptor(tm)), @@ -86,7 +86,7 @@ func setupGRPCGateway(t *testing.T, basePath string, serverTLS tlscfg.Options, c router := &mux.Router{} router = router.PathPrefix(basePath).Subrouter() ctx, cancel := context.WithCancel(context.Background()) - err := RegisterGRPCGateway(ctx, zap.NewNop(), router, basePath, lis.Addr().String(), clientTLS, tenancy.NewTenancyManager(&tenancyOptions)) + err := RegisterGRPCGateway(ctx, zap.NewNop(), router, basePath, lis.Addr().String(), clientTLS, tenancy.NewManager(&tenancyOptions)) require.NoError(t, err) httpLis, err := net.Listen("tcp", ":0") @@ -176,7 +176,7 @@ func TestTenancyGRPCGateway(t *testing.T) { tenancyOptions := tenancy.Options{ Enabled: true, } - tm := tenancy.NewTenancyManager(&tenancyOptions) + tm := tenancy.NewManager(&tenancyOptions) testGRPCGatewayWithTenancy(t, "/", tlscfg.Options{}, tlscfg.Options{}, // Configure the gateway to forward tenancy header from HTTP to GRPC tenancyOptions, @@ -217,7 +217,7 @@ func TestTenancyGRPCRejection(t *testing.T) { require.Equal(t, http.StatusForbidden, response.StatusCode) // Try again with tenant header set - tm := tenancy.NewTenancyManager(&tenancyOptions) + tm := tenancy.NewManager(&tenancyOptions) req.Header.Set(tm.Header, "acme") response, err = http.DefaultClient.Do(req) require.NoError(t, err) diff --git a/cmd/query/app/grpc_handler_test.go b/cmd/query/app/grpc_handler_test.go index c25b890ccf3..8384bafb40b 100644 --- a/cmd/query/app/grpc_handler_test.go +++ b/cmd/query/app/grpc_handler_test.go @@ -145,7 +145,7 @@ type grpcClient struct { conn *grpc.ClientConn } -func newGRPCServer(t *testing.T, q *querysvc.QueryService, mq querysvc.MetricsQueryService, logger *zap.Logger, tracer opentracing.Tracer, tenancyMgr *tenancy.TenancyManager) (*grpc.Server, net.Addr) { +func newGRPCServer(t *testing.T, q *querysvc.QueryService, mq querysvc.MetricsQueryService, logger *zap.Logger, tracer opentracing.Tracer, tenancyMgr *tenancy.Manager) (*grpc.Server, net.Addr) { lis, _ := net.Listen("tcp", ":0") var grpcOpts []grpc.ServerOption if tenancyMgr.Enabled { @@ -203,7 +203,7 @@ func withMetricsQuery() testOption { } func withServerAndClient(t *testing.T, actualTest func(server *grpcServer, client *grpcClient), options ...testOption) { - server := initializeTenantedTestServerGRPCWithOptions(t, &tenancy.TenancyManager{}, options...) + server := initializeTenantedTestServerGRPCWithOptions(t, &tenancy.Manager{}, options...) client := newGRPCClient(t, server.lisAddr.String()) defer server.server.Stop() defer client.conn.Close() @@ -901,7 +901,7 @@ func TestMetricsQueryNilRequestGRPC(t *testing.T) { assert.EqualError(t, err, errNilRequest.Error()) } -func initializeTenantedTestServerGRPCWithOptions(t *testing.T, tm *tenancy.TenancyManager, options ...testOption) *grpcServer { +func initializeTenantedTestServerGRPCWithOptions(t *testing.T, tm *tenancy.Manager, options ...testOption) *grpcServer { archiveSpanReader := &spanstoremocks.Reader{} archiveSpanWriter := &spanstoremocks.Writer{} @@ -942,7 +942,7 @@ func initializeTenantedTestServerGRPCWithOptions(t *testing.T, tm *tenancy.Tenan } } -func withTenantedServerAndClient(t *testing.T, tm *tenancy.TenancyManager, actualTest func(server *grpcServer, client *grpcClient), options ...testOption) { +func withTenantedServerAndClient(t *testing.T, tm *tenancy.Manager, actualTest func(server *grpcServer, client *grpcClient), options ...testOption) { server := initializeTenantedTestServerGRPCWithOptions(t, tm, options...) client := newGRPCClient(t, server.lisAddr.String()) defer server.server.Stop() @@ -960,7 +960,7 @@ func withOutgoingMetadata(t *testing.T, ctx context.Context, headerName, headerV } func TestSearchTenancyGRPC(t *testing.T) { - tm := tenancy.NewTenancyManager(&tenancy.Options{ + tm := tenancy.NewManager(&tenancy.Options{ Enabled: true, }) withTenantedServerAndClient(t, tm, func(server *grpcServer, client *grpcClient) { @@ -996,7 +996,7 @@ func TestSearchTenancyGRPC(t *testing.T) { } func TestServicesTenancyGRPC(t *testing.T) { - tm := tenancy.NewTenancyManager(&tenancy.Options{ + tm := tenancy.NewManager(&tenancy.Options{ Enabled: true, }) withTenantedServerAndClient(t, tm, func(server *grpcServer, client *grpcClient) { @@ -1015,7 +1015,7 @@ func TestServicesTenancyGRPC(t *testing.T) { } func TestSearchTenancyGRPCExplicitList(t *testing.T) { - tm := tenancy.NewTenancyManager(&tenancy.Options{ + tm := tenancy.NewManager(&tenancy.Options{ Enabled: true, Header: "non-standard-tenant-header", Tenants: []string{"mercury", "venus", "mars"}, @@ -1097,7 +1097,7 @@ func TestSearchTenancyGRPCExplicitList(t *testing.T) { } func TestTenancyContextFlowGRPC(t *testing.T) { - tm := tenancy.NewTenancyManager(&tenancy.Options{ + tm := tenancy.NewManager(&tenancy.Options{ Enabled: true, }) withTenantedServerAndClient(t, tm, func(server *grpcServer, client *grpcClient) { diff --git a/cmd/query/app/http_handler.go b/cmd/query/app/http_handler.go index 8abde1b9b74..49b7805a628 100644 --- a/cmd/query/app/http_handler.go +++ b/cmd/query/app/http_handler.go @@ -85,7 +85,7 @@ type APIHandler struct { queryService *querysvc.QueryService metricsQueryService querysvc.MetricsQueryService queryParser queryParser - tenancyMgr *tenancy.TenancyManager + tenancyMgr *tenancy.Manager basePath string apiPrefix string logger *zap.Logger @@ -93,7 +93,7 @@ type APIHandler struct { } // NewAPIHandler returns an APIHandler -func NewAPIHandler(queryService *querysvc.QueryService, tm *tenancy.TenancyManager, options ...HandlerOption) *APIHandler { +func NewAPIHandler(queryService *querysvc.QueryService, tm *tenancy.Manager, options ...HandlerOption) *APIHandler { aH := &APIHandler{ queryService: queryService, queryParser: queryParser{ diff --git a/cmd/query/app/http_handler_test.go b/cmd/query/app/http_handler_test.go index 881b164cf4d..ae6124feffd 100644 --- a/cmd/query/app/http_handler_test.go +++ b/cmd/query/app/http_handler_test.go @@ -93,7 +93,7 @@ type structuredTraceResponse struct { func initializeTestServerWithHandler(queryOptions querysvc.QueryServiceOptions, options ...HandlerOption) *testServer { return initializeTestServerWithOptions( - &tenancy.TenancyManager{}, + &tenancy.Manager{}, queryOptions, append( []HandlerOption{ @@ -108,7 +108,7 @@ func initializeTestServerWithHandler(queryOptions querysvc.QueryServiceOptions, ) } -func initializeTestServerWithOptions(tenancyMgr *tenancy.TenancyManager, queryOptions querysvc.QueryServiceOptions, options ...HandlerOption) *testServer { +func initializeTestServerWithOptions(tenancyMgr *tenancy.Manager, queryOptions querysvc.QueryServiceOptions, options ...HandlerOption) *testServer { readStorage := &spanstoremocks.Reader{} dependencyStorage := &depsmocks.Reader{} qs := querysvc.NewQueryService(readStorage, dependencyStorage, queryOptions) @@ -135,7 +135,7 @@ type testServer struct { } func withTestServer(doTest func(s *testServer), queryOptions querysvc.QueryServiceOptions, options ...HandlerOption) { - ts := initializeTestServerWithOptions(&tenancy.TenancyManager{}, queryOptions, options...) + ts := initializeTestServerWithOptions(&tenancy.Manager{}, queryOptions, options...) defer ts.server.Close() doTest(ts) } @@ -183,7 +183,7 @@ func TestLogOnServerError(t *testing.T) { apiHandlerOptions := []HandlerOption{ HandlerOptions.Logger(zap.New(l)), } - h := NewAPIHandler(qs, &tenancy.TenancyManager{}, apiHandlerOptions...) + h := NewAPIHandler(qs, &tenancy.Manager{}, apiHandlerOptions...) e := errors.New("test error") h.handleError(&testHttp.TestResponseWriter{}, e, http.StatusInternalServerError) require.Equal(t, 1, len(*l.logs)) @@ -404,7 +404,7 @@ func TestSearchByTraceIDSuccess(t *testing.T) { func TestSearchByTraceIDSuccessWithArchive(t *testing.T) { archiveReadMock := &spanstoremocks.Reader{} - ts := initializeTestServerWithOptions(&tenancy.TenancyManager{}, querysvc.QueryServiceOptions{ + ts := initializeTestServerWithOptions(&tenancy.Manager{}, querysvc.QueryServiceOptions{ ArchiveSpanReader: archiveReadMock, }) defer ts.server.Close() @@ -447,7 +447,7 @@ func TestSearchByTraceIDFailure(t *testing.T) { func TestSearchModelConversionFailure(t *testing.T) { ts := initializeTestServerWithOptions( - &tenancy.TenancyManager{}, + &tenancy.Manager{}, querysvc.QueryServiceOptions{ Adjuster: adjuster.Func(func(trace *model.Trace) (*model.Trace, error) { return trace, errAdjustment @@ -886,7 +886,7 @@ func TestSearchTenancyHTTP(t *testing.T) { Enabled: true, } ts := initializeTestServerWithOptions( - tenancy.NewTenancyManager(&tenancyOptions), + tenancy.NewManager(&tenancyOptions), querysvc.QueryServiceOptions{}) defer ts.server.Close() ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). @@ -913,7 +913,7 @@ func TestSearchTenancyRejectionHTTP(t *testing.T) { Enabled: true, } ts := initializeTestServerWithOptions( - tenancy.NewTenancyManager(&tenancyOptions), + tenancy.NewManager(&tenancyOptions), querysvc.QueryServiceOptions{}) defer ts.server.Close() ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). @@ -927,7 +927,7 @@ func TestSearchTenancyRejectionHTTP(t *testing.T) { assert.NoError(t, err) assert.Equal(t, http.StatusUnauthorized, resp.StatusCode) - tm := tenancy.NewTenancyManager(&tenancyOptions) + tm := tenancy.NewManager(&tenancyOptions) req.Header.Set(tm.Header, "acme") resp, err = http.DefaultClient.Do(req) require.NoError(t, err) @@ -940,7 +940,7 @@ func TestSearchTenancyFlowTenantHTTP(t *testing.T) { Enabled: true, } ts := initializeTestServerWithOptions( - tenancy.NewTenancyManager(&tenancyOptions), + tenancy.NewManager(&tenancyOptions), querysvc.QueryServiceOptions{}) defer ts.server.Close() ts.spanReader.On("GetTrace", mock.MatchedBy(func(v interface{}) bool { diff --git a/cmd/query/app/server.go b/cmd/query/app/server.go index 721a0491ead..3e06b2e2538 100644 --- a/cmd/query/app/server.go +++ b/cmd/query/app/server.go @@ -65,7 +65,7 @@ type Server struct { } // NewServer creates and initializes Server -func NewServer(logger *zap.Logger, querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, tm *tenancy.TenancyManager, tracer opentracing.Tracer) (*Server, error) { +func NewServer(logger *zap.Logger, querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, tm *tenancy.Manager, tracer opentracing.Tracer) (*Server, error) { _, httpPort, err := net.SplitHostPort(options.HTTPHostPort) if err != nil { return nil, err @@ -107,7 +107,7 @@ func (s Server) HealthCheckStatus() chan healthcheck.Status { return s.unavailableChannel } -func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, tm *tenancy.TenancyManager, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, error) { +func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, tm *tenancy.Manager, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, error) { var grpcOpts []grpc.ServerOption if options.TLSGRPC.Enabled { @@ -151,7 +151,7 @@ func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc. return server, nil } -func createHTTPServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, queryOpts *QueryOptions, tm *tenancy.TenancyManager, tracer opentracing.Tracer, logger *zap.Logger) (*http.Server, context.CancelFunc, error) { +func createHTTPServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, queryOpts *QueryOptions, tm *tenancy.Manager, tracer opentracing.Tracer, logger *zap.Logger) (*http.Server, context.CancelFunc, error) { apiHandlerOptions := []HandlerOption{ HandlerOptions.Logger(logger), HandlerOptions.Tracer(tracer), diff --git a/cmd/query/app/server_test.go b/cmd/query/app/server_test.go index f72373d3434..d1d473d57af 100644 --- a/cmd/query/app/server_test.go +++ b/cmd/query/app/server_test.go @@ -69,7 +69,7 @@ func TestCreateTLSServerSinglePortError(t *testing.T) { _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8080", TLSGRPC: tlsCfg, TLSHTTP: tlsCfg}, - tenancy.NewTenancyManager(&tenancy.Options{}), opentracing.NoopTracer{}) + tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -83,7 +83,7 @@ func TestCreateTLSGrpcServerError(t *testing.T) { _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8081", TLSGRPC: tlsCfg}, - tenancy.NewTenancyManager(&tenancy.Options{}), opentracing.NoopTracer{}) + tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -97,7 +97,7 @@ func TestCreateTLSHttpServerError(t *testing.T) { _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8081", TLSHTTP: tlsCfg}, - tenancy.NewTenancyManager(&tenancy.Options{}), opentracing.NoopTracer{}) + tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -339,7 +339,7 @@ func TestServerHTTPTLS(t *testing.T) { querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) server, err := NewServer(flagsSvc.Logger, querySvc, nil, - serverOptions, tenancy.NewTenancyManager(&tenancy.Options{}), + serverOptions, tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.Nil(t, err) assert.NoError(t, server.Start()) @@ -499,7 +499,7 @@ func TestServerGRPCTLS(t *testing.T) { querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) server, err := NewServer(flagsSvc.Logger, querySvc, nil, - serverOptions, tenancy.NewTenancyManager(&tenancy.Options{}), + serverOptions, tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.Nil(t, err) assert.NoError(t, server.Start()) @@ -554,13 +554,13 @@ func TestServerGRPCTLS(t *testing.T) { func TestServerBadHostPort(t *testing.T) { _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: "8080", GRPCHostPort: "127.0.0.1:8081", BearerTokenPropagation: true}, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.NotNil(t, err) _, err = NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: "127.0.0.1:8081", GRPCHostPort: "9123", BearerTokenPropagation: true}, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.NotNil(t, err) @@ -591,7 +591,7 @@ func TestServerInUseHostPort(t *testing.T) { GRPCHostPort: tc.grpcHostPort, BearerTokenPropagation: true, }, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}, ) assert.NoError(t, err) @@ -621,7 +621,7 @@ func TestServerSinglePort(t *testing.T) { querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) server, err := NewServer(flagsSvc.Logger, querySvc, nil, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort, BearerTokenPropagation: true}, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), opentracing.NoopTracer{}) assert.Nil(t, err) assert.NoError(t, server.Start()) @@ -671,7 +671,7 @@ func TestServerGracefulExit(t *testing.T) { tracer := opentracing.NoopTracer{} server, err := NewServer(flagsSvc.Logger, querySvc, nil, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort}, - tenancy.NewTenancyManager(&tenancy.Options{}), tracer) + tenancy.NewManager(&tenancy.Options{}), tracer) assert.Nil(t, err) assert.NoError(t, server.Start()) go func() { @@ -700,7 +700,7 @@ func TestServerHandlesPortZero(t *testing.T) { tracer := opentracing.NoopTracer{} server, err := NewServer(flagsSvc.Logger, querySvc, nil, &QueryOptions{GRPCHostPort: ":0", HTTPHostPort: ":0"}, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), tracer) assert.Nil(t, err) assert.NoError(t, server.Start()) @@ -751,7 +751,7 @@ func TestServerHTTPTenancy(t *testing.T) { Enabled: true, }, } - tenancyMgr := tenancy.NewTenancyManager(&serverOptions.Tenancy) + tenancyMgr := tenancy.NewManager(&serverOptions.Tenancy) spanReader := &spanstoremocks.Reader{} dependencyReader := &depsmocks.Reader{} diff --git a/cmd/query/main.go b/cmd/query/main.go index bd9b7e49530..51c374637d8 100644 --- a/cmd/query/main.go +++ b/cmd/query/main.go @@ -125,7 +125,7 @@ func main() { spanReader, dependencyReader, *queryServiceOptions) - tm := tenancy.NewTenancyManager(&queryOpts.Tenancy) + tm := tenancy.NewManager(&queryOpts.Tenancy) server, err := app.NewServer(svc.Logger, queryService, metricsQueryService, queryOpts, tm, tracer) if err != nil { logger.Fatal("Failed to create server", zap.Error(err)) diff --git a/cmd/remote-storage/app/server.go b/cmd/remote-storage/app/server.go index 1093517c71d..b7ccbf596da 100644 --- a/cmd/remote-storage/app/server.go +++ b/cmd/remote-storage/app/server.go @@ -43,7 +43,7 @@ type Server struct { } // NewServer creates and initializes Server. -func NewServer(options *Options, storageFactory storage.Factory, tm *tenancy.TenancyManager, logger *zap.Logger) (*Server, error) { +func NewServer(options *Options, storageFactory storage.Factory, tm *tenancy.Manager, logger *zap.Logger) (*Server, error) { handler, err := createGRPCHandler(storageFactory, logger) if err != nil { return nil, err @@ -99,7 +99,7 @@ func (s Server) HealthCheckStatus() chan healthcheck.Status { return s.unavailableChannel } -func createGRPCServer(opts *Options, tm *tenancy.TenancyManager, handler *shared.GRPCHandler, logger *zap.Logger) (*grpc.Server, error) { +func createGRPCServer(opts *Options, tm *tenancy.Manager, handler *shared.GRPCHandler, logger *zap.Logger) (*grpc.Server, error) { var grpcOpts []grpc.ServerOption if opts.TLSGRPC.Enabled { diff --git a/cmd/remote-storage/app/server_test.go b/cmd/remote-storage/app/server_test.go index 4a6f43ad0e3..613f09cf26e 100644 --- a/cmd/remote-storage/app/server_test.go +++ b/cmd/remote-storage/app/server_test.go @@ -57,7 +57,7 @@ func TestNewServer_CreateStorageErrors(t *testing.T) { return NewServer( &Options{GRPCHostPort: ":0"}, factory, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), zap.NewNop(), ) } @@ -128,7 +128,7 @@ func TestNewServer_TLSConfigError(t *testing.T) { _, err := NewServer( &Options{GRPCHostPort: ":8081", TLSGRPC: tlsCfg}, storageMocks.factory, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), zap.NewNop(), ) require.Error(t, err) @@ -293,7 +293,7 @@ type grpcClient struct { conn *grpc.ClientConn } -func newGRPCClient(t *testing.T, addr string, creds credentials.TransportCredentials, tm *tenancy.TenancyManager) *grpcClient { +func newGRPCClient(t *testing.T, addr string, creds credentials.TransportCredentials, tm *tenancy.Manager) *grpcClient { ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) defer cancel() @@ -329,7 +329,7 @@ func TestServerGRPCTLS(t *testing.T) { expectedServices := []string{"test"} storageMocks.reader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) - tm := tenancy.NewTenancyManager(&tenancy.Options{Enabled: true}) + tm := tenancy.NewManager(&tenancy.Options{Enabled: true}) server, err := NewServer( serverOptions, storageMocks.factory, @@ -393,7 +393,7 @@ func TestServerHandlesPortZero(t *testing.T) { server, err := NewServer( &Options{GRPCHostPort: ":0"}, storageMocks.factory, - tenancy.NewTenancyManager(&tenancy.Options{}), + tenancy.NewManager(&tenancy.Options{}), flagsSvc.Logger, ) require.Nil(t, err) diff --git a/cmd/remote-storage/main.go b/cmd/remote-storage/main.go index 6a9d797a307..a020504d72d 100644 --- a/cmd/remote-storage/main.go +++ b/cmd/remote-storage/main.go @@ -75,7 +75,7 @@ func main() { logger.Fatal("Failed to init storage factory", zap.Error(err)) } - tm := tenancy.NewTenancyManager(&opts.Tenancy) + tm := tenancy.NewManager(&opts.Tenancy) server, err := app.NewServer(opts, storageFactory, tm, svc.Logger) if err != nil { logger.Fatal("Failed to create server", zap.Error(err)) diff --git a/pkg/tenancy/grpc.go b/pkg/tenancy/grpc.go index 468101fa2a9..1bcf4705ed7 100644 --- a/pkg/tenancy/grpc.go +++ b/pkg/tenancy/grpc.go @@ -33,7 +33,7 @@ func (tss *tenantedServerStream) Context() context.Context { return tss.context } -func getValidTenant(ctx context.Context, tc *TenancyManager) (string, error) { +func getValidTenant(ctx context.Context, tc *Manager) (string, error) { // Handle case where tenant is already directly in the context tenant := GetTenant(ctx) if tenant != "" { @@ -67,7 +67,7 @@ func directlyAttachedTenant(ctx context.Context) bool { // NewGuardingStreamInterceptor blocks handling of streams whose tenancy header doesn't meet tenancy requirements. // It also ensures the tenant is directly in the context, rather than context metadata. -func NewGuardingStreamInterceptor(tc *TenancyManager) grpc.StreamServerInterceptor { +func NewGuardingStreamInterceptor(tc *Manager) grpc.StreamServerInterceptor { return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { tenant, err := getValidTenant(ss.Context(), tc) if err != nil { @@ -99,7 +99,7 @@ func tenantFromMetadata(md metadata.MD, tenancyHeader string) (string, error) { // NewGuardingUnaryInterceptor blocks handling of RPCs whose tenancy header doesn't meet tenancy requirements. // It also ensures the tenant is directly in the context, rather than context metadata. -func NewGuardingUnaryInterceptor(tc *TenancyManager) grpc.UnaryServerInterceptor { +func NewGuardingUnaryInterceptor(tc *Manager) grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { tenant, err := getValidTenant(ctx, tc) if err != nil { @@ -115,7 +115,7 @@ func NewGuardingUnaryInterceptor(tc *TenancyManager) grpc.UnaryServerInterceptor } // NewClientUnaryInterceptor injects tenant header into gRPC request metadata. -func NewClientUnaryInterceptor(tc *TenancyManager) grpc.UnaryClientInterceptor { +func NewClientUnaryInterceptor(tc *Manager) grpc.UnaryClientInterceptor { return grpc.UnaryClientInterceptor(func( ctx context.Context, method string, diff --git a/pkg/tenancy/grpc_test.go b/pkg/tenancy/grpc_test.go index 94e68dbbb74..d2fb69622ce 100644 --- a/pkg/tenancy/grpc_test.go +++ b/pkg/tenancy/grpc_test.go @@ -28,49 +28,49 @@ import ( func TestTenancyInterceptors(t *testing.T) { tests := []struct { name string - tenancyMgr *TenancyManager + tenancyMgr *Manager ctx context.Context errMsg string }{ { name: "missing tenant context", - tenancyMgr: NewTenancyManager(&Options{Enabled: true}), + tenancyMgr: NewManager(&Options{Enabled: true}), ctx: context.Background(), errMsg: "rpc error: code = PermissionDenied desc = missing tenant header", }, { name: "invalid tenant context", - tenancyMgr: NewTenancyManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), + tenancyMgr: NewManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), ctx: WithTenant(context.Background(), "acme"), errMsg: "rpc error: code = PermissionDenied desc = unknown tenant", }, { name: "valid tenant context", - tenancyMgr: NewTenancyManager(&Options{Enabled: true, Tenants: []string{"acme"}}), + tenancyMgr: NewManager(&Options{Enabled: true, Tenants: []string{"acme"}}), ctx: WithTenant(context.Background(), "acme"), errMsg: "", }, { name: "invalid tenant header", - tenancyMgr: NewTenancyManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), + tenancyMgr: NewManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), ctx: metadata.NewIncomingContext(context.Background(), map[string][]string{"x-tenant": {"acme"}}), errMsg: "rpc error: code = PermissionDenied desc = unknown tenant", }, { name: "missing tenant header", - tenancyMgr: NewTenancyManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), + tenancyMgr: NewManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), ctx: metadata.NewIncomingContext(context.Background(), map[string][]string{}), errMsg: "rpc error: code = PermissionDenied desc = missing tenant header", }, { name: "valid tenant header", - tenancyMgr: NewTenancyManager(&Options{Enabled: true, Tenants: []string{"acme"}}), + tenancyMgr: NewManager(&Options{Enabled: true, Tenants: []string{"acme"}}), ctx: metadata.NewIncomingContext(context.Background(), map[string][]string{"x-tenant": {"acme"}}), errMsg: "", }, { name: "extra tenant header", - tenancyMgr: NewTenancyManager(&Options{Enabled: true, Tenants: []string{"acme"}}), + tenancyMgr: NewManager(&Options{Enabled: true, Tenants: []string{"acme"}}), ctx: metadata.NewIncomingContext(context.Background(), map[string][]string{"x-tenant": {"acme", "megacorp"}}), errMsg: "rpc error: code = PermissionDenied desc = extra tenant header", }, @@ -114,7 +114,7 @@ func TestTenancyInterceptors(t *testing.T) { } func TestClientUnaryInterceptor(t *testing.T) { - tm := NewTenancyManager(&Options{Enabled: true, Tenants: []string{"acme"}}) + tm := NewManager(&Options{Enabled: true, Tenants: []string{"acme"}}) interceptor := NewClientUnaryInterceptor(tm) var tenant string fakeErr := errors.New("foo") diff --git a/pkg/tenancy/http.go b/pkg/tenancy/http.go index 156fb45d400..0884a7d41ed 100644 --- a/pkg/tenancy/http.go +++ b/pkg/tenancy/http.go @@ -24,7 +24,7 @@ import ( // PropagationHandler returns a http.Handler containing the logic to extract // the tenancy header of the http.Request and insert the tenant into request.Context // for propagation. The token can be accessed via tenancy.GetTenant(). -func ExtractTenantHTTPHandler(tc *TenancyManager, h http.Handler) http.Handler { +func ExtractTenantHTTPHandler(tc *Manager, h http.Handler) http.Handler { if !tc.Enabled { return h } @@ -50,7 +50,7 @@ func ExtractTenantHTTPHandler(tc *TenancyManager, h http.Handler) http.Handler { // MetadataAnnotator returns a function suitable for propagating tenancy // via github.com/grpc-ecosystem/grpc-gateway/runtime.NewServeMux -func (tc *TenancyManager) MetadataAnnotator() func(context.Context, *http.Request) metadata.MD { +func (tc *Manager) MetadataAnnotator() func(context.Context, *http.Request) metadata.MD { return func(ctx context.Context, req *http.Request) metadata.MD { tenant := req.Header.Get(tc.Header) if tenant == "" { diff --git a/pkg/tenancy/http_test.go b/pkg/tenancy/http_test.go index db0ba9191ca..c4ee53a53d0 100644 --- a/pkg/tenancy/http_test.go +++ b/pkg/tenancy/http_test.go @@ -36,31 +36,31 @@ func (thh *testHttpHandler) ServeHTTP(res http.ResponseWriter, req *http.Request func TestProgationHandler(t *testing.T) { tests := []struct { name string - tenancyMgr *TenancyManager + tenancyMgr *Manager shouldReach bool requestHeaders map[string][]string }{ { name: "untenanted", - tenancyMgr: NewTenancyManager(&Options{}), + tenancyMgr: NewManager(&Options{}), requestHeaders: map[string][]string{}, shouldReach: true, }, { name: "missing tenant header", - tenancyMgr: NewTenancyManager(&Options{Enabled: true}), + tenancyMgr: NewManager(&Options{Enabled: true}), requestHeaders: map[string][]string{}, shouldReach: false, }, { name: "valid tenant header", - tenancyMgr: NewTenancyManager(&Options{Enabled: true}), + tenancyMgr: NewManager(&Options{Enabled: true}), requestHeaders: map[string][]string{"x-tenant": {"acme"}}, shouldReach: true, }, { name: "unauthorized tenant", - tenancyMgr: NewTenancyManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), + tenancyMgr: NewManager(&Options{Enabled: true, Tenants: []string{"megacorp"}}), requestHeaders: map[string][]string{"x-tenant": {"acme"}}, shouldReach: false, }, @@ -87,17 +87,17 @@ func TestProgationHandler(t *testing.T) { func TestMetadataAnnotator(t *testing.T) { tests := []struct { name string - tenancyMgr *TenancyManager + tenancyMgr *Manager requestHeaders map[string][]string }{ { name: "missing tenant", - tenancyMgr: NewTenancyManager(&Options{Enabled: true}), + tenancyMgr: NewManager(&Options{Enabled: true}), requestHeaders: map[string][]string{}, }, { name: "tenanted", - tenancyMgr: NewTenancyManager(&Options{Enabled: true}), + tenancyMgr: NewManager(&Options{Enabled: true}), requestHeaders: map[string][]string{"x-tenant": {"acme"}}, }, } diff --git a/pkg/tenancy/config_test.go b/pkg/tenancy/manage_test.go similarity index 97% rename from pkg/tenancy/config_test.go rename to pkg/tenancy/manage_test.go index a38067dc39e..c3e926b908e 100644 --- a/pkg/tenancy/config_test.go +++ b/pkg/tenancy/manage_test.go @@ -84,7 +84,7 @@ func TestTenancyValidity(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - tc := NewTenancyManager(&test.options) + tc := NewManager(&test.options) assert.Equal(t, test.valid, tc.Valid(test.tenant)) }) } diff --git a/pkg/tenancy/config.go b/pkg/tenancy/manager.go similarity index 86% rename from pkg/tenancy/config.go rename to pkg/tenancy/manager.go index 5277ead9b93..9f6addf1471 100644 --- a/pkg/tenancy/config.go +++ b/pkg/tenancy/manager.go @@ -14,8 +14,15 @@ package tenancy -// TenancyManager can check tenant usage for multi-tenant Jaeger configurations -type TenancyManager struct { +// Options describes the configuration properties for multitenancy +type Options struct { + Enabled bool + Header string + Tenants []string +} + +// Manager can check tenant usage for multi-tenant Jaeger configurations +type Manager struct { Enabled bool Header string guard guard @@ -26,28 +33,21 @@ type guard interface { Valid(candidate string) bool } -// Options describes the configuration properties for multitenancy -type Options struct { - Enabled bool - Header string - Tenants []string -} - -// NewTenancyManager creates a TenancyManager from tenancy Options -func NewTenancyManager(options *Options) *TenancyManager { +// NewManager creates a tenancy.Manager for given tenancy.Options. +func NewManager(options *Options) *Manager { // Default header value (although set by CLI flags, this helps tests and API users) header := options.Header if header == "" && options.Enabled { header = "x-tenant" } - return &TenancyManager{ + return &Manager{ Enabled: options.Enabled, Header: header, guard: tenancyGuardFactory(options), } } -func (tc *TenancyManager) Valid(tenant string) bool { +func (tc *Manager) Valid(tenant string) bool { return tc.guard.Valid(tenant) } From a026fdff7ab3353dfc8862d343af7ca9abdb9e23 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 2 Aug 2022 12:23:52 -0400 Subject: [PATCH 11/87] Build remote-storage (#3841) --- .gitignore | 3 ++- Makefile | 11 +++++++++-- cmd/remote-storage/Dockerfile | 8 ++++---- scripts/build-upload-docker-images.sh | 19 ++++--------------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 1f1239b99b5..1372707b7ac 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ cmd/collector/collector cmd/collector/collector-* cmd/ingester/ingester cmd/ingester/ingester-* +cmd/remote-storage/remote-storage +cmd/remote-storage/remote-storage-* cmd/es-index-cleaner/es-index-cleaner-* cmd/es-rollover/es-rollover-* cmd/query/query @@ -38,4 +40,3 @@ crossdock/crossdock-* run-crossdock.log proto-gen/.patched-otel-proto/ __pycache__ - diff --git a/Makefile b/Makefile index 1d0cc87a9ec..7bc9d6e746e 100644 --- a/Makefile +++ b/Makefile @@ -216,8 +216,8 @@ rebuild-ui: build-all-in-one-linux: GOOS=linux $(MAKE) build-all-in-one -build-all-in-one-debug build-agent-debug build-query-debug build-collector-debug build-ingester-debug: DISABLE_OPTIMIZATIONS = -gcflags="all=-N -l" -build-all-in-one-debug build-agent-debug build-query-debug build-collector-debug build-ingester-debug: SUFFIX = -debug +build-all-in-one-debug build-agent-debug build-query-debug build-collector-debug build-ingester-debug build-remote-storage-debug: DISABLE_OPTIMIZATIONS = -gcflags="all=-N -l" +build-all-in-one-debug build-agent-debug build-query-debug build-collector-debug build-ingester-debug build-remote-storage-debug: SUFFIX = -debug .PHONY: build-all-in-one build-all-in-one-debug build-all-in-one build-all-in-one-debug: build-ui @@ -239,6 +239,10 @@ build-collector build-collector-debug: build-ingester build-ingester-debug: $(GOBUILD) $(DISABLE_OPTIMIZATIONS) -o ./cmd/ingester/ingester$(SUFFIX)-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/ingester/main.go +.PHONY: build-remote-storage build-remote-storage-debug +build-remote-storage build-remote-storage-debug: + $(GOBUILD) $(DISABLE_OPTIMIZATIONS) -o ./cmd/remote-storage/remote-storage$(SUFFIX)-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/remote-storage/main.go + .PHONY: build-binaries-linux build-binaries-linux: GOOS=linux GOARCH=amd64 $(MAKE) build-platform-binaries @@ -276,7 +280,10 @@ build-platform-binaries: build-agent \ build-query-debug \ build-ingester \ build-ingester-debug \ + build-remote-storage \ + build-remote-storage-debug \ build-all-in-one \ + build-all-in-one-debug \ build-examples \ build-tracegen \ build-anonymizer \ diff --git a/cmd/remote-storage/Dockerfile b/cmd/remote-storage/Dockerfile index 8ca40ad2ee8..0da1354b60d 100644 --- a/cmd/remote-storage/Dockerfile +++ b/cmd/remote-storage/Dockerfile @@ -5,12 +5,12 @@ ARG SVC=remote-storage FROM $base_image AS release ARG TARGETARCH -COPY $SVC-linux-$TARGETARCH /go/bin/$SVC-linux +COPY remote-storage-linux-$TARGETARCH /go/bin/remote-storage-linux EXPOSE 16686/tcp -ENTRYPOINT ["/go/bin/$SVC-linux"] +ENTRYPOINT ["/go/bin/remote-storage-linux"] FROM $debug_image AS debug ARG TARGETARCH=amd64 -COPY $SVC-debug-linux-$TARGETARCH /go/bin/$SVC-linux +COPY remote-storage-debug-linux-$TARGETARCH /go/bin/remote-storage-linux EXPOSE 12345/tcp 16686/tcp -ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/$SVC-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"] +ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/remote-storage-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"] diff --git a/scripts/build-upload-docker-images.sh b/scripts/build-upload-docker-images.sh index 7e004fc48bd..3f3c9254a1e 100755 --- a/scripts/build-upload-docker-images.sh +++ b/scripts/build-upload-docker-images.sh @@ -13,30 +13,19 @@ make build-binaries-arm64 # build multi-arch docker images platforms="linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" -# build/upload images for release version of Jaeger backend components -for component in agent collector query ingester +# build/upload raw and debug images of Jaeger backend components +for component in agent collector query ingester remote-storage do bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}" -t release + bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug done -# build/upload images for jaeger-es-index-cleaner and jaeger-es-rollover bash scripts/build-upload-a-docker-image.sh -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -p "${platforms}" -t release bash scripts/build-upload-a-docker-image.sh -b -c jaeger-es-rollover -d cmd/es-rollover -p "${platforms}" -t release +bash scripts/build-upload-a-docker-image.sh -c jaeger-cassandra-schema -d plugin/storage/cassandra/ # build/upload images for jaeger-tracegen and jaeger-anonymizer for component in tracegen anonymizer do bash scripts/build-upload-a-docker-image.sh -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}" -done - - -# build amd64 docker images - -# build/upload images for debug version of Jaeger backend components -for component in agent collector query ingester -do - bash scripts/build-upload-a-docker-image.sh -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug done - -# build/upload images for jaeger-cassandra-schema -bash scripts/build-upload-a-docker-image.sh -c jaeger-cassandra-schema -d plugin/storage/cassandra/ From 9a0fbd8713f1d81f33f83e4e1614539d90ab23be Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 2 Aug 2022 23:40:17 -0400 Subject: [PATCH 12/87] Replace Elasticsearch in crossdock CI with remote memstore (#3843) --- .github/workflows/ci-crossdock.yml | 13 ++++------- crossdock/docker-compose.yml | 2 +- crossdock/jaeger-docker-compose.yml | 36 ++++++++++++++++------------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-crossdock.yml b/.github/workflows/ci-crossdock.yml index 6f620d90466..e98be85f546 100644 --- a/.github/workflows/ci-crossdock.yml +++ b/.github/workflows/ci-crossdock.yml @@ -10,12 +10,7 @@ on: jobs: crossdock: runs-on: ubuntu-latest - strategy: - matrix: - steps: - - name: crossdock - cmd: bash scripts/build-crossdock.sh - name: ${{ matrix.steps.name }} + steps: - uses: actions/checkout@v3 with: @@ -34,11 +29,11 @@ jobs: - name: Install tools run: make install-ci - + - uses: docker/setup-qemu-action@v2 - - name: Build, test, and publish ${{ matrix.steps.name }} image - run: ${{ matrix.steps.cmd }} + - name: Build, test, and publish crossdock image + run: bash scripts/build-crossdock.sh env: DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} diff --git a/crossdock/docker-compose.yml b/crossdock/docker-compose.yml index 667fa95de4d..4bcfd782ef6 100644 --- a/crossdock/docker-compose.yml +++ b/crossdock/docker-compose.yml @@ -40,7 +40,7 @@ services: ports: - "8080-8082" depends_on: -# UDP sender needs to know agent's address + # UDP sender needs to know agent's address - jaeger-agent python: diff --git a/crossdock/jaeger-docker-compose.yml b/crossdock/jaeger-docker-compose.yml index 84218978456..fefc3714864 100644 --- a/crossdock/jaeger-docker-compose.yml +++ b/crossdock/jaeger-docker-compose.yml @@ -1,33 +1,46 @@ version: '2' services: + jaeger-remote-storage: + image: jaegertracing/jaeger-remote-storage + command: + - "--log-level=debug" + environment: + - SPAN_STORAGE_TYPE=memory + ports: + - "17271:17271" + jaeger-collector: image: jaegertracing/jaeger-collector - command: ["--es.num-shards=1", "--es.num-replicas=0", "--es.server-urls=http://elasticsearch:9200", "--collector.zipkin.host-port=:9411"] + command: + - "--grpc-storage.server=jaeger-remote-storage:17271" + - "--collector.zipkin.host-port=:9411" + - "--log-level=debug" ports: - "14269" - "14268:14268" - "14250" - "9411:9411" environment: - - SPAN_STORAGE_TYPE=elasticsearch + - SPAN_STORAGE_TYPE=grpc-plugin - LOG_LEVEL=debug restart: on-failure depends_on: - - elasticsearch + - jaeger-remote-storage jaeger-query: image: jaegertracing/jaeger-query - command: ["--es.num-shards=1", "--es.num-replicas=0", "--es.server-urls=http://elasticsearch:9200"] + command: + - "--grpc-storage.server=jaeger-remote-storage:17271" + - "--log-level=debug" ports: - "16686:16686" - "16687" environment: - - SPAN_STORAGE_TYPE=elasticsearch - - LOG_LEVEL=debug + - SPAN_STORAGE_TYPE=grpc-plugin restart: on-failure depends_on: - - elasticsearch + - jaeger-remote-storage jaeger-agent: image: jaegertracing/jaeger-agent @@ -42,12 +55,3 @@ services: restart: on-failure depends_on: - jaeger-collector - - elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.3 - environment: - - discovery.type=single-node - ports: - - "9200:9200/tcp" - - From d70ff2d1c20e2cd7ab31d4c5337d819b82bc6a65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 04:05:32 +0000 Subject: [PATCH 13/87] Bump github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger (#3823) Bumps [github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger](https://github.com/open-telemetry/opentelemetry-collector-contrib) from 0.55.0 to 0.56.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/v0.55.0...v0.56.0) --- updated-dependencies: - dependency-name: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 20 ++++++++++---------- go.sum | 44 +++++++++++++++++++++----------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 6dda7f24272..dc563d8bc0c 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/hashicorp/go-plugin v1.4.4 github.com/kr/pretty v0.3.0 github.com/olivere/elastic v6.2.37+incompatible - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.55.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.56.0 github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 @@ -47,9 +47,9 @@ require ( github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/uber/jaeger-lib v2.4.1+incompatible github.com/xdg-go/scram v1.1.1 - go.opentelemetry.io/collector v0.55.0 - go.opentelemetry.io/collector/pdata v0.55.0 - go.opentelemetry.io/collector/semconv v0.55.0 + go.opentelemetry.io/collector v0.56.0 + go.opentelemetry.io/collector/pdata v0.56.0 + go.opentelemetry.io/collector/semconv v0.56.0 go.opentelemetry.io/otel v1.8.0 go.uber.org/atomic v1.9.0 go.uber.org/automaxprocs v1.5.1 @@ -76,7 +76,7 @@ require ( github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/fatih/color v1.13.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.21.2 // indirect @@ -99,7 +99,7 @@ require ( github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.7 // indirect + github.com/klauspost/compress v1.15.8 // indirect github.com/knadh/koanf v1.4.2 // indirect github.com/kr/text v0.2.0 // indirect github.com/magiconair/properties v1.8.6 // indirect @@ -118,7 +118,7 @@ require ( github.com/oklog/ulid v1.3.1 // indirect github.com/onsi/ginkgo v1.16.4 // indirect github.com/onsi/gomega v1.13.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.55.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.56.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect @@ -137,9 +137,9 @@ require ( github.com/xdg-go/stringprep v1.0.3 // indirect go.mongodb.org/mongo-driver v1.8.3 // indirect go.opencensus.io v0.23.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 // indirect - go.opentelemetry.io/otel/metric v0.30.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect + go.opentelemetry.io/otel/metric v0.31.0 // indirect go.opentelemetry.io/otel/trace v1.8.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect diff --git a/go.sum b/go.sum index 1f69839f178..e171c69092c 100644 --- a/go.sum +++ b/go.sum @@ -151,8 +151,8 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= @@ -415,8 +415,8 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.7 h1:7cgTQxJCU/vy+oP/E3B9RGbQTgbiVzIJWIKOLoAsPok= -github.com/klauspost/compress v1.15.7/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.8 h1:JahtItbkWjf2jzm/T+qgMxkP9EMHsqEUA6vCMGmXvhA= +github.com/klauspost/compress v1.15.8/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -507,10 +507,10 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.55.0 h1:ruS+QeZ33UjAs7yeRTzliTb12gHsHdL4Dd8X8PCRWes= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.55.0/go.mod h1:Rg7RP5u87jRlzIi1Zh3KgBf79y0F5MLTPAWa+AkLUEo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.55.0 h1:6ldbOJsxpM33KtZab1APXWAQiPrdlo5ZjNvf6geI/iY= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.55.0/go.mod h1:KUnXKJpcAdWPNuONubmpFUBlOfXPlSYuoU52GuByya4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.56.0 h1:gQRNxr5sW2kxwBAQWJYTcl8H3oW6V2M5fLsiCSOe61M= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.56.0/go.mod h1:26zJmolOTD2CqKCl1wJio+k6yEZpsaSsbWqcCIJ59Uc= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.56.0 h1:4OzAOHjNGaCaS166MYBVZN+3D3wH/GsD4IGbH9IekPo= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.56.0/go.mod h1:D3Z00WpV75kVnou9F6NdtGfHEOTxtnVHGUYcSbBIJSY= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df h1:vdYtBU6zvL7v+Tr+0xFM/qhahw/EvY8DMMunZHKH6eE= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= @@ -665,23 +665,21 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/collector v0.55.0 h1:2IhhqKNi07MIMXVi8ovOXY29Ixo6qbSqF0mfRTnJQZs= -go.opentelemetry.io/collector v0.55.0/go.mod h1:q12RmApzWIfOc+ao73+UmSyTy6X8pHXi2B7CeLJxnbk= -go.opentelemetry.io/collector/pdata v0.55.0 h1:NCg20aZHqbLc5mx7e+mFnoEYt7Neu4Q/lPa76X6rBXs= -go.opentelemetry.io/collector/pdata v0.55.0/go.mod h1:f/jo/rDlHowf1T4XIAU+4XGhxaBDaAnKg+3tl3VnQGM= -go.opentelemetry.io/collector/semconv v0.55.0 h1:nstjzHS7Q3MyHpKSgIbOKDP6UW94fe9VQhnvPzzEZuA= -go.opentelemetry.io/collector/semconv v0.55.0/go.mod h1:EH1wbDvTyqKpKBBpoMIe0KQk2plCcFS66Mo17WtR7CQ= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 h1:WenoaOMNP71oq3KkMZ/jnxI9xU/JSCLw8yZILSI2lfU= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0/go.mod h1:J0dBVrt7dPS/lKJyQoW0xzQiUr4r2Ik1VwPjAUWnofI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY= -go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/collector v0.56.0 h1:p9lLKYyWgX0PBdNP4EScZfMpk8XYSj+MuIhS0dSWzq8= +go.opentelemetry.io/collector v0.56.0/go.mod h1:zYv4Ds01+96vPhYIwhYb3unemGriZ4OQBWeMT6JoVEQ= +go.opentelemetry.io/collector/pdata v0.56.0 h1:JD8KjQ7dNZ441xMuVZVu5NRYmkA4vOYGV7w8tkCdyrE= +go.opentelemetry.io/collector/pdata v0.56.0/go.mod h1:mYcCREWiIJyHss0dbU+GSiz2tmGZ6u09vtfkKTciog4= +go.opentelemetry.io/collector/semconv v0.56.0 h1:zpQ6IBimBsiVsJibsSM2/13vKtaeteFFIx4bmIiOS6E= +go.opentelemetry.io/collector/semconv v0.56.0/go.mod h1:EH1wbDvTyqKpKBBpoMIe0KQk2plCcFS66Mo17WtR7CQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= -go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c= -go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= -go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= -go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= +go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= +go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= From 5eba1397d31de18f53b83f433e75ec449b7aa0ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 02:32:34 -0400 Subject: [PATCH 14/87] Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 (#3846) Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.0 to 1.28.1. - [Release notes](https://github.com/protocolbuffers/protobuf-go/releases) - [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash) - [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.0...v1.28.1) --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index dc563d8bc0c..17119b35356 100644 --- a/go.mod +++ b/go.mod @@ -57,7 +57,7 @@ require ( golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a google.golang.org/grpc v1.48.0 - google.golang.org/protobuf v1.28.0 + google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index e171c69092c..a5709d3cfbc 100644 --- a/go.sum +++ b/go.sum @@ -1080,8 +1080,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 51c1c04f0d787f1eedbf2f14dddfc84bead8a6dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 06:54:27 +0000 Subject: [PATCH 15/87] Bump github.com/hashicorp/go-hclog from 1.2.1 to 1.2.2 (#3844) Bumps [github.com/hashicorp/go-hclog](https://github.com/hashicorp/go-hclog) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/hashicorp/go-hclog/releases) - [Commits](https://github.com/hashicorp/go-hclog/compare/v1.2.1...v1.2.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-hclog dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 17119b35356..2dbe3c5cc8e 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 - github.com/hashicorp/go-hclog v1.2.1 + github.com/hashicorp/go-hclog v1.2.2 github.com/hashicorp/go-plugin v1.4.4 github.com/kr/pretty v0.3.0 github.com/olivere/elastic v6.2.37+incompatible diff --git a/go.sum b/go.sum index a5709d3cfbc..ad8d5cada8b 100644 --- a/go.sum +++ b/go.sum @@ -346,8 +346,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= -github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= +github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= From fdc3ae5d914daa5c097bf18afbfa62e1c0d4de97 Mon Sep 17 00:00:00 2001 From: Joe Elliott Date: Wed, 3 Aug 2022 13:29:32 -0400 Subject: [PATCH 16/87] release (#3847) Signed-off-by: Joe Elliott --- CHANGELOG.md | 16 ++++++++++++++++ RELEASE.md | 2 +- jaeger-ui | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f461663846..5fcc4dec465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,22 @@ next release ### UI Changes +1.37.0 (2022-08-03) +------------------- +### Backend Changes + +* Add remote-storage service ([@yurishkuro](https://github.com/yurishkuro) in [#3836](https://github.com/jaegertracing/jaeger/pull/3836)) + +#### Bug fixes, Minor Improvements + +* Fix ingester panic when span.process=nil ([@locmai](https://github.com/locmai) in [#3819](https://github.com/jaegertracing/jaeger/pull/3819)) +* Added windows zip file generation ([@adhithyasrinivasan](https://github.com/adhithyasrinivasan) in [#3817](https://github.com/jaegertracing/jaeger/pull/3817)) +* Refactor gRPC storage plugin for better composability ([@yurishkuro](https://github.com/yurishkuro) in [#3833](https://github.com/jaegertracing/jaeger/pull/3833)) + +### UI Changes + +* UI pinned to version [1.26.0 - see the changelog](https://github.com/jaegertracing/jaeger-ui/blob/main/CHANGELOG.md#v1260-2022-08-03). + 1.36.0 (2022-07-05) ------------------- ### Backend Changes diff --git a/RELEASE.md b/RELEASE.md index ee7536c0436..3bd765f0f1e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -53,7 +53,7 @@ Here are the release managers for future versions with the tentative release dat | Version | Release Manager | Tentative release date | |---------|-----------------|------------------------| -| 1.37.0 | @joe-elliott | 3 August 2022 | | 1.38.0 | @pavolloffay | 7 September 2022 | | 1.39.0 | @yurishkuro | 2 October 2022 | | 1.40.0 | @albertteoh | 2 November 2022 | +| 1.41.0 | @joe-elliott | 7 December 2022 | diff --git a/jaeger-ui b/jaeger-ui index 54950689587..d69509b8bc2 160000 --- a/jaeger-ui +++ b/jaeger-ui @@ -1 +1 @@ -Subproject commit 549506895874c64b6bc5c675699ef0d203e2b7e7 +Subproject commit d69509b8bc2635b5b9dd536b66fc634060ad54fb From 7006e9fe50c8467ad6b84f2072a3cf136bfbe4ec Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Wed, 3 Aug 2022 18:12:44 -0400 Subject: [PATCH 17/87] Add sample docker-compose configuration using Kafka Signed-off-by: Yuri Shkuro --- docker-compose/kafka/README.md | 23 ++++ docker-compose/kafka/docker-compose.yml | 136 ++++++++++++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 docker-compose/kafka/README.md create mode 100644 docker-compose/kafka/docker-compose.yml diff --git a/docker-compose/kafka/README.md b/docker-compose/kafka/README.md new file mode 100644 index 00000000000..0f18aad2e11 --- /dev/null +++ b/docker-compose/kafka/README.md @@ -0,0 +1,23 @@ +# Sample configuration with Kafka + +This `docker-compose` environment provides a sample configuration of Jaeger depoyment utilizing collector-Kafka-injester pipeline. Storage is provided by the `jageer-remote-storage` service running memstore. + +Jaeger UI can be accessed at http://localhost:16686/, as usual, and refreshing the screen should produce internal traces. + +```mermaid +graph LR + C[jaeger-collector] --> KafkaBroker + KafkaBroker --> I[jaeger-ingester] + I --> S[jaeger-remote-storage] + UI[jaeger-query
Jaeger UI] --> S + S --> MemStore + KafkaBroker --> ZooKeeper + subgraph Kafka + KafkaBroker + ZooKeeper + end + subgraph Shared Storage + S + MemStore + end +``` diff --git a/docker-compose/kafka/docker-compose.yml b/docker-compose/kafka/docker-compose.yml new file mode 100644 index 00000000000..02922cd95a4 --- /dev/null +++ b/docker-compose/kafka/docker-compose.yml @@ -0,0 +1,136 @@ +version: "2.1" + +services: + zookeeper: + image: bitnami/zookeeper + ports: + - 2181:2181 + environment: + - ALLOW_ANONYMOUS_LOGIN=yes + kafka: + image: 'bitnami/kafka:latest' + ports: + - '9092:9092' + environment: + - KAFKA_BROKER_ID=1 + - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_LISTENERS=INTERNAL://0.0.0.0:9092,OUTSIDE://0.0.0.0:9094 + - KAFKA_ADVERTISED_LISTENERS=INTERNAL://kafka:9092,OUTSIDE://localhost:9094 + - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT + - KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL + restart: always + depends_on: + - zookeeper + links: + - zookeeper + healthcheck: + test: ["CMD-SHELL", "kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092"] + interval: 5s + timeout: 5s + retries: 3 + start_period: 5s + + jaeger-remote-storage: + image: jaegertracing/jaeger-remote-storage + ports: + - 17271:17271 + environment: + - SPAN_STORAGE_TYPE=memory + healthcheck: + test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:17270/ || exit 1"] + interval: 5s + timeout: 5s + retries: 3 + + jaeger-collector: + image: jaegertracing/jaeger-collector + command: + - "--collector.otlp.enabled=true" + - "--log-level=debug" + ports: + - 4318:4318 + - 14250:14250 + environment: + - SPAN_STORAGE_TYPE=kafka + - KAFKA_PRODUCER_BROKERS=kafka:9092 + healthcheck: + test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:14269/ || exit 1"] + interval: 5s + timeout: 5s + retries: 3 + depends_on: + kafka: + condition: service_healthy + links: + - kafka + + jaeger-ingester: + image: jaegertracing/jaeger-ingester + command: + - "--grpc-storage.server=jaeger-remote-storage:17271" + - "--log-level=debug" + environment: + - SPAN_STORAGE_TYPE=grpc-plugin + - KAFKA_CONSUMER_BROKERS=kafka:9092 + healthcheck: + test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:14270/ || exit 1"] + interval: 5s + timeout: 5s + retries: 3 + depends_on: + kafka: + condition: service_healthy + jaeger-remote-storage: + condition: service_healthy + jaeger-collector: + condition: service_healthy + links: + - kafka + - jaeger-remote-storage + + jaeger-agent: + image: jaegertracing/jaeger-agent + command: + - "--reporter.grpc.host-port=jaeger-collector:14250" + - "--log-level=debug" + ports: + - "6831:6831/udp" + - "6832:6832/udp" + - "5778:5778" + restart: on-failure + healthcheck: + test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:14271/ || exit 1"] + interval: 5s + timeout: 5s + retries: 3 + depends_on: + jaeger-collector: + condition: service_healthy + links: + - jaeger-collector + + jaeger-query: + image: jaegertracing/jaeger-query + command: + - "--grpc-storage.server=jaeger-remote-storage:17271" + - "--log-level=debug" + environment: + - SPAN_STORAGE_TYPE=grpc-plugin + - JAEGER_AGENT_HOST=jaeger-agent + ports: + - "16686:16686" + - "16687" + restart: on-failure + healthcheck: + test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:16687/ || exit 1"] + interval: 5s + timeout: 5s + retries: 3 + depends_on: + jaeger-remote-storage: + condition: service_healthy + links: + - jaeger-agent + - jaeger-remote-storage From 7066c38b9e28f2d6d17123ecf26138f39dff52a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 18:21:04 -0400 Subject: [PATCH 18/87] Bump go.opentelemetry.io/otel from 1.8.0 to 1.9.0 (#3845) Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.8.0 to 1.9.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.8.0...v1.9.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yuri Shkuro --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 2dbe3c5cc8e..9c0ea1a4183 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( go.opentelemetry.io/collector v0.56.0 go.opentelemetry.io/collector/pdata v0.56.0 go.opentelemetry.io/collector/semconv v0.56.0 - go.opentelemetry.io/otel v1.8.0 + go.opentelemetry.io/otel v1.9.0 go.uber.org/atomic v1.9.0 go.uber.org/automaxprocs v1.5.1 go.uber.org/zap v1.21.0 @@ -140,7 +140,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect go.opentelemetry.io/otel/metric v0.31.0 // indirect - go.opentelemetry.io/otel/trace v1.8.0 // indirect + go.opentelemetry.io/otel/trace v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect golang.org/x/text v0.3.7 // indirect diff --git a/go.sum b/go.sum index ad8d5cada8b..bcba0c66112 100644 --- a/go.sum +++ b/go.sum @@ -675,13 +675,13 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= -go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg= -go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= +go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= +go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= -go.opentelemetry.io/otel/trace v1.8.0 h1:cSy0DF9eGI5WIfNwZ1q2iUyGj00tGzP24dE1lOlHrfY= -go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4= +go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= +go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= From a17aa35771fca35b11cbba55ddf0512fc9fbf072 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:05:06 -0400 Subject: [PATCH 19/87] Bump github.com/go-openapi/strfmt from 0.21.2 to 0.21.3 (#3818) Bumps [github.com/go-openapi/strfmt](https://github.com/go-openapi/strfmt) from 0.21.2 to 0.21.3. - [Release notes](https://github.com/go-openapi/strfmt/releases) - [Commits](https://github.com/go-openapi/strfmt/compare/v0.21.2...v0.21.3) --- updated-dependencies: - dependency-name: github.com/go-openapi/strfmt dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 7 +++---- go.sum | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 9c0ea1a4183..90a44b13d4a 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/go-openapi/loads v0.21.1 github.com/go-openapi/runtime v0.23.3 github.com/go-openapi/spec v0.20.6 - github.com/go-openapi/strfmt v0.21.2 + github.com/go-openapi/strfmt v0.21.3 github.com/go-openapi/swag v0.21.1 github.com/go-openapi/validate v0.22.0 github.com/gocql/gocql v0.0.0-20211222173705-d73e6b1002a7 @@ -82,7 +82,6 @@ require ( github.com/go-openapi/analysis v0.21.2 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-stack/stack v1.8.1 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect @@ -135,14 +134,14 @@ require ( github.com/subosito/gotenv v1.3.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/stringprep v1.0.3 // indirect - go.mongodb.org/mongo-driver v1.8.3 // indirect + go.mongodb.org/mongo-driver v1.10.0 // indirect go.opencensus.io v0.23.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect go.opentelemetry.io/otel/metric v0.31.0 // indirect go.opentelemetry.io/otel/trace v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index bcba0c66112..b07831bcf90 100644 --- a/go.sum +++ b/go.sum @@ -205,8 +205,9 @@ github.com/go-openapi/spec v0.20.6 h1:ich1RQ3WDbfoeTqTAb+5EIxNmpKVJZWBNah9RAT0jI github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o= +github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= @@ -215,7 +216,6 @@ github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUri github.com/go-openapi/validate v0.22.0 h1:b0QecH6VslW/TxtpKgzpO1SNG7GU2FsaqKdP1E2T50Y= github.com/go-openapi/validate v0.22.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= @@ -655,8 +655,9 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.8.3 h1:TDKlTkGDKm9kkJVUOAXDK5/fkqKHJVwYQSpoRfB43R4= go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.mongodb.org/mongo-driver v1.10.0 h1:UtV6N5k14upNp4LTduX0QCufG124fSu25Wz9tu94GLg= +go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -712,8 +713,8 @@ golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= From 0729754cf55ec3dde62e11e26e02f0a94122d00c Mon Sep 17 00:00:00 2001 From: Ashmita Date: Fri, 5 Aug 2022 22:43:37 +1000 Subject: [PATCH 20/87] Fix upload of zip file in release github action (#3854) Earlier we used to have tar.gz for windows release. https://github.com/jaegertracing/jaeger/pull/3817 changed the windows release from tar.gz to zip format. This PR also restores that i.e. now we have both tar.gz and zip for windows release. Signed-off-by: Ashmita152 --- .github/workflows/ci-release.yml | 2 +- scripts/package-deploy.sh | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 1865d2bbac3..86cd131c8f3 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -44,7 +44,7 @@ jobs: - name: Upload binaries uses: svenstaro/upload-release-action@2.3.0 with: - file: deploy/*.tar.gz + file: '{deploy/*.tar.gz,deploy/*.zip}' file_glob: true tag: ${{ github.ref }} repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/package-deploy.sh b/scripts/package-deploy.sh index 55de936719e..c97344fb8b9 100755 --- a/scripts/package-deploy.sh +++ b/scripts/package-deploy.sh @@ -28,19 +28,17 @@ function stage-platform-files { stage-file ./examples/hotrod/hotrod-$PLATFORM $PACKAGE_STAGING_DIR/example-hotrod$FILE_EXTENSION } -# package pulls built files for the platform ($1). If you pass in a file -# extension ($2) it will be used on the binaries +# package pulls built files for the platform ($2) and compresses it using the compression ($1). +# If you pass in a file extension ($3) it will be look for binaries with that extension. function package { - local COMPRESSION=$1 local PLATFORM=$2 local FILE_EXTENSION=$3 - # script start local PACKAGE_STAGING_DIR=jaeger-$VERSION-$PLATFORM mkdir $PACKAGE_STAGING_DIR - stage-platform-files $PLATFORM $PACKAGE_STAGING_DIR $FILE_EXTENSION + if [ "$COMPRESSION" == "zip" ] then local ARCHIVE_NAME="$PACKAGE_STAGING_DIR.zip" @@ -68,7 +66,8 @@ mkdir $DEPLOY_STAGING_DIR package tar linux-amd64 package tar darwin-amd64 package tar darwin-arm64 -package zip windows-amd64 .exe +package tar windows-amd64 .exe +package zip windows-amd64 .exe package tar linux-s390x package tar linux-arm64 package tar linux-ppc64le From 38f62031491c869223694506966a4b57d69be256 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Aug 2022 21:30:38 -0400 Subject: [PATCH 21/87] Bump github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger (#3853) Bumps [github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger](https://github.com/open-telemetry/opentelemetry-collector-contrib) from 0.56.0 to 0.57.2. - [Release notes](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/v0.56.0...v0.57.2) --- updated-dependencies: - dependency-name: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 38 +++++++++++++++----------------------- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 90a44b13d4a..db07e33304b 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/hashicorp/go-plugin v1.4.4 github.com/kr/pretty v0.3.0 github.com/olivere/elastic v6.2.37+incompatible - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.56.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.57.2 github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 @@ -47,9 +47,9 @@ require ( github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/uber/jaeger-lib v2.4.1+incompatible github.com/xdg-go/scram v1.1.1 - go.opentelemetry.io/collector v0.56.0 - go.opentelemetry.io/collector/pdata v0.56.0 - go.opentelemetry.io/collector/semconv v0.56.0 + go.opentelemetry.io/collector v0.57.2 + go.opentelemetry.io/collector/pdata v0.57.2 + go.opentelemetry.io/collector/semconv v0.57.2 go.opentelemetry.io/otel v1.9.0 go.uber.org/atomic v1.9.0 go.uber.org/automaxprocs v1.5.1 @@ -98,7 +98,7 @@ require ( github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.8 // indirect + github.com/klauspost/compress v1.15.9 // indirect github.com/knadh/koanf v1.4.2 // indirect github.com/kr/text v0.2.0 // indirect github.com/magiconair/properties v1.8.6 // indirect @@ -112,12 +112,12 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/go-grpc-compression v1.1.16 // indirect + github.com/mostynb/go-grpc-compression v1.1.17 // indirect github.com/oklog/run v1.1.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/onsi/ginkgo v1.16.4 // indirect github.com/onsi/gomega v1.13.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.56.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.57.2 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect diff --git a/go.sum b/go.sum index b07831bcf90..10f46f3faa6 100644 --- a/go.sum +++ b/go.sum @@ -37,7 +37,6 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -156,7 +155,6 @@ github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= @@ -413,10 +411,9 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.8 h1:JahtItbkWjf2jzm/T+qgMxkP9EMHsqEUA6vCMGmXvhA= -github.com/klauspost/compress v1.15.8/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -453,7 +450,6 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -479,8 +475,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/mostynb/go-grpc-compression v1.1.16 h1:D9tGUINmcII049pxOj9dl32Fzhp26TrDVQXECoKJqQg= -github.com/mostynb/go-grpc-compression v1.1.16/go.mod h1:xxa6UoYynYS2h+5HB/Hglu81iYAp87ARaNmhhwi0s1s= +github.com/mostynb/go-grpc-compression v1.1.17 h1:N9t6taOJN3mNTTi0wDf4e3lp/G/ON1TP67Pn0vTUA9I= +github.com/mostynb/go-grpc-compression v1.1.17/go.mod h1:FUSBr0QjKqQgoDG/e0yiqlR6aqyXC39+g/hFLDfSsEY= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -497,20 +493,18 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olivere/elastic v6.2.37+incompatible h1:UfSGJem5czY+x/LqxgeCBgjDn6St+z8OnsCuxwD3L0U= github.com/olivere/elastic v6.2.37+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.56.0 h1:gQRNxr5sW2kxwBAQWJYTcl8H3oW6V2M5fLsiCSOe61M= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.56.0/go.mod h1:26zJmolOTD2CqKCl1wJio+k6yEZpsaSsbWqcCIJ59Uc= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.56.0 h1:4OzAOHjNGaCaS166MYBVZN+3D3wH/GsD4IGbH9IekPo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.56.0/go.mod h1:D3Z00WpV75kVnou9F6NdtGfHEOTxtnVHGUYcSbBIJSY= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.57.2 h1:4HeNNbZnqz15hj4oGm1O1x+yP+hPnvhz2UYqrApvPDk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.57.2/go.mod h1:xPchY5YNOL9jr6phVkJEvkEakMYr8HMD4uGYEoKXIek= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.57.2 h1:6aMr+4kCgzJKBpWwZwPGzKfdn0ujXObJC9Rhkg+ak1s= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.57.2/go.mod h1:4rFuWKMbzM9H39RbDvPtJfAp/fxsHydhJhKns6skmK0= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df h1:vdYtBU6zvL7v+Tr+0xFM/qhahw/EvY8DMMunZHKH6eE= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= @@ -525,11 +519,10 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pierrec/cmdflag v0.0.2/go.mod h1:a3zKGZ3cdQUfxjd0RGMLZr8xI3nvpJOB+m6o/1X5BmU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v3 v3.3.4/go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -581,7 +574,6 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/schollz/progressbar/v2 v2.13.2/go.mod h1:6YZjqdthH6SCZKv2rqGryrxPtfmRB/DWZxSMfCXPyD8= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -666,12 +658,12 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/collector v0.56.0 h1:p9lLKYyWgX0PBdNP4EScZfMpk8XYSj+MuIhS0dSWzq8= -go.opentelemetry.io/collector v0.56.0/go.mod h1:zYv4Ds01+96vPhYIwhYb3unemGriZ4OQBWeMT6JoVEQ= -go.opentelemetry.io/collector/pdata v0.56.0 h1:JD8KjQ7dNZ441xMuVZVu5NRYmkA4vOYGV7w8tkCdyrE= -go.opentelemetry.io/collector/pdata v0.56.0/go.mod h1:mYcCREWiIJyHss0dbU+GSiz2tmGZ6u09vtfkKTciog4= -go.opentelemetry.io/collector/semconv v0.56.0 h1:zpQ6IBimBsiVsJibsSM2/13vKtaeteFFIx4bmIiOS6E= -go.opentelemetry.io/collector/semconv v0.56.0/go.mod h1:EH1wbDvTyqKpKBBpoMIe0KQk2plCcFS66Mo17WtR7CQ= +go.opentelemetry.io/collector v0.57.2 h1:/J7twI5BlIK3I4GfDfLhqPgfgSjnhiDesXf24bmrXYM= +go.opentelemetry.io/collector v0.57.2/go.mod h1:9TwWyMRhbFNzaaGLtm/6poWNDJw+etvQMS6Fy+8/8Xs= +go.opentelemetry.io/collector/pdata v0.57.2 h1:w2w3NE7/3WzHloT1xV5caRmifV3qt95gc5iJhO/Bues= +go.opentelemetry.io/collector/pdata v0.57.2/go.mod h1:RU9I8lwBUxucwOsSYzHEcHi15M9QaX78hgQ2PRdSxV0= +go.opentelemetry.io/collector/semconv v0.57.2 h1:+lcI4yi8xUzoSNZgGTs0vytZcEAH95Tb33Ig+gooBV8= +go.opentelemetry.io/collector/semconv v0.57.2/go.mod h1:84YnUjmm+nhGu4YTDLnHCbxnL74ooWpismPG79tFD7w= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= From 474572f7cbeb7c4b44557406fa0d58260f5eb2e3 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Sat, 6 Aug 2022 20:33:28 +0200 Subject: [PATCH 22/87] Force go 1.17 for golangci (#3748) Signed-off-by: Matthieu MOREL Co-authored-by: Yuri Shkuro --- .golangci.yml | 1 + plugin/storage/badger/dependencystore/storage.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index fd19b856bad..5b9cb385082 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,5 @@ run: + go: '1.17' timeout: 10m skip-dirs: - mocks diff --git a/plugin/storage/badger/dependencystore/storage.go b/plugin/storage/badger/dependencystore/storage.go index 4ea64a00fa1..1cc57ebd1f9 100644 --- a/plugin/storage/badger/dependencystore/storage.go +++ b/plugin/storage/badger/dependencystore/storage.go @@ -47,7 +47,7 @@ func (s *DependencyStore) GetDependencies(ctx context.Context, endTs time.Time, // dependencyKeyPrefix + timestamp + parent + child key and do a key-only seek (which is fast - but requires additional writes) // GetDependencies is not shipped with a context like the SpanReader / SpanWriter - traces, err := s.reader.FindTraces(context.Background(), params) + traces, err := s.reader.FindTraces(ctx, params) if err != nil { return nil, err } From 8fe47303644fa474e0f1bf55fdccc0e94d42c1d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 00:48:45 -0400 Subject: [PATCH 23/87] Bump github.com/prometheus/client_golang from 1.12.2 to 1.13.0 (#3858) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.2 to 1.13.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.12.2...v1.13.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index db07e33304b..be6a05826fe 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.13.0 github.com/prometheus/client_model v0.2.0 github.com/prometheus/common v0.37.0 github.com/rs/cors v1.8.2 @@ -123,7 +123,7 @@ require ( github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.6.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect diff --git a/go.sum b/go.sum index 10f46f3faa6..04a6ab737d6 100644 --- a/go.sum +++ b/go.sum @@ -537,8 +537,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -554,8 +554,9 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= From df267586f957d1c962bdf6c4ed13948acaf2a65c Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Tue, 9 Aug 2022 11:06:17 +1000 Subject: [PATCH 24/87] Remove milestone instructions (#3859) Signed-off-by: albertteoh --- CONTRIBUTING.md | 5 +---- RELEASE.md | 9 ++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9def300748..832b87f7fa6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -185,10 +185,7 @@ requires connection to Cassandra ``` ## Merging PRs -For maintainers: before merging a PR make sure: -* the title is descriptive and follows [a good commit message](./CONTRIBUTING_GUIDELINES.md) -* pull request is assigned to the current release milestone -* add `changelog:*` and other labels +**For maintainers:** before merging a PR make sure the title is descriptive and follows [a good commit message](./CONTRIBUTING_GUIDELINES.md) Merge the PR by using "Squash and merge" option on Github. Avoid creating merge commits. After the merge make sure referenced issues were closed. diff --git a/RELEASE.md b/RELEASE.md index 3bd765f0f1e..10785d309f7 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -13,21 +13,20 @@ ``` * Even if a submodule does not have a new release, it should be checked to see if there were any changes warranting cutting a new release and then including it. * Rotate the below release managers table placing yourself at the bottom. The date should be the first Wednesday of the month. -2. Add all merged pull requests to the milestone for the release and create a new milestone for a next release e.g. `Release 1.16`. -3. After the PR is merged, create a release on Github: +2. After the PR is merged, create a release on Github: * Automated: * `make draft-release` * Manual: * Title "Release X.Y.Z" * Tag `vX.Y.Z` (note the `v` prefix) and choose appropriate branch * Copy the new CHANGELOG.md section into the release notes -5. The release tag will trigger a build of the docker images. Since forks don't have jaegertracingbot dockerhub token, they can never publish images to jaegertracing organisation. +3. The release tag will trigger a build of the docker images. Since forks don't have jaegertracingbot dockerhub token, they can never publish images to jaegertracing organisation. 1. Check the images are available on [Docker Hub](https://hub.docker.com/r/jaegertracing/). 2. For monitoring and troubleshooting, refer to the [jaegertracing/jaeger GithubActions tab](https://github.com/jaegertracing/jaeger/actions). -6. [Publish documentation](https://github.com/jaegertracing/documentation/blob/main/RELEASE.md) for the new version in [jaegertracing.io](https://www.jaegertracing.io/docs/latest). +4. [Publish documentation](https://github.com/jaegertracing/documentation/blob/main/RELEASE.md) for the new version in [jaegertracing.io](https://www.jaegertracing.io/docs/latest). 1. Check [jaegertracing.io](https://www.jaegertracing.io/docs/latest) redirects to the new documentation release version URL. 2. For monitoring and troubleshooting, refer to the [jaegertracing/documentation GithubActions tab](https://github.com/jaegertracing/documentation/actions). -7. Announce the release on the [mailing list](https://groups.google.com/g/jaeger-tracing), [slack](https://cloud-native.slack.com/archives/CGG7NFUJ3), and [twitter](https://twitter.com/JaegerTracing?lang=en). +5. Announce the release on the [mailing list](https://groups.google.com/g/jaeger-tracing), [slack](https://cloud-native.slack.com/archives/CGG7NFUJ3), and [twitter](https://twitter.com/JaegerTracing?lang=en). Maintenance branches should follow naming convention: `release-major.minor` (e.g.`release-1.8`). From 919fb73bf68046e6a177140b861f636ba0c6579c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 01:15:35 -0400 Subject: [PATCH 25/87] Bump go.uber.org/zap from 1.21.0 to 1.22.0 (#3861) Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.21.0 to 1.22.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.21.0...v1.22.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index be6a05826fe..5a9cd9a613d 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( go.opentelemetry.io/otel v1.9.0 go.uber.org/atomic v1.9.0 go.uber.org/automaxprocs v1.5.1 - go.uber.org/zap v1.21.0 + go.uber.org/zap v1.22.0 golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a google.golang.org/grpc v1.48.0 diff --git a/go.sum b/go.sum index 04a6ab737d6..072967cc003 100644 --- a/go.sum +++ b/go.sum @@ -77,7 +77,6 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -645,7 +644,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= @@ -684,14 +682,12 @@ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= +go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -746,7 +742,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -958,7 +953,6 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 40e5a276e74f2d44602ab17d32e93a0fe8e1a153 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Wed, 10 Aug 2022 11:54:44 -0400 Subject: [PATCH 26/87] Fix build-ui target to not damage .gitignore file Follow-up to #3698 Signed-off-by: Yuri Shkuro --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7bc9d6e746e..d7757a4c9ba 100644 --- a/Makefile +++ b/Makefile @@ -200,10 +200,10 @@ run-all-in-one: build-ui build-ui: cmd/query/app/ui/actual/index.html.gz cmd/query/app/ui/actual/index.html.gz: jaeger-ui/packages/jaeger-ui/build/index.html - rm -rf cmd/query/app/ui/actual - mkdir cmd/query/app/ui/actual + # do not delete dot-files + rm -rf cmd/query/app/ui/actual/* cp -r jaeger-ui/packages/jaeger-ui/build/* cmd/query/app/ui/actual/ - find cmd/query/app/ui/actual -type f | xargs gzip + find cmd/query/app/ui/actual -type f | grep -v .gitignore | xargs gzip jaeger-ui/packages/jaeger-ui/build/index.html: $(MAKE) rebuild-ui From 26e82f037ee79fde262b83711aa79c1c7efe37fa Mon Sep 17 00:00:00 2001 From: Prithvi Raj Date: Wed, 10 Aug 2022 14:28:40 -0400 Subject: [PATCH 27/87] Add AdditionalDialOptions to ConnBuilder (#3865) Signed-off-by: Prithvi Raj Signed-off-by: Prithvi Raj --- cmd/agent/app/reporter/grpc/builder.go | 4 +++ cmd/agent/app/reporter/grpc/builder_test.go | 30 +++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/cmd/agent/app/reporter/grpc/builder.go b/cmd/agent/app/reporter/grpc/builder.go index ccc2a071c22..9e4bb2c932c 100644 --- a/cmd/agent/app/reporter/grpc/builder.go +++ b/cmd/agent/app/reporter/grpc/builder.go @@ -47,6 +47,8 @@ type ConnBuilder struct { DiscoveryMinPeers int Notifier discovery.Notifier Discoverer discovery.Discoverer + + AdditionalDialOptions []grpc.DialOption } // NewConnBuilder creates a new grpc connection builder. @@ -96,6 +98,8 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact } dialOptions = append(dialOptions, grpc.WithDefaultServiceConfig(grpcresolver.GRPCServiceConfig)) dialOptions = append(dialOptions, grpc.WithUnaryInterceptor(grpc_retry.UnaryClientInterceptor(grpc_retry.WithMax(b.MaxRetry)))) + dialOptions = append(dialOptions, b.AdditionalDialOptions...) + conn, err := grpc.Dial(dialTarget, dialOptions...) if err != nil { return nil, err diff --git a/cmd/agent/app/reporter/grpc/builder_test.go b/cmd/agent/app/reporter/grpc/builder_test.go index 0f792171149..f70de066cf4 100644 --- a/cmd/agent/app/reporter/grpc/builder_test.go +++ b/cmd/agent/app/reporter/grpc/builder_test.go @@ -395,3 +395,33 @@ func assertConnectionState(t *testing.T, conn *grpc.ClientConn, expectedState st } } } + +type fakeInterceptor struct { + isCalled bool +} + +func (f *fakeInterceptor) intercept(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + f.isCalled = true + return invoker(ctx, method, req, reply, cc, opts...) +} + +func (f *fakeInterceptor) assertCalled(t *testing.T) { + assert.True(t, f.isCalled) +} + +func TestBuilderWithAdditionalDialOptions(t *testing.T) { + fi := fakeInterceptor{} + defer fi.assertCalled(t) + + cb := ConnBuilder{ + CollectorHostPorts: []string{"127.0.0.1:14268"}, + AdditionalDialOptions: []grpc.DialOption{grpc.WithUnaryInterceptor(fi.intercept)}, + } + + r, err := cb.CreateConnection(zap.NewNop(), metrics.NullFactory) + require.NoError(t, err) + assert.NotNil(t, r) + + err = r.Invoke(context.Background(), "test", map[string]string{}, map[string]string{}, []grpc.CallOption{}...) + assert.Error(t, err, "should error because no server is running") +} From 55a8ca97e3772579b395ffbe4b937a4f5993b008 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Thu, 11 Aug 2022 15:17:28 -0400 Subject: [PATCH 28/87] =?UTF-8?q?Add=20=F0=9F=9A=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuri Shkuro --- examples/hotrod/services/frontend/web_assets/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hotrod/services/frontend/web_assets/index.html b/examples/hotrod/services/frontend/web_assets/index.html index de55d32e78e..d8bf28b85d8 100644 --- a/examples/hotrod/services/frontend/web_assets/index.html +++ b/examples/hotrod/services/frontend/web_assets/index.html @@ -21,7 +21,7 @@

Hot R.O.D.

-

Rides On Demand

+

🚗 Rides On Demand 🚗

Date: Mon, 15 Aug 2022 12:19:45 -0400 Subject: [PATCH 29/87] Add lint checking for bidi characters (#3872) --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index 5b9cb385082..528fb7c8027 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -39,6 +39,7 @@ linters: - gosec - govet - misspell + - bidichk disable: - errcheck From 20ff31ea3c59e9f7663863e936b11b6a6553997a Mon Sep 17 00:00:00 2001 From: CJB <1406278+TripleDogDare@users.noreply.github.com> Date: Tue, 16 Aug 2022 19:13:32 -0500 Subject: [PATCH 30/87] Change build info date to commit timestamp (#3876) This change fixes binary reproducibility of builds. Injecting a timestamp of the time-of-build produces unique binaries for every build which is undesirable for security and provenance tracking. If timestamps for builds are desired, it is recommended to inject the timestamp of the commit. This gives a timestamp that is consistent for a build based on that commit and allows checking for binary consistenty across build systems. This change updates BuildDate to use the commit timestamp from git. This change also fixes some builds which include the version package but were not injecting BUILD_INFO. Signed-off-by: Calvin Behling Signed-off-by: Calvin Behling --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d7757a4c9ba..7e35edd4d1f 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ IMPORT_LOG=.import.log GIT_SHA=$(shell git rev-parse HEAD) GIT_CLOSEST_TAG=$(shell git describe --abbrev=0 --tags) -DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') +DATE=$(shell date -u -d @$(shell git show -s --format=%ct) +'%Y-%m-%dT%H:%M:%SZ') BUILD_INFO_IMPORT_PATH=$(JAEGER_IMPORT_PATH)/pkg/version BUILD_INFO=-ldflags "-X $(BUILD_INFO_IMPORT_PATH).commitSHA=$(GIT_SHA) -X $(BUILD_INFO_IMPORT_PATH).latestVersion=$(GIT_CLOSEST_TAG) -X $(BUILD_INFO_IMPORT_PATH).date=$(DATE)" @@ -170,15 +170,15 @@ build-tracegen: .PHONY: build-anonymizer build-anonymizer: - $(GOBUILD) -o ./cmd/anonymizer/anonymizer-$(GOOS)-$(GOARCH) ./cmd/anonymizer/main.go + $(GOBUILD) -o ./cmd/anonymizer/anonymizer-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/anonymizer/main.go .PHONY: build-esmapping-generator build-esmapping-generator: - $(GOBUILD) -o ./plugin/storage/es/esmapping-generator-$(GOOS)-$(GOARCH) ./cmd/esmapping-generator/main.go + $(GOBUILD) -o ./plugin/storage/es/esmapping-generator-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/esmapping-generator/main.go .PHONY: build-esmapping-generator-linux build-esmapping-generator-linux: - GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./plugin/storage/es/esmapping-generator ./cmd/esmapping-generator/main.go + GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./plugin/storage/es/esmapping-generator $(BUILD_INFO) ./cmd/esmapping-generator/main.go .PHONY: build-es-index-cleaner build-es-index-cleaner: From 1c97af0ce318150585699a7d9e786e90691219e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:33:35 -0400 Subject: [PATCH 31/87] Bump github.com/go-openapi/swag from 0.21.1 to 0.22.1 (#3878) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5a9cd9a613d..b4ec0e4c9b9 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/go-openapi/runtime v0.23.3 github.com/go-openapi/spec v0.20.6 github.com/go-openapi/strfmt v0.21.3 - github.com/go-openapi/swag v0.21.1 + github.com/go-openapi/swag v0.22.1 github.com/go-openapi/validate v0.22.0 github.com/gocql/gocql v0.0.0-20211222173705-d73e6b1002a7 github.com/gogo/googleapis v1.4.1 diff --git a/go.sum b/go.sum index 072967cc003..063ac3b2213 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,9 @@ github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtK github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.1 h1:S6xFhsBKAtvfphnJwRzeCh3OEGsTL/crXdEetSxLs0Q= +github.com/go-openapi/swag v0.22.1/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-openapi/validate v0.22.0 h1:b0QecH6VslW/TxtpKgzpO1SNG7GU2FsaqKdP1E2T50Y= github.com/go-openapi/validate v0.22.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= From 538d96c195554c748e7d1f9240d767a4039bed52 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Fri, 26 Aug 2022 10:23:33 -0400 Subject: [PATCH 32/87] Fix race condition when adding collector tags (#3886) --- cmd/collector/app/span_processor.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/collector/app/span_processor.go b/cmd/collector/app/span_processor.go index 5e9ff4acafd..140acbd3325 100644 --- a/cmd/collector/app/span_processor.go +++ b/cmd/collector/app/span_processor.go @@ -177,6 +177,16 @@ func (sp *spanProcessor) ProcessSpans(mSpans []*model.Span, options processor.Sp sp.preProcessSpans(mSpans, options.Tenant) sp.metrics.BatchSize.Update(int64(len(mSpans))) retMe := make([]bool, len(mSpans)) + + // Note: this is not the ideal place to do this because collector tags are added to Process.Tags, + // and Process can be shared between different spans in the batch, but we no longer know that, + // the relation is lost upstream and it's impossible in Go to dedupe pointers. But at least here + // we have a single thread updating all spans that may share the same Process, before concurrency + // kicks in. + for _, span := range mSpans { + sp.addCollectorTags(span) + } + for i, mSpan := range mSpans { ok := sp.enqueueSpan(mSpan, options.SpanFormat, options.InboundTransport, options.Tenant) if !ok && sp.reportBusy { @@ -213,6 +223,8 @@ func (sp *spanProcessor) addCollectorTags(span *model.Span) { typedTags.Sort() } +// Note: spans may share the Process object, so no changes should be made to Process +// in this function as it may cause race conditions. func (sp *spanProcessor) enqueueSpan(span *model.Span, originalFormat processor.SpanFormat, transport processor.InboundTransport, tenant string) bool { spanCounts := sp.metrics.GetCountsForFormat(originalFormat, transport) spanCounts.ReceivedBySvc.ReportServiceNameForSpan(span) @@ -225,9 +237,6 @@ func (sp *spanProcessor) enqueueSpan(span *model.Span, originalFormat processor. // add format tag span.Tags = append(span.Tags, model.String("internal.span.format", string(originalFormat))) - // append the collector tags - sp.addCollectorTags(span) - item := &queueItem{ queuedTime: time.Now(), span: span, From 514e27a0702e126f3eb9ef159848e358ae234ca6 Mon Sep 17 00:00:00 2001 From: Arunprasad Rajkumar Date: Fri, 26 Aug 2022 22:24:04 +0530 Subject: [PATCH 33/87] fix: streaming span writer is not working in grpc based remote storage plugin (#3887) * plugin/storage: streaming span writer is not assigned for grpc remote plugin Signed-off-by: Arunprasad Rajkumar * storage/grpc: propagate grpc library errors grpc_handler.go handles only io.EOF and skipping other errors causes crash. Signed-off-by: Arunprasad Rajkumar Signed-off-by: Arunprasad Rajkumar --- plugin/storage/grpc/config/config.go | 5 +++-- plugin/storage/grpc/shared/grpc_handler.go | 3 +++ plugin/storage/grpc/shared/grpc_handler_test.go | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 5bbc6f2876c..b3a84873cf0 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -107,8 +107,9 @@ func (c *Configuration) buildRemote(logger *zap.Logger) (*ClientPluginServices, grpcClient := shared.NewGRPCClient(conn) return &ClientPluginServices{ PluginServices: shared.PluginServices{ - Store: grpcClient, - ArchiveStore: grpcClient, + Store: grpcClient, + ArchiveStore: grpcClient, + StreamingSpanWriter: grpcClient, }, Capabilities: grpcClient, }, nil diff --git a/plugin/storage/grpc/shared/grpc_handler.go b/plugin/storage/grpc/shared/grpc_handler.go index 9534abae2e9..32c1434d2ef 100644 --- a/plugin/storage/grpc/shared/grpc_handler.go +++ b/plugin/storage/grpc/shared/grpc_handler.go @@ -115,6 +115,9 @@ func (s *GRPCHandler) WriteSpanStream(stream storage_v1.StreamingSpanWriterPlugi if err == io.EOF { break } + if err != nil { + return err + } err = writer.WriteSpan(stream.Context(), in.Span) if err != nil { return err diff --git a/plugin/storage/grpc/shared/grpc_handler_test.go b/plugin/storage/grpc/shared/grpc_handler_test.go index 8df0d7c3414..0ca6629f038 100644 --- a/plugin/storage/grpc/shared/grpc_handler_test.go +++ b/plugin/storage/grpc/shared/grpc_handler_test.go @@ -245,6 +245,20 @@ func TestGRPCServerWriteSpanStream(t *testing.T) { }) } +func TestGRPCServerWriteSpanStreamWithGRPCError(t *testing.T) { + withGRPCServer(func(r *grpcServerTest) { + stream := new(grpcMocks.StreamingSpanWriterPlugin_WriteSpanStreamServer) + stream.On("Recv").Return(&storage_v1.WriteSpanRequest{Span: &mockTraceSpans[0]}, nil).Twice(). + On("Recv").Return(nil, context.DeadlineExceeded).Once() + stream.On("SendAndClose", &storage_v1.WriteSpanResponse{}).Return(nil) + stream.On("Context").Return(context.Background()) + r.impl.streamWriter.On("WriteSpan", context.Background(), &mockTraceSpans[0]).Return(nil) + + err := r.server.WriteSpanStream(stream) + assert.ErrorContains(t, err, context.DeadlineExceeded.Error()) + }) +} + func TestGRPCServerGetDependencies(t *testing.T) { withGRPCServer(func(r *grpcServerTest) { lookback := time.Duration(1 * time.Second) From fc490beb1fc4de0cba37ac1c771b428a9174698e Mon Sep 17 00:00:00 2001 From: Prithvi Raj Date: Thu, 1 Sep 2022 10:43:11 -0400 Subject: [PATCH 34/87] fix: jaeger-agent sampling endpoint returns backwards incompatible JSON (#3897) * fix: jaeger-agent sampling endpoint `perOperationStrategies` returns `[]` - Returning an empty slice for `perOperationStrategies` instead of the default nil slice allows json.Marshal to marshal it to `[]` instead of `null` - Fixes #3891 Signed-off-by: Prithvi Raj * fmt Signed-off-by: Prithvi Raj * simplify Signed-off-by: Prithvi Raj Signed-off-by: Prithvi Raj --- model/converter/thrift/jaeger/sampling_from_domain.go | 11 ++++++----- .../thrift/jaeger/sampling_from_domain_test.go | 8 +++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/model/converter/thrift/jaeger/sampling_from_domain.go b/model/converter/thrift/jaeger/sampling_from_domain.go index 563e5416559..c776072cd19 100644 --- a/model/converter/thrift/jaeger/sampling_from_domain.go +++ b/model/converter/thrift/jaeger/sampling_from_domain.go @@ -67,11 +67,12 @@ func convertPerOperationFromDomain(s *api_v2.PerOperationSamplingStrategies) *sa DefaultLowerBoundTracesPerSecond: s.GetDefaultLowerBoundTracesPerSecond(), DefaultUpperBoundTracesPerSecond: &s.DefaultUpperBoundTracesPerSecond, } - if s.GetPerOperationStrategies() != nil { - r.PerOperationStrategies = make([]*sampling.OperationSamplingStrategy, len(s.GetPerOperationStrategies())) - for i, k := range s.PerOperationStrategies { - r.PerOperationStrategies[i] = convertOperationFromDomain(k) - } + + perOp := s.GetPerOperationStrategies() + // Default to empty array so that json.Marshal returns [] instead of null (Issue #3891). + r.PerOperationStrategies = make([]*sampling.OperationSamplingStrategy, len(perOp)) + for i, k := range perOp { + r.PerOperationStrategies[i] = convertOperationFromDomain(k) } return r } diff --git a/model/converter/thrift/jaeger/sampling_from_domain_test.go b/model/converter/thrift/jaeger/sampling_from_domain_test.go index 804397da1d8..8bc2280d3c5 100644 --- a/model/converter/thrift/jaeger/sampling_from_domain_test.go +++ b/model/converter/thrift/jaeger/sampling_from_domain_test.go @@ -116,7 +116,13 @@ func TestConvertPerOperationStrategyFromDomain(t *testing.T) { PerOperationStrategies: []*sampling.OperationSamplingStrategy{{Operation: "fao"}}, }, }, - {}, + { + in: &api_v2.PerOperationSamplingStrategies{DefaultSamplingProbability: 15.2, DefaultUpperBoundTracesPerSecond: a, DefaultLowerBoundTracesPerSecond: 2}, + expected: &sampling.PerOperationSamplingStrategies{ + DefaultSamplingProbability: 15.2, DefaultUpperBoundTracesPerSecond: &a, DefaultLowerBoundTracesPerSecond: 2, + PerOperationStrategies: []*sampling.OperationSamplingStrategy{}, + }, + }, } for _, test := range tests { o := convertPerOperationFromDomain(test.in) From 71f2bb99f65b502ec935b05adbd6f8025c8f3bdf Mon Sep 17 00:00:00 2001 From: CJB <1406278+TripleDogDare@users.noreply.github.com> Date: Thu, 1 Sep 2022 09:45:10 -0500 Subject: [PATCH 35/87] Fixes reproducibility for binaries (#3880) * Fixes reproducibility for binaries Resolves Issue: #3877 Adds reproducibility checks to the make file and CI. Fixes timestamps embedded in gzipped UI files. Fixes reproducibility for asset-manifest.json before compression/embedding. This does not help with reproducibility checks across build systems. But should help that multiple builds on the same build system are reproducible. Signed-off-by: Calvin Behling * Add checksums to releases Adds checksums to the deploy directory during release. Each archive gets a sha256sum file that describes its contents and additionally a checksum of all the archives produced. Removes the reproducibility check from CI. Signed-off-by: Calvin Behling * Cleanup Use bash/shopt options in package-deploy to reduce error checking required. Add comments for complex find calls. Inline checksum collection and checking for repro-check target. Signed-off-by: Calvin Behling * Change to shasum perl script The perl package shasum is more likely to exist on development machines than the GNU coreutils sha256sum and similar packages. Switching to the shasum package should provide less development friction by not introducing a new dependency. Enable binary mode on the shasum script. GNU coreutils sha256sum uses binary mode by default. It shouldn't make a significant difference to users but I think it's best to just do it. This means updating the sed script in the package-deploy script to ignore the leading asterisk on file paths. Added a guard to the package-deploy script around not detecting a version name because I found that the script would silently accept an empty string when the Makefile was invalid. Signed-off-by: Calvin Behling Signed-off-by: Calvin Behling --- .github/workflows/ci-release.yml | 2 +- .gitignore | 4 ++ Makefile | 21 ++++++++-- scripts/package-deploy.sh | 67 +++++++++++++++++--------------- 4 files changed, 58 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 86cd131c8f3..cfe8a9407bb 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -44,7 +44,7 @@ jobs: - name: Upload binaries uses: svenstaro/upload-release-action@2.3.0 with: - file: '{deploy/*.tar.gz,deploy/*.zip}' + file: '{deploy/*.tar.gz,deploy/*.zip,deploy/*.sha256sum.txt}' file_glob: true tag: ${{ github.ref }} repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 1372707b7ac..4612b04cccd 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,7 @@ crossdock/crossdock-* run-crossdock.log proto-gen/.patched-otel-proto/ __pycache__ +.asset-manifest.json +deploy/ +deploy-staging/ +sha256sum.combined.txt diff --git a/Makefile b/Makefile index 7e35edd4d1f..2c68a3e8d97 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,9 @@ else endif GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) -GOBUILD=CGO_ENABLED=0 installsuffix=cgo go build -trimpath -GOTEST=go test -v $(RACE) +GOCACHE=$(abspath .gocache) +GOBUILD=GOCACHE=$(GOCACHE) CGO_ENABLED=0 installsuffix=cgo go build -trimpath +GOTEST=GOCACHE=$(GOCACHE) go test -v $(RACE) GOFMT=gofmt GOFUMPT=gofumpt FMT_LOG=.fmt.log @@ -82,6 +83,9 @@ go-gen: clean: rm -rf cover.out .cover/ cover.html $(FMT_LOG) $(IMPORT_LOG) \ jaeger-ui/packages/jaeger-ui/build + find ./cmd/query/app/ui/actual -type f -name '*.gz' -delete + GOCACHE=$(GOCACHE) go clean -cache -testcache + find cmd -type f -executable | xargs -I{} sh -c '(git ls-files --error-unmatch {} 2>/dev/null || rm -v {})' .PHONY: test test: go-gen @@ -203,7 +207,7 @@ cmd/query/app/ui/actual/index.html.gz: jaeger-ui/packages/jaeger-ui/build/index. # do not delete dot-files rm -rf cmd/query/app/ui/actual/* cp -r jaeger-ui/packages/jaeger-ui/build/* cmd/query/app/ui/actual/ - find cmd/query/app/ui/actual -type f | grep -v .gitignore | xargs gzip + find cmd/query/app/ui/actual -type f | grep -v .gitignore | xargs gzip --no-name jaeger-ui/packages/jaeger-ui/build/index.html: $(MAKE) rebuild-ui @@ -598,3 +602,14 @@ certs: .PHONY: certs-dryrun certs-dryrun: cd pkg/config/tlscfg/testdata && ./gen-certs.sh -d + +.PHONY: repro-check +repro-check: + # Check local reproducibility of generated executables. + $(MAKE) clean + $(MAKE) build-all-platforms + # Generate checksum for all executables under ./cmd + find cmd -type f -executable -exec shasum -b -a 256 {} \; | sort -k2 | tee sha256sum.combined.txt + $(MAKE) clean + $(MAKE) build-all-platforms + shasum -b -a 256 --strict --check ./sha256sum.combined.txt diff --git a/scripts/package-deploy.sh b/scripts/package-deploy.sh index c97344fb8b9..599bcd75e46 100755 --- a/scripts/package-deploy.sh +++ b/scripts/package-deploy.sh @@ -1,67 +1,68 @@ #!/bin/bash - -# stage-file copies the file $1 with the specified path $2 -# if no file exists it will silently continue -function stage-file { - if [ -f $1 ]; then - echo "Copying $1 to $2" - cp $1 $2 - else - echo "$1 does not exist. Aborting." - exit 1 - fi -} +set -euxf -o pipefail # stage-platform-files stages the different the platform ($1) into the package # staging dir ($2). If you pass in a file extension ($3) it will be used when # copying on the source function stage-platform-files { - local PLATFORM=$1 - local PACKAGE_STAGING_DIR=$2 - local FILE_EXTENSION=$3 + local -r PLATFORM=$1 + local -r PACKAGE_STAGING_DIR=$2 + local -r FILE_EXTENSION=${3:-} - stage-file ./cmd/all-in-one/all-in-one-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-all-in-one$FILE_EXTENSION - stage-file ./cmd/agent/agent-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-agent$FILE_EXTENSION - stage-file ./cmd/query/query-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-query$FILE_EXTENSION - stage-file ./cmd/collector/collector-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-collector$FILE_EXTENSION - stage-file ./cmd/ingester/ingester-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-ingester$FILE_EXTENSION - stage-file ./examples/hotrod/hotrod-$PLATFORM $PACKAGE_STAGING_DIR/example-hotrod$FILE_EXTENSION + cp ./cmd/all-in-one/all-in-one-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-all-in-one$FILE_EXTENSION + cp ./cmd/agent/agent-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-agent$FILE_EXTENSION + cp ./cmd/query/query-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-query$FILE_EXTENSION + cp ./cmd/collector/collector-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-collector$FILE_EXTENSION + cp ./cmd/ingester/ingester-$PLATFORM $PACKAGE_STAGING_DIR/jaeger-ingester$FILE_EXTENSION + cp ./examples/hotrod/hotrod-$PLATFORM $PACKAGE_STAGING_DIR/example-hotrod$FILE_EXTENSION } # package pulls built files for the platform ($2) and compresses it using the compression ($1). # If you pass in a file extension ($3) it will be look for binaries with that extension. function package { - local COMPRESSION=$1 - local PLATFORM=$2 - local FILE_EXTENSION=$3 - local PACKAGE_STAGING_DIR=jaeger-$VERSION-$PLATFORM + local -r COMPRESSION=$1 + local -r PLATFORM=$2 + local -r FILE_EXTENSION=${3:-} + local -r PACKAGE_NAME=jaeger-$VERSION-$PLATFORM + local -r PACKAGE_STAGING_DIR=$PACKAGE_NAME + if [ -d $PACKAGE_STAGING_DIR ] + then + rm -vrf "$PACKAGE_STAGING_DIR" + fi mkdir $PACKAGE_STAGING_DIR stage-platform-files $PLATFORM $PACKAGE_STAGING_DIR $FILE_EXTENSION + # Create a checksum file for all the files being packaged in the archive. Sorted by filename. + find $PACKAGE_STAGING_DIR -type f -exec shasum -b -a 256 {} \; | sort -k2 | tee ./deploy/$PACKAGE_NAME.sha256sum.txt if [ "$COMPRESSION" == "zip" ] then - local ARCHIVE_NAME="$PACKAGE_STAGING_DIR.zip" + local -r ARCHIVE_NAME="$PACKAGE_NAME.zip" echo "Packaging into $ARCHIVE_NAME:" zip -r ./deploy/$ARCHIVE_NAME $PACKAGE_STAGING_DIR else - local ARCHIVE_NAME="$PACKAGE_STAGING_DIR.tar.gz" + local -r ARCHIVE_NAME="$PACKAGE_NAME.tar.gz" echo "Packaging into $ARCHIVE_NAME:" - tar -czvf ./deploy/$ARCHIVE_NAME $PACKAGE_STAGING_DIR + tar --sort=name -czvf ./deploy/$ARCHIVE_NAME $PACKAGE_STAGING_DIR fi + rm -rf $PACKAGE_STAGING_DIR } set -e -DEPLOY_STAGING_DIR=./deploy-staging -VERSION="$(make echo-version | awk 'match($0, /([0-9]*\.[0-9]*\.[0-9]*)$/) { print substr($0, RSTART, RLENGTH) }')" +readonly VERSION="$(make echo-version | awk 'match($0, /([0-9]*\.[0-9]*\.[0-9]*)$/) { print substr($0, RSTART, RLENGTH) }')" echo "Working on version: $VERSION" +if [ -z "$VERSION" ] +then + # We want to halt if for some reason the version string is empty as this is an obvious error case + >&2 echo 'Failed to detect a version string' + exit 1 +fi # make needed directories -rm -rf deploy $DEPLOY_STAGING_DIR +rm -rf deploy mkdir deploy -mkdir $DEPLOY_STAGING_DIR package tar linux-amd64 package tar darwin-amd64 @@ -71,3 +72,5 @@ package zip windows-amd64 .exe package tar linux-s390x package tar linux-arm64 package tar linux-ppc64le +# Create a checksum file for all non-checksum files in the deploy directory. Strips the leading 'deploy/' directory from filepaths. Sort by filename. +find deploy \( ! -name '*sha256sum.txt' \) -type f -exec shasum -b -a 256 {} \; | sed -r 's#(\w+\s+\*?)deploy/(.*)#\1\2#' | sort -k2 | tee ./deploy/jaeger-$VERSION.sha256sum.txt From 7fc25b5de02bbcfecd7bb202a2a59eaf977a5338 Mon Sep 17 00:00:00 2001 From: Ivan Babrou Date: Fri, 9 Sep 2022 23:43:52 -0700 Subject: [PATCH 36/87] Do not pass -signkey to avoid duplicate extension (#3904) Before: ``` $ openssl x509 -in pkg/config/tlscfg/testdata/example-server-cert.pem -noout -text | grep X509v3 -A1 X509v3 extensions: X509v3 Subject Alternative Name: DNS:example.com X509v3 Subject Alternative Name: DNS:example.com ``` After: ``` $ openssl x509 -in pkg/config/tlscfg/testdata/example-server-cert.pem -noout -text | grep X509v3 -A1 X509v3 extensions: X509v3 Subject Alternative Name: DNS:example.com ``` See: https://stackoverflow.com/questions/48041544/ca-signed-x509-cert-contains-x509v3-extension-subject-alternative-name-twice Closes #3903. Signed-off-by: Ivan Babrou Signed-off-by: Ivan Babrou --- .../tlscfg/testdata/example-CA-cert.pem | 35 ++++++------- .../tlscfg/testdata/example-client-cert.pem | 37 +++++++------- .../tlscfg/testdata/example-client-key.pem | 50 +++++++++---------- .../tlscfg/testdata/example-server-cert.pem | 37 +++++++------- .../tlscfg/testdata/example-server-key.pem | 50 +++++++++---------- pkg/config/tlscfg/testdata/gen-certs.sh | 4 +- pkg/config/tlscfg/testdata/wrong-CA-cert.pem | 35 ++++++------- 7 files changed, 123 insertions(+), 125 deletions(-) diff --git a/pkg/config/tlscfg/testdata/example-CA-cert.pem b/pkg/config/tlscfg/testdata/example-CA-cert.pem index 56445a141cc..ca50b7c7e38 100644 --- a/pkg/config/tlscfg/testdata/example-CA-cert.pem +++ b/pkg/config/tlscfg/testdata/example-CA-cert.pem @@ -1,19 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDJjCCAg4CCQCUvReiJZlWHDANBgkqhkiG9w0BAQsFADBVMQswCQYDVQQGEwJB -VTESMBAGA1UECAwJQXVzdHJhbGlhMQ8wDQYDVQQHDAZTeWRuZXkxEDAOBgNVBAoM -B0xvZ3ouaW8xDzANBgNVBAMMBmphZWdlcjAeFw0yMDA5MDkwNTU1NTdaFw0zMDA5 -MDcwNTU1NTdaMFUxCzAJBgNVBAYTAkFVMRIwEAYDVQQIDAlBdXN0cmFsaWExDzAN -BgNVBAcMBlN5ZG5leTEQMA4GA1UECgwHTG9nei5pbzEPMA0GA1UEAwwGamFlZ2Vy -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx4y863TsHMNFTe/5f4Ab -jxg7rpQLuQhzr1u5re2aWlPIehTxrVxdZ9RiqNxoOVt8k0hrMmF/HoyFMzgUR3bu -bnC7tLepjlDGf5FxuW1TrGlihefq2QtwnHUac30CTulPhC3WlTrvkb6FpvZL7h8u -1NzU7yu0lCRiN9tQ7smLfH8vOClNIvInXiznHZdFc1NGdMKX9sP6fc8Rvu4GVshY -Iyf44tb1vkg5jTFCBqtsbVybu3S/q9RuFhh8w0AG6PiHS/bmaS+3lUnLlKpPn283 -vAciimMy3Ss3XlqVPfri+uXARsFVPnrpL+U4W77nF9PTq/IjG7Dcji2L/iCR5Pga -swIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAaNqHKiXHPTUvUpkm5AIu7/Mlc2dft -ROiA9lAbpI5JMBhJp9zdfsSiqY84+1zk66ORoiSrwrGMc5woobkHxXX4NL5D3WiW -kXX+x/cmBq5CcQWnc/eeUSSMFSre/dl+hLvkmLFZJgsMuGzyuTXvZZ3edpfhnOVw -FOKb8UNd3E1yHBdwp2pMZ5d+5VXhc3NdPTL+isE79rk/wwqhkITxavqe3j5Bc7+6 -rQIHbrLyjGi7vhaRGUiVIwECmgLV6tK7TKbHB9jkQdbJYgAGehCeNH/vc5BuRKbT -NYXklFMfGV04LUJdQ9v6xVzdO5hSfsaewoCd47VaU0RvTxfS5Nympy8E +MIIDMTCCAhkCFCi65dSe1JONpNGghyam61+4gTL7MA0GCSqGSIb3DQEBCwUAMFUx +CzAJBgNVBAYTAkFVMRIwEAYDVQQIDAlBdXN0cmFsaWExDzANBgNVBAcMBlN5ZG5l +eTEQMA4GA1UECgwHTG9nei5pbzEPMA0GA1UEAwwGSmFlZ2VyMB4XDTIyMDkxMDAw +MjE0NFoXDTMyMDkwNzAwMjE0NFowVTELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCUF1 +c3RyYWxpYTEPMA0GA1UEBwwGU3lkbmV5MRAwDgYDVQQKDAdMb2d6LmlvMQ8wDQYD +VQQDDAZKYWVnZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDLlEq/ +DF2pkhfSedvAd5h6BXCjpC/mUA6BN3RyMHUjTWr9hhBtaIYv68O12GMVf//ST/Fs +CjRrjOcqrz2QQn3P8UelGRd2vJfcMhJElQ/lnKmZZlAHEOMF8TC7nQfsReLCwcpj +T6bXqvDcfHjDye+45F2rPDpRGLzyysg7pgdINp0Duph0Z16ggrBgz7RVNBmWsYVe +sGD3VOR3hLd8GTDzJ5amRpkq8nfliJ+U3JLGcDG/7Wkuvl/YZZxf21v9f4yYVEZZ +aLAcKsHIUoFRDJtdrBeaPZRJjL/I9B1M6En+Styxb5wJw42h9BXtJd2IeQPp15pP +KfPbkmOj+X+2s9n1AgMBAAEwDQYJKoZIhvcNAQELBQADggEBAJbm7WXgQirWQbaa +E304K8tvdpC2E1ewxTTrUEN8jUONER4KC+epRnsTgkEpVlj7sehiAgSMnbT4E3ve +GjmsUrZiJcKPaf+ogn49Cj0weD99wbJtUNgbH4HiqR1ePOHIRDQ7GD5G0zdFq7oO +Il09eHAbbWM61x04I3XDQ0OwXyeVXIEWJcR1R6wnuNMJm54czbXvn6SrIuoMCvs6 +oSkVm43Q+plk0hlDZnA/KiOxqFRLVHBuX/SgRf5NBg8m7id3fNzIJnWWK+zqoDoZ +ryja7dFIJnLqEXJxJkc5ubT1/j9PDE51WbM5MyPB6lnuQKdZTbDziyKiVXg0au3E +QK5K/Ow= -----END CERTIFICATE----- diff --git a/pkg/config/tlscfg/testdata/example-client-cert.pem b/pkg/config/tlscfg/testdata/example-client-cert.pem index 224b387b243..569e23ac033 100644 --- a/pkg/config/tlscfg/testdata/example-client-cert.pem +++ b/pkg/config/tlscfg/testdata/example-client-cert.pem @@ -1,21 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgIJAJu8RcLAVAT9MA0GCSqGSIb3DQEBCwUAMFUxCzAJBgNV -BAYTAkFVMRIwEAYDVQQIDAlBdXN0cmFsaWExDzANBgNVBAcMBlN5ZG5leTEQMA4G -A1UECgwHTG9nei5pbzEPMA0GA1UEAwwGamFlZ2VyMB4XDTIwMDkwOTA1NTYwMloX -DTMwMDkwNzA1NTYwMlowVTELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCUF1c3RyYWxp -YTEPMA0GA1UEBwwGU3lkbmV5MRAwDgYDVQQKDAdMb2d6LmlvMQ8wDQYDVQQDDAZq -YWVnZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+TigmWq+LqZr5 -jk9TqVMw/MF1Lcu1jOry219hk3yUaEifPX4WAOqufPTRuyWf5DzdGsEXbtuZ5iEz -Oqr/hxGMN5dm7czg0vK1bj/wwr3gb3LcHREAZzZgGvZ9w1zgScyuut2HdbXElLNm -3IVm1UuomrroNVLfztPVXFh+hRp/48jzZdo1d4M4iFCd/rFJCyLL4qtF1hhmB/qI -IAR/0iCZX1SiIb2Ecn01IJR41ZtuFoal1yzrfCgrCvI3kt1KAfdmPe72WXQSNhXD -1+1IqfP7t14TTqUJEzKaz0nQCJ7aRwgNQ0MviByjUDtCAkaNS/aPyjn2FqV/FRuG -zz2fd5UTAgMBAAGjMjAwMBYGA1UdEQQPMA2CC2V4YW1wbGUuY29tMBYGA1UdEQQP -MA2CC2V4YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQCRk15aAkoyBXUDd512 -oVlcgoX4LjXiU5iZufQkhwT1nFg0E9iCyU+AkMDvNPDt3NILyuDb4zpyTY8txJq5 -2DlCC9LZpyAORdjtKFYwn4W2NtgWVUr2zuzjXdG23XSfOmU+D+AcLF3JCYLQQxbM -ow63J40INtQ5OKT41jhTEksyPjU7C/gmBfS8j8BmqkQtAO773zpCLJT+whfctANB -MLfT0z97UwPSN/Z8nyqTDqtOn0PWjrSDo25geRkfqx3Zatjb1WgZRCUqVm4J4hG5 -weCO6bagyMMExU0yTwrFjZFNDUoFvGd1uC15E4GYbPPymLSXjLEfO3QQGUPqRfIe -IPlh +MIIDUjCCAjqgAwIBAgIUE56RLVss9rH/ojHQlVqysg6vJQYwDQYJKoZIhvcNAQEL +BQAwVTELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCUF1c3RyYWxpYTEPMA0GA1UEBwwG +U3lkbmV5MRAwDgYDVQQKDAdMb2d6LmlvMQ8wDQYDVQQDDAZKYWVnZXIwHhcNMjIw +OTEwMDAyMTQ0WhcNMzIwOTA3MDAyMTQ0WjBVMQswCQYDVQQGEwJBVTESMBAGA1UE +CAwJQXVzdHJhbGlhMQ8wDQYDVQQHDAZTeWRuZXkxEDAOBgNVBAoMB0xvZ3ouaW8x +DzANBgNVBAMMBkphZWdlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ALwEHBIe2nffXpJtYRUQ2GzuIwzPhI6fwT/KYXc/ao6mhHQ/oGyMZJFBxxpB0Inz +GuurMtJBIgAlrhKmX5Dg5tB05iMpqA1Hbxa4fQS34iw9bBEvH/7SkuQ7gox6ht/n +ZX9UuyAw751B/KlGQlVInGzySAgR9T7RdT7YOAGoaQtXNsE6b3/Jm6z/uRW3Buqp +1jzqL9VHzUdC7k8nRRdTTivcDUiZ+ocp4j2lRVP4hOylU0DSAG7mfwR8YQ/Xt1cU +kn+2pe+D4tcx23lQcQFFWeJ2CKVx+Gx2BwJNoqPJ0LJLLSAQyY+S2wGSjoc8nqvM +8mhgykFU9dW+GEwJzhLqRRMCAwEAAaMaMBgwFgYDVR0RBA8wDYILZXhhbXBsZS5j +b20wDQYJKoZIhvcNAQELBQADggEBABqjQPg5voqMNnBBtnAKDnuTF4hOBNAo0Wq/ +KzD5QqvaWPPspx+oIahSIwq+8aL+NzptfYwbke10Q5qmOzq/ZgVTela+k/hgbjn6 +I/nOTCg5/v7m0AN3HgIGdgh5TOBiZMEsNpS+Lr2DangjaBKwpe4sucsgevJpggg1 +m/FT8rL7X5AjNx+mgsjdzQaboe6SkaGSSzByN8jEO03ceYpLvfqMGdAJpF4MEGiZ +BlAAMHn3m5NLuBsHM/SiewTEmLBa6AEo33/XI0rOjDlYOj7A0xj2NLz0EwfRf3AG +UpDuAB9O5n3iVXrHtaHDMRihGjBbeDEVaf68uodz7nH/UIWc2Rs= -----END CERTIFICATE----- diff --git a/pkg/config/tlscfg/testdata/example-client-key.pem b/pkg/config/tlscfg/testdata/example-client-key.pem index c4ba12b30d8..25148bb9455 100644 --- a/pkg/config/tlscfg/testdata/example-client-key.pem +++ b/pkg/config/tlscfg/testdata/example-client-key.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEAvk4oJlqvi6ma+Y5PU6lTMPzBdS3LtYzq8ttfYZN8lGhInz1+ -FgDqrnz00bsln+Q83RrBF27bmeYhMzqq/4cRjDeXZu3M4NLytW4/8MK94G9y3B0R -AGc2YBr2fcNc4EnMrrrdh3W1xJSzZtyFZtVLqJq66DVS387T1VxYfoUaf+PI82Xa -NXeDOIhQnf6xSQsiy+KrRdYYZgf6iCAEf9IgmV9UoiG9hHJ9NSCUeNWbbhaGpdcs -63woKwryN5LdSgH3Zj3u9ll0EjYVw9ftSKnz+7deE06lCRMyms9J0Aie2kcIDUND -L4gco1A7QgJGjUv2j8o59halfxUbhs89n3eVEwIDAQABAoIBAE//zwUAjlcpv0o1 -Nse2oJAxUKoPzFjPmlzpN1lvhKlmhVDbqstZK06anNgl0hU6/xL7kjxlj89MXJyK -hyPQBeJp5C2SvdOtGfaHGD3/v44/i4tYdLM0sDkKXKBVpg9rNq4lQ8cUBotS72/I -OBQYiiugj/3ZnLMU4RwKK/FTxuYHg1lk8pxhEx9AMpih2S6ni7SG9+O8/lto5FDZ -brImQJxBOxWlaNfFAeLxXLD9svwljNJFI2rMZ0rH/TrTP62uTzdVOLUVVjUW5DUI -oqtWdnQJCME5ymom9VP+nDhARa2cYEwXBQhJBACgjx12NNptfe9Wr8CL67oyRmV4 -7OSI90ECgYEA75cRwvYGVa38UasCfPHvGTtHwfIgQ3ZAQkuFLgFeF+TynR7aPkkM -SyPPInJs68NotHZYE8dSqE7Psjh4HARWhXdEYUoXQ90NEW0iQtTPXSqyaXcHYh9Z -4JfKhezzPQGpDdS7F5E8pO5ew/EHjV+C/y/tGzlDqgulQkiJt4YHZTECgYEAy1bv -reYvJvWUqFtVGGc76AAyuTSXgEywxT+LI2ZqMh/rFAlOKgx+W8WANQcci9GgfK4v -yG4JZ0MaTLziRbbnjqZTCXEtqL334uf1GNzYXGavKaEa8OHLUJvuewJ3zkmES24n -e+QKpH+ekEGijlrBjDpMhfskAfRR1E1Zje2sXYMCgYBlf+ZyZa/BVHf0UTI4pHXa -hpabv2uTqOEINN4y4zltffyaO5vRjzi6DG2P9lHWf244JXqixmpqCxlKM0oO9HeD -C0fYv36jrV3/5+//yBAhNBlpPJfQJd/5mdSecAeL7Mwlo92u2kSKysEy2UWNyszA -NxmH0varb0uPjRNqwEkZwQKBgGZtq5yo6DWy3aiVIV+CmT2749FBudNqTl1+LeOu -Mm5/f5Z/PX2W/4vRCE0uAOY5uaM0x2MqctguiDABseW2RhyokgmeloZ680S83c0h -amfZXgEVY5HV2+oGMnKKgrlKdTbeDUuuSuIkW0aFmZImC3tM3sFbCf9mCFZuhF8n -S31rAoGAShuBbD4i6w/saaAQyLMi/Pjeb2mRdLfyngsDUoOyKxoMPHHKC7qXKkHi -0BjkAnOyuQg+Awq8Tt0MlTyilHQXyRZxuWmXbw4EuhCZ2Ed2qS+m+ZxGN8AuUvl4 -AsmoB1weKDWu+0fXxSSnautP9HlxJCQ+bLXTfaltLVNf/L0+k7I= +MIIEpAIBAAKCAQEAvAQcEh7ad99ekm1hFRDYbO4jDM+Ejp/BP8phdz9qjqaEdD+g +bIxkkUHHGkHQifMa66sy0kEiACWuEqZfkODm0HTmIymoDUdvFrh9BLfiLD1sES8f +/tKS5DuCjHqG3+dlf1S7IDDvnUH8qUZCVUicbPJICBH1PtF1Ptg4AahpC1c2wTpv +f8mbrP+5FbcG6qnWPOov1UfNR0LuTydFF1NOK9wNSJn6hyniPaVFU/iE7KVTQNIA +buZ/BHxhD9e3VxSSf7al74Pi1zHbeVBxAUVZ4nYIpXH4bHYHAk2io8nQskstIBDJ +j5LbAZKOhzyeq8zyaGDKQVT11b4YTAnOEupFEwIDAQABAoIBAEWCa3JTj8dDgG44 +G+0y1iCnhbPFwKcN7t8Lji8M9fMZItzrbP7UhJWjMN3HOTbW9rvsBhTvWYeeZpWk +hq5ER3EH1tFnJCcMoshOmoG1Ddv3NU3BE14dMYtJaQFQhy6eGMsTYz8KeHu2Gpfm +Tr3C43nvtKuvH/ECdQsv2rzaK0OybxwN0GQGPPeKFhGJ8/v+s2NGQvfuaDFqPZ3u +9e/gZ8DHAPrj6kf87j1SzDAytuaDItPwQJv01Kc9gVPajuoWMTkz1IcGB5KhRohO +CO8h33PSA1gq7d7yn4fCqtwWORJTqFc7Bq1512bM4dh+lqhm+LAYPI7s899x2KI3 +A837xLkCgYEA6O/6nN2npwhPEROBL7T5KGKOwWrgKLO1XL/zwtrXAXFO4pN0Pvcf +K5Aqrm1TjhDqwvMUmtjFVrB6FkejGw/22NlKNrsBQ5HQvHv8RjLu7kC5VxysUei1 +S7IlS8HjA6APap9cgELWocivrFIOijXXvRmO0EgIqWYl2TF60Cyx6sUCgYEAzqGO +TR1IE8s2bJGxwF3toSR69Q3i5GgUnELATNEqIg0i/j9kYDNl8oJmyJ0DEsKlIe6X +72JSDMLX0mwzBHit7LXvBUYAXCu/i91Rnkn7ME7KTPIJaKnZHNT1KZQi0vClv9St +gQeAl1YGHSlEh98lEhHwykchmqaVFiOo0zlNzfcCgYEAwDHRvEB/JiiK5HINc4mE +0zeOxjQixDKS//Y5cJsUL9KH3hcAITvRciY/sS/vcxauPTBH3gPhv0dZVKzC/X9M +k1umCkZ+InxbmElMu7cmwVqSEjhMTkEN5WkVsM5HOySD09utfP6pDVAC8tG5wXvv +h81gsqXcz7jCndRfmwhlvGkCgYEAhVOLDUj6jAMQX+d2aShyPwrZ56sJHtXljpon +mKlR5VzSmnju3H/tpRftGD7vj7hWctmP4Z9wT9mdBqJYHOd9WgJecumjK9Xyp12r +31XfJWGBeTqnRYhqlgb3FdgGzFMIsAmb1miv2XZhRYmuNXmPYuR+mRZioXYhNoLV +2UzdXisCgYAofFoRrtFAUZn1AY7no1MSXrOZ0fAwnRm6va73aSOFHHJG9swI2GOi +hGUuABh6TbpU6G7FIDD/E9zjXoz43j6muN9RUqynVK4x+fEUQDGUtHXavtL97vWg +eHbzNbxx46DlaGj2VQkQZ8iFsIMXbeAp5vPGbdau5dCFEgL+DfC87w== -----END RSA PRIVATE KEY----- diff --git a/pkg/config/tlscfg/testdata/example-server-cert.pem b/pkg/config/tlscfg/testdata/example-server-cert.pem index 09d1c99425a..dbaad9f6f33 100644 --- a/pkg/config/tlscfg/testdata/example-server-cert.pem +++ b/pkg/config/tlscfg/testdata/example-server-cert.pem @@ -1,21 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgIJAJu8RcLAVAT8MA0GCSqGSIb3DQEBCwUAMFUxCzAJBgNV -BAYTAkFVMRIwEAYDVQQIDAlBdXN0cmFsaWExDzANBgNVBAcMBlN5ZG5leTEQMA4G -A1UECgwHTG9nei5pbzEPMA0GA1UEAwwGamFlZ2VyMB4XDTIwMDkwOTA1NTYwMloX -DTMwMDkwNzA1NTYwMlowVTELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCUF1c3RyYWxp -YTEPMA0GA1UEBwwGU3lkbmV5MRAwDgYDVQQKDAdMb2d6LmlvMQ8wDQYDVQQDDAZq -YWVnZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDJ9238Gi4EvqL -oMSQ0jqja0PCYrT3xKBZU+k+ab0MjYm1+W2b9TIw1BWjkZKHTAn+9Daw3RqJ3DDP -AjL4mU7pT5JpUoa7tfORFFG3cayFa2gKLUNahg8QRSO2+794BuDgY9FNNDdv2MQj -buKp3m34UMxcGtVwsv4tD5oOcrPbcLla6JYtTJiofXTo2oH6xm2n1IPeS2/grCvp -69zv/JH2AFqzBdwxAjf7GCS++lRa+huIbOJqDyAwJBerV2p4UlOJhWq0PONKkr04 -yL12eg0xkvIFPV1bWsAGb+UjEvrUkhn+OTZy8xy4K5hsRrawdsvm5lX2MHSVj3d9 -Y5pkJ+WhAgMBAAGjMjAwMBYGA1UdEQQPMA2CC2V4YW1wbGUuY29tMBYGA1UdEQQP -MA2CC2V4YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBrjHlOJnotaql2a+zy -gv9S4T5t5QjwvzH7FC30KtS3ZnzrWp9Jgqjcgr1qQv3ui4c+nnlGFezCUT0E6xCE -Wjm4KbpvD/SzWEab4Ke8hw9pE8fP4fGd/8DE6QbKaq5DqP3B4IMe2NF4T9c8Sb7c -Gg/Upkk9/uJ04hCJm7X6TyRUS56GTlBvLHvmspoaZu14dDpkRyXlrHQiwmuZs9xr -mZNT7xZZgrlSCIfadILMafm2DkNhc7ByADurYOF7SORWWJMyJXx/Mb8r+IaWH2tW -ouaqWPzQNdIHePa8eJyPE7ypZuJsaMvXu5MwEayvOux1P13dyorOdqcL1vybtvxm -qT1B +MIIDUjCCAjqgAwIBAgIUE56RLVss9rH/ojHQlVqysg6vJQUwDQYJKoZIhvcNAQEL +BQAwVTELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCUF1c3RyYWxpYTEPMA0GA1UEBwwG +U3lkbmV5MRAwDgYDVQQKDAdMb2d6LmlvMQ8wDQYDVQQDDAZKYWVnZXIwHhcNMjIw +OTEwMDAyMTQ0WhcNMzIwOTA3MDAyMTQ0WjBVMQswCQYDVQQGEwJBVTESMBAGA1UE +CAwJQXVzdHJhbGlhMQ8wDQYDVQQHDAZTeWRuZXkxEDAOBgNVBAoMB0xvZ3ouaW8x +DzANBgNVBAMMBkphZWdlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN17nlVlHzFoEDnAA7kvrjzuKiZQZ70znDW5TrqtwXqHr5XG0m7rdQlt9xyr3HFg +DbXbkg7wBidqUySWZ7N/cxiqB/oMnfbntapwmBP77Ss8KLLQx17Geb8pryIHrhcE +a/E556epv3WRkoz3j8ph3DY7g+ghQWNtWI3UvBdaIkmPaS+wVfH6hwzpT4rbdVSF +1n7SnMcJccKPEPgqASiEsYZeQgnZUedayKzHRnJeQD3lOPXLHAOIGHajGvyQFMqE +fG9dJfWNVxH/+GxMNul9jsUfJMc99mG/vy3B1WROOl2EiTi8FzfM64lo8SvEs3Db +jcAFItI7BcyM/MJxqYtYFQ0CAwEAAaMaMBgwFgYDVR0RBA8wDYILZXhhbXBsZS5j +b20wDQYJKoZIhvcNAQELBQADggEBAFjZrgLJiezjX2enrh1pJDRrj9NClTKM8Vck +dnpI4OFmViqSyUkyY28PO9omoXUPAbcVuXcGQ/f4PR7tlKmv1lGH/4vGGgmvLjus +Mm0vYZoBos/KPN92RIUkpO1Lvt3es96CFI0k6G0JmstXn4EShQibm1424jTWU3tF +praOAsaTVWO/ukVPbULJ8dWzKoQVTyb/cNQiPiL0IXx7XYc/cqCB2yqzELtMOmIe +kQuyCmUNzK1qQaezxwkMl2P+121QdOvKkxcu7XlAEo0SRNNNkpOkyRqLvC2iou39 +SHxqc/Vbf+Pj9N6oC0twI7KAJELHMi9qhlQsNssxUMjYe7BRYmQ= -----END CERTIFICATE----- diff --git a/pkg/config/tlscfg/testdata/example-server-key.pem b/pkg/config/tlscfg/testdata/example-server-key.pem index 638e7d12d7a..0e9cb5c9663 100644 --- a/pkg/config/tlscfg/testdata/example-server-key.pem +++ b/pkg/config/tlscfg/testdata/example-server-key.pem @@ -1,27 +1,27 @@ -----BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEAwyfdt/BouBL6i6DEkNI6o2tDwmK098SgWVPpPmm9DI2Jtflt -m/UyMNQVo5GSh0wJ/vQ2sN0aidwwzwIy+JlO6U+SaVKGu7XzkRRRt3GshWtoCi1D -WoYPEEUjtvu/eAbg4GPRTTQ3b9jEI27iqd5t+FDMXBrVcLL+LQ+aDnKz23C5WuiW -LUyYqH106NqB+sZtp9SD3ktv4Kwr6evc7/yR9gBaswXcMQI3+xgkvvpUWvobiGzi -ag8gMCQXq1dqeFJTiYVqtDzjSpK9OMi9dnoNMZLyBT1dW1rABm/lIxL61JIZ/jk2 -cvMcuCuYbEa2sHbL5uZV9jB0lY93fWOaZCfloQIDAQABAoIBAACA1NCJnSuEWQMN -KhSZhi8vsqAIsyDEcAlq7voLOcKThtxiRUcWrcd0dI3UbUVOC+SNaqqwF0Ztu+58 -ufbsJkjxvJXq8ZAAWx1vqPpJH8HEUiNclITiPZ20H/Bz272Kfv/1IfAKB26RZ4gT -3B/GBBCU3MIMC6rbu04QcTxCTXZuZdOIbxhQgCPCFXbFbDRe6nw7ZjvqPa02kzXC -htJuvvrq+HINozzttTnsGGgiqZbGeO4T23SdhbaPEnoPLPtv0c11l1YdBuDoY4DN -VWRoab4m2UJZnHEaFYOM1N295Y2M9WJ66wqHzR3OLt5YlcjRc3vlTNZ7WhdgBEaB -LyimNrECgYEA9a8FdMrbdJ/k0eTdJ+ppHf49kyeXvJDZggo8FAWy/nb9cfp4+bNE -CSsZ3dZX9xVORjtihJMGSQ0V4Buw3GkszEyZcPr9HwuNIQyUAU38b9J5500h1pvB -5Jb91On9XJKExoQB/ZyOGYWryRxJVUNak+MWmw49y4k4o/cZnmYSDl0CgYEAy1mx -tLNWs4wLbLPgm4NOYZ2lYdjSnWq1PdDwChzuEDfkEBHMEJeTiL7X6KRdGfVLVTmr -pFHELVttmE8Kd+ybUcw7Dd0NymeEOu/clSpM6cU1M1FMUKaQWbeh5/hOu+BUno1z -Bit2NcgCk28c/lqTbgWnO/5h4wYdyykwviNkGBUCgYEA4gCp1UFS1ZrMxGRzKOfS -4Ntiyz6Nr9HTtHMzxvtjKABPrwzJQnIs8P4sIkytyMZZpfO08d3J12NpLypp7Kf3 -pMwGDs9kD63xmmhWskiKIleM+kCTEzdfCqf3QmgpQIIsD+2ZYzIj6ch0OWGC+CMo -bIhm4CYepGBLsVF6yKJ+k6UCgYEAgFLo1px5sTJGH2Hf8qNI+kbuj7GxL0+gchMA -95DMFoX+sLlaanoMyzWLsK7QZcoqsOyEyVwkDW9t2LjAZW91kIfuGFCQHFN42Wx2 -addY1Aj0Cp9aJmcGHufID0fd/6eQHsIqfRE+NrAyF/H9fPGRqdN9dlmQUiCQ+pzS -uppA1wUCgYEA29yNmR6+Y1erm9ynneesOxo6mnPArEyQJal/LHowbrJL08yva4gQ -GlZUYyjPrbj2wNaUGXDmmRcbeilSXblUhB4j50dhSB1GqiRvNs9E1W9UGoO/tI/3 -8sjE2E/zkWHax7ynUEvSWm5PK9Y587ioOe3OBgMyE6KGGuKINg+8HrE= +MIIEpQIBAAKCAQEA3XueVWUfMWgQOcADuS+uPO4qJlBnvTOcNblOuq3BeoevlcbS +but1CW33HKvccWANtduSDvAGJ2pTJJZns39zGKoH+gyd9ue1qnCYE/vtKzwostDH +XsZ5vymvIgeuFwRr8Tnnp6m/dZGSjPePymHcNjuD6CFBY21YjdS8F1oiSY9pL7BV +8fqHDOlPitt1VIXWftKcxwlxwo8Q+CoBKISxhl5CCdlR51rIrMdGcl5APeU49csc +A4gYdqMa/JAUyoR8b10l9Y1XEf/4bEw26X2OxR8kxz32Yb+/LcHVZE46XYSJOLwX +N8zriWjxK8SzcNuNwAUi0jsFzIz8wnGpi1gVDQIDAQABAoIBAQCAE55J74IMRgsr ++hetHR966JbDNTfoN1Ib1x7p4NTDkHc++4xwzAQQAeEmWVPO1CbZhTF/JdnJLTkL +LVamfAsItjqKpIUsZG2vNBEdbU+G8vDuBsFj0w5QN0CpQxuu/8WT51JIqGapDBdd +IUOrWs/HJL9wmtp/LppI2j4ymtK9Cffce8AVTazfHspVF2e05b8GEeBjoMmvpPgw +bvHPLdCVoWPGsYOFUWG9V1eCo2CFtvspsa8CYghpaXg7EOElF73W1gEoEd5SdMx9 +svHeH4bJAzrWoqDrC5kOJUZRip9YjF8WXRudVmSaRPHptwN6qRvF8HWiGrYrdTtJ +j1seb87BAoGBAPUrxCI64EN/6YYNziM49RpORLVrZGLaZQCf0IJkoH3DcsBcrtF8 +hqJC73z75kj1Y+oOzulYPBlhQr+4hvbMSzHwsffi5nepPXSSGK2+D1O5rASou7b3 +Re/OiJNex7IrDAy354PV4B/7iFmgGOVUn+sXIKoprqnor7f3mALAa/yZAoGBAOdE +AMKktCQYIHweKPF0mYDsOnoJ8TEAydxShOan5r5gkVTnZhDHa3fD9eGh19Mfi9qC +cDro5Sq1+8OLoX6Ta/Ju3PNfI2Qn4KLF9CZrEQhrV90HmXluCflZXyL71SB8pGVo +5ybr8UtalUXVPXKi+inK7CXaJBZaboJWnqmaqJCVAoGAdIX0lgA9jldA+gGds4fi +ljoU1dTQxVrfHkjWpOKGlL9Lzrk+LTpuEriVcmWWsZ5PenLHTIgvKDDdtJlTLAE0 +y+uF6jbhKoY5OyokqI7oYfahFyXK8c7cYnla2A/4AWoMNA9D7Zi9CPZXe6Fns7dg +ui8nyzg8V2zL9zep+8TQjiECgYEAm2zTif0BaGSiqGfoomX3qHKa1lwKMiHSiHUZ +Bp9+7yGdas9dhBdSPZqAjJSlpSlFZ6RUYvMU2UCXJJOaBKR1XuhtLE8bTPuT+DFL +5en894iU82JhHf/7Sg5rZuqTERNTtSfsefcGItuNCPLIKlwn/qB3VvUlXbSHIqeu +WFQtx4UCgYEA1FIVEc4BjRE6jH80X7RSSOLJ6PwPglZzM8JEVyiYHAHE65zdORF1 +iCiuI+pRQc3yHkm2gbB+hY5HSrCmyJrJc0tcUd4QoMqOHV8UEGLVwxtr/4DPMsl4 +JIEmzmgvs56TJeKX0YlXnD612zjDWCPV6q+LWlUUzd8qLwk6L1+EFhE= -----END RSA PRIVATE KEY----- diff --git a/pkg/config/tlscfg/testdata/gen-certs.sh b/pkg/config/tlscfg/testdata/gen-certs.sh index 2df0aef87ee..dcdf31f086d 100755 --- a/pkg/config/tlscfg/testdata/gen-certs.sh +++ b/pkg/config/tlscfg/testdata/gen-certs.sh @@ -91,7 +91,6 @@ openssl x509 -req \ -sha256 \ -days 3650 \ -in "$tmp_dir/example-server.csr" \ - -signkey "$tmp_dir/example-server-key.pem" \ -out "$tmp_dir/example-server-cert.pem" \ -extensions req_ext \ -CA "$tmp_dir/example-CA-cert.pem" \ @@ -102,7 +101,6 @@ openssl x509 -req \ -sha256 \ -days 3650 \ -in "$tmp_dir/example-client.csr" \ - -signkey "$tmp_dir/example-client-key.pem" \ -out "$tmp_dir/example-client-cert.pem" \ -extensions req_ext \ -CA "$tmp_dir/example-CA-cert.pem" \ @@ -118,4 +116,4 @@ if [ $dry_run = false ]; then "$tmp_dir/example-server-cert.pem" \ "$tmp_dir/example-server-key.pem" \ "$tmp_dir/wrong-CA-cert.pem" . -fi \ No newline at end of file +fi diff --git a/pkg/config/tlscfg/testdata/wrong-CA-cert.pem b/pkg/config/tlscfg/testdata/wrong-CA-cert.pem index d915f5441ae..7de314c45e1 100644 --- a/pkg/config/tlscfg/testdata/wrong-CA-cert.pem +++ b/pkg/config/tlscfg/testdata/wrong-CA-cert.pem @@ -1,19 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDJjCCAg4CCQDbGRmsbCS7tzANBgkqhkiG9w0BAQsFADBVMQswCQYDVQQGEwJB -VTESMBAGA1UECAwJQXVzdHJhbGlhMQ8wDQYDVQQHDAZTeWRuZXkxEDAOBgNVBAoM -B0xvZ3ouaW8xDzANBgNVBAMMBmphZWdlcjAeFw0yMDA5MDkwNTU1NThaFw0zMDA5 -MDcwNTU1NThaMFUxCzAJBgNVBAYTAkFVMRIwEAYDVQQIDAlBdXN0cmFsaWExDzAN -BgNVBAcMBlN5ZG5leTEQMA4GA1UECgwHTG9nei5pbzEPMA0GA1UEAwwGamFlZ2Vy -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs72r4dAH4lb08E4RT82/ -uKbGJaje/wckQae4rrUIR8VDnlnOoTbPNHl7x7+5B3oRuFCkWYV/Ny5Tec8ABwu1 -e5Z+5ZtSySi1OjnqAHH7xdUFVdeDLn7JrA6AVs9Hd26T5YhQMFu24JxmxjN2CA8D -r4vBeUjuATDbHZtvjmvZ3HxlG9G3mjcldkwPh2LjWQBOQYOHwqyJqJHzsRDuUJBM -slazOdq3vAfCZammzwEI/OAdUNN0aQBtePIzMyZ9Oa+7d2xEcniwyFfpLc3Adcpq -jemU83BDVBKmSuj8sqnzcG0b5c4J8zifkK6bzVWO6e/3BV5uUEanzJqD6D1PNg3u -XwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBpIbVmtcN25W0byZRPDnKuu+6MC36P -E/kwXasEEbtKxSLHq3LwEc7fTahuRLwQ2vKeXxdaf5EuvEsr2VJEnle04uXAruHX -pFKRIFuj9G7mCHuR9NiE5eq5fF1P7FhyTWQbIQmaqgqk44kRDr3SpHnr0uKNJjJB -HFXxub48bDCbV12yHnHVk/hhqGIrdjAC+1DUDPRSN1MYzLVz4axREJhuDJNgUujs -Nwjz2/yZS0/l9lNzyxuWVaVOUiFN+tdezu+pvckygCD1fjtIY4jfE7yAMEJy4MDd -djCgeZC6D3XEoKQFE2VYx46LzgboUpZMy/XPvT/p+/9XFsbaCc+9uyfR +MIIDMTCCAhkCFHHHf3IkwJYPKija3g7MR53ttN+QMA0GCSqGSIb3DQEBCwUAMFUx +CzAJBgNVBAYTAkFVMRIwEAYDVQQIDAlBdXN0cmFsaWExDzANBgNVBAcMBlN5ZG5l +eTEQMA4GA1UECgwHTG9nei5pbzEPMA0GA1UEAwwGSmFlZ2VyMB4XDTIyMDkxMDAw +MjE0NFoXDTMyMDkwNzAwMjE0NFowVTELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCUF1 +c3RyYWxpYTEPMA0GA1UEBwwGU3lkbmV5MRAwDgYDVQQKDAdMb2d6LmlvMQ8wDQYD +VQQDDAZKYWVnZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDWRKQ +VcJGGiQVrAreflpWMaurA+dPBhKwrfiHZ1glFEevEyOcgXVP6pSvRsUYJ1x36yGq +8EV2bEAmpkBx0QEnPOiQIRfA8nuFmy9bE6RWl2amXoEg81E7LhW0uC9qGkF9eLG6 +o9F/knd0WGNCcEpfk9NdXH1HtNJJvjNNi6no/9KHHfT2pg/3OSzt3dCPOHwXZEdL +72rLs+NoV0sM1oP1MFZmYHzSNhquOKGWDEPTk58YvA5uRe06nacLt30ZCZh3oBso +vJxS8Cs7mAGZMnZrMbTcNd7iYN850lTlcYFmv/3zlzF7fO84mPBzWYSY90bJ2AwQ +AdJFrZl5sol/j9STAgMBAAEwDQYJKoZIhvcNAQELBQADggEBALYxUQPwRg+i3yVe +6Q4LuaJdTTJMF/ABHHffAZqAEjkfnzODimRyroGN6l5ixCRokbJ9q2Az7JLSj/Tv +y+5O4Tu8P3Z5nFkTPE70JDEw+sFKxHCGdQ8eNf+DlL7Ado+75a8Yug2RM4wHODVh +TKfHwj7c7vHnPkv8o8a4DiCQBNZmH6qXwCqLAYdeScrrhUzX04+3ZEq0boIYUTFn +FYqsdpKYFwwrQ1njlUu4VDGl02QXD3HYnkbzBzEI7HW7lxfcb2py8xrdIw9bh1fl +r+ou4bKctTJ4NOf3TezWT01MEGCgLgI8vdsyVGRUbPrfuHHVyuYARPXmEe89Q34+ +fHP/TLM= -----END CERTIFICATE----- From c1bb2946e670129314bf88d9730d8ed7566766d4 Mon Sep 17 00:00:00 2001 From: Ashmita Date: Sun, 11 Sep 2022 09:28:39 +1000 Subject: [PATCH 37/87] Bump golang from 1.18 to 1.19 (#3882) * bump golang from 1.18 to 1.19 Signed-off-by: Ashmita152 * feedbacks: fix the indentation for comments Signed-off-by: Ashmita152 Signed-off-by: Ashmita152 --- .github/workflows/ci-all-in-one-build.yml | 2 +- .github/workflows/ci-build-binaries.yml | 2 +- .github/workflows/ci-cassandra.yml | 2 +- .github/workflows/ci-crossdock.yml | 2 +- .github/workflows/ci-docker-build.yml | 2 +- .github/workflows/ci-elasticsearch.yml | 2 +- .github/workflows/ci-grpc-badger.yml | 2 +- .github/workflows/ci-hotrod.yml | 2 +- .github/workflows/ci-kafka.yml | 2 +- .github/workflows/ci-opensearch.yml | 2 +- .github/workflows/ci-protogen-tests.yml | 2 +- .github/workflows/ci-release.yml | 2 +- .github/workflows/ci-unit-tests.yml | 2 +- .github/workflows/fossa.yml | 2 +- .golangci.yml | 4 +- Makefile | 4 +- cmd/agent/app/httpserver/srv.go | 8 +- cmd/agent/app/servers/thriftudp/transport.go | 6 +- .../app/sampling/strategystore/factory.go | 2 +- cmd/collector/app/server/http.go | 6 +- cmd/collector/app/server/zipkin.go | 6 +- cmd/flags/admin.go | 6 +- .../app/consumer/deadlock_detector.go | 1 - cmd/query/app/flags.go | 2 +- cmd/query/app/query_parser.go | 94 +- cmd/query/app/server.go | 5 +- docker/Makefile | 4 +- go.mod | 2 +- model/hash.go | 1 - model/ids.go | 3 +- pkg/config/string_slice.go | 6 +- pkg/es/client/index_client.go | 15 +- plugin/doc.go | 2 - .../sampling/strategystore/factory_config.go | 4 +- plugin/storage/es/mappings/mapping.go | 3 +- plugin/storage/factory.go | 4 +- plugin/storage/factory_config.go | 12 +- .../storage/integration/integration_test.go | 6 +- storage/doc.go | 2 - storage/factory.go | 4 +- swagger-gen/models/annotation.go | 1 - swagger-gen/models/endpoint.go | 2 +- swagger-gen/models/list_of_spans.go | 2 +- swagger-gen/models/tags.go | 1 - swagger-gen/restapi/doc.go | 22 +- swagger-gen/restapi/operations/post_spans.go | 5 +- .../operations/post_spans_responses.go | 3 +- thrift-gen/agent/GoUnusedProtection__.go | 3 +- thrift-gen/agent/agent-consts.go | 6 +- thrift-gen/agent/agent.go | 535 +- thrift-gen/baggage/GoUnusedProtection__.go | 3 +- thrift-gen/baggage/baggage-consts.go | 6 +- thrift-gen/baggage/baggage.go | 859 +-- thrift-gen/jaeger/GoUnusedProtection__.go | 3 +- thrift-gen/jaeger/jaeger-consts.go | 6 +- thrift-gen/jaeger/jaeger.go | 4609 +++++++++-------- thrift-gen/sampling/GoUnusedProtection__.go | 3 +- thrift-gen/sampling/sampling-consts.go | 6 +- thrift-gen/sampling/sampling.go | 2140 ++++---- thrift-gen/zipkincore/GoUnusedProtection__.go | 3 +- thrift-gen/zipkincore/zipkincore-consts.go | 5 +- thrift-gen/zipkincore/zipkincore.go | 3032 ++++++----- 62 files changed, 6105 insertions(+), 5390 deletions(-) diff --git a/.github/workflows/ci-all-in-one-build.yml b/.github/workflows/ci-all-in-one-build.yml index 6df36c9185a..fb704faebbc 100644 --- a/.github/workflows/ci-all-in-one-build.yml +++ b/.github/workflows/ci-all-in-one-build.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/ci-build-binaries.yml b/.github/workflows/ci-build-binaries.yml index 5784cea9ca0..a7d7afcd5a5 100644 --- a/.github/workflows/ci-build-binaries.yml +++ b/.github/workflows/ci-build-binaries.yml @@ -39,7 +39,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Export BRANCH variable uses: ./.github/actions/setup-branch diff --git a/.github/workflows/ci-cassandra.yml b/.github/workflows/ci-cassandra.yml index b16008dc9f3..57a8b048a4a 100644 --- a/.github/workflows/ci-cassandra.yml +++ b/.github/workflows/ci-cassandra.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Run cassandra integration tests run: bash scripts/cassandra-integration-test.sh ${{ matrix.version.image }} ${{ matrix.version.schema }} diff --git a/.github/workflows/ci-crossdock.yml b/.github/workflows/ci-crossdock.yml index e98be85f546..37721685e4c 100644 --- a/.github/workflows/ci-crossdock.yml +++ b/.github/workflows/ci-crossdock.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Export BRANCH variable uses: ./.github/actions/setup-branch diff --git a/.github/workflows/ci-docker-build.yml b/.github/workflows/ci-docker-build.yml index 05b885f39f4..8ade4c68740 100644 --- a/.github/workflows/ci-docker-build.yml +++ b/.github/workflows/ci-docker-build.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/ci-elasticsearch.yml b/.github/workflows/ci-elasticsearch.yml index 33b54acc3cd..d4fa9e3dd1d 100644 --- a/.github/workflows/ci-elasticsearch.yml +++ b/.github/workflows/ci-elasticsearch.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Install tools run: make install-ci diff --git a/.github/workflows/ci-grpc-badger.yml b/.github/workflows/ci-grpc-badger.yml index b18b1be4686..5257b2f5cdc 100644 --- a/.github/workflows/ci-grpc-badger.yml +++ b/.github/workflows/ci-grpc-badger.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Run Badger storage integration tests run: make badger-storage-integration-test diff --git a/.github/workflows/ci-hotrod.yml b/.github/workflows/ci-hotrod.yml index 506b7f754c7..e456b454cfd 100644 --- a/.github/workflows/ci-hotrod.yml +++ b/.github/workflows/ci-hotrod.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Export BRANCH variable uses: ./.github/actions/setup-branch diff --git a/.github/workflows/ci-kafka.yml b/.github/workflows/ci-kafka.yml index 48a110185d6..74af4e558c6 100644 --- a/.github/workflows/ci-kafka.yml +++ b/.github/workflows/ci-kafka.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Run kafka integration tests run: bash scripts/kafka-integration-test.sh diff --git a/.github/workflows/ci-opensearch.yml b/.github/workflows/ci-opensearch.yml index f96e76cc276..7a685571e69 100644 --- a/.github/workflows/ci-opensearch.yml +++ b/.github/workflows/ci-opensearch.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Install tools run: make install-ci diff --git a/.github/workflows/ci-protogen-tests.yml b/.github/workflows/ci-protogen-tests.yml index 1cf0dadf373..cbbc5a132b1 100644 --- a/.github/workflows/ci-protogen-tests.yml +++ b/.github/workflows/ci-protogen-tests.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Run protogen validation run: make proto && git diff --name-status --exit-code diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index cfe8a9407bb..b30e2de564e 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index b4f259b1cc7..c85c57e6c6f 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Install tools run: make install-ci diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index 5fa0fc753fe..d7cbdf1eff2 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.19.x - name: Add GOPATH run: | diff --git a/.golangci.yml b/.golangci.yml index 528fb7c8027..64c96a7ef39 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ run: - go: '1.17' + go: '1.19' timeout: 10m skip-dirs: - mocks @@ -27,7 +27,7 @@ linters-settings: - G404 - G601 gosimple: - go: "1.18" + go: "1.19" linters: enable: diff --git a/Makefile b/Makefile index 2c68a3e8d97..ae5ab215039 100644 --- a/Makefile +++ b/Makefile @@ -392,8 +392,8 @@ draft-release: .PHONY: install-tools install-tools: - go install github.com/vektra/mockery/v2@v2.10.4 - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2 + go install github.com/vektra/mockery/v2@v2.14.0 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0 go install mvdan.cc/gofumpt@latest .PHONY: install-ci diff --git a/cmd/agent/app/httpserver/srv.go b/cmd/agent/app/httpserver/srv.go index 7d4bbaaebcc..698bad33a7e 100644 --- a/cmd/agent/app/httpserver/srv.go +++ b/cmd/agent/app/httpserver/srv.go @@ -17,6 +17,7 @@ package httpserver import ( "net/http" + "time" "github.com/gorilla/mux" "go.uber.org/zap" @@ -39,8 +40,9 @@ func NewHTTPServer(hostPort string, manager configmanager.ClientConfigManager, m handler.RegisterRoutes(r) errorLog, _ := zap.NewStdLogAt(logger, zapcore.ErrorLevel) return &http.Server{ - Addr: hostPort, - Handler: r, - ErrorLog: errorLog, + Addr: hostPort, + Handler: r, + ErrorLog: errorLog, + ReadHeaderTimeout: 2 * time.Second, } } diff --git a/cmd/agent/app/servers/thriftudp/transport.go b/cmd/agent/app/servers/thriftudp/transport.go index 6bb1a1af7bf..4579502061f 100644 --- a/cmd/agent/app/servers/thriftudp/transport.go +++ b/cmd/agent/app/servers/thriftudp/transport.go @@ -46,7 +46,8 @@ var _ thrift.TTransport = (*TUDPTransport)(nil) // All writes are buffered and flushed in one UDP packet. If locHostPort is not "", it // will be used as the local address for the connection // Example: -// trans, err := thriftudp.NewTUDPClientTransport("192.168.1.1:9090", "") +// +// trans, err := thriftudp.NewTUDPClientTransport("192.168.1.1:9090", "") func NewTUDPClientTransport(destHostPort string, locHostPort string) (*TUDPTransport, error) { destAddr, err := net.ResolveUDPAddr("udp", destHostPort) if err != nil { @@ -75,7 +76,8 @@ func createClient(destAddr, locAddr *net.UDPAddr) (*TUDPTransport, error) { // NewTUDPServerTransport creates a net.UDPConn-backed TTransport for Thrift servers // It will listen for incoming udp packets on the specified host/port // Example: -// trans, err := thriftudp.NewTUDPClientTransport("localhost:9001") +// +// trans, err := thriftudp.NewTUDPClientTransport("localhost:9001") func NewTUDPServerTransport(hostPort string) (*TUDPTransport, error) { addr, err := net.ResolveUDPAddr("udp", hostPort) if err != nil { diff --git a/cmd/collector/app/sampling/strategystore/factory.go b/cmd/collector/app/sampling/strategystore/factory.go index e47bd3105b0..5fab77b62bd 100644 --- a/cmd/collector/app/sampling/strategystore/factory.go +++ b/cmd/collector/app/sampling/strategystore/factory.go @@ -24,7 +24,7 @@ import ( // Factory defines an interface for a factory that can create implementations of different strategy storage components. // Implementations are also encouraged to implement plugin.Configurable interface. // -// See also +// # See also // // plugin.Configurable type Factory interface { diff --git a/cmd/collector/app/server/http.go b/cmd/collector/app/server/http.go index ab5e67e17ed..97024412e5b 100644 --- a/cmd/collector/app/server/http.go +++ b/cmd/collector/app/server/http.go @@ -17,6 +17,7 @@ package server import ( "net" "net/http" + "time" "github.com/gorilla/mux" "go.uber.org/zap" @@ -49,8 +50,9 @@ func StartHTTPServer(params *HTTPServerParams) (*http.Server, error) { errorLog, _ := zap.NewStdLogAt(params.Logger, zapcore.ErrorLevel) server := &http.Server{ - Addr: params.HostPort, - ErrorLog: errorLog, + Addr: params.HostPort, + ErrorLog: errorLog, + ReadHeaderTimeout: 2 * time.Second, } if params.TLSConfig.Enabled { tlsCfg, err := params.TLSConfig.Config(params.Logger) // This checks if the certificates are correctly provided diff --git a/cmd/collector/app/server/zipkin.go b/cmd/collector/app/server/zipkin.go index c7f7fcefb3e..a4bf36d999d 100644 --- a/cmd/collector/app/server/zipkin.go +++ b/cmd/collector/app/server/zipkin.go @@ -18,6 +18,7 @@ import ( "net" "net/http" "strings" + "time" "github.com/gorilla/mux" "github.com/rs/cors" @@ -61,8 +62,9 @@ func StartZipkinServer(params *ZipkinServerParams) (*http.Server, error) { errorLog, _ := zap.NewStdLogAt(params.Logger, zapcore.ErrorLevel) server := &http.Server{ - Addr: params.HostPort, - ErrorLog: errorLog, + Addr: params.HostPort, + ErrorLog: errorLog, + ReadHeaderTimeout: 2 * time.Second, } if params.TLSConfig.Enabled { tlsCfg, err := params.TLSConfig.Config(params.Logger) // This checks if the certificates are correctly provided diff --git a/cmd/flags/admin.go b/cmd/flags/admin.go index 31dd979993f..e3e7a069fa3 100644 --- a/cmd/flags/admin.go +++ b/cmd/flags/admin.go @@ -23,6 +23,7 @@ import ( "net" "net/http" "net/http/pprof" + "time" "github.com/spf13/viper" "go.uber.org/zap" @@ -132,8 +133,9 @@ func (s *AdminServer) serveWithListener(l net.Listener) { recoveryHandler := recoveryhandler.NewRecoveryHandler(s.logger, true) errorLog, _ := zap.NewStdLogAt(s.logger, zapcore.ErrorLevel) s.server = &http.Server{ - Handler: recoveryHandler(s.mux), - ErrorLog: errorLog, + Handler: recoveryHandler(s.mux), + ErrorLog: errorLog, + ReadHeaderTimeout: 2 * time.Second, } if s.tlsCfg != nil { s.server.TLSConfig = s.tlsCfg diff --git a/cmd/ingester/app/consumer/deadlock_detector.go b/cmd/ingester/app/consumer/deadlock_detector.go index bac160f7d00..7e8885a08f6 100644 --- a/cmd/ingester/app/consumer/deadlock_detector.go +++ b/cmd/ingester/app/consumer/deadlock_detector.go @@ -36,7 +36,6 @@ import ( // the dead instance. // // This hack protects jaeger-ingester from issues described in https://github.com/jaegertracing/jaeger/issues/1052 -// type deadlockDetector struct { metricsFactory metrics.Factory logger *zap.Logger diff --git a/cmd/query/app/flags.go b/cmd/query/app/flags.go index 5187335f4a3..7a729fd8ec1 100644 --- a/cmd/query/app/flags.go +++ b/cmd/query/app/flags.go @@ -142,7 +142,7 @@ func (qOpts *QueryOptions) BuildQueryServiceOptions(storageFactory storage.Facto } // stringSliceAsHeader parses a slice of strings and returns a http.Header. -// Each string in the slice is expected to be in the format "key: value" +// Each string in the slice is expected to be in the format "key: value" func stringSliceAsHeader(slice []string) (http.Header, error) { if len(slice) == 0 { return nil, nil diff --git a/cmd/query/app/query_parser.go b/cmd/query/app/query_parser.go index fae8928a080..9e885f9a9e3 100644 --- a/cmd/query/app/query_parser.go +++ b/cmd/query/app/query_parser.go @@ -101,30 +101,31 @@ func newDurationUnitsParser(units time.Duration) durationParser { // parseTraceQueryParams takes a request and constructs a model of parameters. // // Why start/end parameters are expressed in microseconds: -// Span searches operate on span latencies, which are expressed as microseconds in the data model, hence why -// support for high accuracy in search query parameters is required. -// Microsecond precision is a legacy artifact from zipkin origins where timestamps and durations -// are in microseconds (see: https://zipkin.io/pages/instrumenting.html). +// Span searches operate on span latencies, which are expressed as microseconds in the data model, hence why +// support for high accuracy in search query parameters is required. +// Microsecond precision is a legacy artifact from zipkin origins where timestamps and durations +// are in microseconds (see: https://zipkin.io/pages/instrumenting.html). // // Why duration parameters are expressed as duration strings like "1ms": -// The search UI itself does not insist on exact units because it supports string like 1ms. -// Go makes parsing duration strings like "1ms" very easy, hence why parsing of such strings is -// deferred to the backend rather than Jaeger UI. +// The search UI itself does not insist on exact units because it supports string like 1ms. +// Go makes parsing duration strings like "1ms" very easy, hence why parsing of such strings is +// deferred to the backend rather than Jaeger UI. // // Trace query syntax: -// query ::= param | param '&' query -// param ::= service | operation | limit | start | end | minDuration | maxDuration | tag | tags -// service ::= 'service=' strValue -// operation ::= 'operation=' strValue -// limit ::= 'limit=' intValue -// start ::= 'start=' intValue in unix microseconds -// end ::= 'end=' intValue in unix microseconds -// minDuration ::= 'minDuration=' strValue (units are "ns", "us" (or "µs"), "ms", "s", "m", "h") -// maxDuration ::= 'maxDuration=' strValue (units are "ns", "us" (or "µs"), "ms", "s", "m", "h") -// tag ::= 'tag=' key | 'tag=' keyvalue -// key := strValue -// keyValue := strValue ':' strValue -// tags :== 'tags=' jsonMap +// +// query ::= param | param '&' query +// param ::= service | operation | limit | start | end | minDuration | maxDuration | tag | tags +// service ::= 'service=' strValue +// operation ::= 'operation=' strValue +// limit ::= 'limit=' intValue +// start ::= 'start=' intValue in unix microseconds +// end ::= 'end=' intValue in unix microseconds +// minDuration ::= 'minDuration=' strValue (units are "ns", "us" (or "µs"), "ms", "s", "m", "h") +// maxDuration ::= 'maxDuration=' strValue (units are "ns", "us" (or "µs"), "ms", "s", "m", "h") +// tag ::= 'tag=' key | 'tag=' keyvalue +// key := strValue +// keyValue := strValue ':' strValue +// tags :== 'tags=' jsonMap func (p *queryParser) parseTraceQueryParams(r *http.Request) (*traceQueryParameters, error) { service := r.FormValue(serviceParam) operation := r.FormValue(operationParam) @@ -211,38 +212,39 @@ func (p *queryParser) parseDependenciesQueryParams(r *http.Request) (dqp depende // parseMetricsQueryParams takes a request and constructs a model of metrics query parameters. // // Why the API is designed using an end time (endTs) and lookback: -// The typical usage of the metrics APIs is to view the most recent metrics from now looking -// back a certain period of time, given the value of metrics generally degrades with time. As such, the API -// is also designed to mirror the user interface inputs. +// The typical usage of the metrics APIs is to view the most recent metrics from now looking +// back a certain period of time, given the value of metrics generally degrades with time. As such, the API +// is also designed to mirror the user interface inputs. // // Why times are expressed as unix milliseconds: -// - The minimum step size for Prometheus-compliant metrics backends is 1ms, -// hence millisecond precision on times is sufficient. -// - The metrics API is designed with one primary client in mind, the Jaeger UI. As it is a React.js application, -// the maximum supported built-in time precision is milliseconds, making it a convenient precision to use for such a client. +// - The minimum step size for Prometheus-compliant metrics backends is 1ms, +// hence millisecond precision on times is sufficient. +// - The metrics API is designed with one primary client in mind, the Jaeger UI. As it is a React.js application, +// the maximum supported built-in time precision is milliseconds, making it a convenient precision to use for such a client. // // Why durations are expressed as unix milliseconds: -// - Given the endTs time is expressed as milliseconds, it follows that lookback durations should use the -// same time units to compute the start time. -// - As above, the minimum step size for Prometheus-compliant metrics backends is 1ms. -// - Other durations are in milliseconds to maintain consistency of units with other parameters in the metrics APIs. -// - As the primary client for the metrics API is the Jaeger UI, it is programmatically simpler to supply the -// integer representations of durations in milliseconds rather than the human-readable representation such as "1ms". +// - Given the endTs time is expressed as milliseconds, it follows that lookback durations should use the +// same time units to compute the start time. +// - As above, the minimum step size for Prometheus-compliant metrics backends is 1ms. +// - Other durations are in milliseconds to maintain consistency of units with other parameters in the metrics APIs. +// - As the primary client for the metrics API is the Jaeger UI, it is programmatically simpler to supply the +// integer representations of durations in milliseconds rather than the human-readable representation such as "1ms". // // Metrics query syntax: -// query ::= services , [ '&' optionalParams ] -// optionalParams := param | param '&' optionalParams -// param ::= groupByOperation | endTs | lookback | step | ratePer | spanKinds -// services ::= service | service '&' services -// service ::= 'service=' strValue -// groupByOperation ::= 'groupByOperation=' boolValue -// endTs ::= 'endTs=' intValue in unix milliseconds -// lookback ::= 'lookback=' intValue duration in milliseconds -// step ::= 'step=' intValue duration in milliseconds -// ratePer ::= 'ratePer=' intValue duration in milliseconds -// spanKinds ::= spanKind | spanKind '&' spanKinds -// spanKind ::= 'spanKind=' spanKindType -// spanKindType ::= "unspecified" | "internal" | "server" | "client" | "producer" | "consumer" +// +// query ::= services , [ '&' optionalParams ] +// optionalParams := param | param '&' optionalParams +// param ::= groupByOperation | endTs | lookback | step | ratePer | spanKinds +// services ::= service | service '&' services +// service ::= 'service=' strValue +// groupByOperation ::= 'groupByOperation=' boolValue +// endTs ::= 'endTs=' intValue in unix milliseconds +// lookback ::= 'lookback=' intValue duration in milliseconds +// step ::= 'step=' intValue duration in milliseconds +// ratePer ::= 'ratePer=' intValue duration in milliseconds +// spanKinds ::= spanKind | spanKind '&' spanKinds +// spanKind ::= 'spanKind=' spanKindType +// spanKindType ::= "unspecified" | "internal" | "server" | "client" | "producer" | "consumer" func (p *queryParser) parseMetricsQueryParams(r *http.Request) (bqp metricsstore.BaseQueryParameters, err error) { query := r.URL.Query() services, ok := query[serviceParam] diff --git a/cmd/query/app/server.go b/cmd/query/app/server.go index 3e06b2e2538..70e2988e7e4 100644 --- a/cmd/query/app/server.go +++ b/cmd/query/app/server.go @@ -185,8 +185,9 @@ func createHTTPServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc. errorLog, _ := zap.NewStdLogAt(logger, zapcore.ErrorLevel) server := &http.Server{ - Handler: recoveryHandler(handler), - ErrorLog: errorLog, + Handler: recoveryHandler(handler), + ErrorLog: errorLog, + ReadHeaderTimeout: 2 * time.Second, } if queryOpts.TLSHTTP.Enabled { diff --git a/docker/Makefile b/docker/Makefile index f0568adf438..33ee9cd62a0 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,7 +1,7 @@ VERSION := 1.0.0 -ROOT_IMAGE ?= alpine:3.14 +ROOT_IMAGE ?= alpine:3.16 CERT_IMAGE := $(ROOT_IMAGE) -GOLANG_IMAGE := golang:1.18-alpine +GOLANG_IMAGE := golang:1.19-alpine DOCKER_REGISTRY ?= localhost:5000 BASE_IMAGE ?= $(DOCKER_REGISTRY)/baseimg_alpine:latest diff --git a/go.mod b/go.mod index b4ec0e4c9b9..a9a27f0ce86 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/jaegertracing/jaeger -go 1.18 +go 1.19 require ( github.com/HdrHistogram/hdrhistogram-go v1.1.2 diff --git a/model/hash.go b/model/hash.go index a37ea65a364..890843a8aaf 100644 --- a/model/hash.go +++ b/model/hash.go @@ -22,7 +22,6 @@ import ( // Hashable interface is for type that can participate in a hash computation // by writing their data into io.Writer, which is usually an instance of hash.Hash. -// type Hashable interface { Hash(w io.Writer) error } diff --git a/model/ids.go b/model/ids.go index be7da4d546c..4c21199eaa8 100644 --- a/model/ids.go +++ b/model/ids.go @@ -248,7 +248,8 @@ func (s *SpanID) UnmarshalJSON(data []byte) error { // User by protobuf JSON serialization. // // TODO: can be removed once this ticket is fixed: -// https://github.com/gogo/protobuf/issues/411#issuecomment-393856837 +// +// https://github.com/gogo/protobuf/issues/411#issuecomment-393856837 func (s *SpanID) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, b []byte) error { return s.UnmarshalJSON(b) } diff --git a/pkg/config/string_slice.go b/pkg/config/string_slice.go index f96860be09c..c38ff826123 100644 --- a/pkg/config/string_slice.go +++ b/pkg/config/string_slice.go @@ -17,9 +17,9 @@ package config import "strings" // StringSlice implements the pflag.Value interface and allows for parsing multiple -// config values with the same name -// It purposefully mimics pFlag.stringSliceValue (https://github.com/spf13/pflag/blob/master/string_slice.go) -// in order to be treated like a string slice by both viper and pflag cleanly +// config values with the same name. It purposefully mimics pFlag.stringSliceValue +// (https://github.com/spf13/pflag/blob/master/string_slice.go) in order to be +// treated like a string slice by both viper and pflag cleanly. type StringSlice []string // String implements pflag.Value diff --git a/pkg/es/client/index_client.go b/pkg/es/client/index_client.go index c456a093aeb..93892e80708 100644 --- a/pkg/es/client/index_client.go +++ b/pkg/es/client/index_client.go @@ -53,13 +53,16 @@ type IndicesClient struct { // GetJaegerIndices queries all Jaeger indices including the archive and rollover. // Jaeger daily indices are: -// jaeger-span-2019-01-01, jaeger-service-2019-01-01, jaeger-dependencies-2019-01-01 -// jaeger-span-archive +// - jaeger-span-2019-01-01 +// - jaeger-service-2019-01-01 +// - jaeger-dependencies-2019-01-01 +// - jaeger-span-archive +// // Rollover indices: -// aliases: jaeger-span-read, jaeger-span-write, jaeger-service-read, jaeger-service-write -// indices: jaeger-span-000001, jaeger-service-000001 etc. -// aliases: jaeger-span-archive-read, jaeger-span-archive-write -// indices: jaeger-span-archive-000001 +// - aliases: jaeger-span-read, jaeger-span-write, jaeger-service-read, jaeger-service-write +// - indices: jaeger-span-000001, jaeger-service-000001 etc. +// - aliases: jaeger-span-archive-read, jaeger-span-archive-write +// - indices: jaeger-span-archive-000001 func (i *IndicesClient) GetJaegerIndices(prefix string) ([]Index, error) { prefix += "jaeger-*" diff --git a/plugin/doc.go b/plugin/doc.go index 097b4f0d15e..dd04bfff02b 100644 --- a/plugin/doc.go +++ b/plugin/doc.go @@ -16,6 +16,4 @@ // Package plugin is the collection of implementations of different interfaces defined across Jaeger // // For example, implementations of the storage interface can be found in the plugin package -// -// package plugin diff --git a/plugin/sampling/strategystore/factory_config.go b/plugin/sampling/strategystore/factory_config.go index 824d1a7ac98..5c4b67e6b2a 100644 --- a/plugin/sampling/strategystore/factory_config.go +++ b/plugin/sampling/strategystore/factory_config.go @@ -36,8 +36,8 @@ type FactoryConfig struct { } // FactoryConfigFromEnv reads the desired sampling type from the SAMPLING_CONFIG_TYPE environment variable. Allowed values: -// * `file` - built-in -// * `adaptive` - built-in +// * `file` - built-in +// * `adaptive` - built-in func FactoryConfigFromEnv(log io.Writer) (*FactoryConfig, error) { strategyStoreType := getStrategyStoreTypeFromEnv(log) if strategyStoreType != samplingTypeAdaptive && diff --git a/plugin/storage/es/mappings/mapping.go b/plugin/storage/es/mappings/mapping.go index 56e0ec7b6a2..d76efd0bbbe 100644 --- a/plugin/storage/es/mappings/mapping.go +++ b/plugin/storage/es/mappings/mapping.go @@ -22,8 +22,9 @@ import ( "github.com/jaegertracing/jaeger/pkg/es" ) -//go:embed *.json // MAPPINGS contains embedded index templates. +// +//go:embed *.json var MAPPINGS embed.FS // MappingBuilder holds parameters required to render an elasticsearch index template diff --git a/plugin/storage/factory.go b/plugin/storage/factory.go index 1e8c92b2fe9..84d2aa4e01c 100644 --- a/plugin/storage/factory.go +++ b/plugin/storage/factory.go @@ -237,8 +237,8 @@ func (f *Factory) AddFlags(flagSet *flag.FlagSet) { } // AddPipelineFlags adds all the standard flags as well as the downsampling -// flags. This is intended to be used in Jaeger pipeline services such as -// the collector or ingester. +// flags. This is intended to be used in Jaeger pipeline services such as +// the collector or ingester. func (f *Factory) AddPipelineFlags(flagSet *flag.FlagSet) { f.AddFlags(flagSet) f.addDownsamplingFlags(flagSet) diff --git a/plugin/storage/factory_config.go b/plugin/storage/factory_config.go index 6a2761fab69..0fb576491c4 100644 --- a/plugin/storage/factory_config.go +++ b/plugin/storage/factory_config.go @@ -47,12 +47,12 @@ type FactoryConfig struct { // FactoryConfigFromEnvAndCLI reads the desired types of storage backends from SPAN_STORAGE_TYPE and // DEPENDENCY_STORAGE_TYPE environment variables. Allowed values: -// * `cassandra` - built-in -// * `opensearch` - built-in -// * `elasticsearch` - built-in -// * `memory` - built-in -// * `kafka` - built-in -// * `plugin` - loads a dynamic plugin that implements storage.Factory interface (not supported at the moment) +// * `cassandra` - built-in +// * `opensearch` - built-in +// * `elasticsearch` - built-in +// * `memory` - built-in +// * `kafka` - built-in +// * `plugin` - loads a dynamic plugin that implements storage.Factory interface (not supported at the moment) // // For backwards compatibility it also parses the args looking for deprecated --span-storage.type flag. // If found, it writes a deprecation warning to the log. diff --git a/plugin/storage/integration/integration_test.go b/plugin/storage/integration/integration_test.go index 3a860fb42ae..87634eb993d 100644 --- a/plugin/storage/integration/integration_test.go +++ b/plugin/storage/integration/integration_test.go @@ -63,9 +63,9 @@ type StorageIntegration struct { // QueryFixtures and TraceFixtures are under ./fixtures/queries.json and ./fixtures/traces/*.json respectively. // Each query fixture includes: -// Caption: describes the query we are testing -// Query: the query we are testing -// ExpectedFixture: the trace fixture that we want back from these queries. +// - Caption: describes the query we are testing +// - Query: the query we are testing +// - ExpectedFixture: the trace fixture that we want back from these queries. // Queries are not necessarily numbered, but since each query requires a service name, // the service name is formatted "query##-service". type QueryFixtures struct { diff --git a/storage/doc.go b/storage/doc.go index 241fbcfc482..4b3b595ca6a 100644 --- a/storage/doc.go +++ b/storage/doc.go @@ -16,6 +16,4 @@ // Package storage is the collection of different storage interfaces that are shared by two or more components. // // If a storage is used by only one component, its interface should be defined in the component package, and implementations under ./plugin/storage/{db_name}/{store_type}/.... -// -// package storage diff --git a/storage/factory.go b/storage/factory.go index 50c99dc390e..f6d3394840b 100644 --- a/storage/factory.go +++ b/storage/factory.go @@ -31,7 +31,7 @@ import ( // Factory defines an interface for a factory that can create implementations of different storage components. // Implementations are also encouraged to implement plugin.Configurable interface. // -// See also +// # See also // // plugin.Configurable type Factory interface { @@ -78,7 +78,7 @@ type ArchiveFactory interface { // MetricsFactory defines an interface for a factory that can create implementations of different metrics storage components. // Implementations are also encouraged to implement plugin.Configurable interface. // -// See also +// # See also // // plugin.Configurable type MetricsFactory interface { diff --git a/swagger-gen/models/annotation.go b/swagger-gen/models/annotation.go index a1d1ac0f44f..53fb4fe26d3 100644 --- a/swagger-gen/models/annotation.go +++ b/swagger-gen/models/annotation.go @@ -20,7 +20,6 @@ import ( // Zipkin v1 core annotations such as "cs" and "sr" have been replaced with // Span.Kind, which interprets timestamp and duration. // -// // swagger:model Annotation type Annotation struct { diff --git a/swagger-gen/models/endpoint.go b/swagger-gen/models/endpoint.go index 06ae40ae303..0d18cbff40d 100644 --- a/swagger-gen/models/endpoint.go +++ b/swagger-gen/models/endpoint.go @@ -16,7 +16,7 @@ import ( // Endpoint Endpoint // -// The network context of a node in the service graph +// # The network context of a node in the service graph // // swagger:model Endpoint type Endpoint struct { diff --git a/swagger-gen/models/list_of_spans.go b/swagger-gen/models/list_of_spans.go index 1d407d4bf0c..d3ff6e29c0d 100644 --- a/swagger-gen/models/list_of_spans.go +++ b/swagger-gen/models/list_of_spans.go @@ -16,7 +16,7 @@ import ( // ListOfSpans ListOfSpans // -// A list of spans with possibly different trace ids, in no particular order +// # A list of spans with possibly different trace ids, in no particular order // // swagger:model ListOfSpans type ListOfSpans []*Span diff --git a/swagger-gen/models/tags.go b/swagger-gen/models/tags.go index 2b4f300b2a2..89fd94db026 100644 --- a/swagger-gen/models/tags.go +++ b/swagger-gen/models/tags.go @@ -19,7 +19,6 @@ import ( // A tag "sql.query" isn't searchable, but it can help in debugging when viewing // a trace. // -// // swagger:model Tags type Tags map[string]string diff --git a/swagger-gen/restapi/doc.go b/swagger-gen/restapi/doc.go index 1a88cb632dd..ce19adf0144 100644 --- a/swagger-gen/restapi/doc.go +++ b/swagger-gen/restapi/doc.go @@ -2,20 +2,20 @@ // Package restapi Zipkin API // -// Zipkin's v2 api currently includes a POST endpoint that can receive spans. +// Zipkin's v2 api currently includes a POST endpoint that can receive spans. // -// Schemes: -// http -// https -// Host: localhost:9411 -// BasePath: /api/v2 -// Version: 1.0.0 +// Schemes: +// http +// https +// Host: localhost:9411 +// BasePath: /api/v2 +// Version: 1.0.0 // -// Consumes: -// - application/json +// Consumes: +// - application/json // -// Produces: -// - application/json +// Produces: +// - application/json // // swagger:meta package restapi diff --git a/swagger-gen/restapi/operations/post_spans.go b/swagger-gen/restapi/operations/post_spans.go index 2ac22f4cb2f..e6d1fc02913 100644 --- a/swagger-gen/restapi/operations/post_spans.go +++ b/swagger-gen/restapi/operations/post_spans.go @@ -29,11 +29,10 @@ func NewPostSpans(ctx *middleware.Context, handler PostSpansHandler) *PostSpans return &PostSpans{Context: ctx, Handler: handler} } -/* PostSpans swagger:route POST /spans postSpans +/* + PostSpans swagger:route POST /spans postSpans Uploads a list of spans encoded per content-type, for example json. - - */ type PostSpans struct { Context *middleware.Context diff --git a/swagger-gen/restapi/operations/post_spans_responses.go b/swagger-gen/restapi/operations/post_spans_responses.go index 71aa8ff4178..c3aaba70943 100644 --- a/swagger-gen/restapi/operations/post_spans_responses.go +++ b/swagger-gen/restapi/operations/post_spans_responses.go @@ -14,7 +14,8 @@ import ( // PostSpansAcceptedCode is the HTTP code returned for type PostSpansAccepted const PostSpansAcceptedCode int = 202 -/*PostSpansAccepted Accepted +/* +PostSpansAccepted Accepted swagger:response postSpansAccepted */ diff --git a/thrift-gen/agent/GoUnusedProtection__.go b/thrift-gen/agent/GoUnusedProtection__.go index 54cd3b0867a..18f429790b1 100644 --- a/thrift-gen/agent/GoUnusedProtection__.go +++ b/thrift-gen/agent/GoUnusedProtection__.go @@ -2,5 +2,4 @@ package agent -var GoUnusedProtection__ int; - +var GoUnusedProtection__ int diff --git a/thrift-gen/agent/agent-consts.go b/thrift-gen/agent/agent-consts.go index af972ea8b60..d413d24e526 100644 --- a/thrift-gen/agent/agent-consts.go +++ b/thrift-gen/agent/agent-consts.go @@ -2,15 +2,14 @@ package agent -import( +import ( "bytes" "context" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" "github.com/jaegertracing/jaeger/thrift-gen/jaeger" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" - + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -25,4 +24,3 @@ var _ = zipkincore.GoUnusedProtection__ func init() { } - diff --git a/thrift-gen/agent/agent.go b/thrift-gen/agent/agent.go index cc68b54f92d..d092f157abb 100644 --- a/thrift-gen/agent/agent.go +++ b/thrift-gen/agent/agent.go @@ -2,15 +2,14 @@ package agent -import( +import ( "bytes" "context" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" "github.com/jaegertracing/jaeger/thrift-gen/jaeger" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" - + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -22,375 +21,391 @@ var _ = bytes.Equal var _ = jaeger.GoUnusedProtection__ var _ = zipkincore.GoUnusedProtection__ + type Agent interface { - // Parameters: - // - Spans - EmitZipkinBatch(ctx context.Context, spans []*zipkincore.Span) (_err error) - // Parameters: - // - Batch - EmitBatch(ctx context.Context, batch *jaeger.Batch) (_err error) + // Parameters: + // - Spans + EmitZipkinBatch(ctx context.Context, spans []*zipkincore.Span) (_err error) + // Parameters: + // - Batch + EmitBatch(ctx context.Context, batch *jaeger.Batch) (_err error) } type AgentClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient + meta thrift.ResponseMeta } func NewAgentClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AgentClient { - return &AgentClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + return &AgentClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } } func NewAgentClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AgentClient { - return &AgentClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } + return &AgentClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewAgentClient(c thrift.TClient) *AgentClient { - return &AgentClient{ - c: c, - } + return &AgentClient{ + c: c, + } } func (p *AgentClient) Client_() thrift.TClient { - return p.c + return p.c } func (p *AgentClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta + return p.meta } func (p *AgentClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + p.meta = meta } // Parameters: -// - Spans +// - Spans func (p *AgentClient) EmitZipkinBatch(ctx context.Context, spans []*zipkincore.Span) (_err error) { - var _args0 AgentEmitZipkinBatchArgs - _args0.Spans = spans - p.SetLastResponseMeta_(thrift.ResponseMeta{}) - if _, err := p.Client_().Call(ctx, "emitZipkinBatch", &_args0, nil); err != nil { - return err - } - return nil + var _args0 AgentEmitZipkinBatchArgs + _args0.Spans = spans + p.SetLastResponseMeta_(thrift.ResponseMeta{}) + if _, err := p.Client_().Call(ctx, "emitZipkinBatch", &_args0, nil); err != nil { + return err + } + return nil } // Parameters: -// - Batch +// - Batch func (p *AgentClient) EmitBatch(ctx context.Context, batch *jaeger.Batch) (_err error) { - var _args1 AgentEmitBatchArgs - _args1.Batch = batch - p.SetLastResponseMeta_(thrift.ResponseMeta{}) - if _, err := p.Client_().Call(ctx, "emitBatch", &_args1, nil); err != nil { - return err - } - return nil + var _args1 AgentEmitBatchArgs + _args1.Batch = batch + p.SetLastResponseMeta_(thrift.ResponseMeta{}) + if _, err := p.Client_().Call(ctx, "emitBatch", &_args1, nil); err != nil { + return err + } + return nil } type AgentProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler Agent + processorMap map[string]thrift.TProcessorFunction + handler Agent } func (p *AgentProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *AgentProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *AgentProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewAgentProcessor(handler Agent) *AgentProcessor { - self2 := &AgentProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self2.processorMap["emitZipkinBatch"] = &agentProcessorEmitZipkinBatch{handler:handler} - self2.processorMap["emitBatch"] = &agentProcessorEmitBatch{handler:handler} -return self2 + self2 := &AgentProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self2.processorMap["emitZipkinBatch"] = &agentProcessorEmitZipkinBatch{handler: handler} + self2.processorMap["emitBatch"] = &agentProcessorEmitBatch{handler: handler} + return self2 } func (p *AgentProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x3 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x3.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x3 + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { + return false, thrift.WrapTException(err2) + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x3 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x3.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x3 } type agentProcessorEmitZipkinBatch struct { - handler Agent + handler Agent } func (p *agentProcessorEmitZipkinBatch) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AgentEmitZipkinBatchArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) + args := AgentEmitZipkinBatchArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) - tickerCancel := func() {} - _ = tickerCancel + tickerCancel := func() {} + _ = tickerCancel - if err2 = p.handler.EmitZipkinBatch(ctx, args.Spans); err2 != nil { - tickerCancel() - return true, thrift.WrapTException(err2) - } - tickerCancel() - return true, nil + if err2 = p.handler.EmitZipkinBatch(ctx, args.Spans); err2 != nil { + tickerCancel() + return true, thrift.WrapTException(err2) + } + tickerCancel() + return true, nil } type agentProcessorEmitBatch struct { - handler Agent + handler Agent } func (p *agentProcessorEmitBatch) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AgentEmitBatchArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) + args := AgentEmitBatchArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) - tickerCancel := func() {} - _ = tickerCancel + tickerCancel := func() {} + _ = tickerCancel - if err2 = p.handler.EmitBatch(ctx, args.Batch); err2 != nil { - tickerCancel() - return true, thrift.WrapTException(err2) - } - tickerCancel() - return true, nil + if err2 = p.handler.EmitBatch(ctx, args.Batch); err2 != nil { + tickerCancel() + return true, thrift.WrapTException(err2) + } + tickerCancel() + return true, nil } - // HELPER FUNCTIONS AND STRUCTURES // Attributes: -// - Spans +// - Spans type AgentEmitZipkinBatchArgs struct { - Spans []*zipkincore.Span `thrift:"spans,1" db:"spans" json:"spans"` + Spans []*zipkincore.Span `thrift:"spans,1" db:"spans" json:"spans"` } func NewAgentEmitZipkinBatchArgs() *AgentEmitZipkinBatchArgs { - return &AgentEmitZipkinBatchArgs{} + return &AgentEmitZipkinBatchArgs{} } - func (p *AgentEmitZipkinBatchArgs) GetSpans() []*zipkincore.Span { - return p.Spans + return p.Spans } func (p *AgentEmitZipkinBatchArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AgentEmitZipkinBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*zipkincore.Span, 0, size) - p.Spans = tSlice - for i := 0; i < size; i ++ { - _elem4 := &zipkincore.Span{} - if err := _elem4.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) - } - p.Spans = append(p.Spans, _elem4) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AgentEmitZipkinBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*zipkincore.Span, 0, size) + p.Spans = tSlice + for i := 0; i < size; i++ { + _elem4 := &zipkincore.Span{} + if err := _elem4.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Spans = append(p.Spans, _elem4) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *AgentEmitZipkinBatchArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "emitZipkinBatch_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "emitZipkinBatch_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *AgentEmitZipkinBatchArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "spans", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spans: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spans)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Spans { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:spans: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "spans", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spans: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spans)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spans { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:spans: ", p), err) + } + return err } func (p *AgentEmitZipkinBatchArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AgentEmitZipkinBatchArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("AgentEmitZipkinBatchArgs(%+v)", *p) } // Attributes: -// - Batch +// - Batch type AgentEmitBatchArgs struct { - Batch *jaeger.Batch `thrift:"batch,1" db:"batch" json:"batch"` + Batch *jaeger.Batch `thrift:"batch,1" db:"batch" json:"batch"` } func NewAgentEmitBatchArgs() *AgentEmitBatchArgs { - return &AgentEmitBatchArgs{} + return &AgentEmitBatchArgs{} } var AgentEmitBatchArgs_Batch_DEFAULT *jaeger.Batch + func (p *AgentEmitBatchArgs) GetBatch() *jaeger.Batch { - if !p.IsSetBatch() { - return AgentEmitBatchArgs_Batch_DEFAULT - } -return p.Batch + if !p.IsSetBatch() { + return AgentEmitBatchArgs_Batch_DEFAULT + } + return p.Batch } func (p *AgentEmitBatchArgs) IsSetBatch() bool { - return p.Batch != nil + return p.Batch != nil } func (p *AgentEmitBatchArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AgentEmitBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Batch = &jaeger.Batch{} - if err := p.Batch.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Batch), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AgentEmitBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Batch = &jaeger.Batch{} + if err := p.Batch.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Batch), err) + } + return nil } func (p *AgentEmitBatchArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "emitBatch_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "emitBatch_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *AgentEmitBatchArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "batch", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batch: ", p), err) } - if err := p.Batch.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Batch), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batch: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "batch", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batch: ", p), err) + } + if err := p.Batch.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Batch), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batch: ", p), err) + } + return err } func (p *AgentEmitBatchArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AgentEmitBatchArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("AgentEmitBatchArgs(%+v)", *p) } - - diff --git a/thrift-gen/baggage/GoUnusedProtection__.go b/thrift-gen/baggage/GoUnusedProtection__.go index 712b6a9da4c..b8f86906504 100644 --- a/thrift-gen/baggage/GoUnusedProtection__.go +++ b/thrift-gen/baggage/GoUnusedProtection__.go @@ -2,5 +2,4 @@ package baggage -var GoUnusedProtection__ int; - +var GoUnusedProtection__ int diff --git a/thrift-gen/baggage/baggage-consts.go b/thrift-gen/baggage/baggage-consts.go index 0eeb8239f97..02d3dcf82e3 100644 --- a/thrift-gen/baggage/baggage-consts.go +++ b/thrift-gen/baggage/baggage-consts.go @@ -2,12 +2,12 @@ package baggage -import( +import ( "bytes" "context" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -17,7 +17,5 @@ var _ = context.Background var _ = time.Now var _ = bytes.Equal - func init() { } - diff --git a/thrift-gen/baggage/baggage.go b/thrift-gen/baggage/baggage.go index 40134450580..f2bfa6df596 100644 --- a/thrift-gen/baggage/baggage.go +++ b/thrift-gen/baggage/baggage.go @@ -2,12 +2,12 @@ package baggage -import( +import ( "bytes" "context" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -18,548 +18,581 @@ var _ = time.Now var _ = bytes.Equal // Attributes: -// - BaggageKey -// - MaxValueLength +// - BaggageKey +// - MaxValueLength type BaggageRestriction struct { - BaggageKey string `thrift:"baggageKey,1,required" db:"baggageKey" json:"baggageKey"` - MaxValueLength int32 `thrift:"maxValueLength,2,required" db:"maxValueLength" json:"maxValueLength"` + BaggageKey string `thrift:"baggageKey,1,required" db:"baggageKey" json:"baggageKey"` + MaxValueLength int32 `thrift:"maxValueLength,2,required" db:"maxValueLength" json:"maxValueLength"` } func NewBaggageRestriction() *BaggageRestriction { - return &BaggageRestriction{} + return &BaggageRestriction{} } - func (p *BaggageRestriction) GetBaggageKey() string { - return p.BaggageKey + return p.BaggageKey } func (p *BaggageRestriction) GetMaxValueLength() int32 { - return p.MaxValueLength + return p.MaxValueLength } func (p *BaggageRestriction) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetBaggageKey bool = false; - var issetMaxValueLength bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetBaggageKey = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetMaxValueLength = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetBaggageKey{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BaggageKey is not set")); - } - if !issetMaxValueLength{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxValueLength is not set")); - } - return nil -} - -func (p *BaggageRestriction) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.BaggageKey = v -} - return nil -} - -func (p *BaggageRestriction) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.MaxValueLength = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetBaggageKey bool = false + var issetMaxValueLength bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetBaggageKey = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetMaxValueLength = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetBaggageKey { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BaggageKey is not set")) + } + if !issetMaxValueLength { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxValueLength is not set")) + } + return nil +} + +func (p *BaggageRestriction) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.BaggageKey = v + } + return nil +} + +func (p *BaggageRestriction) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.MaxValueLength = v + } + return nil } func (p *BaggageRestriction) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "BaggageRestriction"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "BaggageRestriction"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *BaggageRestriction) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "baggageKey", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:baggageKey: ", p), err) } - if err := oprot.WriteString(ctx, string(p.BaggageKey)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.baggageKey (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:baggageKey: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "baggageKey", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:baggageKey: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.BaggageKey)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.baggageKey (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:baggageKey: ", p), err) + } + return err } func (p *BaggageRestriction) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxValueLength", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxValueLength: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.MaxValueLength)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxValueLength (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxValueLength: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "maxValueLength", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxValueLength: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.MaxValueLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxValueLength (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxValueLength: ", p), err) + } + return err } func (p *BaggageRestriction) Equals(other *BaggageRestriction) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.BaggageKey != other.BaggageKey { return false } - if p.MaxValueLength != other.MaxValueLength { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.BaggageKey != other.BaggageKey { + return false + } + if p.MaxValueLength != other.MaxValueLength { + return false + } + return true } func (p *BaggageRestriction) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BaggageRestriction(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("BaggageRestriction(%+v)", *p) } type BaggageRestrictionManager interface { - // getBaggageRestrictions retrieves the baggage restrictions for a specific service. - // Usually, baggageRestrictions apply to all services however there may be situations - // where a baggageKey might only be allowed to be set by a specific service. - // - // Parameters: - // - ServiceName - GetBaggageRestrictions(ctx context.Context, serviceName string) (_r []*BaggageRestriction, _err error) + // getBaggageRestrictions retrieves the baggage restrictions for a specific service. + // Usually, baggageRestrictions apply to all services however there may be situations + // where a baggageKey might only be allowed to be set by a specific service. + // + // Parameters: + // - ServiceName + GetBaggageRestrictions(ctx context.Context, serviceName string) (_r []*BaggageRestriction, _err error) } type BaggageRestrictionManagerClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient + meta thrift.ResponseMeta } func NewBaggageRestrictionManagerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *BaggageRestrictionManagerClient { - return &BaggageRestrictionManagerClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + return &BaggageRestrictionManagerClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } } func NewBaggageRestrictionManagerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *BaggageRestrictionManagerClient { - return &BaggageRestrictionManagerClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } + return &BaggageRestrictionManagerClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewBaggageRestrictionManagerClient(c thrift.TClient) *BaggageRestrictionManagerClient { - return &BaggageRestrictionManagerClient{ - c: c, - } + return &BaggageRestrictionManagerClient{ + c: c, + } } func (p *BaggageRestrictionManagerClient) Client_() thrift.TClient { - return p.c + return p.c } func (p *BaggageRestrictionManagerClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta + return p.meta } func (p *BaggageRestrictionManagerClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + p.meta = meta } // getBaggageRestrictions retrieves the baggage restrictions for a specific service. // Usually, baggageRestrictions apply to all services however there may be situations // where a baggageKey might only be allowed to be set by a specific service. -// +// // Parameters: -// - ServiceName +// - ServiceName func (p *BaggageRestrictionManagerClient) GetBaggageRestrictions(ctx context.Context, serviceName string) (_r []*BaggageRestriction, _err error) { - var _args0 BaggageRestrictionManagerGetBaggageRestrictionsArgs - _args0.ServiceName = serviceName - var _result2 BaggageRestrictionManagerGetBaggageRestrictionsResult - var _meta1 thrift.ResponseMeta - _meta1, _err = p.Client_().Call(ctx, "getBaggageRestrictions", &_args0, &_result2) - p.SetLastResponseMeta_(_meta1) - if _err != nil { - return - } - return _result2.GetSuccess(), nil + var _args0 BaggageRestrictionManagerGetBaggageRestrictionsArgs + _args0.ServiceName = serviceName + var _result2 BaggageRestrictionManagerGetBaggageRestrictionsResult + var _meta1 thrift.ResponseMeta + _meta1, _err = p.Client_().Call(ctx, "getBaggageRestrictions", &_args0, &_result2) + p.SetLastResponseMeta_(_meta1) + if _err != nil { + return + } + return _result2.GetSuccess(), nil } type BaggageRestrictionManagerProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler BaggageRestrictionManager + processorMap map[string]thrift.TProcessorFunction + handler BaggageRestrictionManager } func (p *BaggageRestrictionManagerProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *BaggageRestrictionManagerProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *BaggageRestrictionManagerProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewBaggageRestrictionManagerProcessor(handler BaggageRestrictionManager) *BaggageRestrictionManagerProcessor { - self3 := &BaggageRestrictionManagerProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self3.processorMap["getBaggageRestrictions"] = &baggageRestrictionManagerProcessorGetBaggageRestrictions{handler:handler} -return self3 + self3 := &BaggageRestrictionManagerProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self3.processorMap["getBaggageRestrictions"] = &baggageRestrictionManagerProcessorGetBaggageRestrictions{handler: handler} + return self3 } func (p *BaggageRestrictionManagerProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x4 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x4.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x4 + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { + return false, thrift.WrapTException(err2) + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x4 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x4.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x4 } type baggageRestrictionManagerProcessorGetBaggageRestrictions struct { - handler BaggageRestrictionManager + handler BaggageRestrictionManager } func (p *baggageRestrictionManagerProcessorGetBaggageRestrictions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := BaggageRestrictionManagerGetBaggageRestrictionsArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := BaggageRestrictionManagerGetBaggageRestrictionsResult{} - var retval []*BaggageRestriction - if retval, err2 = p.handler.GetBaggageRestrictions(ctx, args.ServiceName); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getBaggageRestrictions: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := BaggageRestrictionManagerGetBaggageRestrictionsArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := BaggageRestrictionManagerGetBaggageRestrictionsResult{} + var retval []*BaggageRestriction + if retval, err2 = p.handler.GetBaggageRestrictions(ctx, args.ServiceName); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getBaggageRestrictions: "+err2.Error()) + oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "getBaggageRestrictions", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err } - // HELPER FUNCTIONS AND STRUCTURES // Attributes: -// - ServiceName +// - ServiceName type BaggageRestrictionManagerGetBaggageRestrictionsArgs struct { - ServiceName string `thrift:"serviceName,1" db:"serviceName" json:"serviceName"` + ServiceName string `thrift:"serviceName,1" db:"serviceName" json:"serviceName"` } func NewBaggageRestrictionManagerGetBaggageRestrictionsArgs() *BaggageRestrictionManagerGetBaggageRestrictionsArgs { - return &BaggageRestrictionManagerGetBaggageRestrictionsArgs{} + return &BaggageRestrictionManagerGetBaggageRestrictionsArgs{} } - func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) GetServiceName() string { - return p.ServiceName + return p.ServiceName } func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.ServiceName = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ServiceName = v + } + return nil } func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getBaggageRestrictions_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "getBaggageRestrictions_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) + } + return err } func (p *BaggageRestrictionManagerGetBaggageRestrictionsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BaggageRestrictionManagerGetBaggageRestrictionsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("BaggageRestrictionManagerGetBaggageRestrictionsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type BaggageRestrictionManagerGetBaggageRestrictionsResult struct { - Success []*BaggageRestriction `thrift:"success,0" db:"success" json:"success,omitempty"` + Success []*BaggageRestriction `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewBaggageRestrictionManagerGetBaggageRestrictionsResult() *BaggageRestrictionManagerGetBaggageRestrictionsResult { - return &BaggageRestrictionManagerGetBaggageRestrictionsResult{} + return &BaggageRestrictionManagerGetBaggageRestrictionsResult{} } var BaggageRestrictionManagerGetBaggageRestrictionsResult_Success_DEFAULT []*BaggageRestriction func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) GetSuccess() []*BaggageRestriction { - return p.Success + return p.Success } func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.LIST { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*BaggageRestriction, 0, size) - p.Success = tSlice - for i := 0; i < size; i ++ { - _elem5 := &BaggageRestriction{} - if err := _elem5.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) - } - p.Success = append(p.Success, _elem5) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.LIST { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BaggageRestriction, 0, size) + p.Success = tSlice + for i := 0; i < size; i++ { + _elem5 := &BaggageRestriction{} + if err := _elem5.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + } + p.Success = append(p.Success, _elem5) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getBaggageRestrictions_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "getBaggageRestrictions_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Success { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Success { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *BaggageRestrictionManagerGetBaggageRestrictionsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BaggageRestrictionManagerGetBaggageRestrictionsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("BaggageRestrictionManagerGetBaggageRestrictionsResult(%+v)", *p) } - - diff --git a/thrift-gen/jaeger/GoUnusedProtection__.go b/thrift-gen/jaeger/GoUnusedProtection__.go index fe45a9f9ad2..4e709e137ce 100644 --- a/thrift-gen/jaeger/GoUnusedProtection__.go +++ b/thrift-gen/jaeger/GoUnusedProtection__.go @@ -2,5 +2,4 @@ package jaeger -var GoUnusedProtection__ int; - +var GoUnusedProtection__ int diff --git a/thrift-gen/jaeger/jaeger-consts.go b/thrift-gen/jaeger/jaeger-consts.go index ca723e29f1a..d80725aeca2 100644 --- a/thrift-gen/jaeger/jaeger-consts.go +++ b/thrift-gen/jaeger/jaeger-consts.go @@ -2,12 +2,12 @@ package jaeger -import( +import ( "bytes" "context" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -17,7 +17,5 @@ var _ = context.Background var _ = time.Now var _ = bytes.Equal - func init() { } - diff --git a/thrift-gen/jaeger/jaeger.go b/thrift-gen/jaeger/jaeger.go index 9a55459f33f..8afd720c07d 100644 --- a/thrift-gen/jaeger/jaeger.go +++ b/thrift-gen/jaeger/jaeger.go @@ -2,14 +2,14 @@ package jaeger -import( +import ( "bytes" "context" "database/sql/driver" "errors" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -20,2679 +20,3002 @@ var _ = time.Now var _ = bytes.Equal type TagType int64 + const ( - TagType_STRING TagType = 0 - TagType_DOUBLE TagType = 1 - TagType_BOOL TagType = 2 - TagType_LONG TagType = 3 - TagType_BINARY TagType = 4 + TagType_STRING TagType = 0 + TagType_DOUBLE TagType = 1 + TagType_BOOL TagType = 2 + TagType_LONG TagType = 3 + TagType_BINARY TagType = 4 ) func (p TagType) String() string { - switch p { - case TagType_STRING: return "STRING" - case TagType_DOUBLE: return "DOUBLE" - case TagType_BOOL: return "BOOL" - case TagType_LONG: return "LONG" - case TagType_BINARY: return "BINARY" - } - return "" + switch p { + case TagType_STRING: + return "STRING" + case TagType_DOUBLE: + return "DOUBLE" + case TagType_BOOL: + return "BOOL" + case TagType_LONG: + return "LONG" + case TagType_BINARY: + return "BINARY" + } + return "" } func TagTypeFromString(s string) (TagType, error) { - switch s { - case "STRING": return TagType_STRING, nil - case "DOUBLE": return TagType_DOUBLE, nil - case "BOOL": return TagType_BOOL, nil - case "LONG": return TagType_LONG, nil - case "BINARY": return TagType_BINARY, nil - } - return TagType(0), fmt.Errorf("not a valid TagType string") + switch s { + case "STRING": + return TagType_STRING, nil + case "DOUBLE": + return TagType_DOUBLE, nil + case "BOOL": + return TagType_BOOL, nil + case "LONG": + return TagType_LONG, nil + case "BINARY": + return TagType_BINARY, nil + } + return TagType(0), fmt.Errorf("not a valid TagType string") } - func TagTypePtr(v TagType) *TagType { return &v } func (p TagType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TagType) UnmarshalText(text []byte) error { -q, err := TagTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TagTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TagType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TagType(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TagType(v) + return nil } -func (p * TagType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TagType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type SpanRefType int64 + const ( - SpanRefType_CHILD_OF SpanRefType = 0 - SpanRefType_FOLLOWS_FROM SpanRefType = 1 + SpanRefType_CHILD_OF SpanRefType = 0 + SpanRefType_FOLLOWS_FROM SpanRefType = 1 ) func (p SpanRefType) String() string { - switch p { - case SpanRefType_CHILD_OF: return "CHILD_OF" - case SpanRefType_FOLLOWS_FROM: return "FOLLOWS_FROM" - } - return "" + switch p { + case SpanRefType_CHILD_OF: + return "CHILD_OF" + case SpanRefType_FOLLOWS_FROM: + return "FOLLOWS_FROM" + } + return "" } func SpanRefTypeFromString(s string) (SpanRefType, error) { - switch s { - case "CHILD_OF": return SpanRefType_CHILD_OF, nil - case "FOLLOWS_FROM": return SpanRefType_FOLLOWS_FROM, nil - } - return SpanRefType(0), fmt.Errorf("not a valid SpanRefType string") + switch s { + case "CHILD_OF": + return SpanRefType_CHILD_OF, nil + case "FOLLOWS_FROM": + return SpanRefType_FOLLOWS_FROM, nil + } + return SpanRefType(0), fmt.Errorf("not a valid SpanRefType string") } - func SpanRefTypePtr(v SpanRefType) *SpanRefType { return &v } func (p SpanRefType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *SpanRefType) UnmarshalText(text []byte) error { -q, err := SpanRefTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := SpanRefTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *SpanRefType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = SpanRefType(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = SpanRefType(v) + return nil } -func (p * SpanRefType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *SpanRefType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + // Attributes: -// - Key -// - VType -// - VStr -// - VDouble -// - VBool -// - VLong -// - VBinary +// - Key +// - VType +// - VStr +// - VDouble +// - VBool +// - VLong +// - VBinary type Tag struct { - Key string `thrift:"key,1,required" db:"key" json:"key"` - VType TagType `thrift:"vType,2,required" db:"vType" json:"vType"` - VStr *string `thrift:"vStr,3" db:"vStr" json:"vStr,omitempty"` - VDouble *float64 `thrift:"vDouble,4" db:"vDouble" json:"vDouble,omitempty"` - VBool *bool `thrift:"vBool,5" db:"vBool" json:"vBool,omitempty"` - VLong *int64 `thrift:"vLong,6" db:"vLong" json:"vLong,omitempty"` - VBinary []byte `thrift:"vBinary,7" db:"vBinary" json:"vBinary,omitempty"` + Key string `thrift:"key,1,required" db:"key" json:"key"` + VType TagType `thrift:"vType,2,required" db:"vType" json:"vType"` + VStr *string `thrift:"vStr,3" db:"vStr" json:"vStr,omitempty"` + VDouble *float64 `thrift:"vDouble,4" db:"vDouble" json:"vDouble,omitempty"` + VBool *bool `thrift:"vBool,5" db:"vBool" json:"vBool,omitempty"` + VLong *int64 `thrift:"vLong,6" db:"vLong" json:"vLong,omitempty"` + VBinary []byte `thrift:"vBinary,7" db:"vBinary" json:"vBinary,omitempty"` } func NewTag() *Tag { - return &Tag{} + return &Tag{} } - func (p *Tag) GetKey() string { - return p.Key + return p.Key } func (p *Tag) GetVType() TagType { - return p.VType + return p.VType } + var Tag_VStr_DEFAULT string + func (p *Tag) GetVStr() string { - if !p.IsSetVStr() { - return Tag_VStr_DEFAULT - } -return *p.VStr + if !p.IsSetVStr() { + return Tag_VStr_DEFAULT + } + return *p.VStr } + var Tag_VDouble_DEFAULT float64 + func (p *Tag) GetVDouble() float64 { - if !p.IsSetVDouble() { - return Tag_VDouble_DEFAULT - } -return *p.VDouble + if !p.IsSetVDouble() { + return Tag_VDouble_DEFAULT + } + return *p.VDouble } + var Tag_VBool_DEFAULT bool + func (p *Tag) GetVBool() bool { - if !p.IsSetVBool() { - return Tag_VBool_DEFAULT - } -return *p.VBool + if !p.IsSetVBool() { + return Tag_VBool_DEFAULT + } + return *p.VBool } + var Tag_VLong_DEFAULT int64 + func (p *Tag) GetVLong() int64 { - if !p.IsSetVLong() { - return Tag_VLong_DEFAULT - } -return *p.VLong + if !p.IsSetVLong() { + return Tag_VLong_DEFAULT + } + return *p.VLong } + var Tag_VBinary_DEFAULT []byte func (p *Tag) GetVBinary() []byte { - return p.VBinary + return p.VBinary } func (p *Tag) IsSetVStr() bool { - return p.VStr != nil + return p.VStr != nil } func (p *Tag) IsSetVDouble() bool { - return p.VDouble != nil + return p.VDouble != nil } func (p *Tag) IsSetVBool() bool { - return p.VBool != nil + return p.VBool != nil } func (p *Tag) IsSetVLong() bool { - return p.VLong != nil + return p.VLong != nil } func (p *Tag) IsSetVBinary() bool { - return p.VBinary != nil + return p.VBinary != nil } func (p *Tag) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetKey bool = false; - var issetVType bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetKey = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetVType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRING { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetKey{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")); - } - if !issetVType{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field VType is not set")); - } - return nil -} - -func (p *Tag) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Key = v -} - return nil -} - -func (p *Tag) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TagType(v) - p.VType = temp -} - return nil -} - -func (p *Tag) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.VStr = &v -} - return nil -} - -func (p *Tag) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.VDouble = &v -} - return nil -} - -func (p *Tag) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.VBool = &v -} - return nil -} - -func (p *Tag) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.VLong = &v -} - return nil -} - -func (p *Tag) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) -} else { - p.VBinary = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetKey bool = false + var issetVType bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetKey = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetVType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetKey { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")) + } + if !issetVType { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field VType is not set")) + } + return nil +} + +func (p *Tag) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Key = v + } + return nil +} + +func (p *Tag) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TagType(v) + p.VType = temp + } + return nil +} + +func (p *Tag) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.VStr = &v + } + return nil +} + +func (p *Tag) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.VDouble = &v + } + return nil +} + +func (p *Tag) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.VBool = &v + } + return nil +} + +func (p *Tag) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.VLong = &v + } + return nil +} + +func (p *Tag) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.VBinary = v + } + return nil } func (p *Tag) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Tag"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Tag"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField7(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Tag) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "key", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Key)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Key)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err } func (p *Tag) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "vType", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.VType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.vType (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vType: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "vType", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vType: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.VType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.vType (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vType: ", p), err) + } + return err } func (p *Tag) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetVStr() { - if err := oprot.WriteFieldBegin(ctx, "vStr", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vStr: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.VStr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.vStr (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vStr: ", p), err) } - } - return err + if p.IsSetVStr() { + if err := oprot.WriteFieldBegin(ctx, "vStr", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vStr: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.VStr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.vStr (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vStr: ", p), err) + } + } + return err } func (p *Tag) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetVDouble() { - if err := oprot.WriteFieldBegin(ctx, "vDouble", thrift.DOUBLE, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:vDouble: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.VDouble)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.vDouble (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:vDouble: ", p), err) } - } - return err + if p.IsSetVDouble() { + if err := oprot.WriteFieldBegin(ctx, "vDouble", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:vDouble: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(*p.VDouble)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.vDouble (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:vDouble: ", p), err) + } + } + return err } func (p *Tag) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetVBool() { - if err := oprot.WriteFieldBegin(ctx, "vBool", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:vBool: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.VBool)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.vBool (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vBool: ", p), err) } - } - return err + if p.IsSetVBool() { + if err := oprot.WriteFieldBegin(ctx, "vBool", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:vBool: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.VBool)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.vBool (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vBool: ", p), err) + } + } + return err } func (p *Tag) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetVLong() { - if err := oprot.WriteFieldBegin(ctx, "vLong", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:vLong: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.VLong)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.vLong (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vLong: ", p), err) } - } - return err + if p.IsSetVLong() { + if err := oprot.WriteFieldBegin(ctx, "vLong", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:vLong: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.VLong)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.vLong (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vLong: ", p), err) + } + } + return err } func (p *Tag) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetVBinary() { - if err := oprot.WriteFieldBegin(ctx, "vBinary", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:vBinary: ", p), err) } - if err := oprot.WriteBinary(ctx, p.VBinary); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.vBinary (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:vBinary: ", p), err) } - } - return err + if p.IsSetVBinary() { + if err := oprot.WriteFieldBegin(ctx, "vBinary", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:vBinary: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.VBinary); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.vBinary (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:vBinary: ", p), err) + } + } + return err } func (p *Tag) Equals(other *Tag) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Key != other.Key { return false } - if p.VType != other.VType { return false } - if p.VStr != other.VStr { - if p.VStr == nil || other.VStr == nil { - return false - } - if (*p.VStr) != (*other.VStr) { return false } - } - if p.VDouble != other.VDouble { - if p.VDouble == nil || other.VDouble == nil { - return false - } - if (*p.VDouble) != (*other.VDouble) { return false } - } - if p.VBool != other.VBool { - if p.VBool == nil || other.VBool == nil { - return false - } - if (*p.VBool) != (*other.VBool) { return false } - } - if p.VLong != other.VLong { - if p.VLong == nil || other.VLong == nil { - return false - } - if (*p.VLong) != (*other.VLong) { return false } - } - if bytes.Compare(p.VBinary, other.VBinary) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Key != other.Key { + return false + } + if p.VType != other.VType { + return false + } + if p.VStr != other.VStr { + if p.VStr == nil || other.VStr == nil { + return false + } + if (*p.VStr) != (*other.VStr) { + return false + } + } + if p.VDouble != other.VDouble { + if p.VDouble == nil || other.VDouble == nil { + return false + } + if (*p.VDouble) != (*other.VDouble) { + return false + } + } + if p.VBool != other.VBool { + if p.VBool == nil || other.VBool == nil { + return false + } + if (*p.VBool) != (*other.VBool) { + return false + } + } + if p.VLong != other.VLong { + if p.VLong == nil || other.VLong == nil { + return false + } + if (*p.VLong) != (*other.VLong) { + return false + } + } + if bytes.Compare(p.VBinary, other.VBinary) != 0 { + return false + } + return true } func (p *Tag) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Tag(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Tag(%+v)", *p) } // Attributes: -// - Timestamp -// - Fields +// - Timestamp +// - Fields type Log struct { - Timestamp int64 `thrift:"timestamp,1,required" db:"timestamp" json:"timestamp"` - Fields []*Tag `thrift:"fields,2,required" db:"fields" json:"fields"` + Timestamp int64 `thrift:"timestamp,1,required" db:"timestamp" json:"timestamp"` + Fields []*Tag `thrift:"fields,2,required" db:"fields" json:"fields"` } func NewLog() *Log { - return &Log{} + return &Log{} } - func (p *Log) GetTimestamp() int64 { - return p.Timestamp + return p.Timestamp } func (p *Log) GetFields() []*Tag { - return p.Fields + return p.Fields } func (p *Log) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTimestamp bool = false; - var issetFields bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetTimestamp = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetFields = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetTimestamp{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamp is not set")); - } - if !issetFields{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Fields is not set")); - } - return nil -} - -func (p *Log) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Timestamp = v -} - return nil -} - -func (p *Log) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Tag, 0, size) - p.Fields = tSlice - for i := 0; i < size; i ++ { - _elem0 := &Tag{} - if err := _elem0.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) - } - p.Fields = append(p.Fields, _elem0) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTimestamp bool = false + var issetFields bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetTimestamp = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetFields = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetTimestamp { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamp is not set")) + } + if !issetFields { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Fields is not set")) + } + return nil +} + +func (p *Log) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Timestamp = v + } + return nil +} + +func (p *Log) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Tag, 0, size) + p.Fields = tSlice + for i := 0; i < size; i++ { + _elem0 := &Tag{} + if err := _elem0.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Fields = append(p.Fields, _elem0) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *Log) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Log"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Log"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Log) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "timestamp", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestamp: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.Timestamp)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timestamp (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestamp: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "timestamp", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestamp: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.Timestamp)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timestamp (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestamp: ", p), err) + } + return err } func (p *Log) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "fields", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:fields: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Fields)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Fields { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:fields: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "fields", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:fields: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:fields: ", p), err) + } + return err } func (p *Log) Equals(other *Log) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Timestamp != other.Timestamp { return false } - if len(p.Fields) != len(other.Fields) { return false } - for i, _tgt := range p.Fields { - _src1 := other.Fields[i] - if !_tgt.Equals(_src1) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Timestamp != other.Timestamp { + return false + } + if len(p.Fields) != len(other.Fields) { + return false + } + for i, _tgt := range p.Fields { + _src1 := other.Fields[i] + if !_tgt.Equals(_src1) { + return false + } + } + return true } func (p *Log) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Log(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Log(%+v)", *p) } // Attributes: -// - RefType -// - TraceIdLow -// - TraceIdHigh -// - SpanId +// - RefType +// - TraceIdLow +// - TraceIdHigh +// - SpanId type SpanRef struct { - RefType SpanRefType `thrift:"refType,1,required" db:"refType" json:"refType"` - TraceIdLow int64 `thrift:"traceIdLow,2,required" db:"traceIdLow" json:"traceIdLow"` - TraceIdHigh int64 `thrift:"traceIdHigh,3,required" db:"traceIdHigh" json:"traceIdHigh"` - SpanId int64 `thrift:"spanId,4,required" db:"spanId" json:"spanId"` + RefType SpanRefType `thrift:"refType,1,required" db:"refType" json:"refType"` + TraceIdLow int64 `thrift:"traceIdLow,2,required" db:"traceIdLow" json:"traceIdLow"` + TraceIdHigh int64 `thrift:"traceIdHigh,3,required" db:"traceIdHigh" json:"traceIdHigh"` + SpanId int64 `thrift:"spanId,4,required" db:"spanId" json:"spanId"` } func NewSpanRef() *SpanRef { - return &SpanRef{} + return &SpanRef{} } - func (p *SpanRef) GetRefType() SpanRefType { - return p.RefType + return p.RefType } func (p *SpanRef) GetTraceIdLow() int64 { - return p.TraceIdLow + return p.TraceIdLow } func (p *SpanRef) GetTraceIdHigh() int64 { - return p.TraceIdHigh + return p.TraceIdHigh } func (p *SpanRef) GetSpanId() int64 { - return p.SpanId + return p.SpanId } func (p *SpanRef) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetRefType bool = false; - var issetTraceIdLow bool = false; - var issetTraceIdHigh bool = false; - var issetSpanId bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetRefType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetTraceIdLow = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetTraceIdHigh = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetSpanId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetRefType{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RefType is not set")); - } - if !issetTraceIdLow{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdLow is not set")); - } - if !issetTraceIdHigh{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdHigh is not set")); - } - if !issetSpanId{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpanId is not set")); - } - return nil -} - -func (p *SpanRef) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := SpanRefType(v) - p.RefType = temp -} - return nil -} - -func (p *SpanRef) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.TraceIdLow = v -} - return nil -} - -func (p *SpanRef) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.TraceIdHigh = v -} - return nil -} - -func (p *SpanRef) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.SpanId = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetRefType bool = false + var issetTraceIdLow bool = false + var issetTraceIdHigh bool = false + var issetSpanId bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetRefType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetTraceIdLow = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetTraceIdHigh = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetSpanId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRefType { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RefType is not set")) + } + if !issetTraceIdLow { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdLow is not set")) + } + if !issetTraceIdHigh { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdHigh is not set")) + } + if !issetSpanId { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpanId is not set")) + } + return nil +} + +func (p *SpanRef) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := SpanRefType(v) + p.RefType = temp + } + return nil +} + +func (p *SpanRef) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TraceIdLow = v + } + return nil +} + +func (p *SpanRef) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TraceIdHigh = v + } + return nil +} + +func (p *SpanRef) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.SpanId = v + } + return nil } func (p *SpanRef) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "SpanRef"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "SpanRef"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *SpanRef) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "refType", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:refType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.RefType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.refType (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:refType: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "refType", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:refType: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.RefType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.refType (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:refType: ", p), err) + } + return err } func (p *SpanRef) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "traceIdLow", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:traceIdLow: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.TraceIdLow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.traceIdLow (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:traceIdLow: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "traceIdLow", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:traceIdLow: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.TraceIdLow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.traceIdLow (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:traceIdLow: ", p), err) + } + return err } func (p *SpanRef) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "traceIdHigh", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:traceIdHigh: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.TraceIdHigh)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.traceIdHigh (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:traceIdHigh: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "traceIdHigh", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:traceIdHigh: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.TraceIdHigh)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.traceIdHigh (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:traceIdHigh: ", p), err) + } + return err } func (p *SpanRef) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "spanId", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:spanId: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.SpanId)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.spanId (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:spanId: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "spanId", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:spanId: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.SpanId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.spanId (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:spanId: ", p), err) + } + return err } func (p *SpanRef) Equals(other *SpanRef) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.RefType != other.RefType { return false } - if p.TraceIdLow != other.TraceIdLow { return false } - if p.TraceIdHigh != other.TraceIdHigh { return false } - if p.SpanId != other.SpanId { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.RefType != other.RefType { + return false + } + if p.TraceIdLow != other.TraceIdLow { + return false + } + if p.TraceIdHigh != other.TraceIdHigh { + return false + } + if p.SpanId != other.SpanId { + return false + } + return true } func (p *SpanRef) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SpanRef(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("SpanRef(%+v)", *p) } // Attributes: -// - TraceIdLow -// - TraceIdHigh -// - SpanId -// - ParentSpanId -// - OperationName -// - References -// - Flags -// - StartTime -// - Duration -// - Tags -// - Logs +// - TraceIdLow +// - TraceIdHigh +// - SpanId +// - ParentSpanId +// - OperationName +// - References +// - Flags +// - StartTime +// - Duration +// - Tags +// - Logs type Span struct { - TraceIdLow int64 `thrift:"traceIdLow,1,required" db:"traceIdLow" json:"traceIdLow"` - TraceIdHigh int64 `thrift:"traceIdHigh,2,required" db:"traceIdHigh" json:"traceIdHigh"` - SpanId int64 `thrift:"spanId,3,required" db:"spanId" json:"spanId"` - ParentSpanId int64 `thrift:"parentSpanId,4,required" db:"parentSpanId" json:"parentSpanId"` - OperationName string `thrift:"operationName,5,required" db:"operationName" json:"operationName"` - References []*SpanRef `thrift:"references,6" db:"references" json:"references,omitempty"` - Flags int32 `thrift:"flags,7,required" db:"flags" json:"flags"` - StartTime int64 `thrift:"startTime,8,required" db:"startTime" json:"startTime"` - Duration int64 `thrift:"duration,9,required" db:"duration" json:"duration"` - Tags []*Tag `thrift:"tags,10" db:"tags" json:"tags,omitempty"` - Logs []*Log `thrift:"logs,11" db:"logs" json:"logs,omitempty"` + TraceIdLow int64 `thrift:"traceIdLow,1,required" db:"traceIdLow" json:"traceIdLow"` + TraceIdHigh int64 `thrift:"traceIdHigh,2,required" db:"traceIdHigh" json:"traceIdHigh"` + SpanId int64 `thrift:"spanId,3,required" db:"spanId" json:"spanId"` + ParentSpanId int64 `thrift:"parentSpanId,4,required" db:"parentSpanId" json:"parentSpanId"` + OperationName string `thrift:"operationName,5,required" db:"operationName" json:"operationName"` + References []*SpanRef `thrift:"references,6" db:"references" json:"references,omitempty"` + Flags int32 `thrift:"flags,7,required" db:"flags" json:"flags"` + StartTime int64 `thrift:"startTime,8,required" db:"startTime" json:"startTime"` + Duration int64 `thrift:"duration,9,required" db:"duration" json:"duration"` + Tags []*Tag `thrift:"tags,10" db:"tags" json:"tags,omitempty"` + Logs []*Log `thrift:"logs,11" db:"logs" json:"logs,omitempty"` } func NewSpan() *Span { - return &Span{} + return &Span{} } - func (p *Span) GetTraceIdLow() int64 { - return p.TraceIdLow + return p.TraceIdLow } func (p *Span) GetTraceIdHigh() int64 { - return p.TraceIdHigh + return p.TraceIdHigh } func (p *Span) GetSpanId() int64 { - return p.SpanId + return p.SpanId } func (p *Span) GetParentSpanId() int64 { - return p.ParentSpanId + return p.ParentSpanId } func (p *Span) GetOperationName() string { - return p.OperationName + return p.OperationName } + var Span_References_DEFAULT []*SpanRef func (p *Span) GetReferences() []*SpanRef { - return p.References + return p.References } func (p *Span) GetFlags() int32 { - return p.Flags + return p.Flags } func (p *Span) GetStartTime() int64 { - return p.StartTime + return p.StartTime } func (p *Span) GetDuration() int64 { - return p.Duration + return p.Duration } + var Span_Tags_DEFAULT []*Tag func (p *Span) GetTags() []*Tag { - return p.Tags + return p.Tags } + var Span_Logs_DEFAULT []*Log func (p *Span) GetLogs() []*Log { - return p.Logs + return p.Logs } func (p *Span) IsSetReferences() bool { - return p.References != nil + return p.References != nil } func (p *Span) IsSetTags() bool { - return p.Tags != nil + return p.Tags != nil } func (p *Span) IsSetLogs() bool { - return p.Logs != nil + return p.Logs != nil } func (p *Span) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTraceIdLow bool = false; - var issetTraceIdHigh bool = false; - var issetSpanId bool = false; - var issetParentSpanId bool = false; - var issetOperationName bool = false; - var issetFlags bool = false; - var issetStartTime bool = false; - var issetDuration bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetTraceIdLow = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetTraceIdHigh = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetSpanId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetParentSpanId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - issetOperationName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.LIST { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.I32 { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - issetFlags = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.I64 { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - issetStartTime = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 9: - if fieldTypeId == thrift.I64 { - if err := p.ReadField9(ctx, iprot); err != nil { - return err - } - issetDuration = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 10: - if fieldTypeId == thrift.LIST { - if err := p.ReadField10(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 11: - if fieldTypeId == thrift.LIST { - if err := p.ReadField11(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetTraceIdLow{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdLow is not set")); - } - if !issetTraceIdHigh{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdHigh is not set")); - } - if !issetSpanId{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpanId is not set")); - } - if !issetParentSpanId{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ParentSpanId is not set")); - } - if !issetOperationName{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationName is not set")); - } - if !issetFlags{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Flags is not set")); - } - if !issetStartTime{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")); - } - if !issetDuration{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Duration is not set")); - } - return nil -} - -func (p *Span) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.TraceIdLow = v -} - return nil -} - -func (p *Span) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.TraceIdHigh = v -} - return nil -} - -func (p *Span) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.SpanId = v -} - return nil -} - -func (p *Span) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ParentSpanId = v -} - return nil -} - -func (p *Span) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.OperationName = v -} - return nil -} - -func (p *Span) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*SpanRef, 0, size) - p.References = tSlice - for i := 0; i < size; i ++ { - _elem2 := &SpanRef{} - if err := _elem2.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) - } - p.References = append(p.References, _elem2) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *Span) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) -} else { - p.Flags = v -} - return nil -} - -func (p *Span) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 8: ", err) -} else { - p.StartTime = v -} - return nil -} - -func (p *Span) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 9: ", err) -} else { - p.Duration = v -} - return nil -} - -func (p *Span) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Tag, 0, size) - p.Tags = tSlice - for i := 0; i < size; i ++ { - _elem3 := &Tag{} - if err := _elem3.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) - } - p.Tags = append(p.Tags, _elem3) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *Span) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Log, 0, size) - p.Logs = tSlice - for i := 0; i < size; i ++ { - _elem4 := &Log{} - if err := _elem4.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) - } - p.Logs = append(p.Logs, _elem4) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTraceIdLow bool = false + var issetTraceIdHigh bool = false + var issetSpanId bool = false + var issetParentSpanId bool = false + var issetOperationName bool = false + var issetFlags bool = false + var issetStartTime bool = false + var issetDuration bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetTraceIdLow = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetTraceIdHigh = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetSpanId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetParentSpanId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + issetOperationName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.LIST { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + issetFlags = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I64 { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + issetStartTime = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.I64 { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + issetDuration = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.LIST { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.LIST { + if err := p.ReadField11(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetTraceIdLow { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdLow is not set")) + } + if !issetTraceIdHigh { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdHigh is not set")) + } + if !issetSpanId { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpanId is not set")) + } + if !issetParentSpanId { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ParentSpanId is not set")) + } + if !issetOperationName { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationName is not set")) + } + if !issetFlags { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Flags is not set")) + } + if !issetStartTime { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")) + } + if !issetDuration { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Duration is not set")) + } + return nil +} + +func (p *Span) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TraceIdLow = v + } + return nil +} + +func (p *Span) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TraceIdHigh = v + } + return nil +} + +func (p *Span) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SpanId = v + } + return nil +} + +func (p *Span) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.ParentSpanId = v + } + return nil +} + +func (p *Span) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.OperationName = v + } + return nil +} + +func (p *Span) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*SpanRef, 0, size) + p.References = tSlice + for i := 0; i < size; i++ { + _elem2 := &SpanRef{} + if err := _elem2.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) + } + p.References = append(p.References, _elem2) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Span) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.Flags = v + } + return nil +} + +func (p *Span) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *Span) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.Duration = v + } + return nil +} + +func (p *Span) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Tag, 0, size) + p.Tags = tSlice + for i := 0; i < size; i++ { + _elem3 := &Tag{} + if err := _elem3.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Tags = append(p.Tags, _elem3) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Span) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Log, 0, size) + p.Logs = tSlice + for i := 0; i < size; i++ { + _elem4 := &Log{} + if err := _elem4.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Logs = append(p.Logs, _elem4) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *Span) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Span"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - if err := p.writeField8(ctx, oprot); err != nil { return err } - if err := p.writeField9(ctx, oprot); err != nil { return err } - if err := p.writeField10(ctx, oprot); err != nil { return err } - if err := p.writeField11(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Span"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField7(ctx, oprot); err != nil { + return err + } + if err := p.writeField8(ctx, oprot); err != nil { + return err + } + if err := p.writeField9(ctx, oprot); err != nil { + return err + } + if err := p.writeField10(ctx, oprot); err != nil { + return err + } + if err := p.writeField11(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Span) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "traceIdLow", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:traceIdLow: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.TraceIdLow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.traceIdLow (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:traceIdLow: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "traceIdLow", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:traceIdLow: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.TraceIdLow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.traceIdLow (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:traceIdLow: ", p), err) + } + return err } func (p *Span) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "traceIdHigh", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:traceIdHigh: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.TraceIdHigh)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.traceIdHigh (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:traceIdHigh: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "traceIdHigh", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:traceIdHigh: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.TraceIdHigh)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.traceIdHigh (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:traceIdHigh: ", p), err) + } + return err } func (p *Span) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "spanId", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spanId: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.SpanId)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.spanId (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spanId: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "spanId", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spanId: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.SpanId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.spanId (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spanId: ", p), err) + } + return err } func (p *Span) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "parentSpanId", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentSpanId: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.ParentSpanId)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentSpanId (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentSpanId: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "parentSpanId", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentSpanId: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.ParentSpanId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentSpanId (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentSpanId: ", p), err) + } + return err } func (p *Span) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationName", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:operationName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.OperationName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationName (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:operationName: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationName", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:operationName: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.OperationName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationName (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:operationName: ", p), err) + } + return err } func (p *Span) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetReferences() { - if err := oprot.WriteFieldBegin(ctx, "references", thrift.LIST, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:references: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.References)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.References { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:references: ", p), err) } - } - return err + if p.IsSetReferences() { + if err := oprot.WriteFieldBegin(ctx, "references", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:references: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.References)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.References { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:references: ", p), err) + } + } + return err } func (p *Span) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "flags", thrift.I32, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:flags: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Flags)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.flags (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:flags: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "flags", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:flags: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.Flags)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.flags (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:flags: ", p), err) + } + return err } func (p *Span) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:startTime: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startTime (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:startTime: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:startTime: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startTime (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:startTime: ", p), err) + } + return err } func (p *Span) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "duration", thrift.I64, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:duration: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.Duration)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.duration (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:duration: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "duration", thrift.I64, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:duration: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.Duration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.duration (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:duration: ", p), err) + } + return err } func (p *Span) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTags() { - if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 10); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:tags: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Tags)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Tags { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 10:tags: ", p), err) } - } - return err + if p.IsSetTags() { + if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:tags: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:tags: ", p), err) + } + } + return err } func (p *Span) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetLogs() { - if err := oprot.WriteFieldBegin(ctx, "logs", thrift.LIST, 11); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:logs: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Logs)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Logs { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 11:logs: ", p), err) } - } - return err + if p.IsSetLogs() { + if err := oprot.WriteFieldBegin(ctx, "logs", thrift.LIST, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:logs: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Logs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Logs { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:logs: ", p), err) + } + } + return err } func (p *Span) Equals(other *Span) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.TraceIdLow != other.TraceIdLow { return false } - if p.TraceIdHigh != other.TraceIdHigh { return false } - if p.SpanId != other.SpanId { return false } - if p.ParentSpanId != other.ParentSpanId { return false } - if p.OperationName != other.OperationName { return false } - if len(p.References) != len(other.References) { return false } - for i, _tgt := range p.References { - _src5 := other.References[i] - if !_tgt.Equals(_src5) { return false } - } - if p.Flags != other.Flags { return false } - if p.StartTime != other.StartTime { return false } - if p.Duration != other.Duration { return false } - if len(p.Tags) != len(other.Tags) { return false } - for i, _tgt := range p.Tags { - _src6 := other.Tags[i] - if !_tgt.Equals(_src6) { return false } - } - if len(p.Logs) != len(other.Logs) { return false } - for i, _tgt := range p.Logs { - _src7 := other.Logs[i] - if !_tgt.Equals(_src7) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TraceIdLow != other.TraceIdLow { + return false + } + if p.TraceIdHigh != other.TraceIdHigh { + return false + } + if p.SpanId != other.SpanId { + return false + } + if p.ParentSpanId != other.ParentSpanId { + return false + } + if p.OperationName != other.OperationName { + return false + } + if len(p.References) != len(other.References) { + return false + } + for i, _tgt := range p.References { + _src5 := other.References[i] + if !_tgt.Equals(_src5) { + return false + } + } + if p.Flags != other.Flags { + return false + } + if p.StartTime != other.StartTime { + return false + } + if p.Duration != other.Duration { + return false + } + if len(p.Tags) != len(other.Tags) { + return false + } + for i, _tgt := range p.Tags { + _src6 := other.Tags[i] + if !_tgt.Equals(_src6) { + return false + } + } + if len(p.Logs) != len(other.Logs) { + return false + } + for i, _tgt := range p.Logs { + _src7 := other.Logs[i] + if !_tgt.Equals(_src7) { + return false + } + } + return true } func (p *Span) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Span(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Span(%+v)", *p) } // Attributes: -// - ServiceName -// - Tags +// - ServiceName +// - Tags type Process struct { - ServiceName string `thrift:"serviceName,1,required" db:"serviceName" json:"serviceName"` - Tags []*Tag `thrift:"tags,2" db:"tags" json:"tags,omitempty"` + ServiceName string `thrift:"serviceName,1,required" db:"serviceName" json:"serviceName"` + Tags []*Tag `thrift:"tags,2" db:"tags" json:"tags,omitempty"` } func NewProcess() *Process { - return &Process{} + return &Process{} } - func (p *Process) GetServiceName() string { - return p.ServiceName + return p.ServiceName } + var Process_Tags_DEFAULT []*Tag func (p *Process) GetTags() []*Tag { - return p.Tags + return p.Tags } func (p *Process) IsSetTags() bool { - return p.Tags != nil + return p.Tags != nil } func (p *Process) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetServiceName bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetServiceName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetServiceName{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServiceName is not set")); - } - return nil -} - -func (p *Process) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.ServiceName = v -} - return nil -} - -func (p *Process) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Tag, 0, size) - p.Tags = tSlice - for i := 0; i < size; i ++ { - _elem8 := &Tag{} - if err := _elem8.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) - } - p.Tags = append(p.Tags, _elem8) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetServiceName bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetServiceName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetServiceName { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServiceName is not set")) + } + return nil +} + +func (p *Process) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ServiceName = v + } + return nil +} + +func (p *Process) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Tag, 0, size) + p.Tags = tSlice + for i := 0; i < size; i++ { + _elem8 := &Tag{} + if err := _elem8.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + } + p.Tags = append(p.Tags, _elem8) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *Process) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Process"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Process"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Process) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) + } + return err } func (p *Process) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTags() { - if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Tags)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Tags { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tags: ", p), err) } - } - return err + if p.IsSetTags() { + if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tags: ", p), err) + } + } + return err } func (p *Process) Equals(other *Process) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ServiceName != other.ServiceName { return false } - if len(p.Tags) != len(other.Tags) { return false } - for i, _tgt := range p.Tags { - _src9 := other.Tags[i] - if !_tgt.Equals(_src9) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ServiceName != other.ServiceName { + return false + } + if len(p.Tags) != len(other.Tags) { + return false + } + for i, _tgt := range p.Tags { + _src9 := other.Tags[i] + if !_tgt.Equals(_src9) { + return false + } + } + return true } func (p *Process) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Process(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Process(%+v)", *p) } // Attributes: -// - FullQueueDroppedSpans -// - TooLargeDroppedSpans -// - FailedToEmitSpans +// - FullQueueDroppedSpans +// - TooLargeDroppedSpans +// - FailedToEmitSpans type ClientStats struct { - FullQueueDroppedSpans int64 `thrift:"fullQueueDroppedSpans,1,required" db:"fullQueueDroppedSpans" json:"fullQueueDroppedSpans"` - TooLargeDroppedSpans int64 `thrift:"tooLargeDroppedSpans,2,required" db:"tooLargeDroppedSpans" json:"tooLargeDroppedSpans"` - FailedToEmitSpans int64 `thrift:"failedToEmitSpans,3,required" db:"failedToEmitSpans" json:"failedToEmitSpans"` + FullQueueDroppedSpans int64 `thrift:"fullQueueDroppedSpans,1,required" db:"fullQueueDroppedSpans" json:"fullQueueDroppedSpans"` + TooLargeDroppedSpans int64 `thrift:"tooLargeDroppedSpans,2,required" db:"tooLargeDroppedSpans" json:"tooLargeDroppedSpans"` + FailedToEmitSpans int64 `thrift:"failedToEmitSpans,3,required" db:"failedToEmitSpans" json:"failedToEmitSpans"` } func NewClientStats() *ClientStats { - return &ClientStats{} + return &ClientStats{} } - func (p *ClientStats) GetFullQueueDroppedSpans() int64 { - return p.FullQueueDroppedSpans + return p.FullQueueDroppedSpans } func (p *ClientStats) GetTooLargeDroppedSpans() int64 { - return p.TooLargeDroppedSpans + return p.TooLargeDroppedSpans } func (p *ClientStats) GetFailedToEmitSpans() int64 { - return p.FailedToEmitSpans + return p.FailedToEmitSpans } func (p *ClientStats) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetFullQueueDroppedSpans bool = false; - var issetTooLargeDroppedSpans bool = false; - var issetFailedToEmitSpans bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetFullQueueDroppedSpans = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetTooLargeDroppedSpans = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetFailedToEmitSpans = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetFullQueueDroppedSpans{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FullQueueDroppedSpans is not set")); - } - if !issetTooLargeDroppedSpans{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TooLargeDroppedSpans is not set")); - } - if !issetFailedToEmitSpans{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedToEmitSpans is not set")); - } - return nil -} - -func (p *ClientStats) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.FullQueueDroppedSpans = v -} - return nil -} - -func (p *ClientStats) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.TooLargeDroppedSpans = v -} - return nil -} - -func (p *ClientStats) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.FailedToEmitSpans = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetFullQueueDroppedSpans bool = false + var issetTooLargeDroppedSpans bool = false + var issetFailedToEmitSpans bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetFullQueueDroppedSpans = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetTooLargeDroppedSpans = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetFailedToEmitSpans = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetFullQueueDroppedSpans { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FullQueueDroppedSpans is not set")) + } + if !issetTooLargeDroppedSpans { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TooLargeDroppedSpans is not set")) + } + if !issetFailedToEmitSpans { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedToEmitSpans is not set")) + } + return nil +} + +func (p *ClientStats) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.FullQueueDroppedSpans = v + } + return nil +} + +func (p *ClientStats) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.TooLargeDroppedSpans = v + } + return nil +} + +func (p *ClientStats) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.FailedToEmitSpans = v + } + return nil } func (p *ClientStats) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ClientStats"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "ClientStats"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *ClientStats) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "fullQueueDroppedSpans", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fullQueueDroppedSpans: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.FullQueueDroppedSpans)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.fullQueueDroppedSpans (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fullQueueDroppedSpans: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "fullQueueDroppedSpans", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fullQueueDroppedSpans: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.FullQueueDroppedSpans)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fullQueueDroppedSpans (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fullQueueDroppedSpans: ", p), err) + } + return err } func (p *ClientStats) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "tooLargeDroppedSpans", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tooLargeDroppedSpans: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.TooLargeDroppedSpans)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tooLargeDroppedSpans (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tooLargeDroppedSpans: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "tooLargeDroppedSpans", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tooLargeDroppedSpans: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.TooLargeDroppedSpans)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tooLargeDroppedSpans (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tooLargeDroppedSpans: ", p), err) + } + return err } func (p *ClientStats) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "failedToEmitSpans", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:failedToEmitSpans: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.FailedToEmitSpans)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.failedToEmitSpans (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:failedToEmitSpans: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "failedToEmitSpans", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:failedToEmitSpans: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.FailedToEmitSpans)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.failedToEmitSpans (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:failedToEmitSpans: ", p), err) + } + return err } func (p *ClientStats) Equals(other *ClientStats) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.FullQueueDroppedSpans != other.FullQueueDroppedSpans { return false } - if p.TooLargeDroppedSpans != other.TooLargeDroppedSpans { return false } - if p.FailedToEmitSpans != other.FailedToEmitSpans { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.FullQueueDroppedSpans != other.FullQueueDroppedSpans { + return false + } + if p.TooLargeDroppedSpans != other.TooLargeDroppedSpans { + return false + } + if p.FailedToEmitSpans != other.FailedToEmitSpans { + return false + } + return true } func (p *ClientStats) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ClientStats(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("ClientStats(%+v)", *p) } // Attributes: -// - Process -// - Spans -// - SeqNo -// - Stats +// - Process +// - Spans +// - SeqNo +// - Stats type Batch struct { - Process *Process `thrift:"process,1,required" db:"process" json:"process"` - Spans []*Span `thrift:"spans,2,required" db:"spans" json:"spans"` - SeqNo *int64 `thrift:"seqNo,3" db:"seqNo" json:"seqNo,omitempty"` - Stats *ClientStats `thrift:"stats,4" db:"stats" json:"stats,omitempty"` + Process *Process `thrift:"process,1,required" db:"process" json:"process"` + Spans []*Span `thrift:"spans,2,required" db:"spans" json:"spans"` + SeqNo *int64 `thrift:"seqNo,3" db:"seqNo" json:"seqNo,omitempty"` + Stats *ClientStats `thrift:"stats,4" db:"stats" json:"stats,omitempty"` } func NewBatch() *Batch { - return &Batch{} + return &Batch{} } var Batch_Process_DEFAULT *Process + func (p *Batch) GetProcess() *Process { - if !p.IsSetProcess() { - return Batch_Process_DEFAULT - } -return p.Process + if !p.IsSetProcess() { + return Batch_Process_DEFAULT + } + return p.Process } func (p *Batch) GetSpans() []*Span { - return p.Spans + return p.Spans } + var Batch_SeqNo_DEFAULT int64 + func (p *Batch) GetSeqNo() int64 { - if !p.IsSetSeqNo() { - return Batch_SeqNo_DEFAULT - } -return *p.SeqNo + if !p.IsSetSeqNo() { + return Batch_SeqNo_DEFAULT + } + return *p.SeqNo } + var Batch_Stats_DEFAULT *ClientStats + func (p *Batch) GetStats() *ClientStats { - if !p.IsSetStats() { - return Batch_Stats_DEFAULT - } -return p.Stats + if !p.IsSetStats() { + return Batch_Stats_DEFAULT + } + return p.Stats } func (p *Batch) IsSetProcess() bool { - return p.Process != nil + return p.Process != nil } func (p *Batch) IsSetSeqNo() bool { - return p.SeqNo != nil + return p.SeqNo != nil } func (p *Batch) IsSetStats() bool { - return p.Stats != nil + return p.Stats != nil } func (p *Batch) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetProcess bool = false; - var issetSpans bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetProcess = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetSpans = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetProcess{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Process is not set")); - } - if !issetSpans{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Spans is not set")); - } - return nil -} - -func (p *Batch) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Process = &Process{} - if err := p.Process.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Process), err) - } - return nil -} - -func (p *Batch) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Span, 0, size) - p.Spans = tSlice - for i := 0; i < size; i ++ { - _elem10 := &Span{} - if err := _elem10.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) - } - p.Spans = append(p.Spans, _elem10) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *Batch) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.SeqNo = &v -} - return nil -} - -func (p *Batch) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.Stats = &ClientStats{} - if err := p.Stats.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetProcess bool = false + var issetSpans bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetProcess = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetSpans = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetProcess { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Process is not set")) + } + if !issetSpans { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Spans is not set")) + } + return nil +} + +func (p *Batch) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Process = &Process{} + if err := p.Process.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Process), err) + } + return nil +} + +func (p *Batch) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Span, 0, size) + p.Spans = tSlice + for i := 0; i < size; i++ { + _elem10 := &Span{} + if err := _elem10.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.Spans = append(p.Spans, _elem10) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Batch) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SeqNo = &v + } + return nil +} + +func (p *Batch) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Stats = &ClientStats{} + if err := p.Stats.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) + } + return nil } func (p *Batch) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Batch"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Batch"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Batch) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "process", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:process: ", p), err) } - if err := p.Process.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Process), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:process: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "process", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:process: ", p), err) + } + if err := p.Process.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Process), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:process: ", p), err) + } + return err } func (p *Batch) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "spans", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:spans: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spans)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Spans { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:spans: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "spans", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:spans: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spans)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spans { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:spans: ", p), err) + } + return err } func (p *Batch) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSeqNo() { - if err := oprot.WriteFieldBegin(ctx, "seqNo", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:seqNo: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.SeqNo)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.seqNo (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:seqNo: ", p), err) } - } - return err + if p.IsSetSeqNo() { + if err := oprot.WriteFieldBegin(ctx, "seqNo", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:seqNo: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.SeqNo)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.seqNo (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:seqNo: ", p), err) + } + } + return err } func (p *Batch) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStats() { - if err := oprot.WriteFieldBegin(ctx, "stats", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stats: ", p), err) } - if err := p.Stats.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stats: ", p), err) } - } - return err + if p.IsSetStats() { + if err := oprot.WriteFieldBegin(ctx, "stats", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stats: ", p), err) + } + if err := p.Stats.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stats: ", p), err) + } + } + return err } func (p *Batch) Equals(other *Batch) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Process.Equals(other.Process) { return false } - if len(p.Spans) != len(other.Spans) { return false } - for i, _tgt := range p.Spans { - _src11 := other.Spans[i] - if !_tgt.Equals(_src11) { return false } - } - if p.SeqNo != other.SeqNo { - if p.SeqNo == nil || other.SeqNo == nil { - return false - } - if (*p.SeqNo) != (*other.SeqNo) { return false } - } - if !p.Stats.Equals(other.Stats) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Process.Equals(other.Process) { + return false + } + if len(p.Spans) != len(other.Spans) { + return false + } + for i, _tgt := range p.Spans { + _src11 := other.Spans[i] + if !_tgt.Equals(_src11) { + return false + } + } + if p.SeqNo != other.SeqNo { + if p.SeqNo == nil || other.SeqNo == nil { + return false + } + if (*p.SeqNo) != (*other.SeqNo) { + return false + } + } + if !p.Stats.Equals(other.Stats) { + return false + } + return true } func (p *Batch) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Batch(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Batch(%+v)", *p) } // Attributes: -// - Ok +// - Ok type BatchSubmitResponse struct { - Ok bool `thrift:"ok,1,required" db:"ok" json:"ok"` + Ok bool `thrift:"ok,1,required" db:"ok" json:"ok"` } func NewBatchSubmitResponse() *BatchSubmitResponse { - return &BatchSubmitResponse{} + return &BatchSubmitResponse{} } - func (p *BatchSubmitResponse) GetOk() bool { - return p.Ok + return p.Ok } func (p *BatchSubmitResponse) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOk bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOk = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOk{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Ok is not set")); - } - return nil -} - -func (p *BatchSubmitResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Ok = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOk bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOk = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOk { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Ok is not set")) + } + return nil +} + +func (p *BatchSubmitResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Ok = v + } + return nil } func (p *BatchSubmitResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "BatchSubmitResponse"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "BatchSubmitResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *BatchSubmitResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "ok", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ok: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.Ok)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ok (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ok: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "ok", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ok: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.Ok)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ok (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ok: ", p), err) + } + return err } func (p *BatchSubmitResponse) Equals(other *BatchSubmitResponse) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Ok != other.Ok { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Ok != other.Ok { + return false + } + return true } func (p *BatchSubmitResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BatchSubmitResponse(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("BatchSubmitResponse(%+v)", *p) } type Collector interface { - // Parameters: - // - Batches - SubmitBatches(ctx context.Context, batches []*Batch) (_r []*BatchSubmitResponse, _err error) + // Parameters: + // - Batches + SubmitBatches(ctx context.Context, batches []*Batch) (_r []*BatchSubmitResponse, _err error) } type CollectorClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient + meta thrift.ResponseMeta } func NewCollectorClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CollectorClient { - return &CollectorClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + return &CollectorClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } } func NewCollectorClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CollectorClient { - return &CollectorClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } + return &CollectorClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewCollectorClient(c thrift.TClient) *CollectorClient { - return &CollectorClient{ - c: c, - } + return &CollectorClient{ + c: c, + } } func (p *CollectorClient) Client_() thrift.TClient { - return p.c + return p.c } func (p *CollectorClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta + return p.meta } func (p *CollectorClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + p.meta = meta } // Parameters: -// - Batches +// - Batches func (p *CollectorClient) SubmitBatches(ctx context.Context, batches []*Batch) (_r []*BatchSubmitResponse, _err error) { - var _args12 CollectorSubmitBatchesArgs - _args12.Batches = batches - var _result14 CollectorSubmitBatchesResult - var _meta13 thrift.ResponseMeta - _meta13, _err = p.Client_().Call(ctx, "submitBatches", &_args12, &_result14) - p.SetLastResponseMeta_(_meta13) - if _err != nil { - return - } - return _result14.GetSuccess(), nil + var _args12 CollectorSubmitBatchesArgs + _args12.Batches = batches + var _result14 CollectorSubmitBatchesResult + var _meta13 thrift.ResponseMeta + _meta13, _err = p.Client_().Call(ctx, "submitBatches", &_args12, &_result14) + p.SetLastResponseMeta_(_meta13) + if _err != nil { + return + } + return _result14.GetSuccess(), nil } type CollectorProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler Collector + processorMap map[string]thrift.TProcessorFunction + handler Collector } func (p *CollectorProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *CollectorProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *CollectorProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewCollectorProcessor(handler Collector) *CollectorProcessor { - self15 := &CollectorProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self15.processorMap["submitBatches"] = &collectorProcessorSubmitBatches{handler:handler} -return self15 + self15 := &CollectorProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self15.processorMap["submitBatches"] = &collectorProcessorSubmitBatches{handler: handler} + return self15 } func (p *CollectorProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x16 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x16.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x16 + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { + return false, thrift.WrapTException(err2) + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x16 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x16.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x16 } type collectorProcessorSubmitBatches struct { - handler Collector + handler Collector } func (p *collectorProcessorSubmitBatches) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := CollectorSubmitBatchesArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "submitBatches", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := CollectorSubmitBatchesResult{} - var retval []*BatchSubmitResponse - if retval, err2 = p.handler.SubmitBatches(ctx, args.Batches); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing submitBatches: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "submitBatches", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "submitBatches", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := CollectorSubmitBatchesArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "submitBatches", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := CollectorSubmitBatchesResult{} + var retval []*BatchSubmitResponse + if retval, err2 = p.handler.SubmitBatches(ctx, args.Batches); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing submitBatches: "+err2.Error()) + oprot.WriteMessageBegin(ctx, "submitBatches", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "submitBatches", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err } - // HELPER FUNCTIONS AND STRUCTURES // Attributes: -// - Batches +// - Batches type CollectorSubmitBatchesArgs struct { - Batches []*Batch `thrift:"batches,1" db:"batches" json:"batches"` + Batches []*Batch `thrift:"batches,1" db:"batches" json:"batches"` } func NewCollectorSubmitBatchesArgs() *CollectorSubmitBatchesArgs { - return &CollectorSubmitBatchesArgs{} + return &CollectorSubmitBatchesArgs{} } - func (p *CollectorSubmitBatchesArgs) GetBatches() []*Batch { - return p.Batches + return p.Batches } func (p *CollectorSubmitBatchesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *CollectorSubmitBatchesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Batch, 0, size) - p.Batches = tSlice - for i := 0; i < size; i ++ { - _elem17 := &Batch{} - if err := _elem17.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) - } - p.Batches = append(p.Batches, _elem17) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CollectorSubmitBatchesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Batch, 0, size) + p.Batches = tSlice + for i := 0; i < size; i++ { + _elem17 := &Batch{} + if err := _elem17.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + p.Batches = append(p.Batches, _elem17) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *CollectorSubmitBatchesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "submitBatches_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "submitBatches_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *CollectorSubmitBatchesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "batches", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batches: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Batches)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Batches { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batches: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "batches", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batches: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Batches)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Batches { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batches: ", p), err) + } + return err } func (p *CollectorSubmitBatchesArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CollectorSubmitBatchesArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("CollectorSubmitBatchesArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type CollectorSubmitBatchesResult struct { - Success []*BatchSubmitResponse `thrift:"success,0" db:"success" json:"success,omitempty"` + Success []*BatchSubmitResponse `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewCollectorSubmitBatchesResult() *CollectorSubmitBatchesResult { - return &CollectorSubmitBatchesResult{} + return &CollectorSubmitBatchesResult{} } var CollectorSubmitBatchesResult_Success_DEFAULT []*BatchSubmitResponse func (p *CollectorSubmitBatchesResult) GetSuccess() []*BatchSubmitResponse { - return p.Success + return p.Success } func (p *CollectorSubmitBatchesResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *CollectorSubmitBatchesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.LIST { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *CollectorSubmitBatchesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*BatchSubmitResponse, 0, size) - p.Success = tSlice - for i := 0; i < size; i ++ { - _elem18 := &BatchSubmitResponse{} - if err := _elem18.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) - } - p.Success = append(p.Success, _elem18) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.LIST { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CollectorSubmitBatchesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BatchSubmitResponse, 0, size) + p.Success = tSlice + for i := 0; i < size; i++ { + _elem18 := &BatchSubmitResponse{} + if err := _elem18.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + } + p.Success = append(p.Success, _elem18) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *CollectorSubmitBatchesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "submitBatches_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "submitBatches_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *CollectorSubmitBatchesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Success { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Success { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *CollectorSubmitBatchesResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CollectorSubmitBatchesResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("CollectorSubmitBatchesResult(%+v)", *p) } - - diff --git a/thrift-gen/sampling/GoUnusedProtection__.go b/thrift-gen/sampling/GoUnusedProtection__.go index 015ad4b0674..47d051cd17d 100644 --- a/thrift-gen/sampling/GoUnusedProtection__.go +++ b/thrift-gen/sampling/GoUnusedProtection__.go @@ -2,5 +2,4 @@ package sampling -var GoUnusedProtection__ int; - +var GoUnusedProtection__ int diff --git a/thrift-gen/sampling/sampling-consts.go b/thrift-gen/sampling/sampling-consts.go index 9899b278c72..ad3a4282994 100644 --- a/thrift-gen/sampling/sampling-consts.go +++ b/thrift-gen/sampling/sampling-consts.go @@ -2,12 +2,12 @@ package sampling -import( +import ( "bytes" "context" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -17,7 +17,5 @@ var _ = context.Background var _ = time.Now var _ = bytes.Equal - func init() { } - diff --git a/thrift-gen/sampling/sampling.go b/thrift-gen/sampling/sampling.go index f251540656d..12e6c5e637d 100644 --- a/thrift-gen/sampling/sampling.go +++ b/thrift-gen/sampling/sampling.go @@ -2,14 +2,14 @@ package sampling -import( +import ( "bytes" "context" "database/sql/driver" "errors" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -20,1304 +20,1436 @@ var _ = time.Now var _ = bytes.Equal type SamplingStrategyType int64 + const ( - SamplingStrategyType_PROBABILISTIC SamplingStrategyType = 0 - SamplingStrategyType_RATE_LIMITING SamplingStrategyType = 1 + SamplingStrategyType_PROBABILISTIC SamplingStrategyType = 0 + SamplingStrategyType_RATE_LIMITING SamplingStrategyType = 1 ) func (p SamplingStrategyType) String() string { - switch p { - case SamplingStrategyType_PROBABILISTIC: return "PROBABILISTIC" - case SamplingStrategyType_RATE_LIMITING: return "RATE_LIMITING" - } - return "" + switch p { + case SamplingStrategyType_PROBABILISTIC: + return "PROBABILISTIC" + case SamplingStrategyType_RATE_LIMITING: + return "RATE_LIMITING" + } + return "" } func SamplingStrategyTypeFromString(s string) (SamplingStrategyType, error) { - switch s { - case "PROBABILISTIC": return SamplingStrategyType_PROBABILISTIC, nil - case "RATE_LIMITING": return SamplingStrategyType_RATE_LIMITING, nil - } - return SamplingStrategyType(0), fmt.Errorf("not a valid SamplingStrategyType string") + switch s { + case "PROBABILISTIC": + return SamplingStrategyType_PROBABILISTIC, nil + case "RATE_LIMITING": + return SamplingStrategyType_RATE_LIMITING, nil + } + return SamplingStrategyType(0), fmt.Errorf("not a valid SamplingStrategyType string") } - func SamplingStrategyTypePtr(v SamplingStrategyType) *SamplingStrategyType { return &v } func (p SamplingStrategyType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *SamplingStrategyType) UnmarshalText(text []byte) error { -q, err := SamplingStrategyTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := SamplingStrategyTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *SamplingStrategyType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = SamplingStrategyType(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = SamplingStrategyType(v) + return nil } -func (p * SamplingStrategyType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *SamplingStrategyType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + // Attributes: -// - SamplingRate +// - SamplingRate type ProbabilisticSamplingStrategy struct { - SamplingRate float64 `thrift:"samplingRate,1,required" db:"samplingRate" json:"samplingRate"` + SamplingRate float64 `thrift:"samplingRate,1,required" db:"samplingRate" json:"samplingRate"` } func NewProbabilisticSamplingStrategy() *ProbabilisticSamplingStrategy { - return &ProbabilisticSamplingStrategy{} + return &ProbabilisticSamplingStrategy{} } - func (p *ProbabilisticSamplingStrategy) GetSamplingRate() float64 { - return p.SamplingRate + return p.SamplingRate } func (p *ProbabilisticSamplingStrategy) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSamplingRate bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSamplingRate = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSamplingRate{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SamplingRate is not set")); - } - return nil -} - -func (p *ProbabilisticSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.SamplingRate = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSamplingRate bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSamplingRate = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSamplingRate { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SamplingRate is not set")) + } + return nil +} + +func (p *ProbabilisticSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.SamplingRate = v + } + return nil } func (p *ProbabilisticSamplingStrategy) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ProbabilisticSamplingStrategy"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "ProbabilisticSamplingStrategy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *ProbabilisticSamplingStrategy) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "samplingRate", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:samplingRate: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.SamplingRate)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.samplingRate (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:samplingRate: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "samplingRate", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:samplingRate: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(p.SamplingRate)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.samplingRate (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:samplingRate: ", p), err) + } + return err } func (p *ProbabilisticSamplingStrategy) Equals(other *ProbabilisticSamplingStrategy) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.SamplingRate != other.SamplingRate { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SamplingRate != other.SamplingRate { + return false + } + return true } func (p *ProbabilisticSamplingStrategy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ProbabilisticSamplingStrategy(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("ProbabilisticSamplingStrategy(%+v)", *p) } // Attributes: -// - MaxTracesPerSecond +// - MaxTracesPerSecond type RateLimitingSamplingStrategy struct { - MaxTracesPerSecond int16 `thrift:"maxTracesPerSecond,1,required" db:"maxTracesPerSecond" json:"maxTracesPerSecond"` + MaxTracesPerSecond int16 `thrift:"maxTracesPerSecond,1,required" db:"maxTracesPerSecond" json:"maxTracesPerSecond"` } func NewRateLimitingSamplingStrategy() *RateLimitingSamplingStrategy { - return &RateLimitingSamplingStrategy{} + return &RateLimitingSamplingStrategy{} } - func (p *RateLimitingSamplingStrategy) GetMaxTracesPerSecond() int16 { - return p.MaxTracesPerSecond + return p.MaxTracesPerSecond } func (p *RateLimitingSamplingStrategy) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetMaxTracesPerSecond bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I16 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetMaxTracesPerSecond = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetMaxTracesPerSecond{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxTracesPerSecond is not set")); - } - return nil -} - -func (p *RateLimitingSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.MaxTracesPerSecond = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetMaxTracesPerSecond bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I16 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetMaxTracesPerSecond = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetMaxTracesPerSecond { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxTracesPerSecond is not set")) + } + return nil +} + +func (p *RateLimitingSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.MaxTracesPerSecond = v + } + return nil } func (p *RateLimitingSamplingStrategy) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RateLimitingSamplingStrategy"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "RateLimitingSamplingStrategy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *RateLimitingSamplingStrategy) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxTracesPerSecond", thrift.I16, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:maxTracesPerSecond: ", p), err) } - if err := oprot.WriteI16(ctx, int16(p.MaxTracesPerSecond)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxTracesPerSecond (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:maxTracesPerSecond: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "maxTracesPerSecond", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:maxTracesPerSecond: ", p), err) + } + if err := oprot.WriteI16(ctx, int16(p.MaxTracesPerSecond)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxTracesPerSecond (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:maxTracesPerSecond: ", p), err) + } + return err } func (p *RateLimitingSamplingStrategy) Equals(other *RateLimitingSamplingStrategy) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.MaxTracesPerSecond != other.MaxTracesPerSecond { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.MaxTracesPerSecond != other.MaxTracesPerSecond { + return false + } + return true } func (p *RateLimitingSamplingStrategy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("RateLimitingSamplingStrategy(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("RateLimitingSamplingStrategy(%+v)", *p) } // Attributes: -// - Operation -// - ProbabilisticSampling +// - Operation +// - ProbabilisticSampling type OperationSamplingStrategy struct { - Operation string `thrift:"operation,1,required" db:"operation" json:"operation"` - ProbabilisticSampling *ProbabilisticSamplingStrategy `thrift:"probabilisticSampling,2,required" db:"probabilisticSampling" json:"probabilisticSampling"` + Operation string `thrift:"operation,1,required" db:"operation" json:"operation"` + ProbabilisticSampling *ProbabilisticSamplingStrategy `thrift:"probabilisticSampling,2,required" db:"probabilisticSampling" json:"probabilisticSampling"` } func NewOperationSamplingStrategy() *OperationSamplingStrategy { - return &OperationSamplingStrategy{} + return &OperationSamplingStrategy{} } - func (p *OperationSamplingStrategy) GetOperation() string { - return p.Operation + return p.Operation } + var OperationSamplingStrategy_ProbabilisticSampling_DEFAULT *ProbabilisticSamplingStrategy + func (p *OperationSamplingStrategy) GetProbabilisticSampling() *ProbabilisticSamplingStrategy { - if !p.IsSetProbabilisticSampling() { - return OperationSamplingStrategy_ProbabilisticSampling_DEFAULT - } -return p.ProbabilisticSampling + if !p.IsSetProbabilisticSampling() { + return OperationSamplingStrategy_ProbabilisticSampling_DEFAULT + } + return p.ProbabilisticSampling } func (p *OperationSamplingStrategy) IsSetProbabilisticSampling() bool { - return p.ProbabilisticSampling != nil + return p.ProbabilisticSampling != nil } func (p *OperationSamplingStrategy) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperation bool = false; - var issetProbabilisticSampling bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperation = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetProbabilisticSampling = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperation{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Operation is not set")); - } - if !issetProbabilisticSampling{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProbabilisticSampling is not set")); - } - return nil -} - -func (p *OperationSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Operation = v -} - return nil -} - -func (p *OperationSamplingStrategy) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} - if err := p.ProbabilisticSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProbabilisticSampling), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperation bool = false + var issetProbabilisticSampling bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperation = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetProbabilisticSampling = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperation { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Operation is not set")) + } + if !issetProbabilisticSampling { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProbabilisticSampling is not set")) + } + return nil +} + +func (p *OperationSamplingStrategy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Operation = v + } + return nil +} + +func (p *OperationSamplingStrategy) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} + if err := p.ProbabilisticSampling.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProbabilisticSampling), err) + } + return nil } func (p *OperationSamplingStrategy) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OperationSamplingStrategy"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "OperationSamplingStrategy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *OperationSamplingStrategy) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operation", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operation: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Operation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operation (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operation: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operation", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operation: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Operation)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operation (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operation: ", p), err) + } + return err } func (p *OperationSamplingStrategy) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "probabilisticSampling", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:probabilisticSampling: ", p), err) } - if err := p.ProbabilisticSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProbabilisticSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:probabilisticSampling: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "probabilisticSampling", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:probabilisticSampling: ", p), err) + } + if err := p.ProbabilisticSampling.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProbabilisticSampling), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:probabilisticSampling: ", p), err) + } + return err } func (p *OperationSamplingStrategy) Equals(other *OperationSamplingStrategy) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Operation != other.Operation { return false } - if !p.ProbabilisticSampling.Equals(other.ProbabilisticSampling) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Operation != other.Operation { + return false + } + if !p.ProbabilisticSampling.Equals(other.ProbabilisticSampling) { + return false + } + return true } func (p *OperationSamplingStrategy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("OperationSamplingStrategy(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("OperationSamplingStrategy(%+v)", *p) } // Attributes: -// - DefaultSamplingProbability -// - DefaultLowerBoundTracesPerSecond -// - PerOperationStrategies -// - DefaultUpperBoundTracesPerSecond +// - DefaultSamplingProbability +// - DefaultLowerBoundTracesPerSecond +// - PerOperationStrategies +// - DefaultUpperBoundTracesPerSecond type PerOperationSamplingStrategies struct { - DefaultSamplingProbability float64 `thrift:"defaultSamplingProbability,1,required" db:"defaultSamplingProbability" json:"defaultSamplingProbability"` - DefaultLowerBoundTracesPerSecond float64 `thrift:"defaultLowerBoundTracesPerSecond,2,required" db:"defaultLowerBoundTracesPerSecond" json:"defaultLowerBoundTracesPerSecond"` - PerOperationStrategies []*OperationSamplingStrategy `thrift:"perOperationStrategies,3,required" db:"perOperationStrategies" json:"perOperationStrategies"` - DefaultUpperBoundTracesPerSecond *float64 `thrift:"defaultUpperBoundTracesPerSecond,4" db:"defaultUpperBoundTracesPerSecond" json:"defaultUpperBoundTracesPerSecond,omitempty"` + DefaultSamplingProbability float64 `thrift:"defaultSamplingProbability,1,required" db:"defaultSamplingProbability" json:"defaultSamplingProbability"` + DefaultLowerBoundTracesPerSecond float64 `thrift:"defaultLowerBoundTracesPerSecond,2,required" db:"defaultLowerBoundTracesPerSecond" json:"defaultLowerBoundTracesPerSecond"` + PerOperationStrategies []*OperationSamplingStrategy `thrift:"perOperationStrategies,3,required" db:"perOperationStrategies" json:"perOperationStrategies"` + DefaultUpperBoundTracesPerSecond *float64 `thrift:"defaultUpperBoundTracesPerSecond,4" db:"defaultUpperBoundTracesPerSecond" json:"defaultUpperBoundTracesPerSecond,omitempty"` } func NewPerOperationSamplingStrategies() *PerOperationSamplingStrategies { - return &PerOperationSamplingStrategies{} + return &PerOperationSamplingStrategies{} } - func (p *PerOperationSamplingStrategies) GetDefaultSamplingProbability() float64 { - return p.DefaultSamplingProbability + return p.DefaultSamplingProbability } func (p *PerOperationSamplingStrategies) GetDefaultLowerBoundTracesPerSecond() float64 { - return p.DefaultLowerBoundTracesPerSecond + return p.DefaultLowerBoundTracesPerSecond } func (p *PerOperationSamplingStrategies) GetPerOperationStrategies() []*OperationSamplingStrategy { - return p.PerOperationStrategies + return p.PerOperationStrategies } + var PerOperationSamplingStrategies_DefaultUpperBoundTracesPerSecond_DEFAULT float64 + func (p *PerOperationSamplingStrategies) GetDefaultUpperBoundTracesPerSecond() float64 { - if !p.IsSetDefaultUpperBoundTracesPerSecond() { - return PerOperationSamplingStrategies_DefaultUpperBoundTracesPerSecond_DEFAULT - } -return *p.DefaultUpperBoundTracesPerSecond + if !p.IsSetDefaultUpperBoundTracesPerSecond() { + return PerOperationSamplingStrategies_DefaultUpperBoundTracesPerSecond_DEFAULT + } + return *p.DefaultUpperBoundTracesPerSecond } func (p *PerOperationSamplingStrategies) IsSetDefaultUpperBoundTracesPerSecond() bool { - return p.DefaultUpperBoundTracesPerSecond != nil + return p.DefaultUpperBoundTracesPerSecond != nil } func (p *PerOperationSamplingStrategies) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetDefaultSamplingProbability bool = false; - var issetDefaultLowerBoundTracesPerSecond bool = false; - var issetPerOperationStrategies bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetDefaultSamplingProbability = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDefaultLowerBoundTracesPerSecond = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.LIST { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetPerOperationStrategies = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetDefaultSamplingProbability{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DefaultSamplingProbability is not set")); - } - if !issetDefaultLowerBoundTracesPerSecond{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DefaultLowerBoundTracesPerSecond is not set")); - } - if !issetPerOperationStrategies{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PerOperationStrategies is not set")); - } - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.DefaultSamplingProbability = v -} - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DefaultLowerBoundTracesPerSecond = v -} - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*OperationSamplingStrategy, 0, size) - p.PerOperationStrategies = tSlice - for i := 0; i < size; i ++ { - _elem0 := &OperationSamplingStrategy{} - if err := _elem0.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) - } - p.PerOperationStrategies = append(p.PerOperationStrategies, _elem0) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *PerOperationSamplingStrategies) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.DefaultUpperBoundTracesPerSecond = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetDefaultSamplingProbability bool = false + var issetDefaultLowerBoundTracesPerSecond bool = false + var issetPerOperationStrategies bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetDefaultSamplingProbability = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetDefaultLowerBoundTracesPerSecond = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetPerOperationStrategies = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetDefaultSamplingProbability { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DefaultSamplingProbability is not set")) + } + if !issetDefaultLowerBoundTracesPerSecond { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DefaultLowerBoundTracesPerSecond is not set")) + } + if !issetPerOperationStrategies { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PerOperationStrategies is not set")) + } + return nil +} + +func (p *PerOperationSamplingStrategies) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.DefaultSamplingProbability = v + } + return nil +} + +func (p *PerOperationSamplingStrategies) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DefaultLowerBoundTracesPerSecond = v + } + return nil +} + +func (p *PerOperationSamplingStrategies) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*OperationSamplingStrategy, 0, size) + p.PerOperationStrategies = tSlice + for i := 0; i < size; i++ { + _elem0 := &OperationSamplingStrategy{} + if err := _elem0.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.PerOperationStrategies = append(p.PerOperationStrategies, _elem0) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PerOperationSamplingStrategies) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.DefaultUpperBoundTracesPerSecond = &v + } + return nil } func (p *PerOperationSamplingStrategies) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "PerOperationSamplingStrategies"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "PerOperationSamplingStrategies"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *PerOperationSamplingStrategies) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "defaultSamplingProbability", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:defaultSamplingProbability: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.DefaultSamplingProbability)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.defaultSamplingProbability (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:defaultSamplingProbability: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "defaultSamplingProbability", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:defaultSamplingProbability: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(p.DefaultSamplingProbability)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.defaultSamplingProbability (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:defaultSamplingProbability: ", p), err) + } + return err } func (p *PerOperationSamplingStrategies) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "defaultLowerBoundTracesPerSecond", thrift.DOUBLE, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultLowerBoundTracesPerSecond: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.DefaultLowerBoundTracesPerSecond)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.defaultLowerBoundTracesPerSecond (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultLowerBoundTracesPerSecond: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "defaultLowerBoundTracesPerSecond", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultLowerBoundTracesPerSecond: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(p.DefaultLowerBoundTracesPerSecond)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.defaultLowerBoundTracesPerSecond (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultLowerBoundTracesPerSecond: ", p), err) + } + return err } func (p *PerOperationSamplingStrategies) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "perOperationStrategies", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:perOperationStrategies: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.PerOperationStrategies)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.PerOperationStrategies { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:perOperationStrategies: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "perOperationStrategies", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:perOperationStrategies: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.PerOperationStrategies)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PerOperationStrategies { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:perOperationStrategies: ", p), err) + } + return err } func (p *PerOperationSamplingStrategies) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDefaultUpperBoundTracesPerSecond() { - if err := oprot.WriteFieldBegin(ctx, "defaultUpperBoundTracesPerSecond", thrift.DOUBLE, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:defaultUpperBoundTracesPerSecond: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.DefaultUpperBoundTracesPerSecond)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.defaultUpperBoundTracesPerSecond (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:defaultUpperBoundTracesPerSecond: ", p), err) } - } - return err + if p.IsSetDefaultUpperBoundTracesPerSecond() { + if err := oprot.WriteFieldBegin(ctx, "defaultUpperBoundTracesPerSecond", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:defaultUpperBoundTracesPerSecond: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(*p.DefaultUpperBoundTracesPerSecond)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.defaultUpperBoundTracesPerSecond (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:defaultUpperBoundTracesPerSecond: ", p), err) + } + } + return err } func (p *PerOperationSamplingStrategies) Equals(other *PerOperationSamplingStrategies) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.DefaultSamplingProbability != other.DefaultSamplingProbability { return false } - if p.DefaultLowerBoundTracesPerSecond != other.DefaultLowerBoundTracesPerSecond { return false } - if len(p.PerOperationStrategies) != len(other.PerOperationStrategies) { return false } - for i, _tgt := range p.PerOperationStrategies { - _src1 := other.PerOperationStrategies[i] - if !_tgt.Equals(_src1) { return false } - } - if p.DefaultUpperBoundTracesPerSecond != other.DefaultUpperBoundTracesPerSecond { - if p.DefaultUpperBoundTracesPerSecond == nil || other.DefaultUpperBoundTracesPerSecond == nil { - return false - } - if (*p.DefaultUpperBoundTracesPerSecond) != (*other.DefaultUpperBoundTracesPerSecond) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.DefaultSamplingProbability != other.DefaultSamplingProbability { + return false + } + if p.DefaultLowerBoundTracesPerSecond != other.DefaultLowerBoundTracesPerSecond { + return false + } + if len(p.PerOperationStrategies) != len(other.PerOperationStrategies) { + return false + } + for i, _tgt := range p.PerOperationStrategies { + _src1 := other.PerOperationStrategies[i] + if !_tgt.Equals(_src1) { + return false + } + } + if p.DefaultUpperBoundTracesPerSecond != other.DefaultUpperBoundTracesPerSecond { + if p.DefaultUpperBoundTracesPerSecond == nil || other.DefaultUpperBoundTracesPerSecond == nil { + return false + } + if (*p.DefaultUpperBoundTracesPerSecond) != (*other.DefaultUpperBoundTracesPerSecond) { + return false + } + } + return true } func (p *PerOperationSamplingStrategies) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PerOperationSamplingStrategies(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("PerOperationSamplingStrategies(%+v)", *p) } // Attributes: -// - StrategyType -// - ProbabilisticSampling -// - RateLimitingSampling -// - OperationSampling +// - StrategyType +// - ProbabilisticSampling +// - RateLimitingSampling +// - OperationSampling type SamplingStrategyResponse struct { - StrategyType SamplingStrategyType `thrift:"strategyType,1,required" db:"strategyType" json:"strategyType"` - ProbabilisticSampling *ProbabilisticSamplingStrategy `thrift:"probabilisticSampling,2" db:"probabilisticSampling" json:"probabilisticSampling,omitempty"` - RateLimitingSampling *RateLimitingSamplingStrategy `thrift:"rateLimitingSampling,3" db:"rateLimitingSampling" json:"rateLimitingSampling,omitempty"` - OperationSampling *PerOperationSamplingStrategies `thrift:"operationSampling,4" db:"operationSampling" json:"operationSampling,omitempty"` + StrategyType SamplingStrategyType `thrift:"strategyType,1,required" db:"strategyType" json:"strategyType"` + ProbabilisticSampling *ProbabilisticSamplingStrategy `thrift:"probabilisticSampling,2" db:"probabilisticSampling" json:"probabilisticSampling,omitempty"` + RateLimitingSampling *RateLimitingSamplingStrategy `thrift:"rateLimitingSampling,3" db:"rateLimitingSampling" json:"rateLimitingSampling,omitempty"` + OperationSampling *PerOperationSamplingStrategies `thrift:"operationSampling,4" db:"operationSampling" json:"operationSampling,omitempty"` } func NewSamplingStrategyResponse() *SamplingStrategyResponse { - return &SamplingStrategyResponse{} + return &SamplingStrategyResponse{} } - func (p *SamplingStrategyResponse) GetStrategyType() SamplingStrategyType { - return p.StrategyType + return p.StrategyType } + var SamplingStrategyResponse_ProbabilisticSampling_DEFAULT *ProbabilisticSamplingStrategy + func (p *SamplingStrategyResponse) GetProbabilisticSampling() *ProbabilisticSamplingStrategy { - if !p.IsSetProbabilisticSampling() { - return SamplingStrategyResponse_ProbabilisticSampling_DEFAULT - } -return p.ProbabilisticSampling + if !p.IsSetProbabilisticSampling() { + return SamplingStrategyResponse_ProbabilisticSampling_DEFAULT + } + return p.ProbabilisticSampling } + var SamplingStrategyResponse_RateLimitingSampling_DEFAULT *RateLimitingSamplingStrategy + func (p *SamplingStrategyResponse) GetRateLimitingSampling() *RateLimitingSamplingStrategy { - if !p.IsSetRateLimitingSampling() { - return SamplingStrategyResponse_RateLimitingSampling_DEFAULT - } -return p.RateLimitingSampling + if !p.IsSetRateLimitingSampling() { + return SamplingStrategyResponse_RateLimitingSampling_DEFAULT + } + return p.RateLimitingSampling } + var SamplingStrategyResponse_OperationSampling_DEFAULT *PerOperationSamplingStrategies + func (p *SamplingStrategyResponse) GetOperationSampling() *PerOperationSamplingStrategies { - if !p.IsSetOperationSampling() { - return SamplingStrategyResponse_OperationSampling_DEFAULT - } -return p.OperationSampling + if !p.IsSetOperationSampling() { + return SamplingStrategyResponse_OperationSampling_DEFAULT + } + return p.OperationSampling } func (p *SamplingStrategyResponse) IsSetProbabilisticSampling() bool { - return p.ProbabilisticSampling != nil + return p.ProbabilisticSampling != nil } func (p *SamplingStrategyResponse) IsSetRateLimitingSampling() bool { - return p.RateLimitingSampling != nil + return p.RateLimitingSampling != nil } func (p *SamplingStrategyResponse) IsSetOperationSampling() bool { - return p.OperationSampling != nil + return p.OperationSampling != nil } func (p *SamplingStrategyResponse) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStrategyType bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStrategyType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStrategyType{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StrategyType is not set")); - } - return nil -} - -func (p *SamplingStrategyResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := SamplingStrategyType(v) - p.StrategyType = temp -} - return nil -} - -func (p *SamplingStrategyResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} - if err := p.ProbabilisticSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProbabilisticSampling), err) - } - return nil -} - -func (p *SamplingStrategyResponse) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.RateLimitingSampling = &RateLimitingSamplingStrategy{} - if err := p.RateLimitingSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RateLimitingSampling), err) - } - return nil -} - -func (p *SamplingStrategyResponse) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationSampling = &PerOperationSamplingStrategies{} - if err := p.OperationSampling.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationSampling), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStrategyType bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStrategyType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStrategyType { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StrategyType is not set")) + } + return nil +} + +func (p *SamplingStrategyResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := SamplingStrategyType(v) + p.StrategyType = temp + } + return nil +} + +func (p *SamplingStrategyResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} + if err := p.ProbabilisticSampling.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProbabilisticSampling), err) + } + return nil +} + +func (p *SamplingStrategyResponse) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.RateLimitingSampling = &RateLimitingSamplingStrategy{} + if err := p.RateLimitingSampling.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RateLimitingSampling), err) + } + return nil +} + +func (p *SamplingStrategyResponse) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationSampling = &PerOperationSamplingStrategies{} + if err := p.OperationSampling.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationSampling), err) + } + return nil } func (p *SamplingStrategyResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "SamplingStrategyResponse"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "SamplingStrategyResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *SamplingStrategyResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "strategyType", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:strategyType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.StrategyType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.strategyType (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:strategyType: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "strategyType", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:strategyType: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.StrategyType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.strategyType (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:strategyType: ", p), err) + } + return err } func (p *SamplingStrategyResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetProbabilisticSampling() { - if err := oprot.WriteFieldBegin(ctx, "probabilisticSampling", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:probabilisticSampling: ", p), err) } - if err := p.ProbabilisticSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProbabilisticSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:probabilisticSampling: ", p), err) } - } - return err + if p.IsSetProbabilisticSampling() { + if err := oprot.WriteFieldBegin(ctx, "probabilisticSampling", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:probabilisticSampling: ", p), err) + } + if err := p.ProbabilisticSampling.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProbabilisticSampling), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:probabilisticSampling: ", p), err) + } + } + return err } func (p *SamplingStrategyResponse) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRateLimitingSampling() { - if err := oprot.WriteFieldBegin(ctx, "rateLimitingSampling", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:rateLimitingSampling: ", p), err) } - if err := p.RateLimitingSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RateLimitingSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:rateLimitingSampling: ", p), err) } - } - return err + if p.IsSetRateLimitingSampling() { + if err := oprot.WriteFieldBegin(ctx, "rateLimitingSampling", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:rateLimitingSampling: ", p), err) + } + if err := p.RateLimitingSampling.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RateLimitingSampling), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:rateLimitingSampling: ", p), err) + } + } + return err } func (p *SamplingStrategyResponse) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationSampling() { - if err := oprot.WriteFieldBegin(ctx, "operationSampling", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:operationSampling: ", p), err) } - if err := p.OperationSampling.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationSampling), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:operationSampling: ", p), err) } - } - return err + if p.IsSetOperationSampling() { + if err := oprot.WriteFieldBegin(ctx, "operationSampling", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:operationSampling: ", p), err) + } + if err := p.OperationSampling.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationSampling), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:operationSampling: ", p), err) + } + } + return err } func (p *SamplingStrategyResponse) Equals(other *SamplingStrategyResponse) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StrategyType != other.StrategyType { return false } - if !p.ProbabilisticSampling.Equals(other.ProbabilisticSampling) { return false } - if !p.RateLimitingSampling.Equals(other.RateLimitingSampling) { return false } - if !p.OperationSampling.Equals(other.OperationSampling) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StrategyType != other.StrategyType { + return false + } + if !p.ProbabilisticSampling.Equals(other.ProbabilisticSampling) { + return false + } + if !p.RateLimitingSampling.Equals(other.RateLimitingSampling) { + return false + } + if !p.OperationSampling.Equals(other.OperationSampling) { + return false + } + return true } func (p *SamplingStrategyResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SamplingStrategyResponse(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("SamplingStrategyResponse(%+v)", *p) } type SamplingManager interface { - // Parameters: - // - ServiceName - GetSamplingStrategy(ctx context.Context, serviceName string) (_r *SamplingStrategyResponse, _err error) + // Parameters: + // - ServiceName + GetSamplingStrategy(ctx context.Context, serviceName string) (_r *SamplingStrategyResponse, _err error) } type SamplingManagerClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient + meta thrift.ResponseMeta } func NewSamplingManagerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *SamplingManagerClient { - return &SamplingManagerClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + return &SamplingManagerClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } } func NewSamplingManagerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *SamplingManagerClient { - return &SamplingManagerClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } + return &SamplingManagerClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewSamplingManagerClient(c thrift.TClient) *SamplingManagerClient { - return &SamplingManagerClient{ - c: c, - } + return &SamplingManagerClient{ + c: c, + } } func (p *SamplingManagerClient) Client_() thrift.TClient { - return p.c + return p.c } func (p *SamplingManagerClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta + return p.meta } func (p *SamplingManagerClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + p.meta = meta } // Parameters: -// - ServiceName +// - ServiceName func (p *SamplingManagerClient) GetSamplingStrategy(ctx context.Context, serviceName string) (_r *SamplingStrategyResponse, _err error) { - var _args2 SamplingManagerGetSamplingStrategyArgs - _args2.ServiceName = serviceName - var _result4 SamplingManagerGetSamplingStrategyResult - var _meta3 thrift.ResponseMeta - _meta3, _err = p.Client_().Call(ctx, "getSamplingStrategy", &_args2, &_result4) - p.SetLastResponseMeta_(_meta3) - if _err != nil { - return - } - return _result4.GetSuccess(), nil + var _args2 SamplingManagerGetSamplingStrategyArgs + _args2.ServiceName = serviceName + var _result4 SamplingManagerGetSamplingStrategyResult + var _meta3 thrift.ResponseMeta + _meta3, _err = p.Client_().Call(ctx, "getSamplingStrategy", &_args2, &_result4) + p.SetLastResponseMeta_(_meta3) + if _err != nil { + return + } + return _result4.GetSuccess(), nil } type SamplingManagerProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler SamplingManager + processorMap map[string]thrift.TProcessorFunction + handler SamplingManager } func (p *SamplingManagerProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *SamplingManagerProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *SamplingManagerProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewSamplingManagerProcessor(handler SamplingManager) *SamplingManagerProcessor { - self5 := &SamplingManagerProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self5.processorMap["getSamplingStrategy"] = &samplingManagerProcessorGetSamplingStrategy{handler:handler} -return self5 + self5 := &SamplingManagerProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self5.processorMap["getSamplingStrategy"] = &samplingManagerProcessorGetSamplingStrategy{handler: handler} + return self5 } func (p *SamplingManagerProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x6 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x6.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x6 + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { + return false, thrift.WrapTException(err2) + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x6 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x6.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x6 } type samplingManagerProcessorGetSamplingStrategy struct { - handler SamplingManager + handler SamplingManager } func (p *samplingManagerProcessorGetSamplingStrategy) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := SamplingManagerGetSamplingStrategyArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := SamplingManagerGetSamplingStrategyResult{} - var retval *SamplingStrategyResponse - if retval, err2 = p.handler.GetSamplingStrategy(ctx, args.ServiceName); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSamplingStrategy: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := SamplingManagerGetSamplingStrategyArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := SamplingManagerGetSamplingStrategyResult{} + var retval *SamplingStrategyResponse + if retval, err2 = p.handler.GetSamplingStrategy(ctx, args.ServiceName); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSamplingStrategy: "+err2.Error()) + oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "getSamplingStrategy", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err } - // HELPER FUNCTIONS AND STRUCTURES // Attributes: -// - ServiceName +// - ServiceName type SamplingManagerGetSamplingStrategyArgs struct { - ServiceName string `thrift:"serviceName,1" db:"serviceName" json:"serviceName"` + ServiceName string `thrift:"serviceName,1" db:"serviceName" json:"serviceName"` } func NewSamplingManagerGetSamplingStrategyArgs() *SamplingManagerGetSamplingStrategyArgs { - return &SamplingManagerGetSamplingStrategyArgs{} + return &SamplingManagerGetSamplingStrategyArgs{} } - func (p *SamplingManagerGetSamplingStrategyArgs) GetServiceName() string { - return p.ServiceName + return p.ServiceName } func (p *SamplingManagerGetSamplingStrategyArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *SamplingManagerGetSamplingStrategyArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.ServiceName = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SamplingManagerGetSamplingStrategyArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ServiceName = v + } + return nil } func (p *SamplingManagerGetSamplingStrategyArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getSamplingStrategy_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "getSamplingStrategy_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *SamplingManagerGetSamplingStrategyArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "serviceName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) + } + return err } func (p *SamplingManagerGetSamplingStrategyArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SamplingManagerGetSamplingStrategyArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("SamplingManagerGetSamplingStrategyArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type SamplingManagerGetSamplingStrategyResult struct { - Success *SamplingStrategyResponse `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *SamplingStrategyResponse `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewSamplingManagerGetSamplingStrategyResult() *SamplingManagerGetSamplingStrategyResult { - return &SamplingManagerGetSamplingStrategyResult{} + return &SamplingManagerGetSamplingStrategyResult{} } var SamplingManagerGetSamplingStrategyResult_Success_DEFAULT *SamplingStrategyResponse + func (p *SamplingManagerGetSamplingStrategyResult) GetSuccess() *SamplingStrategyResponse { - if !p.IsSetSuccess() { - return SamplingManagerGetSamplingStrategyResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return SamplingManagerGetSamplingStrategyResult_Success_DEFAULT + } + return p.Success } func (p *SamplingManagerGetSamplingStrategyResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *SamplingManagerGetSamplingStrategyResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *SamplingManagerGetSamplingStrategyResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &SamplingStrategyResponse{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SamplingManagerGetSamplingStrategyResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &SamplingStrategyResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *SamplingManagerGetSamplingStrategyResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "getSamplingStrategy_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "getSamplingStrategy_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *SamplingManagerGetSamplingStrategyResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *SamplingManagerGetSamplingStrategyResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SamplingManagerGetSamplingStrategyResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("SamplingManagerGetSamplingStrategyResult(%+v)", *p) } - - diff --git a/thrift-gen/zipkincore/GoUnusedProtection__.go b/thrift-gen/zipkincore/GoUnusedProtection__.go index ebf43018fe7..7744ed7fbaf 100644 --- a/thrift-gen/zipkincore/GoUnusedProtection__.go +++ b/thrift-gen/zipkincore/GoUnusedProtection__.go @@ -2,5 +2,4 @@ package zipkincore -var GoUnusedProtection__ int; - +var GoUnusedProtection__ int diff --git a/thrift-gen/zipkincore/zipkincore-consts.go b/thrift-gen/zipkincore/zipkincore-consts.go index 8b6e02cd2d8..25450e8f4fb 100644 --- a/thrift-gen/zipkincore/zipkincore-consts.go +++ b/thrift-gen/zipkincore/zipkincore-consts.go @@ -2,12 +2,12 @@ package zipkincore -import( +import ( "bytes" "context" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -36,4 +36,3 @@ const MESSAGE_ADDR = "ma" func init() { } - diff --git a/thrift-gen/zipkincore/zipkincore.go b/thrift-gen/zipkincore/zipkincore.go index 71e89125c7b..dbd79986072 100644 --- a/thrift-gen/zipkincore/zipkincore.go +++ b/thrift-gen/zipkincore/zipkincore.go @@ -2,14 +2,14 @@ package zipkincore -import( +import ( "bytes" "context" "database/sql/driver" "errors" "fmt" - "time" "github.com/apache/thrift/lib/go/thrift" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -20,1834 +20,2050 @@ var _ = time.Now var _ = bytes.Equal type AnnotationType int64 + const ( - AnnotationType_BOOL AnnotationType = 0 - AnnotationType_BYTES AnnotationType = 1 - AnnotationType_I16 AnnotationType = 2 - AnnotationType_I32 AnnotationType = 3 - AnnotationType_I64 AnnotationType = 4 - AnnotationType_DOUBLE AnnotationType = 5 - AnnotationType_STRING AnnotationType = 6 + AnnotationType_BOOL AnnotationType = 0 + AnnotationType_BYTES AnnotationType = 1 + AnnotationType_I16 AnnotationType = 2 + AnnotationType_I32 AnnotationType = 3 + AnnotationType_I64 AnnotationType = 4 + AnnotationType_DOUBLE AnnotationType = 5 + AnnotationType_STRING AnnotationType = 6 ) func (p AnnotationType) String() string { - switch p { - case AnnotationType_BOOL: return "BOOL" - case AnnotationType_BYTES: return "BYTES" - case AnnotationType_I16: return "I16" - case AnnotationType_I32: return "I32" - case AnnotationType_I64: return "I64" - case AnnotationType_DOUBLE: return "DOUBLE" - case AnnotationType_STRING: return "STRING" - } - return "" + switch p { + case AnnotationType_BOOL: + return "BOOL" + case AnnotationType_BYTES: + return "BYTES" + case AnnotationType_I16: + return "I16" + case AnnotationType_I32: + return "I32" + case AnnotationType_I64: + return "I64" + case AnnotationType_DOUBLE: + return "DOUBLE" + case AnnotationType_STRING: + return "STRING" + } + return "" } func AnnotationTypeFromString(s string) (AnnotationType, error) { - switch s { - case "BOOL": return AnnotationType_BOOL, nil - case "BYTES": return AnnotationType_BYTES, nil - case "I16": return AnnotationType_I16, nil - case "I32": return AnnotationType_I32, nil - case "I64": return AnnotationType_I64, nil - case "DOUBLE": return AnnotationType_DOUBLE, nil - case "STRING": return AnnotationType_STRING, nil - } - return AnnotationType(0), fmt.Errorf("not a valid AnnotationType string") + switch s { + case "BOOL": + return AnnotationType_BOOL, nil + case "BYTES": + return AnnotationType_BYTES, nil + case "I16": + return AnnotationType_I16, nil + case "I32": + return AnnotationType_I32, nil + case "I64": + return AnnotationType_I64, nil + case "DOUBLE": + return AnnotationType_DOUBLE, nil + case "STRING": + return AnnotationType_STRING, nil + } + return AnnotationType(0), fmt.Errorf("not a valid AnnotationType string") } - func AnnotationTypePtr(v AnnotationType) *AnnotationType { return &v } func (p AnnotationType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *AnnotationType) UnmarshalText(text []byte) error { -q, err := AnnotationTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := AnnotationTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *AnnotationType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = AnnotationType(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = AnnotationType(v) + return nil } -func (p * AnnotationType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *AnnotationType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + // Indicates the network context of a service recording an annotation with two // exceptions. -// +// // When a BinaryAnnotation, and key is CLIENT_ADDR or SERVER_ADDR, // the endpoint indicates the source or destination of an RPC. This exception // allows zipkin to display network context of uninstrumented services, or // clients such as web browsers. -// +// // Attributes: -// - Ipv4: IPv4 host address packed into 4 bytes. -// +// - Ipv4: IPv4 host address packed into 4 bytes. +// // Ex for the ip 1.2.3.4, it would be (1 << 24) | (2 << 16) | (3 << 8) | 4 -// - Port: IPv4 port -// +// - Port: IPv4 port +// // Note: this is to be treated as an unsigned integer, so watch for negatives. -// +// // Conventionally, when the port isn't known, port = 0. -// - ServiceName: Service name in lowercase, such as "memcache" or "zipkin-web" -// +// - ServiceName: Service name in lowercase, such as "memcache" or "zipkin-web" +// // Conventionally, when the service name isn't known, service_name = "unknown". -// - Ipv6: IPv6 host address packed into 16 bytes. Ex Inet6Address.getBytes() +// - Ipv6: IPv6 host address packed into 16 bytes. Ex Inet6Address.getBytes() type Endpoint struct { - Ipv4 int32 `thrift:"ipv4,1" db:"ipv4" json:"ipv4"` - Port int16 `thrift:"port,2" db:"port" json:"port"` - ServiceName string `thrift:"service_name,3" db:"service_name" json:"service_name"` - Ipv6 []byte `thrift:"ipv6,4" db:"ipv6" json:"ipv6,omitempty"` + Ipv4 int32 `thrift:"ipv4,1" db:"ipv4" json:"ipv4"` + Port int16 `thrift:"port,2" db:"port" json:"port"` + ServiceName string `thrift:"service_name,3" db:"service_name" json:"service_name"` + Ipv6 []byte `thrift:"ipv6,4" db:"ipv6" json:"ipv6,omitempty"` } func NewEndpoint() *Endpoint { - return &Endpoint{} + return &Endpoint{} } - func (p *Endpoint) GetIpv4() int32 { - return p.Ipv4 + return p.Ipv4 } func (p *Endpoint) GetPort() int16 { - return p.Port + return p.Port } func (p *Endpoint) GetServiceName() string { - return p.ServiceName + return p.ServiceName } + var Endpoint_Ipv6_DEFAULT []byte func (p *Endpoint) GetIpv6() []byte { - return p.Ipv6 + return p.Ipv6 } func (p *Endpoint) IsSetIpv6() bool { - return p.Ipv6 != nil + return p.Ipv6 != nil } func (p *Endpoint) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I16 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *Endpoint) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Ipv4 = v -} - return nil -} - -func (p *Endpoint) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Port = v -} - return nil -} - -func (p *Endpoint) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.ServiceName = v -} - return nil -} - -func (p *Endpoint) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.Ipv6 = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I16 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Endpoint) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Ipv4 = v + } + return nil +} + +func (p *Endpoint) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Port = v + } + return nil +} + +func (p *Endpoint) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ServiceName = v + } + return nil +} + +func (p *Endpoint) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Ipv6 = v + } + return nil } func (p *Endpoint) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Endpoint"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Endpoint"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Endpoint) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "ipv4", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ipv4: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Ipv4)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ipv4 (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ipv4: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "ipv4", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ipv4: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.Ipv4)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ipv4 (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ipv4: ", p), err) + } + return err } func (p *Endpoint) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "port", thrift.I16, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) } - if err := oprot.WriteI16(ctx, int16(p.Port)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "port", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) + } + if err := oprot.WriteI16(ctx, int16(p.Port)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) + } + return err } func (p *Endpoint) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "service_name", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:service_name: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.service_name (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:service_name: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "service_name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:service_name: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.ServiceName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.service_name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:service_name: ", p), err) + } + return err } func (p *Endpoint) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIpv6() { - if err := oprot.WriteFieldBegin(ctx, "ipv6", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ipv6: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Ipv6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ipv6 (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ipv6: ", p), err) } - } - return err + if p.IsSetIpv6() { + if err := oprot.WriteFieldBegin(ctx, "ipv6", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ipv6: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Ipv6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ipv6 (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ipv6: ", p), err) + } + } + return err } func (p *Endpoint) Equals(other *Endpoint) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Ipv4 != other.Ipv4 { return false } - if p.Port != other.Port { return false } - if p.ServiceName != other.ServiceName { return false } - if bytes.Compare(p.Ipv6, other.Ipv6) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Ipv4 != other.Ipv4 { + return false + } + if p.Port != other.Port { + return false + } + if p.ServiceName != other.ServiceName { + return false + } + if bytes.Compare(p.Ipv6, other.Ipv6) != 0 { + return false + } + return true } func (p *Endpoint) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Endpoint(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Endpoint(%+v)", *p) } // An annotation is similar to a log statement. It includes a host field which // allows these events to be attributed properly, and also aggregatable. -// +// // Attributes: -// - Timestamp: Microseconds from epoch. -// +// - Timestamp: Microseconds from epoch. +// // This value should use the most precise value possible. For example, // gettimeofday or syncing nanoTime against a tick of currentTimeMillis. -// - Value -// - Host: Always the host that recorded the event. By specifying the host you allow +// - Value +// - Host: Always the host that recorded the event. By specifying the host you allow +// // rollup of all events (such as client requests to a service) by IP address. type Annotation struct { - Timestamp int64 `thrift:"timestamp,1" db:"timestamp" json:"timestamp"` - Value string `thrift:"value,2" db:"value" json:"value"` - Host *Endpoint `thrift:"host,3" db:"host" json:"host,omitempty"` + Timestamp int64 `thrift:"timestamp,1" db:"timestamp" json:"timestamp"` + Value string `thrift:"value,2" db:"value" json:"value"` + Host *Endpoint `thrift:"host,3" db:"host" json:"host,omitempty"` } func NewAnnotation() *Annotation { - return &Annotation{} + return &Annotation{} } - func (p *Annotation) GetTimestamp() int64 { - return p.Timestamp + return p.Timestamp } func (p *Annotation) GetValue() string { - return p.Value + return p.Value } + var Annotation_Host_DEFAULT *Endpoint + func (p *Annotation) GetHost() *Endpoint { - if !p.IsSetHost() { - return Annotation_Host_DEFAULT - } -return p.Host + if !p.IsSetHost() { + return Annotation_Host_DEFAULT + } + return p.Host } func (p *Annotation) IsSetHost() bool { - return p.Host != nil + return p.Host != nil } func (p *Annotation) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *Annotation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Timestamp = v -} - return nil -} - -func (p *Annotation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Value = v -} - return nil -} - -func (p *Annotation) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.Host = &Endpoint{} - if err := p.Host.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Annotation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Timestamp = v + } + return nil +} + +func (p *Annotation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Value = v + } + return nil +} + +func (p *Annotation) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &Endpoint{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil } func (p *Annotation) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Annotation"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Annotation"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Annotation) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "timestamp", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestamp: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.Timestamp)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timestamp (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestamp: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "timestamp", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestamp: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.Timestamp)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timestamp (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestamp: ", p), err) + } + return err } func (p *Annotation) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) + } + return err } func (p *Annotation) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHost() { - if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host: ", p), err) } - if err := p.Host.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:host: ", p), err) } - } - return err + if p.IsSetHost() { + if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host: ", p), err) + } + if err := p.Host.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:host: ", p), err) + } + } + return err } func (p *Annotation) Equals(other *Annotation) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Timestamp != other.Timestamp { return false } - if p.Value != other.Value { return false } - if !p.Host.Equals(other.Host) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Timestamp != other.Timestamp { + return false + } + if p.Value != other.Value { + return false + } + if !p.Host.Equals(other.Host) { + return false + } + return true } func (p *Annotation) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Annotation(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Annotation(%+v)", *p) } // Binary annotations are tags applied to a Span to give it context. For // example, a binary annotation of "http.uri" could the path to a resource in a // RPC call. -// +// // Binary annotations of type STRING are always queryable, though more a // historical implementation detail than a structural concern. -// +// // Binary annotations can repeat, and vary on the host. Similar to Annotation, // the host indicates who logged the event. This allows you to tell the // difference between the client and server side of the same key. For example, // the key "http.uri" might be different on the client and server side due to // rewriting, like "/api/v1/myresource" vs "/myresource. Via the host field, // you can see the different points of view, which often help in debugging. -// +// // Attributes: -// - Key -// - Value -// - AnnotationType -// - Host: The host that recorded tag, which allows you to differentiate between +// - Key +// - Value +// - AnnotationType +// - Host: The host that recorded tag, which allows you to differentiate between +// // multiple tags with the same key. There are two exceptions to this. -// +// // When the key is CLIENT_ADDR or SERVER_ADDR, host indicates the source or // destination of an RPC. This exception allows zipkin to display network // context of uninstrumented services, or clients such as web browsers. type BinaryAnnotation struct { - Key string `thrift:"key,1" db:"key" json:"key"` - Value []byte `thrift:"value,2" db:"value" json:"value"` - AnnotationType AnnotationType `thrift:"annotation_type,3" db:"annotation_type" json:"annotation_type"` - Host *Endpoint `thrift:"host,4" db:"host" json:"host,omitempty"` + Key string `thrift:"key,1" db:"key" json:"key"` + Value []byte `thrift:"value,2" db:"value" json:"value"` + AnnotationType AnnotationType `thrift:"annotation_type,3" db:"annotation_type" json:"annotation_type"` + Host *Endpoint `thrift:"host,4" db:"host" json:"host,omitempty"` } func NewBinaryAnnotation() *BinaryAnnotation { - return &BinaryAnnotation{} + return &BinaryAnnotation{} } - func (p *BinaryAnnotation) GetKey() string { - return p.Key + return p.Key } func (p *BinaryAnnotation) GetValue() []byte { - return p.Value + return p.Value } func (p *BinaryAnnotation) GetAnnotationType() AnnotationType { - return p.AnnotationType + return p.AnnotationType } + var BinaryAnnotation_Host_DEFAULT *Endpoint + func (p *BinaryAnnotation) GetHost() *Endpoint { - if !p.IsSetHost() { - return BinaryAnnotation_Host_DEFAULT - } -return p.Host + if !p.IsSetHost() { + return BinaryAnnotation_Host_DEFAULT + } + return p.Host } func (p *BinaryAnnotation) IsSetHost() bool { - return p.Host != nil + return p.Host != nil } func (p *BinaryAnnotation) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *BinaryAnnotation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Key = v -} - return nil -} - -func (p *BinaryAnnotation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Value = v -} - return nil -} - -func (p *BinaryAnnotation) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := AnnotationType(v) - p.AnnotationType = temp -} - return nil -} - -func (p *BinaryAnnotation) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.Host = &Endpoint{} - if err := p.Host.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BinaryAnnotation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Key = v + } + return nil +} + +func (p *BinaryAnnotation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Value = v + } + return nil +} + +func (p *BinaryAnnotation) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := AnnotationType(v) + p.AnnotationType = temp + } + return nil +} + +func (p *BinaryAnnotation) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &Endpoint{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil } func (p *BinaryAnnotation) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "BinaryAnnotation"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "BinaryAnnotation"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *BinaryAnnotation) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "key", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Key)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Key)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) + } + return err } func (p *BinaryAnnotation) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Value); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) + } + return err } func (p *BinaryAnnotation) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "annotation_type", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:annotation_type: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.AnnotationType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.annotation_type (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:annotation_type: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "annotation_type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:annotation_type: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.AnnotationType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.annotation_type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:annotation_type: ", p), err) + } + return err } func (p *BinaryAnnotation) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHost() { - if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:host: ", p), err) } - if err := p.Host.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:host: ", p), err) } - } - return err + if p.IsSetHost() { + if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:host: ", p), err) + } + if err := p.Host.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:host: ", p), err) + } + } + return err } func (p *BinaryAnnotation) Equals(other *BinaryAnnotation) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Key != other.Key { return false } - if bytes.Compare(p.Value, other.Value) != 0 { return false } - if p.AnnotationType != other.AnnotationType { return false } - if !p.Host.Equals(other.Host) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Key != other.Key { + return false + } + if bytes.Compare(p.Value, other.Value) != 0 { + return false + } + if p.AnnotationType != other.AnnotationType { + return false + } + if !p.Host.Equals(other.Host) { + return false + } + return true } func (p *BinaryAnnotation) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BinaryAnnotation(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("BinaryAnnotation(%+v)", *p) } // A trace is a series of spans (often RPC calls) which form a latency tree. -// +// // The root span is where trace_id = id and parent_id = Nil. The root span is // usually the longest interval in the trace, starting with a SERVER_RECV // annotation and ending with a SERVER_SEND. -// +// // Attributes: -// - TraceID -// - Name: Span name in lowercase, rpc method for example -// +// - TraceID +// - Name: Span name in lowercase, rpc method for example +// // Conventionally, when the span name isn't known, name = "unknown". -// - ID -// - ParentID -// - Annotations -// - BinaryAnnotations -// - Debug -// - Timestamp: Microseconds from epoch of the creation of this span. -// +// - ID +// - ParentID +// - Annotations +// - BinaryAnnotations +// - Debug +// - Timestamp: Microseconds from epoch of the creation of this span. +// // This value should be set directly by instrumentation, using the most // precise value possible. For example, gettimeofday or syncing nanoTime // against a tick of currentTimeMillis. -// +// // For compatibility with instrumentation that precede this field, collectors // or span stores can derive this via Annotation.timestamp. // For example, SERVER_RECV.timestamp or CLIENT_SEND.timestamp. -// +// // This field is optional for compatibility with old data: first-party span // stores are expected to support this at time of introduction. -// - Duration: Measurement of duration in microseconds, used to support queries. -// +// - Duration: Measurement of duration in microseconds, used to support queries. +// // This value should be set directly, where possible. Doing so encourages // precise measurement decoupled from problems of clocks, such as skew or NTP // updates causing time to move backwards. -// +// // For compatibility with instrumentation that precede this field, collectors // or span stores can derive this by subtracting Annotation.timestamp. // For example, SERVER_SEND.timestamp - SERVER_RECV.timestamp. -// +// // If this field is persisted as unset, zipkin will continue to work, except // duration query support will be implementation-specific. Similarly, setting // this field non-atomically is implementation-specific. -// +// // This field is i64 vs i32 to support spans longer than 35 minutes. -// - TraceIDHigh: Optional unique 8-byte additional identifier for a trace. If non zero, this +// - TraceIDHigh: Optional unique 8-byte additional identifier for a trace. If non zero, this +// // means the trace uses 128 bit traceIds instead of 64 bit. type Span struct { - TraceID int64 `thrift:"trace_id,1" db:"trace_id" json:"trace_id"` - // unused field # 2 - Name string `thrift:"name,3" db:"name" json:"name"` - ID int64 `thrift:"id,4" db:"id" json:"id"` - ParentID *int64 `thrift:"parent_id,5" db:"parent_id" json:"parent_id,omitempty"` - Annotations []*Annotation `thrift:"annotations,6" db:"annotations" json:"annotations"` - // unused field # 7 - BinaryAnnotations []*BinaryAnnotation `thrift:"binary_annotations,8" db:"binary_annotations" json:"binary_annotations"` - Debug bool `thrift:"debug,9" db:"debug" json:"debug"` - Timestamp *int64 `thrift:"timestamp,10" db:"timestamp" json:"timestamp,omitempty"` - Duration *int64 `thrift:"duration,11" db:"duration" json:"duration,omitempty"` - TraceIDHigh *int64 `thrift:"trace_id_high,12" db:"trace_id_high" json:"trace_id_high,omitempty"` + TraceID int64 `thrift:"trace_id,1" db:"trace_id" json:"trace_id"` + // unused field # 2 + Name string `thrift:"name,3" db:"name" json:"name"` + ID int64 `thrift:"id,4" db:"id" json:"id"` + ParentID *int64 `thrift:"parent_id,5" db:"parent_id" json:"parent_id,omitempty"` + Annotations []*Annotation `thrift:"annotations,6" db:"annotations" json:"annotations"` + // unused field # 7 + BinaryAnnotations []*BinaryAnnotation `thrift:"binary_annotations,8" db:"binary_annotations" json:"binary_annotations"` + Debug bool `thrift:"debug,9" db:"debug" json:"debug"` + Timestamp *int64 `thrift:"timestamp,10" db:"timestamp" json:"timestamp,omitempty"` + Duration *int64 `thrift:"duration,11" db:"duration" json:"duration,omitempty"` + TraceIDHigh *int64 `thrift:"trace_id_high,12" db:"trace_id_high" json:"trace_id_high,omitempty"` } func NewSpan() *Span { - return &Span{} + return &Span{} } - func (p *Span) GetTraceID() int64 { - return p.TraceID + return p.TraceID } func (p *Span) GetName() string { - return p.Name + return p.Name } func (p *Span) GetID() int64 { - return p.ID + return p.ID } + var Span_ParentID_DEFAULT int64 + func (p *Span) GetParentID() int64 { - if !p.IsSetParentID() { - return Span_ParentID_DEFAULT - } -return *p.ParentID + if !p.IsSetParentID() { + return Span_ParentID_DEFAULT + } + return *p.ParentID } func (p *Span) GetAnnotations() []*Annotation { - return p.Annotations + return p.Annotations } func (p *Span) GetBinaryAnnotations() []*BinaryAnnotation { - return p.BinaryAnnotations + return p.BinaryAnnotations } + var Span_Debug_DEFAULT bool = false func (p *Span) GetDebug() bool { - return p.Debug + return p.Debug } + var Span_Timestamp_DEFAULT int64 + func (p *Span) GetTimestamp() int64 { - if !p.IsSetTimestamp() { - return Span_Timestamp_DEFAULT - } -return *p.Timestamp + if !p.IsSetTimestamp() { + return Span_Timestamp_DEFAULT + } + return *p.Timestamp } + var Span_Duration_DEFAULT int64 + func (p *Span) GetDuration() int64 { - if !p.IsSetDuration() { - return Span_Duration_DEFAULT - } -return *p.Duration + if !p.IsSetDuration() { + return Span_Duration_DEFAULT + } + return *p.Duration } + var Span_TraceIDHigh_DEFAULT int64 + func (p *Span) GetTraceIDHigh() int64 { - if !p.IsSetTraceIDHigh() { - return Span_TraceIDHigh_DEFAULT - } -return *p.TraceIDHigh + if !p.IsSetTraceIDHigh() { + return Span_TraceIDHigh_DEFAULT + } + return *p.TraceIDHigh } func (p *Span) IsSetParentID() bool { - return p.ParentID != nil + return p.ParentID != nil } func (p *Span) IsSetDebug() bool { - return p.Debug != Span_Debug_DEFAULT + return p.Debug != Span_Debug_DEFAULT } func (p *Span) IsSetTimestamp() bool { - return p.Timestamp != nil + return p.Timestamp != nil } func (p *Span) IsSetDuration() bool { - return p.Duration != nil + return p.Duration != nil } func (p *Span) IsSetTraceIDHigh() bool { - return p.TraceIDHigh != nil + return p.TraceIDHigh != nil } func (p *Span) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I64 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.LIST { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.LIST { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 9: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField9(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 10: - if fieldTypeId == thrift.I64 { - if err := p.ReadField10(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 11: - if fieldTypeId == thrift.I64 { - if err := p.ReadField11(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 12: - if fieldTypeId == thrift.I64 { - if err := p.ReadField12(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *Span) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.TraceID = v -} - return nil -} - -func (p *Span) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Name = v -} - return nil -} - -func (p *Span) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ID = v -} - return nil -} - -func (p *Span) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ParentID = &v -} - return nil -} - -func (p *Span) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Annotation, 0, size) - p.Annotations = tSlice - for i := 0; i < size; i ++ { - _elem0 := &Annotation{} - if err := _elem0.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) - } - p.Annotations = append(p.Annotations, _elem0) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *Span) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*BinaryAnnotation, 0, size) - p.BinaryAnnotations = tSlice - for i := 0; i < size; i ++ { - _elem1 := &BinaryAnnotation{} - if err := _elem1.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) - } - p.BinaryAnnotations = append(p.BinaryAnnotations, _elem1) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *Span) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 9: ", err) -} else { - p.Debug = v -} - return nil -} - -func (p *Span) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 10: ", err) -} else { - p.Timestamp = &v -} - return nil -} - -func (p *Span) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 11: ", err) -} else { - p.Duration = &v -} - return nil -} - -func (p *Span) ReadField12(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 12: ", err) -} else { - p.TraceIDHigh = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.LIST { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.LIST { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.I64 { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.I64 { + if err := p.ReadField11(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 12: + if fieldTypeId == thrift.I64 { + if err := p.ReadField12(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Span) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TraceID = v + } + return nil +} + +func (p *Span) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Name = v + } + return nil +} + +func (p *Span) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.ID = v + } + return nil +} + +func (p *Span) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ParentID = &v + } + return nil +} + +func (p *Span) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Annotation, 0, size) + p.Annotations = tSlice + for i := 0; i < size; i++ { + _elem0 := &Annotation{} + if err := _elem0.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Annotations = append(p.Annotations, _elem0) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Span) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*BinaryAnnotation, 0, size) + p.BinaryAnnotations = tSlice + for i := 0; i < size; i++ { + _elem1 := &BinaryAnnotation{} + if err := _elem1.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.BinaryAnnotations = append(p.BinaryAnnotations, _elem1) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Span) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.Debug = v + } + return nil +} + +func (p *Span) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 10: ", err) + } else { + p.Timestamp = &v + } + return nil +} + +func (p *Span) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 11: ", err) + } else { + p.Duration = &v + } + return nil +} + +func (p *Span) ReadField12(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 12: ", err) + } else { + p.TraceIDHigh = &v + } + return nil } func (p *Span) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Span"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField8(ctx, oprot); err != nil { return err } - if err := p.writeField9(ctx, oprot); err != nil { return err } - if err := p.writeField10(ctx, oprot); err != nil { return err } - if err := p.writeField11(ctx, oprot); err != nil { return err } - if err := p.writeField12(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Span"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField8(ctx, oprot); err != nil { + return err + } + if err := p.writeField9(ctx, oprot); err != nil { + return err + } + if err := p.writeField10(ctx, oprot); err != nil { + return err + } + if err := p.writeField11(ctx, oprot); err != nil { + return err + } + if err := p.writeField12(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Span) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "trace_id", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:trace_id: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.TraceID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.trace_id (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:trace_id: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "trace_id", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:trace_id: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.TraceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.trace_id (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:trace_id: ", p), err) + } + return err } func (p *Span) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Name)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Name)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) + } + return err } func (p *Span) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "id", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:id: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.ID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.id (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:id: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "id", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:id: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.ID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:id: ", p), err) + } + return err } func (p *Span) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentID() { - if err := oprot.WriteFieldBegin(ctx, "parent_id", thrift.I64, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:parent_id: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.ParentID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parent_id (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:parent_id: ", p), err) } - } - return err + if p.IsSetParentID() { + if err := oprot.WriteFieldBegin(ctx, "parent_id", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:parent_id: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.ParentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parent_id (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:parent_id: ", p), err) + } + } + return err } func (p *Span) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "annotations", thrift.LIST, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:annotations: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Annotations)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Annotations { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:annotations: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "annotations", thrift.LIST, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:annotations: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Annotations)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Annotations { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:annotations: ", p), err) + } + return err } func (p *Span) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "binary_annotations", thrift.LIST, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binary_annotations: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.BinaryAnnotations)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.BinaryAnnotations { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binary_annotations: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "binary_annotations", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binary_annotations: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.BinaryAnnotations)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.BinaryAnnotations { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binary_annotations: ", p), err) + } + return err } func (p *Span) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDebug() { - if err := oprot.WriteFieldBegin(ctx, "debug", thrift.BOOL, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:debug: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.Debug)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.debug (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:debug: ", p), err) } - } - return err + if p.IsSetDebug() { + if err := oprot.WriteFieldBegin(ctx, "debug", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:debug: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.Debug)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.debug (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:debug: ", p), err) + } + } + return err } func (p *Span) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTimestamp() { - if err := oprot.WriteFieldBegin(ctx, "timestamp", thrift.I64, 10); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:timestamp: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.Timestamp)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timestamp (10) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 10:timestamp: ", p), err) } - } - return err + if p.IsSetTimestamp() { + if err := oprot.WriteFieldBegin(ctx, "timestamp", thrift.I64, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:timestamp: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.Timestamp)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timestamp (10) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:timestamp: ", p), err) + } + } + return err } func (p *Span) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDuration() { - if err := oprot.WriteFieldBegin(ctx, "duration", thrift.I64, 11); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:duration: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.Duration)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.duration (11) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 11:duration: ", p), err) } - } - return err + if p.IsSetDuration() { + if err := oprot.WriteFieldBegin(ctx, "duration", thrift.I64, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:duration: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.Duration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.duration (11) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:duration: ", p), err) + } + } + return err } func (p *Span) writeField12(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTraceIDHigh() { - if err := oprot.WriteFieldBegin(ctx, "trace_id_high", thrift.I64, 12); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:trace_id_high: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.TraceIDHigh)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.trace_id_high (12) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 12:trace_id_high: ", p), err) } - } - return err + if p.IsSetTraceIDHigh() { + if err := oprot.WriteFieldBegin(ctx, "trace_id_high", thrift.I64, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:trace_id_high: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.TraceIDHigh)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.trace_id_high (12) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:trace_id_high: ", p), err) + } + } + return err } func (p *Span) Equals(other *Span) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.TraceID != other.TraceID { return false } - if p.Name != other.Name { return false } - if p.ID != other.ID { return false } - if p.ParentID != other.ParentID { - if p.ParentID == nil || other.ParentID == nil { - return false - } - if (*p.ParentID) != (*other.ParentID) { return false } - } - if len(p.Annotations) != len(other.Annotations) { return false } - for i, _tgt := range p.Annotations { - _src2 := other.Annotations[i] - if !_tgt.Equals(_src2) { return false } - } - if len(p.BinaryAnnotations) != len(other.BinaryAnnotations) { return false } - for i, _tgt := range p.BinaryAnnotations { - _src3 := other.BinaryAnnotations[i] - if !_tgt.Equals(_src3) { return false } - } - if p.Debug != other.Debug { return false } - if p.Timestamp != other.Timestamp { - if p.Timestamp == nil || other.Timestamp == nil { - return false - } - if (*p.Timestamp) != (*other.Timestamp) { return false } - } - if p.Duration != other.Duration { - if p.Duration == nil || other.Duration == nil { - return false - } - if (*p.Duration) != (*other.Duration) { return false } - } - if p.TraceIDHigh != other.TraceIDHigh { - if p.TraceIDHigh == nil || other.TraceIDHigh == nil { - return false - } - if (*p.TraceIDHigh) != (*other.TraceIDHigh) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TraceID != other.TraceID { + return false + } + if p.Name != other.Name { + return false + } + if p.ID != other.ID { + return false + } + if p.ParentID != other.ParentID { + if p.ParentID == nil || other.ParentID == nil { + return false + } + if (*p.ParentID) != (*other.ParentID) { + return false + } + } + if len(p.Annotations) != len(other.Annotations) { + return false + } + for i, _tgt := range p.Annotations { + _src2 := other.Annotations[i] + if !_tgt.Equals(_src2) { + return false + } + } + if len(p.BinaryAnnotations) != len(other.BinaryAnnotations) { + return false + } + for i, _tgt := range p.BinaryAnnotations { + _src3 := other.BinaryAnnotations[i] + if !_tgt.Equals(_src3) { + return false + } + } + if p.Debug != other.Debug { + return false + } + if p.Timestamp != other.Timestamp { + if p.Timestamp == nil || other.Timestamp == nil { + return false + } + if (*p.Timestamp) != (*other.Timestamp) { + return false + } + } + if p.Duration != other.Duration { + if p.Duration == nil || other.Duration == nil { + return false + } + if (*p.Duration) != (*other.Duration) { + return false + } + } + if p.TraceIDHigh != other.TraceIDHigh { + if p.TraceIDHigh == nil || other.TraceIDHigh == nil { + return false + } + if (*p.TraceIDHigh) != (*other.TraceIDHigh) { + return false + } + } + return true } func (p *Span) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Span(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Span(%+v)", *p) } // Attributes: -// - Ok +// - Ok type Response struct { - Ok bool `thrift:"ok,1,required" db:"ok" json:"ok"` + Ok bool `thrift:"ok,1,required" db:"ok" json:"ok"` } func NewResponse() *Response { - return &Response{} + return &Response{} } - func (p *Response) GetOk() bool { - return p.Ok + return p.Ok } func (p *Response) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOk bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOk = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOk{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Ok is not set")); - } - return nil -} - -func (p *Response) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Ok = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOk bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOk = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOk { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Ok is not set")) + } + return nil +} + +func (p *Response) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Ok = v + } + return nil } func (p *Response) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "Response"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "Response"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *Response) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "ok", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ok: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.Ok)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ok (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ok: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "ok", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ok: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.Ok)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ok (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ok: ", p), err) + } + return err } func (p *Response) Equals(other *Response) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Ok != other.Ok { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Ok != other.Ok { + return false + } + return true } func (p *Response) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("Response(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("Response(%+v)", *p) } type ZipkinCollector interface { - // Parameters: - // - Spans - SubmitZipkinBatch(ctx context.Context, spans []*Span) (_r []*Response, _err error) + // Parameters: + // - Spans + SubmitZipkinBatch(ctx context.Context, spans []*Span) (_r []*Response, _err error) } type ZipkinCollectorClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient + meta thrift.ResponseMeta } func NewZipkinCollectorClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ZipkinCollectorClient { - return &ZipkinCollectorClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + return &ZipkinCollectorClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } } func NewZipkinCollectorClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ZipkinCollectorClient { - return &ZipkinCollectorClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } + return &ZipkinCollectorClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewZipkinCollectorClient(c thrift.TClient) *ZipkinCollectorClient { - return &ZipkinCollectorClient{ - c: c, - } + return &ZipkinCollectorClient{ + c: c, + } } func (p *ZipkinCollectorClient) Client_() thrift.TClient { - return p.c + return p.c } func (p *ZipkinCollectorClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta + return p.meta } func (p *ZipkinCollectorClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + p.meta = meta } // Parameters: -// - Spans +// - Spans func (p *ZipkinCollectorClient) SubmitZipkinBatch(ctx context.Context, spans []*Span) (_r []*Response, _err error) { - var _args4 ZipkinCollectorSubmitZipkinBatchArgs - _args4.Spans = spans - var _result6 ZipkinCollectorSubmitZipkinBatchResult - var _meta5 thrift.ResponseMeta - _meta5, _err = p.Client_().Call(ctx, "submitZipkinBatch", &_args4, &_result6) - p.SetLastResponseMeta_(_meta5) - if _err != nil { - return - } - return _result6.GetSuccess(), nil + var _args4 ZipkinCollectorSubmitZipkinBatchArgs + _args4.Spans = spans + var _result6 ZipkinCollectorSubmitZipkinBatchResult + var _meta5 thrift.ResponseMeta + _meta5, _err = p.Client_().Call(ctx, "submitZipkinBatch", &_args4, &_result6) + p.SetLastResponseMeta_(_meta5) + if _err != nil { + return + } + return _result6.GetSuccess(), nil } type ZipkinCollectorProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler ZipkinCollector + processorMap map[string]thrift.TProcessorFunction + handler ZipkinCollector } func (p *ZipkinCollectorProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *ZipkinCollectorProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *ZipkinCollectorProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewZipkinCollectorProcessor(handler ZipkinCollector) *ZipkinCollectorProcessor { - self7 := &ZipkinCollectorProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self7.processorMap["submitZipkinBatch"] = &zipkinCollectorProcessorSubmitZipkinBatch{handler:handler} -return self7 + self7 := &ZipkinCollectorProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self7.processorMap["submitZipkinBatch"] = &zipkinCollectorProcessorSubmitZipkinBatch{handler: handler} + return self7 } func (p *ZipkinCollectorProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x8 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x8.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x8 + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { + return false, thrift.WrapTException(err2) + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x8 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x8.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x8 } type zipkinCollectorProcessorSubmitZipkinBatch struct { - handler ZipkinCollector + handler ZipkinCollector } func (p *zipkinCollectorProcessorSubmitZipkinBatch) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ZipkinCollectorSubmitZipkinBatchArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "submitZipkinBatch", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := ZipkinCollectorSubmitZipkinBatchResult{} - var retval []*Response - if retval, err2 = p.handler.SubmitZipkinBatch(ctx, args.Spans); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing submitZipkinBatch: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "submitZipkinBatch", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "submitZipkinBatch", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := ZipkinCollectorSubmitZipkinBatchArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "submitZipkinBatch", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := ZipkinCollectorSubmitZipkinBatchResult{} + var retval []*Response + if retval, err2 = p.handler.SubmitZipkinBatch(ctx, args.Spans); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing submitZipkinBatch: "+err2.Error()) + oprot.WriteMessageBegin(ctx, "submitZipkinBatch", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "submitZipkinBatch", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err } - // HELPER FUNCTIONS AND STRUCTURES // Attributes: -// - Spans +// - Spans type ZipkinCollectorSubmitZipkinBatchArgs struct { - Spans []*Span `thrift:"spans,1" db:"spans" json:"spans"` + Spans []*Span `thrift:"spans,1" db:"spans" json:"spans"` } func NewZipkinCollectorSubmitZipkinBatchArgs() *ZipkinCollectorSubmitZipkinBatchArgs { - return &ZipkinCollectorSubmitZipkinBatchArgs{} + return &ZipkinCollectorSubmitZipkinBatchArgs{} } - func (p *ZipkinCollectorSubmitZipkinBatchArgs) GetSpans() []*Span { - return p.Spans + return p.Spans } func (p *ZipkinCollectorSubmitZipkinBatchArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ZipkinCollectorSubmitZipkinBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Span, 0, size) - p.Spans = tSlice - for i := 0; i < size; i ++ { - _elem9 := &Span{} - if err := _elem9.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) - } - p.Spans = append(p.Spans, _elem9) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ZipkinCollectorSubmitZipkinBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Span, 0, size) + p.Spans = tSlice + for i := 0; i < size; i++ { + _elem9 := &Span{} + if err := _elem9.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Spans = append(p.Spans, _elem9) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *ZipkinCollectorSubmitZipkinBatchArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "submitZipkinBatch_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "submitZipkinBatch_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *ZipkinCollectorSubmitZipkinBatchArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "spans", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spans: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spans)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Spans { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:spans: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "spans", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spans: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spans)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spans { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:spans: ", p), err) + } + return err } func (p *ZipkinCollectorSubmitZipkinBatchArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ZipkinCollectorSubmitZipkinBatchArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("ZipkinCollectorSubmitZipkinBatchArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type ZipkinCollectorSubmitZipkinBatchResult struct { - Success []*Response `thrift:"success,0" db:"success" json:"success,omitempty"` + Success []*Response `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewZipkinCollectorSubmitZipkinBatchResult() *ZipkinCollectorSubmitZipkinBatchResult { - return &ZipkinCollectorSubmitZipkinBatchResult{} + return &ZipkinCollectorSubmitZipkinBatchResult{} } var ZipkinCollectorSubmitZipkinBatchResult_Success_DEFAULT []*Response func (p *ZipkinCollectorSubmitZipkinBatchResult) GetSuccess() []*Response { - return p.Success + return p.Success } func (p *ZipkinCollectorSubmitZipkinBatchResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *ZipkinCollectorSubmitZipkinBatchResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.LIST { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ZipkinCollectorSubmitZipkinBatchResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Response, 0, size) - p.Success = tSlice - for i := 0; i < size; i ++ { - _elem10 := &Response{} - if err := _elem10.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) - } - p.Success = append(p.Success, _elem10) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.LIST { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ZipkinCollectorSubmitZipkinBatchResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Response, 0, size) + p.Success = tSlice + for i := 0; i < size; i++ { + _elem10 := &Response{} + if err := _elem10.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.Success = append(p.Success, _elem10) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *ZipkinCollectorSubmitZipkinBatchResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "submitZipkinBatch_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "submitZipkinBatch_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *ZipkinCollectorSubmitZipkinBatchResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Success { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Success { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *ZipkinCollectorSubmitZipkinBatchResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ZipkinCollectorSubmitZipkinBatchResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("ZipkinCollectorSubmitZipkinBatchResult(%+v)", *p) } - - From 0911e9a946a3eb7c058288495404fef3c23975ba Mon Sep 17 00:00:00 2001 From: alejandrodnm Date: Thu, 15 Sep 2022 21:12:34 +0200 Subject: [PATCH 38/87] Give each span a unique ID in large span test (#3913) To make the test simulate a more realistic scenario, each span in the `loadParseAndWriteLargeTrace` test will have a unique spanID instead of having all the spans be the same. Signed-off-by: Alejandro Do Nascimento Mora Signed-off-by: Alejandro Do Nascimento Mora --- plugin/storage/integration/integration_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/storage/integration/integration_test.go b/plugin/storage/integration/integration_test.go index 87634eb993d..ec1b656daac 100644 --- a/plugin/storage/integration/integration_test.go +++ b/plugin/storage/integration/integration_test.go @@ -277,6 +277,7 @@ func (s *StorageIntegration) loadParseAndWriteLargeTrace(t *testing.T) *model.Tr for i := 1; i < 10008; i++ { s := new(model.Span) *s = *span + s.SpanID = model.SpanID(i) s.StartTime = s.StartTime.Add(time.Second * time.Duration(i+1)) trace.Spans = append(trace.Spans, s) } From cac21f82950545b613f45d3984d96e1498bfd15d Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Fri, 16 Sep 2022 16:25:43 +0200 Subject: [PATCH 39/87] Prepare release v1.38.0 (#3914) --- CHANGELOG.md | 22 ++++++++++++++++++++++ jaeger-ui | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fcc4dec465..83eb4c93f0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,28 @@ next release ### UI Changes +1.38.0 (2022-09-16) +------------------- +### Backend Changes + +#### Breaking Changes + +#### New Features + +#### Bug fixes, Minor Improvements + +* fix: jaeger-agent sampling endpoint returns backwards incompatible JSON ([@vprithvi](https://github.com/vprithvi) in [#3897](https://github.com/jaegertracing/jaeger/pull/3897)) +* fix: streaming span writer is not working in grpc based remote storage plugin ([@arajkumar](https://github.com/arajkumar) in [#3887](https://github.com/jaegertracing/jaeger/pull/3887)) +* Fix race condition when adding collector tags ([@yurishkuro](https://github.com/yurishkuro) in [#3886](https://github.com/jaegertracing/jaeger/pull/3886)) +* Change build info date to commit timestamp ([@TripleDogDare](https://github.com/TripleDogDare) in [#3876](https://github.com/jaegertracing/jaeger/pull/3876)) +* Add 🚗 ([@yurishkuro](https://github.com/yurishkuro) in [55a8ca9](https://github.com/jaegertracing/jaeger/commit/55a8ca97e3772579b395ffbe4b937a4f5993b008)) +* Add AdditionalDialOptions to ConnBuilder ([@vprithvi](https://github.com/vprithvi) in [#3865](https://github.com/jaegertracing/jaeger/pull/3865)) +* Add sample docker-compose configuration using Kafka ([@yurishkuro](https://github.com/yurishkuro) in [7006e9f](https://github.com/jaegertracing/jaeger/commit/7006e9fe50c8467ad6b84f2072a3cf136bfbe4ec)) + +### UI Changes + +* UI pinned to version [1.27.0 - see the changelog](https://github.com/jaegertracing/jaeger-ui/blob/main/CHANGELOG.md#v1270-2022-09-15). + 1.37.0 (2022-08-03) ------------------- ### Backend Changes diff --git a/jaeger-ui b/jaeger-ui index d69509b8bc2..e197d1c8d36 160000 --- a/jaeger-ui +++ b/jaeger-ui @@ -1 +1 @@ -Subproject commit d69509b8bc2635b5b9dd536b66fc634060ad54fb +Subproject commit e197d1c8d36a73616620c2b4d55d18f4a017a188 From 7a382426dd6fd2bd43d1bc931f17f5e961755c4b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 10:36:26 -0400 Subject: [PATCH 40/87] Bump codecov/codecov-action from 3.1.0 to 3.1.1 (#3917) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index c85c57e6c6f..4217f2b4b73 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -24,7 +24,7 @@ jobs: run: make test-ci - name: Upload coverage to codecov - uses: codecov/codecov-action@v3.1.0 + uses: codecov/codecov-action@v3.1.1 with: file: cover.out fail_ci_if_error: true From b79086065998de828b318a301ae94660d22e43fc Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 27 Sep 2022 11:02:56 -0400 Subject: [PATCH 41/87] Bump golang.org/x/net to 2022-09-26 (#3927) --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a9a27f0ce86..91f8539f7e7 100644 --- a/go.mod +++ b/go.mod @@ -54,8 +54,8 @@ require ( go.uber.org/atomic v1.9.0 go.uber.org/automaxprocs v1.5.1 go.uber.org/zap v1.22.0 - golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a + golang.org/x/net v0.0.0-20220926192436-02166a98028e + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 063ac3b2213..0b6296bf128 100644 --- a/go.sum +++ b/go.sum @@ -790,6 +790,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220926192436-02166a98028e h1:I51lVG9ykW5AQeTE50sJ0+gJCAF0J78Hf1+1VUCGxDI= +golang.org/x/net v0.0.0-20220926192436-02166a98028e/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -881,6 +883,8 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= From 57ac89e24dd5eec97b8135c1f1b26ce8cf8ed513 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 27 Sep 2022 12:03:39 -0400 Subject: [PATCH 42/87] Bump OTEL dependencies => v0.60.0 and grpc => v1.49.0 (#3928) --- cmd/agent/app/reporter/client_metrics.go | 2 +- go.mod | 24 ++-- go.sum | 116 +++++++++++++----- .../storage/grpc/shared/streaming_writer.go | 2 +- 4 files changed, 100 insertions(+), 44 deletions(-) diff --git a/cmd/agent/app/reporter/client_metrics.go b/cmd/agent/app/reporter/client_metrics.go index 1bfd8d82101..63c90028dd2 100644 --- a/cmd/agent/app/reporter/client_metrics.go +++ b/cmd/agent/app/reporter/client_metrics.go @@ -123,7 +123,7 @@ func (r *ClientMetricsReporter) EmitBatch(ctx context.Context, batch *jaeger.Bat // Close stops background gc goroutine for client stats map. func (r *ClientMetricsReporter) Close() error { - if r.closed.CAS(false, true) { + if r.closed.CompareAndSwap(false, true) { close(r.shutdown) } return nil diff --git a/go.mod b/go.mod index 91f8539f7e7..91e16fd3fe8 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/hashicorp/go-plugin v1.4.4 github.com/kr/pretty v0.3.0 github.com/olivere/elastic v6.2.37+incompatible - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.57.2 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.60.0 github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 @@ -47,16 +47,16 @@ require ( github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/uber/jaeger-lib v2.4.1+incompatible github.com/xdg-go/scram v1.1.1 - go.opentelemetry.io/collector v0.57.2 - go.opentelemetry.io/collector/pdata v0.57.2 - go.opentelemetry.io/collector/semconv v0.57.2 + go.opentelemetry.io/collector v0.60.0 + go.opentelemetry.io/collector/pdata v0.60.0 + go.opentelemetry.io/collector/semconv v0.60.0 go.opentelemetry.io/otel v1.9.0 - go.uber.org/atomic v1.9.0 + go.uber.org/atomic v1.10.0 go.uber.org/automaxprocs v1.5.1 - go.uber.org/zap v1.22.0 + go.uber.org/zap v1.23.0 golang.org/x/net v0.0.0-20220926192436-02166a98028e - golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 - google.golang.org/grpc v1.48.0 + golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 + google.golang.org/grpc v1.49.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 ) @@ -99,7 +99,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.15.9 // indirect - github.com/knadh/koanf v1.4.2 // indirect + github.com/knadh/koanf v1.4.3 // indirect github.com/kr/text v0.2.0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -117,7 +117,7 @@ require ( github.com/oklog/ulid v1.3.1 // indirect github.com/onsi/ginkgo v1.16.4 // indirect github.com/onsi/gomega v1.13.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.57.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.60.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect @@ -136,8 +136,8 @@ require ( github.com/xdg-go/stringprep v1.0.3 // indirect go.mongodb.org/mongo-driver v1.10.0 // indirect go.opencensus.io v0.23.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 // indirect go.opentelemetry.io/otel/metric v0.31.0 // indirect go.opentelemetry.io/otel/trace v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect diff --git a/go.sum b/go.sum index 0b6296bf128..a9b51ad391d 100644 --- a/go.sum +++ b/go.sum @@ -61,9 +61,11 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= @@ -111,6 +113,8 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= @@ -141,10 +145,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= @@ -243,6 +249,7 @@ github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/V github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gocql/gocql v0.0.0-20211222173705-d73e6b1002a7 h1:jmIMM+nEO+vjz9xaRIg9sZNtNLq5nsSbsxwe1OtRwv4= github.com/gocql/gocql v0.0.0-20211222173705-d73e6b1002a7/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -303,7 +310,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -333,27 +340,36 @@ github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+ github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= +github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.4.4 h1:NVdrSdFRt3SkZtNckJ6tog7gbpRrcbOjQi/rgF7JYWQ= github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= @@ -363,12 +379,18 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d h1:W+SIwDdl3+jXWeidYySAgzytE3piq6GumXeBjFBG67c= github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= +github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -414,14 +436,15 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= -github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= +github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= +github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -440,16 +463,24 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -458,6 +489,7 @@ github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go. github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -501,10 +533,10 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.57.2 h1:4HeNNbZnqz15hj4oGm1O1x+yP+hPnvhz2UYqrApvPDk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.57.2/go.mod h1:xPchY5YNOL9jr6phVkJEvkEakMYr8HMD4uGYEoKXIek= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.57.2 h1:6aMr+4kCgzJKBpWwZwPGzKfdn0ujXObJC9Rhkg+ak1s= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.57.2/go.mod h1:4rFuWKMbzM9H39RbDvPtJfAp/fxsHydhJhKns6skmK0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.60.0 h1:L5ug/ZKhVnyh1Bmygph/6dKS32VhsJeb7ggYbEV9EmY= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.60.0/go.mod h1:XJ02iUcUxcP94hMUkwofboLNoUHKkrb/yb1S/cNL/Nk= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.60.0 h1:feBvT8nabr8Vwei77KM5EhqMTK3Mg7Y2jnpD5hClOz4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.60.0/go.mod h1:OY9IjYAKm7WoKB8MZi2IsOqkaKIEIBXRvrckfmREuvw= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df h1:vdYtBU6zvL7v+Tr+0xFM/qhahw/EvY8DMMunZHKH6eE= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= @@ -512,6 +544,7 @@ github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NH github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= @@ -531,11 +564,13 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= @@ -573,8 +608,10 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -645,6 +682,10 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= +go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= @@ -658,43 +699,46 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/collector v0.57.2 h1:/J7twI5BlIK3I4GfDfLhqPgfgSjnhiDesXf24bmrXYM= -go.opentelemetry.io/collector v0.57.2/go.mod h1:9TwWyMRhbFNzaaGLtm/6poWNDJw+etvQMS6Fy+8/8Xs= -go.opentelemetry.io/collector/pdata v0.57.2 h1:w2w3NE7/3WzHloT1xV5caRmifV3qt95gc5iJhO/Bues= -go.opentelemetry.io/collector/pdata v0.57.2/go.mod h1:RU9I8lwBUxucwOsSYzHEcHi15M9QaX78hgQ2PRdSxV0= -go.opentelemetry.io/collector/semconv v0.57.2 h1:+lcI4yi8xUzoSNZgGTs0vytZcEAH95Tb33Ig+gooBV8= -go.opentelemetry.io/collector/semconv v0.57.2/go.mod h1:84YnUjmm+nhGu4YTDLnHCbxnL74ooWpismPG79tFD7w= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0 h1:Z0lVKLXU+jxGf3ANoh+UWx9Ai5bjpQVnZXI1zEzvqS0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.33.0/go.mod h1:U5rUt7Rw6zuORsWNfpMRy8XMNKLrmIlv/4HgLVW/d5M= +go.opentelemetry.io/collector v0.60.0 h1:rHndW/xILGjNoFaYIvwYpngZnRWw1oQT6GLtzxIs7pw= +go.opentelemetry.io/collector v0.60.0/go.mod h1:n2KBSgs7AakuedVxLR/Tayl3EEztmngrrjZBsYS+qBI= +go.opentelemetry.io/collector/pdata v0.60.0 h1:jCNR5jtUom2FcUu30h4tw7enZytwGnXX6fs/K2FM/A0= +go.opentelemetry.io/collector/pdata v0.60.0/go.mod h1:0hqgNMRneVXaLNelv3q0XKJbyBW9aMDwyC15pKd30+E= +go.opentelemetry.io/collector/semconv v0.60.0 h1:xy6HSukzA5CC8SR4DvFyLd28EFEOnQgxtpU1bSCM0qY= +go.opentelemetry.io/collector/semconv v0.60.0/go.mod h1:aRkHuJ/OshtDFYluKEtnG5nkKTsy1HZuvZVHmakx+Vo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 h1:PNEMW4EvpNQ7SuoPFNkvbZqi1STkTPKq+8vfoMl/6AE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 h1:9NkMW03wwEzPtP/KciZ4Ozu/Uz5ZA7kfqXJIObnrjGU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0/go.mod h1:548ZsYzmT4PL4zWKRd8q/N4z0Wxzn/ZxUE+lkEpwWQA= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= -go.opentelemetry.io/otel/sdk v1.8.0 h1:xwu69/fNuwbSHWe/0PGS888RmjWY181OmcXDQKu7ZQk= +go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= -go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -733,6 +777,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -743,6 +788,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -759,6 +805,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -782,14 +829,13 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220926192436-02166a98028e h1:I51lVG9ykW5AQeTE50sJ0+gJCAF0J78Hf1+1VUCGxDI= golang.org/x/net v0.0.0-20220926192436-02166a98028e/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -824,6 +870,7 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -836,8 +883,11 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -846,6 +896,7 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -868,7 +919,9 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -881,10 +934,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 h1:v1W7bwXHsnLLloWYTVEdvGvA7BHMeBYsPcF0GLDxIRs= +golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -921,6 +972,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -958,6 +1010,7 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1033,6 +1086,7 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1056,10 +1110,11 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1120,3 +1175,4 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/plugin/storage/grpc/shared/streaming_writer.go b/plugin/storage/grpc/shared/streaming_writer.go index 9f01f1de68c..b08db32a9f0 100644 --- a/plugin/storage/grpc/shared/streaming_writer.go +++ b/plugin/storage/grpc/shared/streaming_writer.go @@ -62,7 +62,7 @@ func (s *streamingSpanWriter) WriteSpan(ctx context.Context, span *model.Span) e } func (s *streamingSpanWriter) Close() error { - if !s.closed.CAS(false, true) { + if !s.closed.CompareAndSwap(false, true) { return errors.New("already closed") } close(s.streamPool) From 35cc9910d64bf713c7562c42f3c4f1c2348bbe20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 16:37:14 +0000 Subject: [PATCH 43/87] Bump github.com/spf13/viper from 1.12.0 to 1.13.0 (#3931) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.12.0 to 1.13.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.12.0...v1.13.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yuri Shkuro --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 91e16fd3fe8..d5d7608b8a2 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/soheilhy/cmux v0.1.5 github.com/spf13/cobra v1.5.0 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.12.0 + github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.0 github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/uber/jaeger-lib v2.4.1+incompatible @@ -119,7 +119,7 @@ require ( github.com/onsi/gomega v1.13.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.60.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -131,7 +131,7 @@ require ( github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/stretchr/objx v0.4.0 // indirect - github.com/subosito/gotenv v1.3.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/stringprep v1.0.3 // indirect go.mongodb.org/mongo-driver v1.10.0 // indirect @@ -145,6 +145,6 @@ require ( golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.66.4 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a9b51ad391d..b90a9b9ec95 100644 --- a/go.sum +++ b/go.sum @@ -550,8 +550,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -641,8 +641,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= @@ -657,8 +657,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= @@ -1143,8 +1143,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= -gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= From 409ed25e4c89e19ee5471c5e3626fa2f4b79f1c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 17:05:57 +0000 Subject: [PATCH 44/87] Bump github.com/hashicorp/go-plugin from 1.4.4 to 1.4.5 (#3930) Bumps [github.com/hashicorp/go-plugin](https://github.com/hashicorp/go-plugin) from 1.4.4 to 1.4.5. - [Release notes](https://github.com/hashicorp/go-plugin/releases) - [Changelog](https://github.com/hashicorp/go-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-plugin/compare/v1.4.4...v1.4.5) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d5d7608b8a2..b273df7faa7 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 github.com/hashicorp/go-hclog v1.2.2 - github.com/hashicorp/go-plugin v1.4.4 + github.com/hashicorp/go-plugin v1.4.5 github.com/kr/pretty v0.3.0 github.com/olivere/elastic v6.2.37+incompatible github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.60.0 diff --git a/go.sum b/go.sum index b90a9b9ec95..34beea534b5 100644 --- a/go.sum +++ b/go.sum @@ -362,8 +362,8 @@ github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-plugin v1.4.4 h1:NVdrSdFRt3SkZtNckJ6tog7gbpRrcbOjQi/rgF7JYWQ= -github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-plugin v1.4.5 h1:oTE/oQR4eghggRg8VY7PAz3dr++VwDNBGCcOfIvHpBo= +github.com/hashicorp/go-plugin v1.4.5/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= From 6d45f49eb42ba4cbdcecbec4969d473f7aded8d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 17:26:49 +0000 Subject: [PATCH 45/87] Bump go.opentelemetry.io/otel from 1.9.0 to 1.10.0 (#3932) Bumps [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index b273df7faa7..5dce29bf01f 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( go.opentelemetry.io/collector v0.60.0 go.opentelemetry.io/collector/pdata v0.60.0 go.opentelemetry.io/collector/semconv v0.60.0 - go.opentelemetry.io/otel v1.9.0 + go.opentelemetry.io/otel v1.10.0 go.uber.org/atomic v1.10.0 go.uber.org/automaxprocs v1.5.1 go.uber.org/zap v1.23.0 @@ -139,7 +139,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 // indirect go.opentelemetry.io/otel/metric v0.31.0 // indirect - go.opentelemetry.io/otel/trace v1.9.0 // indirect + go.opentelemetry.io/otel/trace v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/text v0.3.7 // indirect diff --git a/go.sum b/go.sum index 34beea534b5..d6e02925572 100644 --- a/go.sum +++ b/go.sum @@ -709,13 +709,13 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.3 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 h1:9NkMW03wwEzPtP/KciZ4Ozu/Uz5ZA7kfqXJIObnrjGU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0/go.mod h1:548ZsYzmT4PL4zWKRd8q/N4z0Wxzn/ZxUE+lkEpwWQA= -go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= -go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= +go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= +go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= -go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= -go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= +go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= +go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= From 15517116aedfbc88f51c210d04ab57cfaedb82a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 17:56:26 +0000 Subject: [PATCH 46/87] Bump github.com/hashicorp/go-hclog from 1.2.2 to 1.3.1 (#3934) Bumps [github.com/hashicorp/go-hclog](https://github.com/hashicorp/go-hclog) from 1.2.2 to 1.3.1. - [Release notes](https://github.com/hashicorp/go-hclog/releases) - [Commits](https://github.com/hashicorp/go-hclog/compare/v1.2.2...v1.3.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-hclog dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5dce29bf01f..db6f0340cfe 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 - github.com/hashicorp/go-hclog v1.2.2 + github.com/hashicorp/go-hclog v1.3.1 github.com/hashicorp/go-plugin v1.4.5 github.com/kr/pretty v0.3.0 github.com/olivere/elastic v6.2.37+incompatible diff --git a/go.sum b/go.sum index d6e02925572..7db299718cc 100644 --- a/go.sum +++ b/go.sum @@ -355,8 +355,8 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.2 h1:ihRI7YFwcZdiSD7SIenIhHfQH3OuDvWerAUBZbeQS3M= -github.com/hashicorp/go-hclog v1.2.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo= +github.com/hashicorp/go-hclog v1.3.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= From e877a61926a3f7bc1a5f5ba6b9fceb78bcb8b71d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 16:47:09 -0400 Subject: [PATCH 47/87] Bump github.com/apache/thrift from 0.16.0 to 0.17.0 (#3936) Bumps [github.com/apache/thrift](https://github.com/apache/thrift) from 0.16.0 to 0.17.0. - [Release notes](https://github.com/apache/thrift/releases) - [Changelog](https://github.com/apache/thrift/blob/master/CHANGES.md) - [Commits](https://github.com/apache/thrift/compare/v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: github.com/apache/thrift dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index db6f0340cfe..8d00934a6e2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/HdrHistogram/hdrhistogram-go v1.1.2 github.com/Shopify/sarama v1.32.0 - github.com/apache/thrift v0.16.0 + github.com/apache/thrift v0.17.0 github.com/bsm/sarama-cluster v2.1.13+incompatible github.com/crossdock/crossdock-go v0.0.0-20160816171116-049aabb0122b github.com/dgraph-io/badger/v3 v3.2103.2 diff --git a/go.sum b/go.sum index 7db299718cc..46918bff51a 100644 --- a/go.sum +++ b/go.sum @@ -59,8 +59,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY= -github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/apache/thrift v0.17.0 h1:cMd2aj52n+8VoAtvSvLn4kDC3aZ6IAkBuqWQ2IDu7wo= +github.com/apache/thrift v0.17.0/go.mod h1:OLxhMRJxomX+1I/KUw03qoV3mMz16BwaKI+d4fPBx7Q= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -271,7 +271,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= From 4fc291568d8ac59a1c67cc47ee1d91ab20dd06c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 01:28:27 -0400 Subject: [PATCH 48/87] Bump github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger (#3939) Bumps [github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger](https://github.com/open-telemetry/opentelemetry-collector-contrib) from 0.60.0 to 0.61.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/v0.60.0...v0.61.0) --- updated-dependencies: - dependency-name: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 20 ++++++++++---------- go.sum | 46 +++++++++++++++++++++------------------------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/go.mod b/go.mod index 8d00934a6e2..6e662621cca 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/hashicorp/go-plugin v1.4.5 github.com/kr/pretty v0.3.0 github.com/olivere/elastic v6.2.37+incompatible - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.60.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.61.0 github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 @@ -47,9 +47,9 @@ require ( github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/uber/jaeger-lib v2.4.1+incompatible github.com/xdg-go/scram v1.1.1 - go.opentelemetry.io/collector v0.60.0 - go.opentelemetry.io/collector/pdata v0.60.0 - go.opentelemetry.io/collector/semconv v0.60.0 + go.opentelemetry.io/collector v0.61.0 + go.opentelemetry.io/collector/pdata v0.61.0 + go.opentelemetry.io/collector/semconv v0.61.0 go.opentelemetry.io/otel v1.10.0 go.uber.org/atomic v1.10.0 go.uber.org/automaxprocs v1.5.1 @@ -98,7 +98,7 @@ require ( github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.9 // indirect + github.com/klauspost/compress v1.15.10 // indirect github.com/knadh/koanf v1.4.3 // indirect github.com/kr/text v0.2.0 // indirect github.com/magiconair/properties v1.8.6 // indirect @@ -117,7 +117,7 @@ require ( github.com/oklog/ulid v1.3.1 // indirect github.com/onsi/ginkgo v1.16.4 // indirect github.com/onsi/gomega v1.13.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.60.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.61.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect @@ -136,14 +136,14 @@ require ( github.com/xdg-go/stringprep v1.0.3 // indirect go.mongodb.org/mongo-driver v1.10.0 // indirect go.opencensus.io v0.23.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 // indirect - go.opentelemetry.io/otel/metric v0.31.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.0 // indirect + go.opentelemetry.io/otel/metric v0.32.1 // indirect go.opentelemetry.io/otel/trace v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect + google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 46918bff51a..4c18f760ca6 100644 --- a/go.sum +++ b/go.sum @@ -108,7 +108,6 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -147,7 +146,6 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -433,8 +431,9 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo= +github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -532,10 +531,10 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.60.0 h1:L5ug/ZKhVnyh1Bmygph/6dKS32VhsJeb7ggYbEV9EmY= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.60.0/go.mod h1:XJ02iUcUxcP94hMUkwofboLNoUHKkrb/yb1S/cNL/Nk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.60.0 h1:feBvT8nabr8Vwei77KM5EhqMTK3Mg7Y2jnpD5hClOz4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.60.0/go.mod h1:OY9IjYAKm7WoKB8MZi2IsOqkaKIEIBXRvrckfmREuvw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.61.0 h1:BRyqjFUrLwxHgccEbi0sgT+koQXsm+RAOqeebRmfSTM= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.61.0/go.mod h1:gGprfSuPLNWQlYQTinPY4joqsjXAYO5RCEwkOeSCMrk= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.61.0 h1:h4+P5auBCyCYinZSwgl4hJtDr/VL08s9iPmTaWriXkU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.61.0/go.mod h1:qxWGU2qCEulGmmGsiq7jy3hWgTDyHtRQGeU6XuYGL7Q= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df h1:vdYtBU6zvL7v+Tr+0xFM/qhahw/EvY8DMMunZHKH6eE= github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= @@ -698,21 +697,21 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/collector v0.60.0 h1:rHndW/xILGjNoFaYIvwYpngZnRWw1oQT6GLtzxIs7pw= -go.opentelemetry.io/collector v0.60.0/go.mod h1:n2KBSgs7AakuedVxLR/Tayl3EEztmngrrjZBsYS+qBI= -go.opentelemetry.io/collector/pdata v0.60.0 h1:jCNR5jtUom2FcUu30h4tw7enZytwGnXX6fs/K2FM/A0= -go.opentelemetry.io/collector/pdata v0.60.0/go.mod h1:0hqgNMRneVXaLNelv3q0XKJbyBW9aMDwyC15pKd30+E= -go.opentelemetry.io/collector/semconv v0.60.0 h1:xy6HSukzA5CC8SR4DvFyLd28EFEOnQgxtpU1bSCM0qY= -go.opentelemetry.io/collector/semconv v0.60.0/go.mod h1:aRkHuJ/OshtDFYluKEtnG5nkKTsy1HZuvZVHmakx+Vo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 h1:PNEMW4EvpNQ7SuoPFNkvbZqi1STkTPKq+8vfoMl/6AE= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0 h1:9NkMW03wwEzPtP/KciZ4Ozu/Uz5ZA7kfqXJIObnrjGU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0/go.mod h1:548ZsYzmT4PL4zWKRd8q/N4z0Wxzn/ZxUE+lkEpwWQA= +go.opentelemetry.io/collector v0.61.0 h1:lvuhmlskup6Z3AfQKZwuRk43jRClB+1FkwjGXRoxhfs= +go.opentelemetry.io/collector v0.61.0/go.mod h1:515eomlUIwLEXTBwLAEEtl2HPreJy5xtv//LYMk/SZE= +go.opentelemetry.io/collector/pdata v0.61.0 h1:jPUReUpR/D1xsigfRxyXA7cYMnXfnK+D7z61W6F9moo= +go.opentelemetry.io/collector/pdata v0.61.0/go.mod h1:0hqgNMRneVXaLNelv3q0XKJbyBW9aMDwyC15pKd30+E= +go.opentelemetry.io/collector/semconv v0.61.0 h1:RMrzDugNuFsUjppvvNZWiWcNneogZ3Zo4idWyIUWR9k= +go.opentelemetry.io/collector/semconv v0.61.0/go.mod h1:aRkHuJ/OshtDFYluKEtnG5nkKTsy1HZuvZVHmakx+Vo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0 h1:+jrwcA4gF8tIZmdKWgTUysKtYW2VIzywjkfgd/5OPEM= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.0/go.mod h1:h8TWwRAhQpOd0aM5nYsRD8+flnkj+526GEIVlarH7eY= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.0 h1:qZ3KzA4qPzLBDtQyPk4ydjlg8zvXbNysnFHaVMKJbVo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.0/go.mod h1:14Oo79mRwusSI02L0EfG3Gp1uF3+1wSL+D4zDysxyqs= go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= -go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= -go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A= -go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= +go.opentelemetry.io/otel/metric v0.32.1 h1:ftff5LSBCIDwL0UkhBuDg8j9NNxx2IusvJ18q9h6RC4= +go.opentelemetry.io/otel/metric v0.32.1/go.mod h1:iLPP7FaKMAD5BIxJ2VX7f2KTuz//0QK2hEUyti5psqQ= +go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -1086,8 +1085,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc h1:Nf+EdcTLHR8qDNN/KfkQL0u0ssxt9OhbaWCl5C0ucEI= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1111,7 +1110,6 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1126,8 +1124,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= From a68500a5ce475719ce301f9b826ff8eed056c4e6 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 4 Oct 2022 19:34:09 -0400 Subject: [PATCH 49/87] Delete unnecessary .nocover (#3945) The package already has 100% test coverage Signed-off-by: Yuri Shkuro Signed-off-by: Yuri Shkuro --- plugin/storage/es/mappings/.nocover | 1 - 1 file changed, 1 deletion(-) delete mode 100644 plugin/storage/es/mappings/.nocover diff --git a/plugin/storage/es/mappings/.nocover b/plugin/storage/es/mappings/.nocover deleted file mode 100644 index d8260a0a9a7..00000000000 --- a/plugin/storage/es/mappings/.nocover +++ /dev/null @@ -1 +0,0 @@ -statik package hosts auto-generated files. From e3bbf7ede120bc80dd8594295ac4797aa6ea55fb Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 4 Oct 2022 20:25:31 -0400 Subject: [PATCH 50/87] Prepare release 1.38.1 (#3946) --- CHANGELOG.md | 71 +++++++++++++++++++++++++++++----------------------- RELEASE.md | 8 +++--- jaeger-ui | 2 +- 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83eb4c93f0b..b2ef6562fc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ next release ------------------- ### Backend Changes -#### Breaking Changes +#### ⛔ Breaking Changes #### New Features @@ -13,13 +13,30 @@ next release ### UI Changes -1.38.0 (2022-09-16) +1.38.1 (2022-10-04) ------------------- ### Backend Changes -#### Breaking Changes +#### Bug fixes, Minor Improvements -#### New Features +* Bump github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger ([@dependabot[bot]](https://github.com/apps/dependabot) in [#3939](https://github.com/jaegertracing/jaeger/pull/3939)) +* Bump github.com/apache/thrift from 0.16.0 to 0.17.0 ([@dependabot[bot]](https://github.com/apps/dependabot) in [#3936](https://github.com/jaegertracing/jaeger/pull/3936)) +* Bump github.com/hashicorp/go-hclog from 1.2.2 to 1.3.1 ([@dependabot[bot]](https://github.com/apps/dependabot) in [#3934](https://github.com/jaegertracing/jaeger/pull/3934)) +* Bump go.opentelemetry.io/otel from 1.9.0 to 1.10.0 ([@dependabot[bot]](https://github.com/apps/dependabot) in [#3932](https://github.com/jaegertracing/jaeger/pull/3932)) +* Bump github.com/hashicorp/go-plugin from 1.4.4 to 1.4.5 ([@dependabot[bot]](https://github.com/apps/dependabot) in [#3930](https://github.com/jaegertracing/jaeger/pull/3930)) +* Bump github.com/spf13/viper from 1.12.0 to 1.13.0 ([@dependabot[bot]](https://github.com/apps/dependabot) in [#3931](https://github.com/jaegertracing/jaeger/pull/3931)) +* Bump OTEL dependencies => v0.60.0 and grpc => v1.49.0 ([@yurishkuro](https://github.com/yurishkuro) in [#3928](https://github.com/jaegertracing/jaeger/pull/3928)) +* Bump golang.org/x/net to 2022-09-26 ([@yurishkuro](https://github.com/yurishkuro) in [#3927](https://github.com/jaegertracing/jaeger/pull/3927)) +* Bump codecov/codecov-action from 3.1.0 to 3.1.1 ([@dependabot[bot]](https://github.com/apps/dependabot) in [#3917](https://github.com/jaegertracing/jaeger/pull/3917)) + +### UI Changes + +* UI pinned to version [1.27.1](https://github.com/jaegertracing/jaeger-ui/blob/main/CHANGELOG.md#v1271-2022-10-04) to bump dependencies. + + +1.38.0 (2022-09-16) +------------------- +### Backend Changes #### Bug fixes, Minor Improvements @@ -55,8 +72,6 @@ next release ------------------- ### Backend Changes -#### Breaking Changes - #### New Features * Add flag to enable span size metrics reporting ([@ymtdzzz](https://github.com/ymtdzzz) in [#3782](https://github.com/jaegertracing/jaeger/pull/3782)) * Span size metrics are enabled via the `--collector.enable-span-size-metrics` flag (even if `--collector.queue-size-memory` is disabled). @@ -222,7 +237,7 @@ next release ------------------- ### Backend Changes -#### Breaking Changes +#### ⛔ Breaking Changes * Remove deprecated `--badger.truncate` CLI flag ([@yurishkuro](https://github.com/yurishkuro) in [#3410](https://github.com/jaegertracing/jaeger/pull/3410)) @@ -333,7 +348,7 @@ next release ------------------- ### Backend Changes -#### Breaking Changes +#### ⛔ Breaking Changes * Upgrade Badger from v1.6.2 to v3.2103.0 ([#3096](https://github.com/jaegertracing/jaeger/pull/3096), [@Ashmita152](https://github.com/Ashmita152)): * Deprecated `--badger.truncate` flag. @@ -363,7 +378,7 @@ next release #### New Features -#### Breaking Changes +#### ⛔ Breaking Changes * Remove unused `--es-archive.max-span-age` flag ([#2865](https://github.com/jaegertracing/jaeger/pull/2865), [@albertteoh](https://github.com/albertteoh)): @@ -391,7 +406,7 @@ next release ### Backend Changes -#### Breaking Changes +#### ⛔ Breaking Changes * Remove deprecated TLS flags ([#2790](https://github.com/jaegertracing/jaeger/issues/2790), [@albertteoh](https://github.com/albertteoh)): * `--cassandra.tls` is replaced by `--cassandra.tls.enabled` @@ -514,7 +529,7 @@ next release ### Backend Changes -#### Breaking Changes +#### ⛔ Breaking Changes * Configurable ES doc count ([#2453](https://github.com/jaegertracing/jaeger/pull/2453), [@albertteoh](https://github.com/albertteoh)) The `--es.max-num-spans` flag has been deprecated in favour of `--es.max-doc-count`. @@ -639,7 +654,7 @@ The pull request [#2297](https://github.com/jaegertracing/jaeger/pull/2297) aime * CVE-2020-10750: jaegertracing/jaeger: credentials leaked to container logs ([@chlunde](https://github.com/chlunde)) -#### Breaking Changes +#### ⛔ Breaking Changes #### New Features * Add ppc64le support ([#2293](https://github.com/jaegertracing/jaeger/pull/2293), [@Siddhesh-Ghadi](https://github.com/Siddhesh-Ghadi)) @@ -666,7 +681,7 @@ The pull request [#2297](https://github.com/jaegertracing/jaeger/pull/2297) aime ### Backend Changes -#### Breaking Changes +#### ⛔ Breaking Changes * Remove Tchannel between agent and collector ([#2115](https://github.com/jaegertracing/jaeger/pull/2115), [#2112](https://github.com/jaegertracing/jaeger/pull/2112), [@pavolloffay](https://github.com/pavolloffay)) @@ -796,7 +811,7 @@ The pull request [#2297](https://github.com/jaegertracing/jaeger/pull/2297) aime ### Backend Changes -#### Breaking Changes +#### ⛔ Breaking Changes ##### List of service operations can be classified by span kinds ([#1943](https://github.com/jaegertracing/jaeger/pull/1943), [#1942](https://github.com/jaegertracing/jaeger/pull/1942), [#1937](https://github.com/jaegertracing/jaeger/pull/1937), [@guo0693](https://github.com/guo0693)) @@ -917,7 +932,7 @@ running curator would immediately remove the old index. #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes * The default value for the Ingester's flag `ingester.deadlockInterval` has been changed to `0` ([#1868](https://github.com/jaegertracing/jaeger/pull/1868), [@jpkrohling](https://github.com/jpkrohling)) @@ -955,7 +970,7 @@ running curator would immediately remove the old index. #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes * Create ES index templates instead of indices ([#1627](https://github.com/jaegertracing/jaeger/pull/1627), [@pavolloffay](https://github.com/pavolloffay)) @@ -1014,10 +1029,6 @@ running curator would immediately remove the old index. #### Backend Changes -##### Breaking Changes - -##### New Features - ##### Bug fixes, Minor Improvements * Change default for bearer-token-propagation to false ([#1642](https://github.com/jaegertracing/jaeger/pull/1642), [@wsoula](https://github.com/wsoula)) @@ -1029,7 +1040,7 @@ running curator would immediately remove the old index. #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes * The traces related metrics on collector now have a new tag `sampler_type` ([#1576](https://github.com/jaegertracing/jaeger/pull/1576), [@guanw](https://github.com/guanw)) @@ -1075,7 +1086,7 @@ running curator would immediately remove the old index. #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes - The `kafka` flags were removed in favor of `kafka.producer` and `kafka.consumer` flags ([#1424](https://github.com/jaegertracing/jaeger/pull/1424), [@ledor473](https://github.com/ledor473)) The following flags have been **removed** in the Collector and the Ingester: @@ -1144,7 +1155,7 @@ running curator would immediately remove the old index. #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes - Introduce `kafka.producer` and `kafka.consumer` flags to replace `kafka` flags ([#1360](https://github.com/jaegertracing/jaeger/pull/1360), [@ledor473](https://github.com/ledor473)) The following flags have been deprecated in the Collector and the Ingester: @@ -1192,10 +1203,6 @@ running curator would immediately remove the old index. - Discover dependencies table version automatically ([#1364](https://github.com/jaegertracing/jaeger/pull/1364), [@black-adder](https://github.com/black-adder)) -##### Breaking Changes - -##### New Features - ##### Bug fixes, Minor Improvements - Separate query-service functionality from http handler ([#1312](https://github.com/jaegertracing/jaeger/pull/1312), [@annanay25](https://github.com/annanay25)) @@ -1208,7 +1215,7 @@ running curator would immediately remove the old index. #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes - Remove cassandra SASI indices ([#1328](https://github.com/jaegertracing/jaeger/pull/1328), [@black-adder](https://github.com/black-adder)) @@ -1247,7 +1254,7 @@ Users who wish to continue to use the v1 table don't have to do anything as the #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes - Change Elasticsearch index prefix from `:` to `-` ([#1284](https://github.com/jaegertracing/jaeger/pull/1284), [@pavolloffay](https://github.com/pavolloffay)) @@ -1378,7 +1385,7 @@ jaeger_http_server_errors{source="collector-proxy",status="5xx"} #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes - Refactor agent configuration ([#1092](https://github.com/jaegertracing/jaeger/pull/1092), [@pavolloffay](https://github.com/pavolloffay)) @@ -1465,7 +1472,7 @@ jaeger_query_responses_bucket{operation="find_traces",le="0.005"} 2 #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes - `jaeger-standalone` binary has been renamed to `jaeger-all-in-one`. This change also includes package rename from `standalone` to `all-in-one` ([#1062](https://github.com/jaegertracing/jaeger/pull/1062), [@pavolloffay](https://github.com/pavolloffay)) @@ -1484,7 +1491,7 @@ jaeger_query_responses_bucket{operation="find_traces",le="0.005"} 2 #### Backend Changes -##### Breaking Changes +##### ⛔ Breaking Changes - The storage implementations no longer write the parentSpanID field to storage (#856). If you are upgrading to this version, **you must upgrade query service first**! diff --git a/RELEASE.md b/RELEASE.md index 10785d309f7..032e711b64c 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -52,7 +52,7 @@ Here are the release managers for future versions with the tentative release dat | Version | Release Manager | Tentative release date | |---------|-----------------|------------------------| -| 1.38.0 | @pavolloffay | 7 September 2022 | -| 1.39.0 | @yurishkuro | 2 October 2022 | -| 1.40.0 | @albertteoh | 2 November 2022 | -| 1.41.0 | @joe-elliott | 7 December 2022 | +| 1.39.0 | @albertteoh | 2 November 2022 | +| 1.40.0 | @joe-elliott | 7 December 2022 | +| 1.41.0 | @pavolloffay | 4 January 2023 | +| 1.42.0 | @yurishkuro | 1 February 2023 | diff --git a/jaeger-ui b/jaeger-ui index e197d1c8d36..57d5fa3414a 160000 --- a/jaeger-ui +++ b/jaeger-ui @@ -1 +1 @@ -Subproject commit e197d1c8d36a73616620c2b4d55d18f4a017a188 +Subproject commit 57d5fa3414a68b19bcbb710ed08c132825b4ff80 From 5bf8a28fe06d05ab3379552d657f1acee62d055b Mon Sep 17 00:00:00 2001 From: Arunprasad Rajkumar Date: Thu, 6 Oct 2022 05:59:17 +0530 Subject: [PATCH 51/87] Expose storage integration helpers as go pkg (#3944) This commit exposes storage integration test helpers as golang packages so that out of tree grpc storage implementations can import and run tests from their context. Prior to this change out of tree implementations copies these files into their repo[1]. This is not good in terms of keeping fixtures upto date. This commit does the following, - Rename test helper files(integration_test.go => integration.go, trace_compare_test.go => test_compare.go) to expose those as go packages. - Use `go embed` instead of `os.ReadFile` package to read test fixtures, this helps to reuse fixtures - Add a field in StorageIntegration struct to skip tests [1] https://github.com/jaegertracing/jaeger-clickhouse/tree/main/integration Signed-off-by: Arunprasad Rajkumar Signed-off-by: Arunprasad Rajkumar --- .gitignore | 1 + plugin/storage/integration/.nocover | 1 + .../{integration_test.go => integration.go} | 44 ++++++++++++------- ...trace_compare_test.go => trace_compare.go} | 0 4 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 plugin/storage/integration/.nocover rename plugin/storage/integration/{integration_test.go => integration.go} (94%) rename plugin/storage/integration/{trace_compare_test.go => trace_compare.go} (100%) diff --git a/.gitignore b/.gitignore index 4612b04cccd..38127a8b5a7 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ __pycache__ deploy/ deploy-staging/ sha256sum.combined.txt +.gocache diff --git a/plugin/storage/integration/.nocover b/plugin/storage/integration/.nocover new file mode 100644 index 00000000000..c9cd0d9b0c3 --- /dev/null +++ b/plugin/storage/integration/.nocover @@ -0,0 +1 @@ +FIXME - branches for storage test failures are not covered diff --git a/plugin/storage/integration/integration_test.go b/plugin/storage/integration/integration.go similarity index 94% rename from plugin/storage/integration/integration_test.go rename to plugin/storage/integration/integration.go index ec1b656daac..3c965f45751 100644 --- a/plugin/storage/integration/integration_test.go +++ b/plugin/storage/integration/integration.go @@ -18,9 +18,10 @@ package integration import ( "bytes" "context" + "embed" "encoding/json" "fmt" - "os" + "regexp" "strings" "testing" "time" @@ -39,6 +40,9 @@ const ( iterations = 100 ) +//go:embed fixtures +var fixtures embed.FS + // StorageIntegration holds components for storage integration test type StorageIntegration struct { SpanWriter spanstore.Writer @@ -48,8 +52,8 @@ type StorageIntegration struct { Fixtures []*QueryFixtures // TODO: remove this flag after all storage plugins returns spanKind with operationNames NotSupportSpanKindWithOperation bool - FixturesPath string - + // List of tests which has to be skipped, it can be regex too. + SkipList []string // CleanUp() should ensure that the storage backend is clean before another test. // called either before or after each test, and should be idempotent CleanUp func() error @@ -84,6 +88,17 @@ func (s *StorageIntegration) refresh(t *testing.T) { require.NoError(t, s.Refresh()) } +func (s *StorageIntegration) skipIfNeeded(t *testing.T) { + for _, pat := range s.SkipList { + ok, err := regexp.MatchString(pat, t.Name()) + assert.NoError(t, err) + if ok { + t.Skip() + return + } + } +} + func (s *StorageIntegration) waitForCondition(t *testing.T, predicate func(t *testing.T) bool) bool { for i := 0; i < iterations; i++ { t.Logf("Waiting for storage backend to update documents, iteration %d out of %d", i+1, iterations) @@ -96,6 +111,7 @@ func (s *StorageIntegration) waitForCondition(t *testing.T, predicate func(t *te } func (s *StorageIntegration) testGetServices(t *testing.T) { + s.skipIfNeeded(t) defer s.cleanUp(t) expected := []string{"example-service-1", "example-service-2", "example-service-3"} @@ -116,6 +132,7 @@ func (s *StorageIntegration) testGetServices(t *testing.T) { } func (s *StorageIntegration) testGetLargeSpan(t *testing.T) { + s.skipIfNeeded(t) defer s.cleanUp(t) t.Log("Testing Large Trace over 10K ...") @@ -135,6 +152,7 @@ func (s *StorageIntegration) testGetLargeSpan(t *testing.T) { } func (s *StorageIntegration) testGetOperations(t *testing.T) { + s.skipIfNeeded(t) defer s.cleanUp(t) var expected []spanstore.Operation @@ -170,6 +188,7 @@ func (s *StorageIntegration) testGetOperations(t *testing.T) { } func (s *StorageIntegration) testGetTrace(t *testing.T) { + s.skipIfNeeded(t) defer s.cleanUp(t) expected := s.loadParseAndWriteExampleTrace(t) @@ -198,14 +217,11 @@ func (s *StorageIntegration) testGetTrace(t *testing.T) { } func (s *StorageIntegration) testFindTraces(t *testing.T) { + s.skipIfNeeded(t) defer s.cleanUp(t) - fixturesPath := s.FixturesPath - if s.FixturesPath == "" { - fixturesPath = "." - } // Note: all cases include ServiceName + StartTime range - s.Fixtures = append(s.Fixtures, LoadAndParseQueryTestCases(t, fmt.Sprintf("%s/fixtures/queries.json", fixturesPath))...) + s.Fixtures = append(s.Fixtures, LoadAndParseQueryTestCases(t, "fixtures/queries.json")...) // Each query test case only specifies matching traces, but does not provide counterexamples. // To improve coverage we get all possible traces and store all of them before running queries. @@ -228,6 +244,7 @@ func (s *StorageIntegration) testFindTraces(t *testing.T) { s.refresh(t) for i, queryTestCase := range s.Fixtures { t.Run(queryTestCase.Caption, func(t *testing.T) { + s.skipIfNeeded(t) expected := expectedTracesPerTestCase[i] actual := s.findTracesByQuery(t, queryTestCase.Query, expected) CompareSliceOfTraces(t, expected, actual) @@ -287,11 +304,7 @@ func (s *StorageIntegration) loadParseAndWriteLargeTrace(t *testing.T) *model.Tr } func (s *StorageIntegration) getTraceFixture(t *testing.T, fixture string) *model.Trace { - fixturesPath := s.FixturesPath - if s.FixturesPath == "" { - fixturesPath = "." - } - fileName := fmt.Sprintf("%s/fixtures/traces/%s.json", fixturesPath, fixture) + fileName := fmt.Sprintf("fixtures/traces/%s.json", fixture) return getTraceFixtureExact(t, fileName) } @@ -303,7 +316,7 @@ func getTraceFixtureExact(t *testing.T, fileName string) *model.Trace { func loadAndParseJSONPB(t *testing.T, path string, object proto.Message) { // #nosec - inStr, err := os.ReadFile(path) + inStr, err := fixtures.ReadFile(path) require.NoError(t, err, "Not expecting error when loading fixture %s", path) err = jsonpb.Unmarshal(bytes.NewReader(correctTime(inStr)), object) require.NoError(t, err, "Not expecting error when unmarshaling fixture %s", path) @@ -318,7 +331,7 @@ func LoadAndParseQueryTestCases(t *testing.T, queriesFile string) []*QueryFixtur func loadAndParseJSON(t *testing.T, path string, object interface{}) { // #nosec - inStr, err := os.ReadFile(path) + inStr, err := fixtures.ReadFile(path) require.NoError(t, err, "Not expecting error when loading fixture %s", path) err = json.Unmarshal(correctTime(inStr), object) require.NoError(t, err, "Not expecting error when unmarshaling fixture %s", path) @@ -358,6 +371,7 @@ func (s *StorageIntegration) testGetDependencies(t *testing.T) { return } + s.skipIfNeeded(t) defer s.cleanUp(t) expected := []model.DependencyLink{ diff --git a/plugin/storage/integration/trace_compare_test.go b/plugin/storage/integration/trace_compare.go similarity index 100% rename from plugin/storage/integration/trace_compare_test.go rename to plugin/storage/integration/trace_compare.go From b4c88ddf6cdd938f289675812b4b7a392e3b73c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Oct 2022 04:32:06 +0000 Subject: [PATCH 52/87] Bump google.golang.org/grpc from 1.49.0 to 1.50.0 (#3950) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.49.0 to 1.50.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.49.0...v1.50.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6e662621cca..6e497ef9283 100644 --- a/go.mod +++ b/go.mod @@ -56,7 +56,7 @@ require ( go.uber.org/zap v1.23.0 golang.org/x/net v0.0.0-20220926192436-02166a98028e golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 - google.golang.org/grpc v1.49.0 + google.golang.org/grpc v1.50.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 4c18f760ca6..9b9cca0e7ef 100644 --- a/go.sum +++ b/go.sum @@ -1110,8 +1110,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.0 h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU= +google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 878992a3c62222f6cdc883ebaddfa0fe654475ab Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Sun, 9 Oct 2022 14:13:03 +1100 Subject: [PATCH 53/87] Add grafana container to monitor docker-compose (#3955) Signed-off-by: Albert Teoh Signed-off-by: Albert Teoh --- docker-compose/monitor/README.md | 11 +- docker-compose/monitor/datasource.yml | 8 + docker-compose/monitor/docker-compose.yml | 10 + docker-compose/monitor/grafana.ini | 1328 +++++++++++++++++++++ 4 files changed, 1355 insertions(+), 2 deletions(-) create mode 100644 docker-compose/monitor/datasource.yml create mode 100644 docker-compose/monitor/grafana.ini diff --git a/docker-compose/monitor/README.md b/docker-compose/monitor/README.md index 1efe4a914fa..edcad461412 100644 --- a/docker-compose/monitor/README.md +++ b/docker-compose/monitor/README.md @@ -4,12 +4,14 @@ Service Performance Monitoring (SPM) is an opt-in feature introduced to Jaeger t The motivation for providing this environment is to allow developers to either test Jaeger UI or their own applications against jaeger-query's metrics query API, as well as a quick and simple way for users to bring up the entire stack required to visualize RED metrics from simulated traces (or their own). -This environment consists four backend components: +This environment consists the following backend components: - [MicroSim](https://github.com/yurishkuro/microsim): a program to simulate traces. - [Jaeger All-in-one](https://www.jaegertracing.io/docs/1.24/getting-started/#all-in-one): the full Jaeger stack in a single container image. - [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/): vendor agnostic integration layer for traces and metrics. Its main role in this particular development environment is to receive Jaeger spans, forward these spans untouched to Jaeger All-in-one while simultaneously aggregating metrics out of this span data. To learn more about span metrics aggregation, please refer to the [spanmetrics processor documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/spanmetricsprocessor). - [Prometheus](https://prometheus.io/): a metrics collection and query engine, used to scrape metrics computed by OpenTelemetry Collector, and presents an API for Jaeger All-in-one to query these metrics. +- [Grafana](https://grafana.com/): a metrics visualization, analytics & monitoring solution supporting multiple metrics databases. + The following diagram illustrates the relationship between these components: @@ -24,7 +26,11 @@ docker-compose up docker-compose down ``` -**Tip:** Let the application run for a couple of minutes to ensure there is enough time series data to plot in the dashboard. Navigate to Jaeger UI at http://localhost:16686/ and inspect the Monitor tab. Select `redis` service from the dropdown to see more than one endpoint. +**Tips:** +- Let the application run for a couple of minutes to ensure there is enough time series data to plot in the dashboard. +- Navigate to Jaeger UI at http://localhost:16686/ and inspect the Monitor tab. Select `redis` service from the dropdown to see more than one endpoint. +- To visualize the raw metrics stored on the Prometheus server (for debugging and local development use cases), a Grafana server is included in the docker-compose config, which is preconfigured to read metrics from the Prometheus server. + To access Grafana, navigate to http://localhost:3000/, click on the "Explore" and click the "Select metric" dropdown then select `calls_total`, for example. **Warning:** The included [docker-compose.yml](./docker-compose.yml) file uses the `latest` version of Jaeger and other components. If your local Docker registry already contains older versions, which may still be tagged as `latest`, you may want to delete those images before running the full set, to ensure consistent behavior: @@ -32,6 +38,7 @@ docker-compose down docker rmi -f jaegertracing/all-in-one:latest docker rmi -f otel/opentelemetry-collector-contrib:latest docker rmi -f prom/prometheus:latest +docker rmi -f grafana/grafana:latest ``` ## Example 1 diff --git a/docker-compose/monitor/datasource.yml b/docker-compose/monitor/datasource.yml new file mode 100644 index 00000000000..91a1c80c6ca --- /dev/null +++ b/docker-compose/monitor/datasource.yml @@ -0,0 +1,8 @@ +apiVersion: 1 +datasources: +- name: Prometheus + type: prometheus + url: http://prometheus:9090 + isDefault: true + access: proxy + editable: true diff --git a/docker-compose/monitor/docker-compose.yml b/docker-compose/monitor/docker-compose.yml index 8fff1e9fded..4caf3ccf7e6 100644 --- a/docker-compose/monitor/docker-compose.yml +++ b/docker-compose/monitor/docker-compose.yml @@ -40,5 +40,15 @@ services: - "./prometheus.yml:/etc/prometheus/prometheus.yml" ports: - "9090:9090" + grafana: + networks: + - backend + image: grafana/grafana:latest + volumes: + - ./grafana.ini:/etc/grafana/grafana.ini + - ./datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml + ports: + - 3000:3000 + networks: backend: diff --git a/docker-compose/monitor/grafana.ini b/docker-compose/monitor/grafana.ini new file mode 100644 index 00000000000..e5c19f5e4f7 --- /dev/null +++ b/docker-compose/monitor/grafana.ini @@ -0,0 +1,1328 @@ +##################### Grafana Configuration Defaults ##################### +# +# Do not modify this file in grafana installs +# + +# possible values : production, development +app_mode = production + +# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty +instance_name = ${HOSTNAME} + +# force migration will run migrations that might cause dataloss +force_migration = false + +#################################### Paths ############################### +[paths] +# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) +data = data + +# Temporary files in `data` directory older than given duration will be removed +temp_data_lifetime = 24h + +# Directory where grafana can store logs +logs = data/log + +# Directory where grafana will automatically scan and look for plugins +plugins = data/plugins + +# folder that contains provisioning config files that grafana will apply on startup and while running. +provisioning = conf/provisioning + +#################################### Server ############################## +[server] +# Protocol (http, https, h2, socket) +protocol = http + +# The ip address to bind to, empty will bind to all interfaces +http_addr = + +# The http port to use +http_port = 3000 + +# The public facing domain name used to access grafana from a browser +domain = localhost + +# Redirect to correct domain if host header does not match domain +# Prevents DNS rebinding attacks +enforce_domain = false + +# The full public facing url +root_url = %(protocol)s://%(domain)s:%(http_port)s/ + +# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons. +serve_from_sub_path = false + +# Log web requests +router_logging = false + +# the path relative working path +static_root_path = public + +# enable gzip +enable_gzip = false + +# https certs & key file +cert_file = +cert_key = + +# Unix socket path +socket = /tmp/grafana.sock + +# CDN Url +cdn_url = + +# Sets the maximum time in minutes before timing out read of an incoming request and closing idle connections. +# `0` means there is no timeout for reading the request. +read_timeout = 0 + +#################################### Database ############################ +[database] +# You can configure the database connection by specifying type, host, name, user and password +# as separate properties or as on string using the url property. + +# Either "mysql", "postgres" or "sqlite3", it's your choice +type = sqlite3 +host = 127.0.0.1:3306 +name = grafana +user = root +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" +password = +# Use either URL or the previous fields to configure the database +# Example: mysql://user:secret@host:port/database +url = + +# Max idle conn setting default is 2 +max_idle_conn = 2 + +# Max conn setting default is 0 (mean not set) +max_open_conn = + +# Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours) +conn_max_lifetime = 14400 + +# Set to true to log the sql calls and execution times. +log_queries = + +# For "postgres", use either "disable", "require" or "verify-full" +# For "mysql", use either "true", "false", or "skip-verify". +ssl_mode = disable + +# Database drivers may support different transaction isolation levels. +# Currently, only "mysql" driver supports isolation levels. +# If the value is empty - driver's default isolation level is applied. +# For "mysql" use "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ" or "SERIALIZABLE". +isolation_level = + +ca_cert_path = +client_key_path = +client_cert_path = +server_cert_name = + +# For "sqlite3" only, path relative to data_path setting +path = grafana.db + +# For "sqlite3" only. cache mode setting used for connecting to the database +cache_mode = private + +# For "mysql" only if migrationLocking feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0. +locking_attempt_timeout_sec = 0 + +#################################### Cache server ############################# +[remote_cache] +# Either "redis", "memcached" or "database" default is "database" +type = database + +# cache connectionstring options +# database: will use Grafana primary database. +# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0,ssl=false`. Only addr is required. ssl may be 'true', 'false', or 'insecure'. +# memcache: 127.0.0.1:11211 +connstr = + +#################################### Data proxy ########################### +[dataproxy] + +# This enables data proxy logging, default is false +logging = false + +# How long the data proxy waits to read the headers of the response before timing out, default is 30 seconds. +# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set. +timeout = 30 + +# How long the data proxy waits to establish a TCP connection before timing out, default is 10 seconds. +dialTimeout = 10 + +# How many seconds the data proxy waits before sending a keepalive request. +keep_alive_seconds = 30 + +# How many seconds the data proxy waits for a successful TLS Handshake before timing out. +tls_handshake_timeout_seconds = 10 + +# How many seconds the data proxy will wait for a server's first response headers after +# fully writing the request headers if the request has an "Expect: 100-continue" +# header. A value of 0 will result in the body being sent immediately, without +# waiting for the server to approve. +expect_continue_timeout_seconds = 1 + +# Optionally limits the total number of connections per host, including connections in the dialing, +# active, and idle states. On limit violation, dials will block. +# A value of zero (0) means no limit. +max_conns_per_host = 0 + +# The maximum number of idle connections that Grafana will keep alive. +max_idle_connections = 100 + +# How many seconds the data proxy keeps an idle connection open before timing out. +idle_conn_timeout_seconds = 90 + +# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request. +send_user_header = false + +# Limit the amount of bytes that will be read/accepted from responses of outgoing HTTP requests. +response_limit = 0 + +# Limits the number of rows that Grafana will process from SQL data sources. +row_limit = 1000000 + +#################################### Analytics ########################### +[analytics] +# Server reporting, sends usage counters to stats.grafana.org every 24 hours. +# No ip addresses are being tracked, only simple counters to track +# running instances, dashboard and error counts. It is very helpful to us. +# Change this option to false to disable reporting. +reporting_enabled = true + +# The name of the distributor of the Grafana instance. Ex hosted-grafana, grafana-labs +reporting_distributor = grafana-labs + +# Set to false to disable all checks to https://grafana.com +# for new versions of grafana. The check is used +# in some UI views to notify that a grafana update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://raw.githubusercontent.com/grafana/grafana/main/latest.json to get the latest version. +check_for_updates = true + +# Set to false to disable all checks to https://grafana.com +# for new versions of plugins. The check is used +# in some UI views to notify that a plugin update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://grafana.com to get the latest versions. +check_for_plugin_updates = true + +# Google Analytics universal tracking code, only enabled if you specify an id here +google_analytics_ua_id = + +# Google Analytics 4 tracking code, only enabled if you specify an id here +google_analytics_4_id = + +# Google Tag Manager ID, only enabled if you specify an id here +google_tag_manager_id = + +# Rudderstack write key, enabled only if rudderstack_data_plane_url is also set +rudderstack_write_key = + +# Rudderstack data plane url, enabled only if rudderstack_write_key is also set +rudderstack_data_plane_url = + +# Rudderstack SDK url, optional, only valid if rudderstack_write_key and rudderstack_data_plane_url is also set +rudderstack_sdk_url = + +# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config +rudderstack_config_url = + +# Application Insights connection string. Specify an URL string to enable this feature. +application_insights_connection_string = + +# Optional. Specifies an Application Insights endpoint URL where the endpoint string is wrapped in backticks ``. +application_insights_endpoint_url = + +# Controls if the UI contains any links to user feedback forms +feedback_links_enabled = true + +#################################### Security ############################ +[security] +# disable creation of admin user on first start of grafana +disable_initial_admin_creation = false + +# default admin user, created on startup +admin_user = admin + +# default admin password, can be changed before first start of grafana, or in profile settings +admin_password = admin + +# default admin email, created on startup +admin_email = admin@localhost + +# used for signing +secret_key = SW2YcwTIb9zpOOhoPsMm + +# current key provider used for envelope encryption, default to static value specified by secret_key +encryption_provider = secretKey.v1 + +# list of configured key providers, space separated (Enterprise only): e.g., awskms.v1 azurekv.v1 +available_encryption_providers = + +# disable gravatar profile images +disable_gravatar = false + +# data source proxy whitelist (ip_or_domain:port separated by spaces) +data_source_proxy_whitelist = + +# disable protection against brute force login attempts +disable_brute_force_login_protection = false + +# set to true if you host Grafana behind HTTPS. default is false. +cookie_secure = false + +# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled" +cookie_samesite = lax + +# set to true if you want to allow browsers to render Grafana in a ,