From 8b1fbe66e3341a732063e2ed51019979f65edba2 Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Thu, 3 Jun 2021 20:58:46 +1000 Subject: [PATCH 01/22] Add Prometheus metrics reader factory and config (#3049) * Add metrics reader factory and config Signed-off-by: albertteoh * Address review comments Signed-off-by: albertteoh --- pkg/prometheus/config/config.go | 23 ++++ pkg/prometheus/config/empty_test.go | 15 +++ plugin/metrics/factory.go | 101 ++++++++++++++++++ plugin/metrics/factory_config.go | 36 +++++++ plugin/metrics/factory_config_test.go | 42 ++++++++ plugin/metrics/factory_test.go | 108 +++++++++++++++++++ plugin/metrics/prometheus/factory.go | 59 +++++++++++ plugin/metrics/prometheus/factory_test.go | 68 ++++++++++++ plugin/metrics/prometheus/options.go | 77 ++++++++++++++ storage/factory.go | 16 +++ storage/metricsstore/mocks/Reader.go | 123 ++++++++++++++++++++++ storage/mocks/MetricsFactory.go | 66 ++++++++++++ 12 files changed, 734 insertions(+) create mode 100644 pkg/prometheus/config/config.go create mode 100644 pkg/prometheus/config/empty_test.go create mode 100644 plugin/metrics/factory.go create mode 100644 plugin/metrics/factory_config.go create mode 100644 plugin/metrics/factory_config_test.go create mode 100644 plugin/metrics/factory_test.go create mode 100644 plugin/metrics/prometheus/factory.go create mode 100644 plugin/metrics/prometheus/factory_test.go create mode 100644 plugin/metrics/prometheus/options.go create mode 100644 storage/metricsstore/mocks/Reader.go create mode 100644 storage/mocks/MetricsFactory.go diff --git a/pkg/prometheus/config/config.go b/pkg/prometheus/config/config.go new file mode 100644 index 000000000000..494aa7bc2ff1 --- /dev/null +++ b/pkg/prometheus/config/config.go @@ -0,0 +1,23 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package config + +import "time" + +// Configuration describes the options to customize the storage behavior. +type Configuration struct { + HostPort string `validate:"nonzero" mapstructure:"server"` + ConnectTimeout time.Duration `validate:"nonzero" mapstructure:"timeout"` +} diff --git a/pkg/prometheus/config/empty_test.go b/pkg/prometheus/config/empty_test.go new file mode 100644 index 000000000000..e32b13101a4b --- /dev/null +++ b/pkg/prometheus/config/empty_test.go @@ -0,0 +1,15 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package config diff --git a/plugin/metrics/factory.go b/plugin/metrics/factory.go new file mode 100644 index 000000000000..73153e78732a --- /dev/null +++ b/plugin/metrics/factory.go @@ -0,0 +1,101 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metrics + +import ( + "flag" + "fmt" + + "github.com/spf13/viper" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/plugin" + "github.com/jaegertracing/jaeger/plugin/metrics/prometheus" + "github.com/jaegertracing/jaeger/storage" + "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +const ( + prometheusStorageType = "prometheus" +) + +// AllStorageTypes defines all available storage backends. +var AllStorageTypes = []string{prometheusStorageType} + +// Factory implements storage.Factory interface as a meta-factory for storage components. +type Factory struct { + FactoryConfig + factories map[string]storage.MetricsFactory +} + +// NewFactory creates the meta-factory. +func NewFactory(config FactoryConfig) (*Factory, error) { + f := &Factory{FactoryConfig: config} + uniqueTypes := map[string]struct{}{ + f.MetricsStorageType: {}, + } + f.factories = make(map[string]storage.MetricsFactory) + for t := range uniqueTypes { + ff, err := f.getFactoryOfType(t) + if err != nil { + return nil, err + } + f.factories[t] = ff + } + return f, nil +} + +func (f *Factory) getFactoryOfType(factoryType string) (storage.MetricsFactory, error) { + switch factoryType { + case prometheusStorageType: + return prometheus.NewFactory(), nil + } + return nil, fmt.Errorf("unknown metrics type %q. Valid types are %v", factoryType, AllStorageTypes) +} + +// Initialize implements storage.MetricsFactory. +func (f *Factory) Initialize(logger *zap.Logger) error { + for _, factory := range f.factories { + factory.Initialize(logger) + } + return nil +} + +// CreateMetricsReader implements storage.MetricsFactory. +func (f *Factory) CreateMetricsReader() (metricsstore.Reader, error) { + factory, ok := f.factories[f.MetricsStorageType] + if !ok { + return nil, fmt.Errorf("no %q backend registered for metrics store", f.MetricsStorageType) + } + return factory.CreateMetricsReader() +} + +// AddFlags implements plugin.Configurable. +func (f *Factory) AddFlags(flagSet *flag.FlagSet) { + for _, factory := range f.factories { + if conf, ok := factory.(plugin.Configurable); ok { + conf.AddFlags(flagSet) + } + } +} + +// InitFromViper implements plugin.Configurable. +func (f *Factory) InitFromViper(v *viper.Viper) { + for _, factory := range f.factories { + if conf, ok := factory.(plugin.Configurable); ok { + conf.InitFromViper(v) + } + } +} diff --git a/plugin/metrics/factory_config.go b/plugin/metrics/factory_config.go new file mode 100644 index 000000000000..28411dfccf2e --- /dev/null +++ b/plugin/metrics/factory_config.go @@ -0,0 +1,36 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metrics + +import ( + "os" +) + +const ( + // StorageTypeEnvVar is the name of the env var that defines the type of backend used for metrics storage. + StorageTypeEnvVar = "METRICS_STORAGE_TYPE" +) + +// FactoryConfig tells the Factory which types of backends it needs to create for different storage types. +type FactoryConfig struct { + MetricsStorageType string +} + +// FactoryConfigFromEnv reads the desired types of storage backends from METRICS_STORAGE_TYPE. +func FactoryConfigFromEnv() FactoryConfig { + return FactoryConfig{ + MetricsStorageType: os.Getenv(StorageTypeEnvVar), + } +} diff --git a/plugin/metrics/factory_config_test.go b/plugin/metrics/factory_config_test.go new file mode 100644 index 000000000000..82c9ad6aab17 --- /dev/null +++ b/plugin/metrics/factory_config_test.go @@ -0,0 +1,42 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metrics + +import ( + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func clearEnv(t *testing.T) { + err := os.Setenv(StorageTypeEnvVar, "") + require.NoError(t, err) +} + +func TestFactoryConfigFromEnv(t *testing.T) { + clearEnv(t) + defer clearEnv(t) + + fc := FactoryConfigFromEnv() + assert.Empty(t, fc.MetricsStorageType) + + err := os.Setenv(StorageTypeEnvVar, prometheusStorageType) + require.NoError(t, err) + + fc = FactoryConfigFromEnv() + assert.Equal(t, prometheusStorageType, fc.MetricsStorageType) +} diff --git a/plugin/metrics/factory_test.go b/plugin/metrics/factory_test.go new file mode 100644 index 000000000000..49c770e8320b --- /dev/null +++ b/plugin/metrics/factory_test.go @@ -0,0 +1,108 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package metrics + +import ( + "flag" + "testing" + + "github.com/spf13/viper" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/storage" + "github.com/jaegertracing/jaeger/storage/mocks" +) + +var _ storage.MetricsFactory = new(Factory) + +func defaultCfg() FactoryConfig { + return FactoryConfig{ + MetricsStorageType: prometheusStorageType, + } +} + +func TestNewFactory(t *testing.T) { + f, err := NewFactory(defaultCfg()) + require.NoError(t, err) + assert.NotEmpty(t, f.factories) + assert.NotEmpty(t, f.factories[prometheusStorageType]) + assert.Equal(t, prometheusStorageType, f.MetricsStorageType) +} + +func TestUnsupportedMetricsStorageType(t *testing.T) { + f, err := NewFactory(FactoryConfig{MetricsStorageType: "foo"}) + require.Error(t, err) + assert.Nil(t, f) + assert.EqualError(t, err, `unknown metrics type "foo". Valid types are [prometheus]`) +} + +func TestCreateMetricsReader(t *testing.T) { + f, err := NewFactory(defaultCfg()) + require.NoError(t, err) + require.NotNil(t, f) + + require.NoError(t, f.Initialize(zap.NewNop())) + + reader, err := f.CreateMetricsReader() + require.NoError(t, err) + require.NotNil(t, reader) + + f.MetricsStorageType = "foo" + reader, err = f.CreateMetricsReader() + require.Error(t, err) + require.Nil(t, reader) + + assert.EqualError(t, err, `no "foo" backend registered for metrics store`) +} + +type configurable struct { + mocks.MetricsFactory + flagSet *flag.FlagSet + viper *viper.Viper +} + +// AddFlags implements plugin.Configurable. +func (f *configurable) AddFlags(flagSet *flag.FlagSet) { + f.flagSet = flagSet +} + +// InitFromViper implements plugin.Configurable. +func (f *configurable) InitFromViper(v *viper.Viper) { + f.viper = v +} + +func TestConfigurable(t *testing.T) { + clearEnv(t) + defer clearEnv(t) + + f, err := NewFactory(defaultCfg()) + require.NoError(t, err) + assert.NotEmpty(t, f.factories) + assert.NotEmpty(t, f.factories[prometheusStorageType]) + + mock := new(configurable) + f.factories[prometheusStorageType] = mock + + fs := new(flag.FlagSet) + v := viper.New() + + f.AddFlags(fs) + f.InitFromViper(v) + + assert.Equal(t, fs, mock.flagSet) + assert.Equal(t, v, mock.viper) +} diff --git a/plugin/metrics/prometheus/factory.go b/plugin/metrics/prometheus/factory.go new file mode 100644 index 000000000000..8435be82bda4 --- /dev/null +++ b/plugin/metrics/prometheus/factory.go @@ -0,0 +1,59 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package prometheus + +import ( + "flag" + + "github.com/spf13/viper" + "go.uber.org/zap" + + prometheusstore "github.com/jaegertracing/jaeger/plugin/metrics/prometheus/metricsstore" + "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +// Factory implements storage.Factory and creates storage components backed by memory store. +type Factory struct { + options *Options + logger *zap.Logger +} + +// NewFactory creates a new Factory. +func NewFactory() *Factory { + return &Factory{ + options: NewOptions("prometheus"), + } +} + +// AddFlags implements plugin.Configurable. +func (f *Factory) AddFlags(flagSet *flag.FlagSet) { + f.options.AddFlags(flagSet) +} + +// InitFromViper implements plugin.Configurable. +func (f *Factory) InitFromViper(v *viper.Viper) { + f.options.InitFromViper(v) +} + +// Initialize implements storage.MetricsFactory. +func (f *Factory) Initialize(logger *zap.Logger) error { + f.logger = logger + return nil +} + +// CreateMetricsReader implements storage.MetricsFactory. +func (f *Factory) CreateMetricsReader() (metricsstore.Reader, error) { + return prometheusstore.NewMetricsReader(f.logger, f.options.Primary.HostPort, f.options.Primary.ConnectTimeout) +} diff --git a/plugin/metrics/prometheus/factory_test.go b/plugin/metrics/prometheus/factory_test.go new file mode 100644 index 000000000000..bfa801b02207 --- /dev/null +++ b/plugin/metrics/prometheus/factory_test.go @@ -0,0 +1,68 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package prometheus + +import ( + "net" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/pkg/config" + "github.com/jaegertracing/jaeger/storage" +) + +var _ storage.MetricsFactory = new(Factory) + +func TestPrometheusFactory(t *testing.T) { + f := NewFactory() + assert.NoError(t, f.Initialize(zap.NewNop())) + assert.NotNil(t, f.logger) + assert.Equal(t, "prometheus", f.options.Primary.namespace) + + listener, err := net.Listen("tcp", "localhost:") + assert.NoError(t, err) + assert.NotNil(t, listener) + defer listener.Close() + + f.options.Primary.HostPort = listener.Addr().String() + reader, err := f.CreateMetricsReader() + + assert.NoError(t, err) + assert.NotNil(t, reader) +} + +func TestWithDefaultConfiguration(t *testing.T) { + f := NewFactory() + assert.Equal(t, f.options.Primary.HostPort, defaultServerHostPort) + assert.Equal(t, f.options.Primary.ConnectTimeout, defaultConnectTimeout) +} + +func TestWithConfiguration(t *testing.T) { + f := NewFactory() + v, command := config.Viperize(f.AddFlags) + err := command.ParseFlags([]string{ + "--prometheus.host-port=localhost:1234", + "--prometheus.connect-timeout=5s", + }) + require.NoError(t, err) + + f.InitFromViper(v) + assert.Equal(t, f.options.Primary.HostPort, "localhost:1234") + assert.Equal(t, f.options.Primary.ConnectTimeout, 5*time.Second) +} diff --git a/plugin/metrics/prometheus/options.go b/plugin/metrics/prometheus/options.go new file mode 100644 index 000000000000..8d346ef6c36a --- /dev/null +++ b/plugin/metrics/prometheus/options.go @@ -0,0 +1,77 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package prometheus + +import ( + "flag" + "strings" + "time" + + "github.com/spf13/viper" + + "github.com/jaegertracing/jaeger/pkg/prometheus/config" +) + +const ( + suffixHostPort = ".host-port" + suffixConnectTimeout = ".connect-timeout" + + defaultServerHostPort = "localhost:9090" + defaultConnectTimeout = 30 * time.Second +) + +type namespaceConfig struct { + config.Configuration `mapstructure:",squash"` + namespace string +} + +// Options stores the configuration entries for this storage. +type Options struct { + Primary namespaceConfig `mapstructure:",squash"` +} + +// NewOptions creates a new Options struct. +func NewOptions(primaryNamespace string) *Options { + defaultConfig := config.Configuration{ + HostPort: defaultServerHostPort, + ConnectTimeout: defaultConnectTimeout, + } + + return &Options{ + Primary: namespaceConfig{ + Configuration: defaultConfig, + namespace: primaryNamespace, + }, + } +} + +// AddFlags from this storage to the CLI. +func (opt *Options) AddFlags(flagSet *flag.FlagSet) { + nsConfig := &opt.Primary + flagSet.String(nsConfig.namespace+suffixHostPort, defaultServerHostPort, "The host:port of the Prometheus query service.") + flagSet.Duration(nsConfig.namespace+suffixConnectTimeout, defaultConnectTimeout, "The period to wait for a connection to Prometheus when executing queries.") +} + +// InitFromViper initializes the options struct with values from Viper. +func (opt *Options) InitFromViper(v *viper.Viper) { + cfg := &opt.Primary + cfg.HostPort = stripWhiteSpace(v.GetString(cfg.namespace + suffixHostPort)) + cfg.ConnectTimeout = v.GetDuration(cfg.namespace + suffixConnectTimeout) +} + +// stripWhiteSpace removes all whitespace characters from a string. +func stripWhiteSpace(str string) string { + return strings.Replace(str, " ", "", -1) +} diff --git a/storage/factory.go b/storage/factory.go index c8c2bbd996c9..3e69d53d40c8 100644 --- a/storage/factory.go +++ b/storage/factory.go @@ -22,6 +22,7 @@ import ( "go.uber.org/zap" "github.com/jaegertracing/jaeger/storage/dependencystore" + metricsstore "github.com/jaegertracing/jaeger/storage/metricsstore" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -62,3 +63,18 @@ type ArchiveFactory interface { // CreateArchiveSpanWriter creates a spanstore.Writer. CreateArchiveSpanWriter() (spanstore.Writer, error) } + +// 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 +// +// plugin.Configurable +type MetricsFactory interface { + // Initialize performs internal initialization of the factory, such as opening connections to the backend store. + // It is called after all configuration of the factory itself has been done. + Initialize(logger *zap.Logger) error + + // CreateMetricsReader creates a metricsstore.Reader. + CreateMetricsReader() (metricsstore.Reader, error) +} diff --git a/storage/metricsstore/mocks/Reader.go b/storage/metricsstore/mocks/Reader.go new file mode 100644 index 000000000000..62faa95d36ad --- /dev/null +++ b/storage/metricsstore/mocks/Reader.go @@ -0,0 +1,123 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +package mocks + +import ( + context "context" + time "time" + + mock "github.com/stretchr/testify/mock" + + metrics "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" + metricsstore "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +// Reader is an autogenerated mock type for the Reader type +type Reader struct { + mock.Mock +} + +// GetCallRates provides a mock function with given fields: ctx, params +func (_m *Reader) GetCallRates(ctx context.Context, params *metricsstore.CallRateQueryParameters) (*metrics.MetricFamily, error) { + ret := _m.Called(ctx, params) + + var r0 *metrics.MetricFamily + if rf, ok := ret.Get(0).(func(context.Context, *metricsstore.CallRateQueryParameters) *metrics.MetricFamily); ok { + r0 = rf(ctx, params) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*metrics.MetricFamily) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *metricsstore.CallRateQueryParameters) error); ok { + r1 = rf(ctx, params) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetErrorRates provides a mock function with given fields: ctx, params +func (_m *Reader) GetErrorRates(ctx context.Context, params *metricsstore.ErrorRateQueryParameters) (*metrics.MetricFamily, error) { + ret := _m.Called(ctx, params) + + var r0 *metrics.MetricFamily + if rf, ok := ret.Get(0).(func(context.Context, *metricsstore.ErrorRateQueryParameters) *metrics.MetricFamily); ok { + r0 = rf(ctx, params) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*metrics.MetricFamily) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *metricsstore.ErrorRateQueryParameters) error); ok { + r1 = rf(ctx, params) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetLatencies provides a mock function with given fields: ctx, params +func (_m *Reader) GetLatencies(ctx context.Context, params *metricsstore.LatenciesQueryParameters) (*metrics.MetricFamily, error) { + ret := _m.Called(ctx, params) + + var r0 *metrics.MetricFamily + if rf, ok := ret.Get(0).(func(context.Context, *metricsstore.LatenciesQueryParameters) *metrics.MetricFamily); ok { + r0 = rf(ctx, params) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*metrics.MetricFamily) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *metricsstore.LatenciesQueryParameters) error); ok { + r1 = rf(ctx, params) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetMinStepDuration provides a mock function with given fields: ctx, params +func (_m *Reader) GetMinStepDuration(ctx context.Context, params *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { + ret := _m.Called(ctx, params) + + var r0 time.Duration + if rf, ok := ret.Get(0).(func(context.Context, *metricsstore.MinStepDurationQueryParameters) time.Duration); ok { + r0 = rf(ctx, params) + } else { + r0 = ret.Get(0).(time.Duration) + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *metricsstore.MinStepDurationQueryParameters) error); ok { + r1 = rf(ctx, params) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/storage/mocks/MetricsFactory.go b/storage/mocks/MetricsFactory.go new file mode 100644 index 000000000000..2a0c3bee555c --- /dev/null +++ b/storage/mocks/MetricsFactory.go @@ -0,0 +1,66 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + zap "go.uber.org/zap" + + metricsstore "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +// MetricsFactory is an autogenerated mock type for the MetricsFactory type +type MetricsFactory struct { + mock.Mock +} + +// CreateMetricsReader provides a mock function with given fields: +func (_m *MetricsFactory) CreateMetricsReader() (metricsstore.Reader, error) { + ret := _m.Called() + + var r0 metricsstore.Reader + if rf, ok := ret.Get(0).(func() metricsstore.Reader); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(metricsstore.Reader) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Initialize provides a mock function with given fields: logger +func (_m *MetricsFactory) Initialize(logger *zap.Logger) error { + ret := _m.Called(logger) + + var r0 error + if rf, ok := ret.Get(0).(func(*zap.Logger) error); ok { + r0 = rf(logger) + } else { + r0 = ret.Error(0) + } + + return r0 +} From d052d34fe315af73c3fefaa5295570335f50b7a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jun 2021 15:53:10 +0200 Subject: [PATCH 02/22] Bump honnef.co/go/tools from 0.1.4 to 0.2.0 (#3033) Bumps [honnef.co/go/tools](https://github.com/dominikh/go-tools) from 0.1.4 to 0.2.0. - [Release notes](https://github.com/dominikh/go-tools/releases) - [Commits](https://github.com/dominikh/go-tools/compare/v0.1.4...v0.2.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pavol Loffay --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3de32cda47d8..f9f5b7c69f3e 100644 --- a/go.mod +++ b/go.mod @@ -70,7 +70,7 @@ require ( google.golang.org/grpc v1.29.1 gopkg.in/ini.v1 v1.52.0 // indirect gopkg.in/yaml.v2 v2.4.0 - honnef.co/go/tools v0.1.4 + honnef.co/go/tools v0.2.0 ) replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 diff --git a/go.sum b/go.sum index cc99f8ea7ae6..fc168eacbb57 100644 --- a/go.sum +++ b/go.sum @@ -1002,8 +1002,8 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.1.4 h1:SadWOkti5uVN1FAMgxn165+Mw00fuQKyk4Gyn/inxNQ= -honnef.co/go/tools v0.1.4/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +honnef.co/go/tools v0.2.0 h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE= +honnef.co/go/tools v0.2.0/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 394ec23efdccc3174d0532a89ee77dfb3bf175f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 3 Jun 2021 17:04:08 +0200 Subject: [PATCH 03/22] Switch Thrift with Jaeger's fork (#3050) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Switched Thrift with Jaeger's fork Signed-off-by: Juraci Paixão Kröhling * Changed assertion on error Signed-off-by: Juraci Paixão Kröhling * Changes based on the review Signed-off-by: Juraci Paixão Kröhling --- cmd/collector/app/zipkin/http_handler_test.go | 2 +- go.mod | 5 +++-- go.sum | 11 +++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmd/collector/app/zipkin/http_handler_test.go b/cmd/collector/app/zipkin/http_handler_test.go index f5331bfa3296..4db665de07ba 100644 --- a/cmd/collector/app/zipkin/http_handler_test.go +++ b/cmd/collector/app/zipkin/http_handler_test.go @@ -225,7 +225,7 @@ func TestFormatBadBody(t *testing.T) { statusCode, resBodyStr, err := postBytes(server.URL+`/api/v1/spans`, []byte("not good"), createHeader("application/x-thrift")) assert.NoError(t, err) assert.EqualValues(t, http.StatusBadRequest, statusCode) - assert.EqualValues(t, "Unable to process request body: Unknown data type 111\n", resBodyStr) + assert.Contains(t, resBodyStr, "Unable to process request body:") } func TestCannotReadBodyFromRequest(t *testing.T) { diff --git a/go.mod b/go.mod index f9f5b7c69f3e..d3579f4beaa9 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9 github.com/opentracing/opentracing-go v1.2.0 github.com/prometheus/client_golang v1.5.1 - github.com/prometheus/common v0.10.0 // indirect + github.com/prometheus/common v0.10.0 github.com/prometheus/procfs v0.1.3 // indirect github.com/rs/cors v1.7.0 github.com/securego/gosec v0.0.0-20200203094520-d13bb6d2420c @@ -73,4 +73,5 @@ require ( honnef.co/go/tools v0.2.0 ) -replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 +// TODO: remove once the 0.14.2 or 0.15.0 is released +replace github.com/apache/thrift => github.com/jaegertracing/thrift v0.14.1-patch1 diff --git a/go.sum b/go.sum index fc168eacbb57..3870e8e1aa09 100644 --- a/go.sum +++ b/go.sum @@ -40,10 +40,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.14.1 h1:Yh8v0hpCj63p5edXOLaqTJW0IJ1p+eMW6+YSOqw1d6s= -github.com/apache/thrift v0.14.1/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= 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= @@ -286,6 +282,9 @@ github.com/gocql/gocql v0.0.0-20200228163523-cd4b606dd2fb/go.mod h1:DL0ekTmBSTdl github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= 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= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -392,6 +391,8 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jaegertracing/thrift v0.14.1-patch1 h1:NcAyet3G3NmmxE9zNrUcdQIeDU7NBP0M4Hsigw28KPQ= +github.com/jaegertracing/thrift v0.14.1-patch1/go.mod h1:OdHPxgcEtN+TatW0e/SZ6NA1AwyMikWYQYYsX6AAiEY= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= @@ -424,6 +425,7 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -878,6 +880,7 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 2687983d24e002c69733fc800bbd765313cf3ad1 Mon Sep 17 00:00:00 2001 From: chgl Date: Fri, 4 Jun 2021 12:49:55 +0200 Subject: [PATCH 04/22] Run cassandra schema job as a non-root user by default (#3043) Signed-off-by: chgl --- plugin/storage/cassandra/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/storage/cassandra/Dockerfile b/plugin/storage/cassandra/Dockerfile index 1c329f480103..c8e5de3fea61 100644 --- a/plugin/storage/cassandra/Dockerfile +++ b/plugin/storage/cassandra/Dockerfile @@ -3,4 +3,9 @@ FROM cassandra:3.11 COPY schema/* /cassandra-schema/ ENV CQLSH_HOST=cassandra + +RUN groupadd -g 65532 nonroot && \ + useradd -u 65532 -g nonroot nonroot --create-home + +USER 65532:65532 ENTRYPOINT ["/cassandra-schema/docker.sh"] From ff32436682897b1cf83c256716c0f45f67b3b595 Mon Sep 17 00:00:00 2001 From: Lu Jiajing Date: Fri, 4 Jun 2021 22:56:06 +0800 Subject: [PATCH 05/22] Inject trace context to grpc metadata (#2870) * inject trace context to grpc metadata Signed-off-by: Megrez Lu * remove unused vars Signed-off-by: Megrez Lu * run make fmt Signed-off-by: Megrez Lu * fix year in header Signed-off-by: Megrez Lu * refactor with ContextUpgradeFunc Signed-off-by: Megrez Lu * refactor another usage in archive.go Signed-off-by: Megrez Lu * eliminate metadata copy Signed-off-by: Megrez Lu * retry unit tests Signed-off-by: Megrez Lu * update hashicorp/go-plugin to 1.4.2 Signed-off-by: Megrez Lu * tidy Signed-off-by: Megrez Lu * remove context upgrade Signed-off-by: Megrez Lu * add tracing interceptor Signed-off-by: Megrez Lu * remove test cases in grpc_plugin_test Signed-off-by: Megrez Lu * directly depend on grpc-ot Signed-off-by: Megrez Lu * run make fmt Signed-off-by: Megrez Lu * add example Signed-off-by: Megrez Lu * add docs Signed-off-by: Megrez Lu --- examples/memstore-plugin/main.go | 38 ++++++++++++++++++++--- go.mod | 3 +- go.sum | 5 +-- plugin/storage/grpc/README.md | 22 +++++++++++++ plugin/storage/grpc/config/config.go | 7 +++++ plugin/storage/grpc/shared/archive.go | 2 +- plugin/storage/grpc/shared/grpc_client.go | 37 ++++++++++++++++------ 7 files changed, 97 insertions(+), 17 deletions(-) diff --git a/examples/memstore-plugin/main.go b/examples/memstore-plugin/main.go index 76018ef9155c..03ea1db8abf5 100644 --- a/examples/memstore-plugin/main.go +++ b/examples/memstore-plugin/main.go @@ -19,7 +19,12 @@ import ( "path" "strings" + "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" + "github.com/hashicorp/go-plugin" + "github.com/opentracing/opentracing-go" "github.com/spf13/viper" + jaegerClientConfig "github.com/uber/jaeger-client-go/config" + googleGRPC "google.golang.org/grpc" "github.com/jaegertracing/jaeger/plugin/storage/grpc" "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" @@ -28,6 +33,10 @@ import ( "github.com/jaegertracing/jaeger/storage/spanstore" ) +const ( + serviceName = "mem-store" +) + var configPath string func main() { @@ -46,13 +55,34 @@ func main() { opts := memory.Options{} opts.InitFromViper(v) - plugin := &memoryStorePlugin{ + traceCfg := &jaegerClientConfig.Configuration{ + ServiceName: serviceName, + Sampler: &jaegerClientConfig.SamplerConfig{ + Type: "const", + Param: 1.0, + }, + RPCMetrics: true, + } + + tracer, closer, err := traceCfg.NewTracer() + if err != nil { + panic("Failed to initialize tracer") + } + defer closer.Close() + opentracing.SetGlobalTracer(tracer) + + memStorePlugin := &memoryStorePlugin{ store: memory.NewStore(), archiveStore: memory.NewStore(), } - grpc.Serve(&shared.PluginServices{ - Store: plugin, - ArchiveStore: plugin, + grpc.ServeWithGRPCServer(&shared.PluginServices{ + Store: memStorePlugin, + ArchiveStore: memStorePlugin, + }, func(options []googleGRPC.ServerOption) *googleGRPC.Server { + return plugin.DefaultGRPCServer([]googleGRPC.ServerOption{ + googleGRPC.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer)), + googleGRPC.StreamInterceptor(otgrpc.OpenTracingStreamServerInterceptor(tracer)), + }) }) } diff --git a/go.mod b/go.mod index d3579f4beaa9..c6792a0df0b8 100644 --- a/go.mod +++ b/go.mod @@ -30,8 +30,9 @@ require ( github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 github.com/hashicorp/go-hclog v0.16.1 - github.com/hashicorp/go-plugin v1.4.1 + github.com/hashicorp/go-plugin v1.4.2 github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect github.com/kr/pretty v0.2.1 github.com/mailru/easyjson v0.7.7 // indirect diff --git a/go.sum b/go.sum index 3870e8e1aa09..3452e673730e 100644 --- a/go.sum +++ b/go.sum @@ -348,6 +348,7 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +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= @@ -363,8 +364,8 @@ github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 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-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= -github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/go-plugin v1.4.2 h1:yFvG3ufXXpqiMiZx9HLcaK3XbIqQ1WJFR/F1a2CuVw0= +github.com/hashicorp/go-plugin v1.4.2/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= diff --git a/plugin/storage/grpc/README.md b/plugin/storage/grpc/README.md index 0db8fd50aaf2..fd64d06c79a2 100644 --- a/plugin/storage/grpc/README.md +++ b/plugin/storage/grpc/README.md @@ -150,6 +150,28 @@ There are more logger options that can be used with `hclog` listed on [godoc](ht Note: Setting the `Output` option to `os.Stdout` can confuse the `go-plugin` framework and lead it to consider the plugin errored. +Tracing +------- + +When `grpc-plugin` is used, it will be running as a separated process, thus context propagation is necessary for inter-process scenarios. + +In order to get complete traces containing both `jaeger-component`(s) and the `grpc-plugin`, developers should enable tracing at server-side. +Thus, we can leverage gRPC interceptors, + +```golang +grpc.ServeWithGRPCServer(&shared.PluginServices{ + Store: memStorePlugin, + ArchiveStore: memStorePlugin, +}, func(options []googleGRPC.ServerOption) *googleGRPC.Server { + return plugin.DefaultGRPCServer([]googleGRPC.ServerOption{ + googleGRPC.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer)), + googleGRPC.StreamInterceptor(otgrpc.OpenTracingStreamServerInterceptor(tracer)), + }) +}) +``` + +Refer to `example/memstore-plugin` for more details. + Bearer token propagation from the UI ------------------------------------ When using `--query.bearer-token-propagation=true`, the bearer token will be properly passed on to the gRPC plugin server. To get access to the bearer token in your plugin, use a method similar to: diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 6ee887d39c9c..72a04a422ee4 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -19,8 +19,11 @@ import ( "os/exec" "runtime" + "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-plugin" + "github.com/opentracing/opentracing-go" + "google.golang.org/grpc" "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" ) @@ -58,6 +61,10 @@ func (c *Configuration) Build() (*ClientPluginServices, error) { Logger: hclog.New(&hclog.LoggerOptions{ Level: hclog.LevelFromString(c.PluginLogLevel), }), + GRPCDialOptions: []grpc.DialOption{ + grpc.WithUnaryInterceptor(otgrpc.OpenTracingClientInterceptor(opentracing.GlobalTracer())), + grpc.WithStreamInterceptor(otgrpc.OpenTracingStreamClientInterceptor(opentracing.GlobalTracer())), + }, }) runtime.SetFinalizer(client, func(c *plugin.Client) { diff --git a/plugin/storage/grpc/shared/archive.go b/plugin/storage/grpc/shared/archive.go index cd74f038c0f8..41741e7b9507 100644 --- a/plugin/storage/grpc/shared/archive.go +++ b/plugin/storage/grpc/shared/archive.go @@ -44,7 +44,7 @@ type archiveWriter struct { // GetTrace takes a traceID and returns a Trace associated with that traceID from Archive Storage func (r *archiveReader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { - stream, err := r.client.GetArchiveTrace(upgradeContextWithBearerToken(ctx), &storage_v1.GetTraceRequest{ + stream, err := r.client.GetArchiveTrace(upgradeContext(ctx), &storage_v1.GetTraceRequest{ TraceID: traceID, }) if status.Code(err) == codes.NotFound { diff --git a/plugin/storage/grpc/shared/grpc_client.go b/plugin/storage/grpc/shared/grpc_client.go index ec09629b7ef9..f8342847044e 100644 --- a/plugin/storage/grpc/shared/grpc_client.go +++ b/plugin/storage/grpc/shared/grpc_client.go @@ -34,6 +34,9 @@ var ( _ StoragePlugin = (*grpcClient)(nil) _ ArchiveStoragePlugin = (*grpcClient)(nil) _ PluginCapabilities = (*grpcClient)(nil) + + // upgradeContext composites several steps of upgrading context + upgradeContext = composeContextUpgradeFuncs(upgradeContextWithBearerToken) ) // grpcClient implements shared.StoragePlugin and reads/writes spans and dependencies @@ -46,16 +49,32 @@ type grpcClient struct { depsReaderClient storage_v1.DependenciesReaderPluginClient } +// ContextUpgradeFunc is a functional type that can be composed to upgrade context +type ContextUpgradeFunc func(ctx context.Context) context.Context + +// composeContextUpgradeFuncs composes ContextUpgradeFunc and returns a composed function +// to run the given func in strict order. +func composeContextUpgradeFuncs(funcs ...ContextUpgradeFunc) ContextUpgradeFunc { + return func(ctx context.Context) context.Context { + for _, fun := range funcs { + ctx = fun(ctx) + } + return ctx + } +} + // upgradeContextWithBearerToken turns the context into a gRPC outgoing context with bearer token // in the request metadata, if the original context has bearer token attached. // Otherwise returns original context. func upgradeContextWithBearerToken(ctx context.Context) context.Context { bearerToken, hasToken := spanstore.GetBearerToken(ctx) if hasToken { - requestMetadata := metadata.New(map[string]string{ - spanstore.BearerTokenKey: bearerToken, - }) - return metadata.NewOutgoingContext(ctx, requestMetadata) + md, ok := metadata.FromOutgoingContext(ctx) + if !ok { + md = metadata.New(nil) + } + md.Set(spanstore.BearerTokenKey, bearerToken) + return metadata.NewOutgoingContext(ctx, md) } return ctx } @@ -85,7 +104,7 @@ func (c *grpcClient) ArchiveSpanWriter() spanstore.Writer { // GetTrace takes a traceID and returns a Trace associated with that traceID func (c *grpcClient) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { - stream, err := c.readerClient.GetTrace(upgradeContextWithBearerToken(ctx), &storage_v1.GetTraceRequest{ + stream, err := c.readerClient.GetTrace(upgradeContext(ctx), &storage_v1.GetTraceRequest{ TraceID: traceID, }) if status.Code(err) == codes.NotFound { @@ -100,7 +119,7 @@ func (c *grpcClient) GetTrace(ctx context.Context, traceID model.TraceID) (*mode // GetServices returns a list of all known services func (c *grpcClient) GetServices(ctx context.Context) ([]string, error) { - resp, err := c.readerClient.GetServices(upgradeContextWithBearerToken(ctx), &storage_v1.GetServicesRequest{}) + resp, err := c.readerClient.GetServices(upgradeContext(ctx), &storage_v1.GetServicesRequest{}) if err != nil { return nil, fmt.Errorf("plugin error: %w", err) } @@ -113,7 +132,7 @@ func (c *grpcClient) GetOperations( ctx context.Context, query spanstore.OperationQueryParameters, ) ([]spanstore.Operation, error) { - resp, err := c.readerClient.GetOperations(upgradeContextWithBearerToken(ctx), &storage_v1.GetOperationsRequest{ + resp, err := c.readerClient.GetOperations(upgradeContext(ctx), &storage_v1.GetOperationsRequest{ Service: query.ServiceName, SpanKind: query.SpanKind, }) @@ -141,7 +160,7 @@ func (c *grpcClient) GetOperations( // FindTraces retrieves traces that match the traceQuery func (c *grpcClient) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { - stream, err := c.readerClient.FindTraces(upgradeContextWithBearerToken(ctx), &storage_v1.FindTracesRequest{ + stream, err := c.readerClient.FindTraces(upgradeContext(ctx), &storage_v1.FindTracesRequest{ Query: &storage_v1.TraceQueryParameters{ ServiceName: query.ServiceName, OperationName: query.OperationName, @@ -179,7 +198,7 @@ func (c *grpcClient) FindTraces(ctx context.Context, query *spanstore.TraceQuery // FindTraceIDs retrieves traceIDs that match the traceQuery func (c *grpcClient) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { - resp, err := c.readerClient.FindTraceIDs(upgradeContextWithBearerToken(ctx), &storage_v1.FindTraceIDsRequest{ + resp, err := c.readerClient.FindTraceIDs(upgradeContext(ctx), &storage_v1.FindTraceIDsRequest{ Query: &storage_v1.TraceQueryParameters{ ServiceName: query.ServiceName, OperationName: query.OperationName, From 0b59004a6efd023eb208d9bc8a8446b406d4d05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Fri, 4 Jun 2021 21:13:43 +0200 Subject: [PATCH 06/22] Preparing release v1.23.0 (#3057) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- CHANGELOG.md | 21 ++++++++++++++++++++- jaeger-ui | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1277058c611a..41db28e3aa97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Changes by Version ================== -1.23.0 (unreleased) +1.23.0 (2021-06-04) ------------------- ### Backend Changes @@ -9,6 +9,25 @@ Changes by Version * Remove unused `--es-archive.max-span-age` flag ([#2865](https://github.com/jaegertracing/jaeger/pull/2865), [@albertteoh](https://github.com/albertteoh)): +#### New Features + +* Inject trace context to grpc metadata ([#2870](https://github.com/jaegertracing/jaeger/pull/2870), [@lujiajing1126](https://github.com/lujiajing1126)) +* Passing default sampling strategies file as environment variable ([#3027](https://github.com/jaegertracing/jaeger/pull/3027), [@Ashmita152](https://github.com/Ashmita152)) +* [es] Add index rollover mode that can choose day and hour ([#2965](https://github.com/jaegertracing/jaeger/pull/2965), [@WalkerWang731](https://github.com/WalkerWang731)) +* Add a TIMEOUT environment variable for es rollover ([#2938](https://github.com/jaegertracing/jaeger/pull/2938), [@ediezh](https://github.com/ediezh)) +* Allow the ILM policy name to be configurable ([#2971](https://github.com/jaegertracing/jaeger/pull/2971), [@jrRibeiro](https://github.com/jrRibeiro)) +* [es] Add remote read clusters option for cross-cluster querying ([#2874](https://github.com/jaegertracing/jaeger/pull/2874), [@dgrizzanti](https://github.com/dgrizzanti)) +* Enable logging in ES client ([#2862](https://github.com/jaegertracing/jaeger/pull/2862), [@albertteoh](https://github.com/albertteoh)) + +#### Bug fixes, Minor Improvements + +* Fix jaeger-agent reproducible memory leak ([#3050](https://github.com/jaegertracing/jaeger/pull/3050), [@jpkrohling](https://github.com/jpkrohling)) +* Changed Range Query to use startTimeMillis date field instead of startTime field ([#2980](https://github.com/jaegertracing/jaeger/pull/2980), [@Sreevani871](https://github.com/Sreevani871)) +* Verify FindTraces() received a query ([#2979](https://github.com/jaegertracing/jaeger/pull/2979), [@esnible](https://github.com/esnible)) +* Set Content-Type in healthcheck's http response ([#2926](https://github.com/jaegertracing/jaeger/pull/2926), [@logeable](https://github.com/logeable)) +* Add jaeger-query HTTP handler diagnostic logging ([#2906](https://github.com/jaegertracing/jaeger/pull/2906), [@albertteoh](https://github.com/albertteoh)) +* Fix es-archive namespace default values ([#2865](https://github.com/jaegertracing/jaeger/pull/2865), [@albertteoh](https://github.com/albertteoh)) + 1.22.0 (2021-02-23) ------------------- diff --git a/jaeger-ui b/jaeger-ui index a922b6a145c0..0d9946bdb69b 160000 --- a/jaeger-ui +++ b/jaeger-ui @@ -1 +1 @@ -Subproject commit a922b6a145c0d534dad09769ad0aaecd238768b8 +Subproject commit 0d9946bdb69bdb065fa3fafe23dc150f386a1c99 From 013ecf28b604ecd7fb09a9598215a6df377a36cb Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Sat, 5 Jun 2021 07:49:19 +1000 Subject: [PATCH 07/22] Add TLS support for Prometheus Reader (#3055) * Add TLS support Signed-off-by: albertteoh * Address review comments Signed-off-by: albertteoh --- pkg/prometheus/config/config.go | 11 ++- plugin/metrics/prometheus/factory.go | 2 +- plugin/metrics/prometheus/factory_test.go | 10 +-- .../metrics/prometheus/metricsstore/reader.go | 42 +++++++---- .../prometheus/metricsstore/reader_test.go | 69 +++++++++++++++++-- plugin/metrics/prometheus/options.go | 22 ++++-- 6 files changed, 124 insertions(+), 32 deletions(-) diff --git a/pkg/prometheus/config/config.go b/pkg/prometheus/config/config.go index 494aa7bc2ff1..6560f51fd9a7 100644 --- a/pkg/prometheus/config/config.go +++ b/pkg/prometheus/config/config.go @@ -14,10 +14,15 @@ package config -import "time" +import ( + "time" + + "github.com/jaegertracing/jaeger/pkg/config/tlscfg" +) // Configuration describes the options to customize the storage behavior. type Configuration struct { - HostPort string `validate:"nonzero" mapstructure:"server"` - ConnectTimeout time.Duration `validate:"nonzero" mapstructure:"timeout"` + ServerURL string + ConnectTimeout time.Duration + TLS tlscfg.Options } diff --git a/plugin/metrics/prometheus/factory.go b/plugin/metrics/prometheus/factory.go index 8435be82bda4..31802418a0d7 100644 --- a/plugin/metrics/prometheus/factory.go +++ b/plugin/metrics/prometheus/factory.go @@ -55,5 +55,5 @@ func (f *Factory) Initialize(logger *zap.Logger) error { // CreateMetricsReader implements storage.MetricsFactory. func (f *Factory) CreateMetricsReader() (metricsstore.Reader, error) { - return prometheusstore.NewMetricsReader(f.logger, f.options.Primary.HostPort, f.options.Primary.ConnectTimeout) + return prometheusstore.NewMetricsReader(f.logger, f.options.Primary.Configuration) } diff --git a/plugin/metrics/prometheus/factory_test.go b/plugin/metrics/prometheus/factory_test.go index bfa801b02207..e3b028a020b1 100644 --- a/plugin/metrics/prometheus/factory_test.go +++ b/plugin/metrics/prometheus/factory_test.go @@ -40,7 +40,7 @@ func TestPrometheusFactory(t *testing.T) { assert.NotNil(t, listener) defer listener.Close() - f.options.Primary.HostPort = listener.Addr().String() + f.options.Primary.ServerURL = "http://" + listener.Addr().String() reader, err := f.CreateMetricsReader() assert.NoError(t, err) @@ -49,20 +49,20 @@ func TestPrometheusFactory(t *testing.T) { func TestWithDefaultConfiguration(t *testing.T) { f := NewFactory() - assert.Equal(t, f.options.Primary.HostPort, defaultServerHostPort) - assert.Equal(t, f.options.Primary.ConnectTimeout, defaultConnectTimeout) + assert.Equal(t, f.options.Primary.ServerURL, "http://localhost:9090") + assert.Equal(t, f.options.Primary.ConnectTimeout, 30*time.Second) } func TestWithConfiguration(t *testing.T) { f := NewFactory() v, command := config.Viperize(f.AddFlags) err := command.ParseFlags([]string{ - "--prometheus.host-port=localhost:1234", + "--prometheus.server-url=http://localhost:1234", "--prometheus.connect-timeout=5s", }) require.NoError(t, err) f.InitFromViper(v) - assert.Equal(t, f.options.Primary.HostPort, "localhost:1234") + assert.Equal(t, f.options.Primary.ServerURL, "http://localhost:1234") assert.Equal(t, f.options.Primary.ConnectTimeout, 5*time.Second) } diff --git a/plugin/metrics/prometheus/metricsstore/reader.go b/plugin/metrics/prometheus/metricsstore/reader.go index 99f5cde4c58d..257d1d1616a0 100644 --- a/plugin/metrics/prometheus/metricsstore/reader.go +++ b/plugin/metrics/prometheus/metricsstore/reader.go @@ -16,6 +16,7 @@ package metricsstore import ( "context" + "crypto/tls" "fmt" "net" "net/http" @@ -30,6 +31,7 @@ import ( promapi "github.com/prometheus/client_golang/api/prometheus/v1" "go.uber.org/zap" + "github.com/jaegertracing/jaeger/pkg/prometheus/config" "github.com/jaegertracing/jaeger/plugin/metrics/prometheus/metricsstore/dbmodel" "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" "github.com/jaegertracing/jaeger/storage/metricsstore" @@ -72,20 +74,13 @@ type ( ) // NewMetricsReader returns a new MetricsReader. -func NewMetricsReader(logger *zap.Logger, hostPort string, connectTimeout time.Duration) (*MetricsReader, error) { - // KeepAlive and TLSHandshake timeouts are kept to existing Prometheus client's - // DefaultRoundTripper to simplify user configuration and may be made configurable when required. - roundTripper := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: connectTimeout, - KeepAlive: 30 * time.Second, - }).DialContext, - TLSHandshakeTimeout: 10 * time.Second, +func NewMetricsReader(logger *zap.Logger, cfg config.Configuration) (*MetricsReader, error) { + roundTripper, err := getHTTPRoundTripper(&cfg, logger) + if err != nil { + return nil, err } - client, err := api.NewClient(api.Config{ - Address: "http://" + hostPort, + Address: cfg.ServerURL, RoundTripper: roundTripper, }) if err != nil { @@ -95,7 +90,7 @@ func NewMetricsReader(logger *zap.Logger, hostPort string, connectTimeout time.D client: promapi.NewAPI(client), logger: logger, } - logger.Info("Prometheus reader initialized", zap.String("addr", hostPort)) + logger.Info("Prometheus reader initialized", zap.String("addr", cfg.ServerURL)) return mr, nil } @@ -247,3 +242,24 @@ func logErrorToSpan(span opentracing.Span, err error) { ottag.Error.Set(span, true) span.LogFields(otlog.Error(err)) } + +func getHTTPRoundTripper(c *config.Configuration, logger *zap.Logger) (rt http.RoundTripper, err error) { + var ctlsConfig *tls.Config + if c.TLS.Enabled { + if ctlsConfig, err = c.TLS.Config(logger); err != nil { + return nil, err + } + } + + // KeepAlive and TLSHandshake timeouts are kept to existing Prometheus client's + // DefaultRoundTripper to simplify user configuration and may be made configurable when required. + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: c.ConnectTimeout, + KeepAlive: 30 * time.Second, + }).DialContext, + TLSHandshakeTimeout: 10 * time.Second, + TLSClientConfig: ctlsConfig, + }, nil +} diff --git a/plugin/metrics/prometheus/metricsstore/reader_test.go b/plugin/metrics/prometheus/metricsstore/reader_test.go index 16c38132c110..560a5786917e 100644 --- a/plugin/metrics/prometheus/metricsstore/reader_test.go +++ b/plugin/metrics/prometheus/metricsstore/reader_test.go @@ -31,6 +31,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" + "github.com/jaegertracing/jaeger/pkg/config/tlscfg" + "github.com/jaegertracing/jaeger/pkg/prometheus/config" "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" "github.com/jaegertracing/jaeger/storage/metricsstore" ) @@ -52,14 +54,20 @@ const defaultTimeout = 30 * time.Second func TestNewMetricsReaderValidAddress(t *testing.T) { logger := zap.NewNop() - reader, err := NewMetricsReader(logger, "localhost:1234", defaultTimeout) + reader, err := NewMetricsReader(logger, config.Configuration{ + ServerURL: "http://localhost:1234", + ConnectTimeout: defaultTimeout, + }) require.NoError(t, err) assert.NotNil(t, reader) } func TestNewMetricsReaderInvalidAddress(t *testing.T) { logger := zap.NewNop() - reader, err := NewMetricsReader(logger, "\n", defaultTimeout) + reader, err := NewMetricsReader(logger, config.Configuration{ + ServerURL: "\n", + ConnectTimeout: defaultTimeout, + }) require.Error(t, err) assert.Contains(t, err.Error(), "failed to initialize prometheus client") assert.Nil(t, reader) @@ -72,7 +80,10 @@ func TestGetMinStepDuration(t *testing.T) { require.NoError(t, err) assert.NotNil(t, listener) - reader, err := NewMetricsReader(logger, listener.Addr().String(), defaultTimeout) + reader, err := NewMetricsReader(logger, config.Configuration{ + ServerURL: "http://" + listener.Addr().String(), + ConnectTimeout: defaultTimeout, + }) require.NoError(t, err) minStep, err := reader.GetMinStepDuration(context.Background(), ¶ms) @@ -102,7 +113,10 @@ func TestMetricsServerError(t *testing.T) { logger := zap.NewNop() address := mockPrometheus.Listener.Addr().String() - reader, err := NewMetricsReader(logger, address, defaultTimeout) + reader, err := NewMetricsReader(logger, config.Configuration{ + ServerURL: "http://" + address, + ConnectTimeout: defaultTimeout, + }) require.NoError(t, err) m, err := reader.GetCallRates(context.Background(), ¶ms) @@ -299,6 +313,48 @@ func TestWarningResponse(t *testing.T) { assert.NotNil(t, m) } +func TestGetRoundTripper(t *testing.T) { + for _, tc := range []struct { + name string + tlsEnabled bool + }{ + {"tls tlsEnabled", true}, + {"tls disabled", false}, + } { + t.Run(tc.name, func(t *testing.T) { + logger := zap.NewNop() + rt, err := getHTTPRoundTripper(&config.Configuration{ + ServerURL: "https://localhost:1234", + ConnectTimeout: 9 * time.Millisecond, + TLS: tlscfg.Options{ + Enabled: tc.tlsEnabled, + }, + }, logger) + require.NoError(t, err) + assert.IsType(t, &http.Transport{}, rt) + if tc.tlsEnabled { + assert.NotNil(t, rt.(*http.Transport).TLSClientConfig) + } else { + assert.Nil(t, rt.(*http.Transport).TLSClientConfig) + } + }) + } +} + +func TestInvalidCertFile(t *testing.T) { + logger := zap.NewNop() + reader, err := NewMetricsReader(logger, config.Configuration{ + ServerURL: "https://localhost:1234", + ConnectTimeout: defaultTimeout, + TLS: tlscfg.Options{ + Enabled: true, + CAPath: "foo", + }, + }) + require.Error(t, err) + assert.Nil(t, reader) +} + func startMockPrometheusServer(t *testing.T, wantPromQlQuery string, wantWarnings []string) *httptest.Server { return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if len(wantWarnings) > 0 { @@ -356,7 +412,10 @@ func prepareMetricsReaderAndServer(t *testing.T, wantPromQlQuery string, wantWar logger := zap.NewNop() address := mockPrometheus.Listener.Addr().String() - reader, err := NewMetricsReader(logger, address, defaultTimeout) + reader, err := NewMetricsReader(logger, config.Configuration{ + ServerURL: "http://" + address, + ConnectTimeout: defaultTimeout, + }) require.NoError(t, err) return reader, mockPrometheus } diff --git a/plugin/metrics/prometheus/options.go b/plugin/metrics/prometheus/options.go index 8d346ef6c36a..76afd5252c50 100644 --- a/plugin/metrics/prometheus/options.go +++ b/plugin/metrics/prometheus/options.go @@ -21,14 +21,15 @@ import ( "github.com/spf13/viper" + "github.com/jaegertracing/jaeger/pkg/config/tlscfg" "github.com/jaegertracing/jaeger/pkg/prometheus/config" ) const ( - suffixHostPort = ".host-port" + suffixServerURL = ".server-url" suffixConnectTimeout = ".connect-timeout" - defaultServerHostPort = "localhost:9090" + defaultServerURL = "http://localhost:9090" defaultConnectTimeout = 30 * time.Second ) @@ -45,7 +46,7 @@ type Options struct { // NewOptions creates a new Options struct. func NewOptions(primaryNamespace string) *Options { defaultConfig := config.Configuration{ - HostPort: defaultServerHostPort, + ServerURL: defaultServerURL, ConnectTimeout: defaultConnectTimeout, } @@ -60,15 +61,26 @@ func NewOptions(primaryNamespace string) *Options { // AddFlags from this storage to the CLI. func (opt *Options) AddFlags(flagSet *flag.FlagSet) { nsConfig := &opt.Primary - flagSet.String(nsConfig.namespace+suffixHostPort, defaultServerHostPort, "The host:port of the Prometheus query service.") + flagSet.String(nsConfig.namespace+suffixServerURL, defaultServerURL, "The Prometheus server's URL, must include the protocol scheme e.g. http://localhost:9090") flagSet.Duration(nsConfig.namespace+suffixConnectTimeout, defaultConnectTimeout, "The period to wait for a connection to Prometheus when executing queries.") + + nsConfig.getTLSFlagsConfig().AddFlags(flagSet) } // InitFromViper initializes the options struct with values from Viper. func (opt *Options) InitFromViper(v *viper.Viper) { cfg := &opt.Primary - cfg.HostPort = stripWhiteSpace(v.GetString(cfg.namespace + suffixHostPort)) + cfg.ServerURL = stripWhiteSpace(v.GetString(cfg.namespace + suffixServerURL)) cfg.ConnectTimeout = v.GetDuration(cfg.namespace + suffixConnectTimeout) + cfg.TLS = cfg.getTLSFlagsConfig().InitFromViper(v) +} + +func (config *namespaceConfig) getTLSFlagsConfig() tlscfg.ClientFlagsConfig { + return tlscfg.ClientFlagsConfig{ + Prefix: config.namespace, + ShowEnabled: true, + ShowServerName: true, + } } // stripWhiteSpace removes all whitespace characters from a string. From 7f9924bfed6cf7309f562cac29094189f5df540e Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Sun, 6 Jun 2021 11:33:34 +1000 Subject: [PATCH 08/22] Refactor QueryService tests (#3060) * Refactor QueryService tests Signed-off-by: albertteoh * Address review comments Signed-off-by: albertteoh --- cmd/query/app/querysvc/query_service_test.go | 140 +++++++++++-------- 1 file changed, 81 insertions(+), 59 deletions(-) diff --git a/cmd/query/app/querysvc/query_service_test.go b/cmd/query/app/querysvc/query_service_test.go index baeb08e4bb4a..41303a702375 100644 --- a/cmd/query/app/querysvc/query_service_test.go +++ b/cmd/query/app/querysvc/query_service_test.go @@ -59,97 +59,119 @@ var ( } ) -func initializeTestServiceWithArchiveOptions() (*QueryService, *spanstoremocks.Reader, *depsmocks.Reader, *spanstoremocks.Reader, *spanstoremocks.Writer) { - readStorage := &spanstoremocks.Reader{} - dependencyStorage := &depsmocks.Reader{} - archiveReadStorage := &spanstoremocks.Reader{} - archiveWriteStorage := &spanstoremocks.Writer{} - options := QueryServiceOptions{ - ArchiveSpanReader: archiveReadStorage, - ArchiveSpanWriter: archiveWriteStorage, +type testQueryService struct { + queryService *QueryService + spanReader *spanstoremocks.Reader + depsReader *depsmocks.Reader + + archiveSpanReader *spanstoremocks.Reader + archiveSpanWriter *spanstoremocks.Writer +} + +type testOption func(*testQueryService, *QueryServiceOptions) + +func withArchiveSpanReader() testOption { + return func(mocks *testQueryService, options *QueryServiceOptions) { + r := &spanstoremocks.Reader{} + mocks.archiveSpanReader = r + options.ArchiveSpanReader = r } - qs := NewQueryService(readStorage, dependencyStorage, options) - return qs, readStorage, dependencyStorage, archiveReadStorage, archiveWriteStorage } -func initializeTestServiceWithAdjustOption() *QueryService { - readStorage := &spanstoremocks.Reader{} - dependencyStorage := &depsmocks.Reader{} - options := QueryServiceOptions{ - Adjuster: adjuster.Func(func(trace *model.Trace) (*model.Trace, error) { +func withArchiveSpanWriter() testOption { + return func(mocks *testQueryService, options *QueryServiceOptions) { + r := &spanstoremocks.Writer{} + mocks.archiveSpanWriter = r + options.ArchiveSpanWriter = r + } +} + +func withAdjuster() testOption { + return func(mocks *testQueryService, options *QueryServiceOptions) { + options.Adjuster = adjuster.Func(func(trace *model.Trace) (*model.Trace, error) { return trace, errAdjustment - }), + }) } - qs := NewQueryService(readStorage, dependencyStorage, options) - return qs } -func initializeTestService() (*QueryService, *spanstoremocks.Reader, *depsmocks.Reader) { +func initializeTestService(optionAppliers ...testOption) *testQueryService { readStorage := &spanstoremocks.Reader{} dependencyStorage := &depsmocks.Reader{} - qs := NewQueryService(readStorage, dependencyStorage, QueryServiceOptions{}) - return qs, readStorage, dependencyStorage + + options := QueryServiceOptions{} + + tqs := testQueryService{ + spanReader: readStorage, + depsReader: dependencyStorage, + } + + for _, optApplier := range optionAppliers { + optApplier(&tqs, &options) + } + + tqs.queryService = NewQueryService(readStorage, dependencyStorage, options) + return &tqs } // Test QueryService.GetTrace() func TestGetTraceSuccess(t *testing.T) { - qs, readMock, _ := initializeTestService() - readMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs := initializeTestService() + tqs.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(mockTrace, nil).Once() type contextKey string ctx := context.Background() - res, err := qs.GetTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) + res, err := tqs.queryService.GetTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) assert.NoError(t, err) assert.Equal(t, res, mockTrace) } // Test QueryService.GetTrace() without ArchiveSpanReader func TestGetTraceNotFound(t *testing.T) { - qs, readMock, _ := initializeTestService() - readMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs := initializeTestService() + tqs.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(nil, spanstore.ErrTraceNotFound).Once() type contextKey string ctx := context.Background() - _, err := qs.GetTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) + _, err := tqs.queryService.GetTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) assert.Equal(t, err, spanstore.ErrTraceNotFound) } // Test QueryService.GetTrace() with ArchiveSpanReader func TestGetTraceFromArchiveStorage(t *testing.T) { - qs, readMock, _, readArchiveMock, _ := initializeTestServiceWithArchiveOptions() - readMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs := initializeTestService(withArchiveSpanReader()) + tqs.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(nil, spanstore.ErrTraceNotFound).Once() - readArchiveMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs.archiveSpanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(mockTrace, nil).Once() type contextKey string ctx := context.Background() - res, err := qs.GetTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) + res, err := tqs.queryService.GetTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) assert.NoError(t, err) assert.Equal(t, res, mockTrace) } // Test QueryService.GetServices() for success. func TestGetServices(t *testing.T) { - qs, readMock, _ := initializeTestService() + tqs := initializeTestService() expectedServices := []string{"trifle", "bling"} - readMock.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil).Once() + tqs.spanReader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil).Once() type contextKey string ctx := context.Background() - actualServices, err := qs.GetServices(context.WithValue(ctx, contextKey("foo"), "bar")) + actualServices, err := tqs.queryService.GetServices(context.WithValue(ctx, contextKey("foo"), "bar")) assert.NoError(t, err) assert.Equal(t, expectedServices, actualServices) } // Test QueryService.GetOperations() for success. func TestGetOperations(t *testing.T) { - qs, readMock, _ := initializeTestService() + tqs := initializeTestService() expectedOperations := []spanstore.Operation{{Name: "", SpanKind: ""}, {Name: "get", SpanKind: ""}} operationQuery := spanstore.OperationQueryParameters{ServiceName: "abc/trifle"} - readMock.On( + tqs.spanReader.On( "GetOperations", mock.AnythingOfType("*context.valueCtx"), operationQuery, @@ -157,15 +179,15 @@ func TestGetOperations(t *testing.T) { type contextKey string ctx := context.Background() - actualOperations, err := qs.GetOperations(context.WithValue(ctx, contextKey("foo"), "bar"), operationQuery) + actualOperations, err := tqs.queryService.GetOperations(context.WithValue(ctx, contextKey("foo"), "bar"), operationQuery) assert.NoError(t, err) assert.Equal(t, expectedOperations, actualOperations) } // Test QueryService.FindTraces() for success. func TestFindTraces(t *testing.T) { - qs, readMock, _ := initializeTestService() - readMock.On("FindTraces", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*spanstore.TraceQueryParameters")). + tqs := initializeTestService() + tqs.spanReader.On("FindTraces", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*spanstore.TraceQueryParameters")). Return([]*model.Trace{mockTrace}, nil).Once() type contextKey string @@ -178,46 +200,46 @@ func TestFindTraces(t *testing.T) { DurationMin: duration, NumTraces: 200, } - traces, err := qs.FindTraces(context.WithValue(ctx, contextKey("foo"), "bar"), params) + traces, err := tqs.queryService.FindTraces(context.WithValue(ctx, contextKey("foo"), "bar"), params) assert.NoError(t, err) assert.Len(t, traces, 1) } // Test QueryService.ArchiveTrace() with no ArchiveSpanWriter. func TestArchiveTraceNoOptions(t *testing.T) { - qs, _, _ := initializeTestService() + tqs := initializeTestService() type contextKey string ctx := context.Background() - err := qs.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) + err := tqs.queryService.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) assert.Equal(t, errNoArchiveSpanStorage, err) } // Test QueryService.ArchiveTrace() with ArchiveSpanWriter but invalid traceID. func TestArchiveTraceWithInvalidTraceID(t *testing.T) { - qs, readMock, _, readArchiveMock, _ := initializeTestServiceWithArchiveOptions() - readMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs := initializeTestService(withArchiveSpanReader(), withArchiveSpanWriter()) + tqs.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(nil, spanstore.ErrTraceNotFound).Once() - readArchiveMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs.archiveSpanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(nil, spanstore.ErrTraceNotFound).Once() type contextKey string ctx := context.Background() - err := qs.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) + err := tqs.queryService.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) assert.Equal(t, spanstore.ErrTraceNotFound, err) } // Test QueryService.ArchiveTrace(), save error with ArchiveSpanWriter. func TestArchiveTraceWithArchiveWriterError(t *testing.T) { - qs, readMock, _, _, writeMock := initializeTestServiceWithArchiveOptions() - readMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs := initializeTestService(withArchiveSpanWriter()) + tqs.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(mockTrace, nil).Once() - writeMock.On("WriteSpan", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*model.Span")). + tqs.archiveSpanWriter.On("WriteSpan", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*model.Span")). Return(errors.New("cannot save")).Times(2) type contextKey string ctx := context.Background() - multiErr := qs.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) + multiErr := tqs.queryService.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) assert.Len(t, multiErr, 2) // There are two spans in the mockTrace, ArchiveTrace should return a wrapped error. assert.EqualError(t, multiErr, "[cannot save, cannot save]") @@ -225,30 +247,30 @@ func TestArchiveTraceWithArchiveWriterError(t *testing.T) { // Test QueryService.ArchiveTrace() with correctly configured ArchiveSpanWriter. func TestArchiveTraceSuccess(t *testing.T) { - qs, readMock, _, _, writeMock := initializeTestServiceWithArchiveOptions() - readMock.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). + tqs := initializeTestService(withArchiveSpanWriter()) + tqs.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(mockTrace, nil).Once() - writeMock.On("WriteSpan", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*model.Span")). + tqs.archiveSpanWriter.On("WriteSpan", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*model.Span")). Return(nil).Times(2) type contextKey string ctx := context.Background() - err := qs.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) + err := tqs.queryService.ArchiveTrace(context.WithValue(ctx, contextKey("foo"), "bar"), mockTraceID) assert.NoError(t, err) } // Test QueryService.Adjust() func TestTraceAdjustmentFailure(t *testing.T) { - qs := initializeTestServiceWithAdjustOption() + tqs := initializeTestService(withAdjuster()) - _, err := qs.Adjust(mockTrace) + _, err := tqs.queryService.Adjust(mockTrace) assert.Error(t, err) assert.EqualValues(t, errAdjustment.Error(), err.Error()) } // Test QueryService.GetDependencies() func TestGetDependencies(t *testing.T) { - qs, _, depsMock := initializeTestService() + tqs := initializeTestService() expectedDependencies := []model.DependencyLink{ { Parent: "killer", @@ -257,9 +279,9 @@ func TestGetDependencies(t *testing.T) { }, } endTs := time.Unix(0, 1476374248550*millisToNanosMultiplier) - depsMock.On("GetDependencies", endTs, defaultDependencyLookbackDuration).Return(expectedDependencies, nil).Times(1) + tqs.depsReader.On("GetDependencies", endTs, defaultDependencyLookbackDuration).Return(expectedDependencies, nil).Times(1) - actualDependencies, err := qs.GetDependencies(context.Background(), time.Unix(0, 1476374248550*millisToNanosMultiplier), defaultDependencyLookbackDuration) + actualDependencies, err := tqs.queryService.GetDependencies(context.Background(), time.Unix(0, 1476374248550*millisToNanosMultiplier), defaultDependencyLookbackDuration) assert.NoError(t, err) assert.Equal(t, expectedDependencies, actualDependencies) } From 628c3f2658cc3f05a5a38116a247c8393594c744 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 6 Jun 2021 14:42:12 -0400 Subject: [PATCH 09/22] Add adaptive sampling files (#3065) Signed-off-by: Prithvi Raj --- .../strategystore/adaptive/aggregator.go | 131 +++++++++++++++++ .../strategystore/adaptive/aggregator_test.go | 91 ++++++++++++ .../adaptive/root_span_handler.go | 42 ++++++ .../adaptive/root_span_handler_test.go | 65 +++++++++ .../sampling/strategystore/adaptive/span.go | 70 +++++++++ .../strategystore/adaptive/span_test.go | 137 ++++++++++++++++++ 6 files changed, 536 insertions(+) create mode 100644 plugin/sampling/strategystore/adaptive/aggregator.go create mode 100644 plugin/sampling/strategystore/adaptive/aggregator_test.go create mode 100644 plugin/sampling/strategystore/adaptive/root_span_handler.go create mode 100644 plugin/sampling/strategystore/adaptive/root_span_handler_test.go create mode 100644 plugin/sampling/strategystore/adaptive/span.go create mode 100644 plugin/sampling/strategystore/adaptive/span_test.go diff --git a/plugin/sampling/strategystore/adaptive/aggregator.go b/plugin/sampling/strategystore/adaptive/aggregator.go new file mode 100644 index 000000000000..bd674782d394 --- /dev/null +++ b/plugin/sampling/strategystore/adaptive/aggregator.go @@ -0,0 +1,131 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package adaptive + +import ( + "sync" + "time" + + "github.com/uber/jaeger-client-go" + "github.com/uber/jaeger-lib/metrics" + + "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/model" + "github.com/jaegertracing/jaeger/storage/samplingstore" +) + +const ( + maxProbabilities = 10 +) + +// Aggregator defines an interface used to aggregate operation throughput. +type Aggregator interface { + // RecordThroughput records throughput for an operation for aggregation. + RecordThroughput(service, operation, samplerType string, probability float64) + + // Start starts aggregating operation throughput. + Start() + + // Stop stops the aggregator from aggregating throughput. + Stop() +} + +type aggregator struct { + sync.Mutex + + operationsCounter metrics.Counter + servicesCounter metrics.Counter + currentThroughput serviceOperationThroughput + aggregationInterval time.Duration + storage samplingstore.Store + stop chan struct{} +} + +// NewAggregator creates a throughput aggregator that simply emits metrics +// about the number of operations seen over the aggregationInterval. +func NewAggregator(metricsFactory metrics.Factory, interval time.Duration, storage samplingstore.Store) Aggregator { + return &aggregator{ + operationsCounter: metricsFactory.Counter(metrics.Options{Name: "sampling_operations"}), + servicesCounter: metricsFactory.Counter(metrics.Options{Name: "sampling_services"}), + currentThroughput: make(serviceOperationThroughput), + aggregationInterval: interval, + storage: storage, + stop: make(chan struct{}), + } +} + +func (a *aggregator) runAggregationLoop() { + ticker := time.NewTicker(a.aggregationInterval) + for { + select { + case <-ticker.C: + a.Lock() + a.saveThroughput() + a.currentThroughput = make(serviceOperationThroughput) + a.Unlock() + case <-a.stop: + ticker.Stop() + return + } + } +} + +func (a *aggregator) saveThroughput() { + totalOperations := 0 + var throughputSlice []*model.Throughput + for _, opThroughput := range a.currentThroughput { + totalOperations += len(opThroughput) + for _, throughput := range opThroughput { + throughputSlice = append(throughputSlice, throughput) + } + } + a.operationsCounter.Inc(int64(totalOperations)) + a.servicesCounter.Inc(int64(len(a.currentThroughput))) + a.storage.InsertThroughput(throughputSlice) +} + +func (a *aggregator) RecordThroughput(service, operation, samplerType string, probability float64) { + a.Lock() + defer a.Unlock() + if _, ok := a.currentThroughput[service]; !ok { + a.currentThroughput[service] = make(map[string]*model.Throughput) + } + throughput, ok := a.currentThroughput[service][operation] + if !ok { + throughput = &model.Throughput{ + Service: service, + Operation: operation, + Probabilities: make(map[string]struct{}), + } + a.currentThroughput[service][operation] = throughput + } + probStr := TruncateFloat(probability) + if len(throughput.Probabilities) != maxProbabilities { + throughput.Probabilities[probStr] = struct{}{} + } + // Only if we see probabilistically sampled root spans do we increment the throughput counter, + // for lowerbound sampled spans, we don't increment at all but we still save a count of 0 as + // the throughput so that the adaptive sampling processor is made aware of the endpoint. + if samplerType == jaeger.SamplerTypeProbabilistic { + throughput.Count++ + } +} + +func (a *aggregator) Start() { + go a.runAggregationLoop() +} + +func (a *aggregator) Stop() { + close(a.stop) +} diff --git a/plugin/sampling/strategystore/adaptive/aggregator_test.go b/plugin/sampling/strategystore/adaptive/aggregator_test.go new file mode 100644 index 000000000000..3f5fba57f030 --- /dev/null +++ b/plugin/sampling/strategystore/adaptive/aggregator_test.go @@ -0,0 +1,91 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package adaptive + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/uber/jaeger-lib/metrics/metricstest" + + "github.com/jaegertracing/jaeger/storage/samplingstore/mocks" +) + +const ( + probabilistic = "probabilistic" + lowerbound = "lowerbound" +) + +func TestAggregator(t *testing.T) { + t.Skip("Skipping flaky unit test") + metricsFactory := metricstest.NewFactory(0) + + mockStorage := &mocks.Store{} + mockStorage.On("InsertThroughput", mock.AnythingOfType("[]*model.Throughput")).Return(nil) + + a := NewAggregator(metricsFactory, 5*time.Millisecond, mockStorage) + a.RecordThroughput("A", "GET", probabilistic, 0.001) + a.RecordThroughput("B", "POST", probabilistic, 0.001) + a.RecordThroughput("C", "GET", probabilistic, 0.001) + a.RecordThroughput("A", "POST", probabilistic, 0.001) + a.RecordThroughput("A", "GET", probabilistic, 0.001) + a.RecordThroughput("A", "GET", lowerbound, 0.001) + + a.Start() + defer a.Stop() + for i := 0; i < 10000; i++ { + counters, _ := metricsFactory.Snapshot() + if _, ok := counters["sampling_operations"]; ok { + break + } + time.Sleep(1 * time.Millisecond) + } + + metricsFactory.AssertCounterMetrics(t, []metricstest.ExpectedMetric{ + {Name: "sampling_operations", Value: 4}, + {Name: "sampling_services", Value: 3}, + }...) +} + +func TestIncrementThroughput(t *testing.T) { + metricsFactory := metricstest.NewFactory(0) + mockStorage := &mocks.Store{} + + a := NewAggregator(metricsFactory, 5*time.Millisecond, mockStorage) + // 20 different probabilities + for i := 0; i < 20; i++ { + a.RecordThroughput("A", "GET", probabilistic, 0.001*float64(i)) + } + assert.Len(t, a.(*aggregator).currentThroughput["A"]["GET"].Probabilities, 10) + + a = NewAggregator(metricsFactory, 5*time.Millisecond, mockStorage) + // 20 of the same probabilities + for i := 0; i < 20; i++ { + a.RecordThroughput("A", "GET", probabilistic, 0.001) + } + assert.Len(t, a.(*aggregator).currentThroughput["A"]["GET"].Probabilities, 1) +} + +func TestLowerboundThroughput(t *testing.T) { + metricsFactory := metricstest.NewFactory(0) + mockStorage := &mocks.Store{} + + a := NewAggregator(metricsFactory, 5*time.Millisecond, mockStorage) + a.RecordThroughput("A", "GET", lowerbound, 0.001) + assert.EqualValues(t, 0, a.(*aggregator).currentThroughput["A"]["GET"].Count) + assert.Empty(t, a.(*aggregator).currentThroughput["A"]["GET"].Probabilities["0.001000"]) +} diff --git a/plugin/sampling/strategystore/adaptive/root_span_handler.go b/plugin/sampling/strategystore/adaptive/root_span_handler.go new file mode 100644 index 000000000000..ec91af6f661c --- /dev/null +++ b/plugin/sampling/strategystore/adaptive/root_span_handler.go @@ -0,0 +1,42 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package adaptive + +import ( + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/cmd/collector/app" + "github.com/jaegertracing/jaeger/model" +) + +// HandleRootSpan returns a function that records throughput for root spans +func HandleRootSpan(aggregator Aggregator, logger *zap.Logger) app.ProcessSpan { + return func(span *model.Span) { + // TODO simply checking parentId to determine if a span is a root span is not sufficient. However, + // we can be sure that only a root span will have sampler tags. + if span.ParentSpanID() != model.NewSpanID(0) { + return + } + service := span.Process.ServiceName + if service == "" || span.OperationName == "" { + return + } + samplerType, samplerParam := GetSamplerParams(span, logger) + if samplerType == "" { + return + } + aggregator.RecordThroughput(service, span.OperationName, samplerType, samplerParam) + } +} diff --git a/plugin/sampling/strategystore/adaptive/root_span_handler_test.go b/plugin/sampling/strategystore/adaptive/root_span_handler_test.go new file mode 100644 index 000000000000..8fc8d388291e --- /dev/null +++ b/plugin/sampling/strategystore/adaptive/root_span_handler_test.go @@ -0,0 +1,65 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package adaptive + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/model" +) + +type mockAggregator struct { + callCount int +} + +func (t *mockAggregator) RecordThroughput(service, operation, samplerType string, probability float64) { + t.callCount++ +} +func (t *mockAggregator) Start() {} +func (t *mockAggregator) Stop() {} + +func TestHandleRootSpan(t *testing.T) { + aggregator := &mockAggregator{} + processor := HandleRootSpan(aggregator, zap.NewNop()) + + // Testing non-root span + span := &model.Span{References: []model.SpanRef{{SpanID: model.NewSpanID(1), RefType: model.ChildOf}}} + processor(span) + assert.Equal(t, 0, aggregator.callCount) + + // Testing span with service name but no operation + span.References = []model.SpanRef{} + span.Process = &model.Process{ + ServiceName: "service", + } + processor(span) + assert.Equal(t, 0, aggregator.callCount) + + // Testing span with service name and operation but no probabilistic sampling tags + span.OperationName = "GET" + processor(span) + assert.Equal(t, 0, aggregator.callCount) + + // Testing span with service name, operation, and probabilistic sampling tags + span.Tags = model.KeyValues{ + model.String("sampler.type", "probabilistic"), + model.String("sampler.param", "0.001"), + } + processor(span) + assert.Equal(t, 1, aggregator.callCount) +} diff --git a/plugin/sampling/strategystore/adaptive/span.go b/plugin/sampling/strategystore/adaptive/span.go new file mode 100644 index 000000000000..71a38258cfb4 --- /dev/null +++ b/plugin/sampling/strategystore/adaptive/span.go @@ -0,0 +1,70 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package adaptive + +import ( + "strconv" + + "github.com/uber/jaeger-client-go" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/model" +) + +// GetSamplerParams returns the sampler.type and sampler.param value if they are valid. +func GetSamplerParams(span *model.Span, logger *zap.Logger) (string, float64) { + // TODO move this into model.Span + tag, ok := model.KeyValues(span.Tags).FindByKey(jaeger.SamplerTypeTagKey) + if !ok { + return "", 0 + } + if tag.VType != model.StringType { + logger. + With(zap.String("traceID", span.TraceID.String())). + With(zap.String("spanID", span.SpanID.String())). + Warn("sampler.type tag is not a string", zap.Any("tag", tag)) + return "", 0 + } + samplerType := tag.AsString() + if samplerType != jaeger.SamplerTypeProbabilistic && samplerType != jaeger.SamplerTypeLowerBound && + samplerType != jaeger.SamplerTypeRateLimiting { + return "", 0 + } + tag, ok = model.KeyValues(span.Tags).FindByKey(jaeger.SamplerParamTagKey) + if !ok { + return "", 0 + } + samplerParam, err := getParam(tag) + if err != nil { + logger. + With(zap.String("traceID", span.TraceID.String())). + With(zap.String("spanID", span.SpanID.String())). + Warn("sampler.param tag is not a number", zap.Any("tag", tag)) + return "", 0 + } + return samplerType, samplerParam +} + +func getParam(samplerParamTag model.KeyValue) (float64, error) { + // The param could be represented as a string, an int, or a float + switch samplerParamTag.VType { + case model.Float64Type: + return samplerParamTag.Float64(), nil + case model.Int64Type: + return float64(samplerParamTag.Int64()), nil + default: + return strconv.ParseFloat(samplerParamTag.AsString(), 64) + } +} diff --git a/plugin/sampling/strategystore/adaptive/span_test.go b/plugin/sampling/strategystore/adaptive/span_test.go new file mode 100644 index 000000000000..02f4c1b8a715 --- /dev/null +++ b/plugin/sampling/strategystore/adaptive/span_test.go @@ -0,0 +1,137 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package adaptive + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/model" +) + +func TestGetSamplerParams(t *testing.T) { + logger := zap.NewNop() + tests := []struct { + tags model.KeyValues + expectedType string + expectedParam float64 + }{ + { + tags: model.KeyValues{ + model.String("sampler.type", "probabilistic"), + model.String("sampler.param", "1e-05"), + }, + expectedType: "probabilistic", + expectedParam: 0.00001, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "probabilistic"), + model.Float64("sampler.param", 0.10404450002098709), + }, + expectedType: "probabilistic", + expectedParam: 0.10404450002098709, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "probabilistic"), + model.String("sampler.param", "0.10404450002098709"), + }, + expectedType: "probabilistic", + expectedParam: 0.10404450002098709, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "probabilistic"), + model.Int64("sampler.param", 1), + }, + expectedType: "probabilistic", + expectedParam: 1.0, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "ratelimiting"), + model.String("sampler.param", "1"), + }, + expectedType: "ratelimiting", + expectedParam: 1, + }, + { + tags: model.KeyValues{ + model.Float64("sampler.type", 1.5), + }, + expectedType: "", + expectedParam: 0, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "probabilistic"), + }, + expectedType: "", + expectedParam: 0, + }, + { + tags: model.KeyValues{}, + expectedType: "", + expectedParam: 0, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "lowerbound"), + model.String("sampler.param", "1"), + }, + expectedType: "lowerbound", + expectedParam: 1, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "lowerbound"), + model.Int64("sampler.param", 1), + }, + expectedType: "lowerbound", + expectedParam: 1, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "lowerbound"), + model.Float64("sampler.param", 0.5), + }, + expectedType: "lowerbound", + expectedParam: 0.5, + }, + { + tags: model.KeyValues{ + model.String("sampler.type", "lowerbound"), + model.String("sampler.param", "not_a_number"), + }, + expectedType: "", + expectedParam: 0, + }, + } + + for i, test := range tests { + tt := test + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + span := &model.Span{} + span.Tags = tt.tags + actualType, actualParam := GetSamplerParams(span, logger) + assert.Equal(t, tt.expectedType, actualType) + assert.Equal(t, tt.expectedParam, actualParam) + }) + } +} From aefe42dbd4fc6b6e4ce68de48e65e1dc6236110c Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Mon, 7 Jun 2021 22:23:54 +1000 Subject: [PATCH 10/22] Remove templates (#3066) Signed-off-by: albertteoh --- .github/ISSUE_TEMPLATE/bug_report.md | 34 --------------------- .github/ISSUE_TEMPLATE/config.yml | 8 ----- .github/ISSUE_TEMPLATE/feature_request.md | 37 ----------------------- .github/PULL_REQUEST_TEMPLATE.md | 18 ----------- 4 files changed, 97 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 4152e06381a8..000000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. -2. -3. - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Version (please complete the following information):** - - OS: [e.g. Linux] - - Jaeger version: [e.g. 1.8] - - Deployment: [e.g. bare metal, Docker, Kubernetes, ...] - -**What troubleshooting steps did you try?** -Try to follow https://www.jaegertracing.io/docs/latest/troubleshooting/ and describe how far you were able to progress and/or which steps did not work. - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index c66604f2f17c..000000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Question via Jaeger Community Support (online chat) - url: https://cloud-native.slack.com/archives/CGG7NFUJ3 - about: Please ask and answer questions here for faster response. - - name: Question via GitHub Discussions (similar to Stack Overflow) - url: https://github.com/jaegertracing/jaeger/discussions - about: Please ask and answer questions here for async response. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 9fe43484d50d..000000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - - - -## Requirement - what kind of business use case are you trying to solve? - - - -## Problem - what in Jaeger blocks you from solving the requirement? - - - - -## Proposal - what do you suggest to solve the problem or improve the existing situation? - - - -## Any open questions to address - - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index ef69c5fa7eb6..000000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,18 +0,0 @@ - - -## Which problem is this PR solving? -- - -## Short description of the changes -- From a2b2e4bb85693b32451a68b5c5a36f2c40f742d2 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Tue, 8 Jun 2021 17:26:50 +0200 Subject: [PATCH 11/22] Upgrade gRPC to 1.38.x (#3056) * Upgrade gRPC to 1.38.x Signed-off-by: Pavol Loffay * ui Signed-off-by: Pavol Loffay * Fix thrift Signed-off-by: Pavol Loffay * fix ugly thrift Signed-off-by: Pavol Loffay * Add test Signed-off-by: Pavol Loffay * Add wire compatibility test Signed-off-by: Pavol Loffay * import fmt Signed-off-by: Pavol Loffay * more tests Signed-off-by: Pavol Loffay * Bump mux Signed-off-by: Pavol Loffay * Add benchmark Signed-off-by: Pavol Loffay * move package Signed-off-by: Pavol Loffay * lint Signed-off-by: Pavol Loffay --- Makefile | 4 +- cmd/agent/app/reporter/grpc/builder.go | 13 +- cmd/collector/app/zipkin/http_handler.go | 2 +- cmd/collector/app/zipkin/http_handler_test.go | 2 +- cmd/query/app/grpc_handler.go | 1 + go.mod | 14 +- go.sum | 80 +- model/ids_test.go | 2 +- model/model.pb.go | 795 ++++---- model/prototest/model_test.pb.go | 252 ++- model/span_test.go | 52 + pkg/gogocodec/codec.go | 73 + pkg/gogocodec/codec_test.go | 69 + .../proto/storageprototest/storage_test.pb.go | 182 +- plugin/storage/grpc/shared/plugin.go | 1 + plugin/storage/integration/grpc_test.go | 2 + plugin/storage/memory/memory.go | 2 +- proto-gen/api_v2/collector.pb.go | 144 +- proto-gen/api_v2/metrics/metricsquery.pb.go | 475 ++--- proto-gen/api_v2/metrics/openmetrics.pb.go | 1783 +++++++---------- proto-gen/api_v2/metrics/otelspankind.pb.go | 2 +- proto-gen/api_v2/query.pb.go | 728 +++---- proto-gen/api_v2/sampling.pb.go | 380 ++-- proto-gen/storage_v1/storage.pb.go | 917 +++++---- proto-gen/zipkin/zipkin.pb.go | 12 +- 25 files changed, 3179 insertions(+), 2808 deletions(-) create mode 100644 pkg/gogocodec/codec.go create mode 100644 pkg/gogocodec/codec_test.go diff --git a/Makefile b/Makefile index 960fd298af84..956fe51b0a61 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ SWAGGER_IMAGE=quay.io/goswagger/swagger:v$(SWAGGER_VER) SWAGGER=docker run --rm -it -u ${shell id -u} -v "${PWD}:/go/src/" -w /go/src/ $(SWAGGER_IMAGE) SWAGGER_GEN_DIR=swagger-gen -JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.2.0 +JAEGER_DOCKER_PROTOBUF=jaegertracing/protobuf:0.3.0 COLOR_PASS=$(shell printf "\033[32mPASS\033[0m") COLOR_FAIL=$(shell printf "\033[31mFAIL\033[0m") @@ -172,6 +172,8 @@ lint-staticcheck: time staticcheck ./... \ | grep -v \ -e model/model.pb.go \ + -e proto-gen \ + -e _test.pb.go \ -e thrift-gen/ \ -e swagger-gen/ \ >> $(LINT_LOG) || true diff --git a/cmd/agent/app/reporter/grpc/builder.go b/cmd/agent/app/reporter/grpc/builder.go index 4f220c0a9b9d..e228293ab31f 100644 --- a/cmd/agent/app/reporter/grpc/builder.go +++ b/cmd/agent/app/reporter/grpc/builder.go @@ -18,7 +18,9 @@ import ( "context" "errors" "fmt" + "strconv" "strings" + "time" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" "github.com/uber/jaeger-lib/metrics" @@ -80,7 +82,7 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact return nil, errors.New("at least one collector hostPort address is required when resolver is not available") } if len(b.CollectorHostPorts) > 1 { - r, _ := manual.GenerateAndRegisterManualResolver() + r, _ := generateAndRegisterManualResolver() var resolvedAddrs []resolver.Address for _, addr := range b.CollectorHostPorts { resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: addr}) @@ -123,3 +125,12 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact return conn, nil } + +// generateAndRegisterManualResolver was removed from grpc. +// Copied here to keep behavior the same. +func generateAndRegisterManualResolver() (*manual.Resolver, func()) { + scheme := strconv.FormatInt(time.Now().UnixNano(), 36) + r := manual.NewBuilderWithScheme(scheme) + resolver.Register(r) + return r, func() { resolver.UnregisterForTesting(scheme) } +} diff --git a/cmd/collector/app/zipkin/http_handler.go b/cmd/collector/app/zipkin/http_handler.go index a84326b41b6c..9b795b563ed3 100644 --- a/cmd/collector/app/zipkin/http_handler.go +++ b/cmd/collector/app/zipkin/http_handler.go @@ -28,7 +28,7 @@ import ( "github.com/go-openapi/loads" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/jaegertracing/jaeger/cmd/collector/app/handler" diff --git a/cmd/collector/app/zipkin/http_handler_test.go b/cmd/collector/app/zipkin/http_handler_test.go index 4db665de07ba..d4da3f8301b7 100644 --- a/cmd/collector/app/zipkin/http_handler_test.go +++ b/cmd/collector/app/zipkin/http_handler_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/cmd/query/app/grpc_handler.go b/cmd/query/app/grpc_handler.go index 598df0a4bcca..bc223230daeb 100644 --- a/cmd/query/app/grpc_handler.go +++ b/cmd/query/app/grpc_handler.go @@ -24,6 +24,7 @@ import ( "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" "github.com/jaegertracing/jaeger/model" + _ "github.com/jaegertracing/jaeger/pkg/gogocodec" //force gogo codec registration "github.com/jaegertracing/jaeger/proto-gen/api_v2" "github.com/jaegertracing/jaeger/storage/spanstore" ) diff --git a/go.mod b/go.mod index c6792a0df0b8..7ce316a5fae7 100644 --- a/go.mod +++ b/go.mod @@ -26,10 +26,10 @@ require ( github.com/gogo/googleapis v1.4.1 github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.4.3 // indirect - github.com/golang/protobuf v1.3.5 + github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 + github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 github.com/hashicorp/go-hclog v0.16.1 github.com/hashicorp/go-plugin v1.4.2 @@ -65,10 +65,12 @@ require ( go.uber.org/atomic v1.7.0 go.uber.org/automaxprocs v1.4.0 go.uber.org/zap v1.17.0 - golang.org/x/lint v0.0.0-20200302205851-738671d3881b - golang.org/x/net v0.0.0-20210510120150-4163338589ed - golang.org/x/sys v0.0.0-20210423082822-04245dca01da - google.golang.org/grpc v1.29.1 + golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 + golang.org/x/net v0.0.0-20210525063256-abc453219eb5 + golang.org/x/sys v0.0.0-20210603125802-9665404d3644 + google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect + google.golang.org/grpc v1.38.0 + google.golang.org/protobuf v1.26.0 gopkg.in/ini.v1 v1.52.0 // indirect gopkg.in/yaml.v2 v2.4.0 honnef.co/go/tools v0.2.0 diff --git a/go.sum b/go.sum index 3452e673730e..f7370a01dcb6 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,10 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.14.1 h1:Yh8v0hpCj63p5edXOLaqTJW0IJ1p+eMW6+YSOqw1d6s= +github.com/apache/thrift v0.14.1/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= 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= @@ -78,6 +82,7 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= @@ -129,6 +134,7 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= 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 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= @@ -148,6 +154,7 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= @@ -301,8 +308,16 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -314,17 +329,20 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= @@ -334,6 +352,8 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= @@ -343,8 +363,8 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -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-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -663,6 +683,7 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -700,6 +721,7 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/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/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= @@ -757,6 +779,7 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -767,16 +790,18 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= +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= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -805,6 +830,7 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL 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= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -812,9 +838,10 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/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-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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= @@ -826,6 +853,7 @@ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -852,6 +880,7 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/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= @@ -862,11 +891,15 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -916,10 +949,12 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200203023011-6f24f261dadb/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= +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= @@ -947,8 +982,10 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215 h1:0Uz5jLJQioKgVozXa1gzGbzYxbb/rhQEVvSWxzw5oUs= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -963,8 +1000,21 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +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= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +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 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/model/ids_test.go b/model/ids_test.go index aa9af0babfd0..19eb6e14d04c 100644 --- a/model/ids_test.go +++ b/model/ids_test.go @@ -20,7 +20,7 @@ import ( "testing" "github.com/gogo/protobuf/jsonpb" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/model/model.pb.go b/model/model.pb.go index 166307a44a84..42290c9cce59 100644 --- a/model/model.pb.go +++ b/model/model.pb.go @@ -13,6 +13,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -26,7 +27,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ValueType int32 @@ -114,7 +115,7 @@ func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -204,7 +205,7 @@ func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Log.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -260,7 +261,7 @@ func (m *SpanRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpanRef.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -308,7 +309,7 @@ func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Process.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -373,7 +374,7 @@ func (m *Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Span.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -478,7 +479,7 @@ func (m *Trace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Trace.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -540,7 +541,7 @@ func (m *Trace_ProcessMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_Trace_ProcessMapping.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -604,7 +605,7 @@ func (m *Batch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Batch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -661,7 +662,7 @@ func (m *DependencyLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_DependencyLink.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -905,7 +906,7 @@ func (this *KeyValue) Equal(that interface{}) bool { func (m *KeyValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -913,64 +914,73 @@ func (m *KeyValue) Marshal() (dAtA []byte, err error) { } func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.VType != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.VType)) + if len(m.VBinary) > 0 { + i -= len(m.VBinary) + copy(dAtA[i:], m.VBinary) + i = encodeVarintModel(dAtA, i, uint64(len(m.VBinary))) + i-- + dAtA[i] = 0x3a } - if len(m.VStr) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.VStr))) - i += copy(dAtA[i:], m.VStr) + if m.VFloat64 != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.VFloat64)))) + i-- + dAtA[i] = 0x31 + } + if m.VInt64 != 0 { + i = encodeVarintModel(dAtA, i, uint64(m.VInt64)) + i-- + dAtA[i] = 0x28 } if m.VBool { - dAtA[i] = 0x20 - i++ + i-- if m.VBool { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.VInt64 != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.VInt64)) + i-- + dAtA[i] = 0x20 } - if m.VFloat64 != 0 { - dAtA[i] = 0x31 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.VFloat64)))) - i += 8 + if len(m.VStr) > 0 { + i -= len(m.VStr) + copy(dAtA[i:], m.VStr) + i = encodeVarintModel(dAtA, i, uint64(len(m.VStr))) + i-- + dAtA[i] = 0x1a } - if len(m.VBinary) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.VBinary))) - i += copy(dAtA[i:], m.VBinary) + if m.VType != 0 { + i = encodeVarintModel(dAtA, i, uint64(m.VType)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintModel(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Log) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -978,40 +988,48 @@ func (m *Log) Marshal() (dAtA []byte, err error) { } func (m *Log) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Log) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n1 if len(m.Fields) > 0 { - for _, msg := range m.Fields { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err1 != nil { + return 0, err1 } - return i, nil + i -= n1 + i = encodeVarintModel(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SpanRef) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1019,41 +1037,51 @@ func (m *SpanRef) Marshal() (dAtA []byte, err error) { } func (m *SpanRef) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpanRef) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(m.TraceID.Size())) - n2, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.SpanID.Size())) - n3, err := m.SpanID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n3 if m.RefType != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintModel(dAtA, i, uint64(m.RefType)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + { + size := m.SpanID.Size() + i -= size + if _, err := m.SpanID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintModel(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Process) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1061,38 +1089,47 @@ func (m *Process) Marshal() (dAtA []byte, err error) { } func (m *Process) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Process) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Tags) > 0 { - for _, msg := range m.Tags { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ServiceName) > 0 { + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) + i = encodeVarintModel(dAtA, i, uint64(len(m.ServiceName))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Span) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1100,130 +1137,144 @@ func (m *Span) Marshal() (dAtA []byte, err error) { } func (m *Span) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Span) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(m.TraceID.Size())) - n4, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n4 - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.SpanID.Size())) - n5, err := m.SpanID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = encodeVarintModel(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x62 + } } - i += n5 - if len(m.OperationName) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.OperationName))) - i += copy(dAtA[i:], m.OperationName) + if len(m.ProcessID) > 0 { + i -= len(m.ProcessID) + copy(dAtA[i:], m.ProcessID) + i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) + i-- + dAtA[i] = 0x5a } - if len(m.References) > 0 { - for _, msg := range m.References { - dAtA[i] = 0x22 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.Process != nil { + { + size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x52 } - if m.Flags != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Flags)) - } - dAtA[i] = 0x32 - i++ - i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - dAtA[i] = 0x3a - i++ - i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration))) - n7, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i:]) - if err != nil { - return 0, err + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } } - i += n7 if len(m.Tags) > 0 { - for _, msg := range m.Tags { - dAtA[i] = 0x42 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x42 } } - if len(m.Logs) > 0 { - for _, msg := range m.Logs { - dAtA[i] = 0x4a - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintModel(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x3a + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintModel(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x32 + if m.Flags != 0 { + i = encodeVarintModel(dAtA, i, uint64(m.Flags)) + i-- + dAtA[i] = 0x28 + } + if len(m.References) > 0 { + for iNdEx := len(m.References) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.References[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } - if m.Process != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Process.Size())) - n8, err := m.Process.MarshalTo(dAtA[i:]) - if err != nil { + if len(m.OperationName) > 0 { + i -= len(m.OperationName) + copy(dAtA[i:], m.OperationName) + i = encodeVarintModel(dAtA, i, uint64(len(m.OperationName))) + i-- + dAtA[i] = 0x1a + } + { + size := m.SpanID.Size() + i -= size + if _, err := m.SpanID.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i += n8 - } - if len(m.ProcessID) > 0 { - dAtA[i] = 0x5a - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) - i += copy(dAtA[i:], m.ProcessID) + i = encodeVarintModel(dAtA, i, uint64(size)) } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - dAtA[i] = 0x62 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0x12 + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintModel(dAtA, i, uint64(size)) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Trace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1231,59 +1282,63 @@ func (m *Trace) Marshal() (dAtA []byte, err error) { } func (m *Trace) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Trace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = encodeVarintModel(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.ProcessMap) > 0 { - for _, msg := range m.ProcessMap { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.ProcessMap) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProcessMap[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ + if len(m.Spans) > 0 { + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *Trace_ProcessMapping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1291,34 +1346,43 @@ func (m *Trace_ProcessMapping) Marshal() (dAtA []byte, err error) { } func (m *Trace_ProcessMapping) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Trace_ProcessMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ProcessID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) - i += copy(dAtA[i:], m.ProcessID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Process.Size())) - n9, err := m.Process.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - i += n9 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x12 + if len(m.ProcessID) > 0 { + i -= len(m.ProcessID) + copy(dAtA[i:], m.ProcessID) + i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Batch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1326,42 +1390,52 @@ func (m *Batch) Marshal() (dAtA []byte, err error) { } func (m *Batch) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Batch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Process != nil { + { + size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) } - } - if m.Process != nil { + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(m.Process.Size())) - n10, err := m.Process.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Spans) > 0 { + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *DependencyLink) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1369,47 +1443,58 @@ func (m *DependencyLink) Marshal() (dAtA []byte, err error) { } func (m *DependencyLink) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DependencyLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Parent) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Parent))) - i += copy(dAtA[i:], m.Parent) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Child) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Child))) - i += copy(dAtA[i:], m.Child) + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintModel(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x22 } if m.CallCount != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintModel(dAtA, i, uint64(m.CallCount)) + i-- + dAtA[i] = 0x18 } - if len(m.Source) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintModel(dAtA, i, uint64(len(m.Source))) - i += copy(dAtA[i:], m.Source) + if len(m.Child) > 0 { + i -= len(m.Child) + copy(dAtA[i:], m.Child) + i = encodeVarintModel(dAtA, i, uint64(len(m.Child))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Parent) > 0 { + i -= len(m.Parent) + copy(dAtA[i:], m.Parent) + i = encodeVarintModel(dAtA, i, uint64(len(m.Parent))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintModel(dAtA []byte, offset int, v uint64) int { + offset -= sovModel(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *KeyValue) Size() (n int) { if m == nil { @@ -1665,14 +1750,7 @@ func (m *DependencyLink) Size() (n int) { } func sovModel(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozModel(x uint64) (n int) { return sovModel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1879,10 +1957,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2000,10 +2075,7 @@ func (m *Log) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2139,10 +2211,7 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2259,10 +2328,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2698,10 +2764,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2852,10 +2915,7 @@ func (m *Trace) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -2971,10 +3031,7 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -3095,10 +3152,7 @@ func (m *Batch) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -3264,10 +3318,7 @@ func (m *DependencyLink) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthModel } if (iNdEx + skippy) > l { @@ -3286,6 +3337,7 @@ func (m *DependencyLink) Unmarshal(dAtA []byte) error { func skipModel(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -3317,10 +3369,8 @@ func skipModel(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -3341,55 +3391,30 @@ func skipModel(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthModel } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthModel - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipModel(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthModel - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModel + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthModel + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModel = fmt.Errorf("proto: unexpected end of group") ) diff --git a/model/prototest/model_test.pb.go b/model/prototest/model_test.pb.go index 875c6f03cf24..4171214d4953 100644 --- a/model/prototest/model_test.pb.go +++ b/model/prototest/model_test.pb.go @@ -1,24 +1,43 @@ +// Copyright (c) 2018 Uber Technologies, Inc. +// +// 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. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.14.0 // source: model_test.proto package prototest import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type SpanRefType int32 @@ -27,98 +46,189 @@ const ( SpanRefType_FOLLOWS_FROM SpanRefType = 1 ) -var SpanRefType_name = map[int32]string{ - 0: "CHILD_OF", - 1: "FOLLOWS_FROM", -} +// Enum value maps for SpanRefType. +var ( + SpanRefType_name = map[int32]string{ + 0: "CHILD_OF", + 1: "FOLLOWS_FROM", + } + SpanRefType_value = map[string]int32{ + "CHILD_OF": 0, + "FOLLOWS_FROM": 1, + } +) -var SpanRefType_value = map[string]int32{ - "CHILD_OF": 0, - "FOLLOWS_FROM": 1, +func (x SpanRefType) Enum() *SpanRefType { + p := new(SpanRefType) + *p = x + return p } func (x SpanRefType) String() string { - return proto.EnumName(SpanRefType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (SpanRefType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7d019f60590a05da, []int{0} +func (SpanRefType) Descriptor() protoreflect.EnumDescriptor { + return file_model_test_proto_enumTypes[0].Descriptor() } -type SpanRef struct { - TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` - SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` - RefType SpanRefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=prototest.SpanRefType" json:"ref_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (SpanRefType) Type() protoreflect.EnumType { + return &file_model_test_proto_enumTypes[0] } -func (m *SpanRef) Reset() { *m = SpanRef{} } -func (m *SpanRef) String() string { return proto.CompactTextString(m) } -func (*SpanRef) ProtoMessage() {} -func (*SpanRef) Descriptor() ([]byte, []int) { - return fileDescriptor_7d019f60590a05da, []int{0} +func (x SpanRefType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *SpanRef) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SpanRef.Unmarshal(m, b) +// Deprecated: Use SpanRefType.Descriptor instead. +func (SpanRefType) EnumDescriptor() ([]byte, []int) { + return file_model_test_proto_rawDescGZIP(), []int{0} } -func (m *SpanRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SpanRef.Marshal(b, m, deterministic) + +type SpanRef struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + RefType SpanRefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=prototest.SpanRefType" json:"ref_type,omitempty"` } -func (m *SpanRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpanRef.Merge(m, src) + +func (x *SpanRef) Reset() { + *x = SpanRef{} + if protoimpl.UnsafeEnabled { + mi := &file_model_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SpanRef) XXX_Size() int { - return xxx_messageInfo_SpanRef.Size(m) + +func (x *SpanRef) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SpanRef) XXX_DiscardUnknown() { - xxx_messageInfo_SpanRef.DiscardUnknown(m) + +func (*SpanRef) ProtoMessage() {} + +func (x *SpanRef) ProtoReflect() protoreflect.Message { + mi := &file_model_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SpanRef proto.InternalMessageInfo +// Deprecated: Use SpanRef.ProtoReflect.Descriptor instead. +func (*SpanRef) Descriptor() ([]byte, []int) { + return file_model_test_proto_rawDescGZIP(), []int{0} +} -func (m *SpanRef) GetTraceId() []byte { - if m != nil { - return m.TraceId +func (x *SpanRef) GetTraceId() []byte { + if x != nil { + return x.TraceId } return nil } -func (m *SpanRef) GetSpanId() []byte { - if m != nil { - return m.SpanId +func (x *SpanRef) GetSpanId() []byte { + if x != nil { + return x.SpanId } return nil } -func (m *SpanRef) GetRefType() SpanRefType { - if m != nil { - return m.RefType +func (x *SpanRef) GetRefType() SpanRefType { + if x != nil { + return x.RefType } return SpanRefType_CHILD_OF } -func init() { - proto.RegisterEnum("prototest.SpanRefType", SpanRefType_name, SpanRefType_value) - proto.RegisterType((*SpanRef)(nil), "prototest.SpanRef") +var File_model_test_proto protoreflect.FileDescriptor + +var file_model_test_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x22, 0x70, 0x0a, + 0x07, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x08, + 0x72, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x52, + 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x2a, + 0x2d, 0x0a, 0x0b, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, + 0x0a, 0x08, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x5f, 0x4f, 0x46, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, + 0x46, 0x4f, 0x4c, 0x4c, 0x4f, 0x57, 0x53, 0x5f, 0x46, 0x52, 0x4f, 0x4d, 0x10, 0x01, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func init() { proto.RegisterFile("model_test.proto", fileDescriptor_7d019f60590a05da) } +var ( + file_model_test_proto_rawDescOnce sync.Once + file_model_test_proto_rawDescData = file_model_test_proto_rawDesc +) -var fileDescriptor_7d019f60590a05da = []byte{ - // 178 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0xcd, 0x4f, 0x49, - 0xcd, 0x89, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x04, 0x53, - 0x20, 0x01, 0xa5, 0x02, 0x2e, 0xf6, 0xe0, 0x82, 0xc4, 0xbc, 0xa0, 0xd4, 0x34, 0x21, 0x49, 0x2e, - 0x8e, 0x92, 0xa2, 0xc4, 0xe4, 0xd4, 0xf8, 0xcc, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x9e, 0x20, - 0x76, 0x30, 0xdf, 0x33, 0x45, 0x48, 0x9c, 0x8b, 0xbd, 0xb8, 0x20, 0x31, 0x0f, 0x24, 0xc3, 0x04, - 0x96, 0x61, 0x03, 0x71, 0x3d, 0x53, 0x84, 0x0c, 0xb9, 0x38, 0x8a, 0x52, 0xd3, 0xe2, 0x4b, 0x2a, - 0x0b, 0x52, 0x25, 0x98, 0x15, 0x18, 0x35, 0xf8, 0x8c, 0xc4, 0xf4, 0xe0, 0x86, 0xeb, 0x41, 0x4d, - 0x0e, 0xa9, 0x2c, 0x48, 0x0d, 0x62, 0x2f, 0x82, 0x30, 0xb4, 0x74, 0xb9, 0xb8, 0x91, 0xc4, 0x85, - 0x78, 0xb8, 0x38, 0x9c, 0x3d, 0x3c, 0x7d, 0x5c, 0xe2, 0xfd, 0xdd, 0x04, 0x18, 0x84, 0x04, 0xb8, - 0x78, 0xdc, 0xfc, 0x7d, 0x7c, 0xfc, 0xc3, 0x83, 0xe3, 0xdd, 0x82, 0xfc, 0x7d, 0x05, 0x18, 0x93, - 0xd8, 0xc0, 0xc6, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x29, 0x73, 0x43, 0x66, 0xc6, 0x00, - 0x00, 0x00, +func file_model_test_proto_rawDescGZIP() []byte { + file_model_test_proto_rawDescOnce.Do(func() { + file_model_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_test_proto_rawDescData) + }) + return file_model_test_proto_rawDescData +} + +var file_model_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_model_test_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_model_test_proto_goTypes = []interface{}{ + (SpanRefType)(0), // 0: prototest.SpanRefType + (*SpanRef)(nil), // 1: prototest.SpanRef +} +var file_model_test_proto_depIdxs = []int32{ + 0, // 0: prototest.SpanRef.ref_type:type_name -> prototest.SpanRefType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_model_test_proto_init() } +func file_model_test_proto_init() { + if File_model_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_model_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SpanRef); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_model_test_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_model_test_proto_goTypes, + DependencyIndexes: file_model_test_proto_depIdxs, + EnumInfos: file_model_test_proto_enumTypes, + MessageInfos: file_model_test_proto_msgTypes, + }.Build() + File_model_test_proto = out.File + file_model_test_proto_rawDesc = nil + file_model_test_proto_goTypes = nil + file_model_test_proto_depIdxs = nil } diff --git a/model/span_test.go b/model/span_test.go index 2fafe3ca9a3e..6c2099bd9eb9 100644 --- a/model/span_test.go +++ b/model/span_test.go @@ -22,6 +22,7 @@ import ( "time" "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" "github.com/opentracing/opentracing-go/ext" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -331,3 +332,54 @@ func BenchmarkSpanHash(b *testing.B) { span.Hash(buf) } } + +func BenchmarkBatchSerialization(b *testing.B) { + batch := &model.Batch{ + Spans: []*model.Span{ + { + TraceID: model.NewTraceID(154, 1879), + SpanID: model.NewSpanID(66974), + OperationName: "test_op", + References: []model.SpanRef{ + { + TraceID: model.NewTraceID(45, 12), + SpanID: model.NewSpanID(789), + RefType: model.SpanRefType_CHILD_OF, + }, + }, + Flags: 0, + StartTime: time.Now(), + Duration: time.Second, + Tags: []model.KeyValue{ + model.String("foo", "bar"), model.Bool("haha", true), + }, + Logs: []model.Log{ + { + Timestamp: time.Now(), + Fields: []model.KeyValue{ + model.String("foo", "bar"), model.Int64("bar", 156), + }, + }, + }, + Process: model.NewProcess("process1", []model.KeyValue{model.String("aaa", "bbb")}), + ProcessID: "156", + }, + }, + Process: nil, + } + + b.Run("marshal", func(b *testing.B) { + for i := 0; i < b.N; i++ { + proto.Marshal(batch) + } + }) + + data, err := proto.Marshal(batch) + require.NoError(b, err) + b.Run("unmarshal", func(b *testing.B) { + for i := 0; i < b.N; i++ { + var batch2 model.Batch + proto.Unmarshal(data, &batch2) + } + }) +} diff --git a/pkg/gogocodec/codec.go b/pkg/gogocodec/codec.go new file mode 100644 index 000000000000..e16e62304c0f --- /dev/null +++ b/pkg/gogocodec/codec.go @@ -0,0 +1,73 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gogocodec + +import ( + "reflect" + "strings" + + gogoproto "github.com/gogo/protobuf/proto" + "google.golang.org/grpc/encoding" + "google.golang.org/protobuf/proto" +) + +const jaegerProtoGenPkgPath = "github.com/jaegertracing/jaeger/proto-gen" +const jaegerModelPkgPath = "github.com/jaegertracing/jaeger/model" + +func init() { + encoding.RegisterCodec(newCodec()) +} + +// gogoCodec forces the use of gogo proto marshalling/unmarshalling for +// Jaeger proto types (package jaeger/gen-proto). +type gogoCodec struct { +} + +var _ encoding.Codec = (*gogoCodec)(nil) + +func newCodec() *gogoCodec { + return &gogoCodec{} +} + +// Name implements encoding.Codec +func (c *gogoCodec) Name() string { + return "proto" +} + +// Marshal implements encoding.Codec +func (c *gogoCodec) Marshal(v interface{}) ([]byte, error) { + t := reflect.TypeOf(v) + elem := t.Elem() + // use gogo proto only for Jaeger types + if useGogo(elem) { + return gogoproto.Marshal(v.(gogoproto.Message)) + } + return proto.Marshal(v.(proto.Message)) +} + +// Unmarshal implements encoding.Codec +func (c *gogoCodec) Unmarshal(data []byte, v interface{}) error { + t := reflect.TypeOf(v) + elem := t.Elem() + // use gogo proto only for Jaeger types + if useGogo(elem) { + return gogoproto.Unmarshal(data, v.(gogoproto.Message)) + } + return proto.Unmarshal(data, v.(proto.Message)) +} + +func useGogo(t reflect.Type) bool { + return t != nil && (strings.HasPrefix(t.PkgPath(), jaegerProtoGenPkgPath) || strings.HasPrefix(t.PkgPath(), jaegerModelPkgPath)) +} diff --git a/pkg/gogocodec/codec_test.go b/pkg/gogocodec/codec_test.go new file mode 100644 index 000000000000..7e05f6323cc7 --- /dev/null +++ b/pkg/gogocodec/codec_test.go @@ -0,0 +1,69 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gogocodec + +import ( + "testing" + + "github.com/golang/protobuf/proto" //lint:ignore SA1019 deprecated package + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/emptypb" + + "github.com/jaegertracing/jaeger/model" +) + +func TestCodecMarshallAndUnmarshall_jaeger_type(t *testing.T) { + c := newCodec() + s1 := &model.Span{OperationName: "foo", TraceID: model.NewTraceID(1, 2)} + data, err := c.Marshal(s1) + require.NoError(t, err) + + s2 := &model.Span{} + err = c.Unmarshal(data, s2) + require.NoError(t, err) + assert.Equal(t, s1, s2) +} + +func TestCodecMarshallAndUnmarshall_no_jaeger_type(t *testing.T) { + c := newCodec() + goprotoMessage1 := &emptypb.Empty{} + data, err := c.Marshal(goprotoMessage1) + require.NoError(t, err) + + goprotoMessage2 := &emptypb.Empty{} + err = c.Unmarshal(data, goprotoMessage2) + require.NoError(t, err) + assert.Equal(t, goprotoMessage1, goprotoMessage2) +} + +func TestWireCompatibility(t *testing.T) { + c := newCodec() + s1 := &model.Span{OperationName: "foo", TraceID: model.NewTraceID(1, 2)} + data, err := c.Marshal(s1) + require.NoError(t, err) + + var goprotoMessage emptypb.Empty + err = proto.Unmarshal(data, &goprotoMessage) + require.NoError(t, err) + + data2, err := proto.Marshal(&goprotoMessage) + require.NoError(t, err) + + s2 := &model.Span{} + err = c.Unmarshal(data2, s2) + require.NoError(t, err) + assert.Equal(t, s1, s2) +} diff --git a/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go b/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go index 6d2e3882717b..96b907a5f236 100644 --- a/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go +++ b/plugin/storage/grpc/proto/storageprototest/storage_test.pb.go @@ -1,77 +1,161 @@ +// 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. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.14.0 // source: storage_test.proto package storageprototest import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 type GetTraceRequest struct { - TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` } -func (m *GetTraceRequest) Reset() { *m = GetTraceRequest{} } -func (m *GetTraceRequest) String() string { return proto.CompactTextString(m) } -func (*GetTraceRequest) ProtoMessage() {} -func (*GetTraceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_84f9f21738fa9462, []int{0} +func (x *GetTraceRequest) Reset() { + *x = GetTraceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetTraceRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTraceRequest.Unmarshal(m, b) +func (x *GetTraceRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTraceRequest.Marshal(b, m, deterministic) + +func (*GetTraceRequest) ProtoMessage() {} + +func (x *GetTraceRequest) ProtoReflect() protoreflect.Message { + mi := &file_storage_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *GetTraceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTraceRequest.Merge(m, src) + +// Deprecated: Use GetTraceRequest.ProtoReflect.Descriptor instead. +func (*GetTraceRequest) Descriptor() ([]byte, []int) { + return file_storage_test_proto_rawDescGZIP(), []int{0} } -func (m *GetTraceRequest) XXX_Size() int { - return xxx_messageInfo_GetTraceRequest.Size(m) + +func (x *GetTraceRequest) GetTraceId() []byte { + if x != nil { + return x.TraceId + } + return nil } -func (m *GetTraceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTraceRequest.DiscardUnknown(m) + +var File_storage_test_proto protoreflect.FileDescriptor + +var file_storage_test_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x74, 0x65, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x49, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var xxx_messageInfo_GetTraceRequest proto.InternalMessageInfo +var ( + file_storage_test_proto_rawDescOnce sync.Once + file_storage_test_proto_rawDescData = file_storage_test_proto_rawDesc +) -func (m *GetTraceRequest) GetTraceId() []byte { - if m != nil { - return m.TraceId - } - return nil +func file_storage_test_proto_rawDescGZIP() []byte { + file_storage_test_proto_rawDescOnce.Do(func() { + file_storage_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_storage_test_proto_rawDescData) + }) + return file_storage_test_proto_rawDescData } -func init() { - proto.RegisterType((*GetTraceRequest)(nil), "storageprototest.GetTraceRequest") +var file_storage_test_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_storage_test_proto_goTypes = []interface{}{ + (*GetTraceRequest)(nil), // 0: storageprototest.GetTraceRequest +} +var file_storage_test_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("storage_test.proto", fileDescriptor_84f9f21738fa9462) } - -var fileDescriptor_84f9f21738fa9462 = []byte{ - // 97 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x2e, 0xc9, 0x2f, - 0x4a, 0x4c, 0x4f, 0x8d, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x80, 0x8a, 0x81, 0x79, 0x20, 0x71, 0x25, 0x1d, 0x2e, 0x7e, 0xf7, 0xd4, 0x92, 0x90, 0xa2, 0xc4, - 0xe4, 0xd4, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0x21, 0x49, 0x2e, 0x8e, 0x12, 0x10, 0x3f, - 0x3e, 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0x27, 0x88, 0x1d, 0xcc, 0xf7, 0x4c, 0x49, 0x62, - 0x03, 0x6b, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x56, 0x76, 0x68, 0x5c, 0x00, 0x00, - 0x00, +func init() { file_storage_test_proto_init() } +func file_storage_test_proto_init() { + if File_storage_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_storage_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTraceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_storage_test_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_storage_test_proto_goTypes, + DependencyIndexes: file_storage_test_proto_depIdxs, + MessageInfos: file_storage_test_proto_msgTypes, + }.Build() + File_storage_test_proto = out.File + file_storage_test_proto_rawDesc = nil + file_storage_test_proto_goTypes = nil + file_storage_test_proto_depIdxs = nil } diff --git a/plugin/storage/grpc/shared/plugin.go b/plugin/storage/grpc/shared/plugin.go index caae9f81a8c6..6ac3c2f8c6e2 100644 --- a/plugin/storage/grpc/shared/plugin.go +++ b/plugin/storage/grpc/shared/plugin.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" + _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration "github.com/jaegertracing/jaeger/proto-gen/storage_v1" ) diff --git a/plugin/storage/integration/grpc_test.go b/plugin/storage/integration/grpc_test.go index 613bd5819cfb..e9ce29968c7c 100644 --- a/plugin/storage/integration/grpc_test.go +++ b/plugin/storage/integration/grpc_test.go @@ -44,6 +44,8 @@ func (s *GRPCStorageIntegrationTestSuite) initialize() error { err := command.ParseFlags([]string{ "--grpc-storage-plugin.binary", s.pluginBinaryPath, + "--grpc-storage-plugin.log-level", + "debug", }) if err != nil { return err diff --git a/plugin/storage/memory/memory.go b/plugin/storage/memory/memory.go index 8ca8678e2df9..b3a1a0454ca7 100644 --- a/plugin/storage/memory/memory.go +++ b/plugin/storage/memory/memory.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/model/adjuster" diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go index 075e3c62dfeb..b15329cc1cac 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.pb.go @@ -11,8 +11,11 @@ import ( proto "github.com/gogo/protobuf/proto" model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -24,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type PostSpansRequest struct { Batch model.Batch `protobuf:"bytes,1,opt,name=batch,proto3" json:"batch"` @@ -47,7 +50,7 @@ func (m *PostSpansRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_PostSpansRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -93,7 +96,7 @@ func (m *PostSpansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_PostSpansResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -177,6 +180,14 @@ type CollectorServiceServer interface { PostSpans(context.Context, *PostSpansRequest) (*PostSpansResponse, error) } +// UnimplementedCollectorServiceServer can be embedded to have forward compatible implementations. +type UnimplementedCollectorServiceServer struct { +} + +func (*UnimplementedCollectorServiceServer) PostSpans(ctx context.Context, req *PostSpansRequest) (*PostSpansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PostSpans not implemented") +} + func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { s.RegisterService(&_CollectorService_serviceDesc, srv) } @@ -215,7 +226,7 @@ var _CollectorService_serviceDesc = grpc.ServiceDesc{ func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -223,28 +234,36 @@ func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { } func (m *PostSpansRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PostSpansRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintCollector(dAtA, i, uint64(m.Batch.Size())) - n1, err := m.Batch.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + { + size, err := m.Batch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCollector(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *PostSpansResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -252,24 +271,32 @@ func (m *PostSpansResponse) Marshal() (dAtA []byte, err error) { } func (m *PostSpansResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PostSpansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { + offset -= sovCollector(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *PostSpansRequest) Size() (n int) { if m == nil { @@ -298,14 +325,7 @@ func (m *PostSpansResponse) Size() (n int) { } func sovCollector(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozCollector(x uint64) (n int) { return sovCollector(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -378,10 +398,7 @@ func (m *PostSpansRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCollector - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCollector } if (iNdEx + skippy) > l { @@ -432,10 +449,7 @@ func (m *PostSpansResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCollector - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCollector } if (iNdEx + skippy) > l { @@ -454,6 +468,7 @@ func (m *PostSpansResponse) Unmarshal(dAtA []byte) error { func skipCollector(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -485,10 +500,8 @@ func skipCollector(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -509,55 +522,30 @@ func skipCollector(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthCollector } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthCollector - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowCollector - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipCollector(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthCollector - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCollector + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthCollector + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthCollector = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCollector = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthCollector = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCollector = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCollector = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/metrics/metricsquery.pb.go b/proto-gen/api_v2/metrics/metricsquery.pb.go index 2409a2469f0c..e4cad11ee40b 100644 --- a/proto-gen/api_v2/metrics/metricsquery.pb.go +++ b/proto-gen/api_v2/metrics/metricsquery.pb.go @@ -12,8 +12,11 @@ import ( _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -27,7 +30,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MetricsQueryBaseRequest is the base request parameter accompanying a MetricsQueryService RPC call. type MetricsQueryBaseRequest struct { @@ -75,7 +78,7 @@ func (m *MetricsQueryBaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_MetricsQueryBaseRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -173,7 +176,7 @@ func (m *GetLatenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetLatenciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -228,7 +231,7 @@ func (m *GetCallRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetCallRatesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -276,7 +279,7 @@ func (m *GetErrorRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetErrorRatesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -322,7 +325,7 @@ func (m *GetMinStepDurationRequest) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_GetMinStepDurationRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -362,7 +365,7 @@ func (m *GetMinStepDurationResponse) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_GetMinStepDurationResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -409,7 +412,7 @@ func (m *GetMetricsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetMetricsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -575,6 +578,23 @@ type MetricsQueryServiceServer interface { GetErrorRates(context.Context, *GetErrorRatesRequest) (*GetMetricsResponse, error) } +// UnimplementedMetricsQueryServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMetricsQueryServiceServer struct { +} + +func (*UnimplementedMetricsQueryServiceServer) GetMinStepDuration(ctx context.Context, req *GetMinStepDurationRequest) (*GetMinStepDurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMinStepDuration not implemented") +} +func (*UnimplementedMetricsQueryServiceServer) GetLatencies(ctx context.Context, req *GetLatenciesRequest) (*GetMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatencies not implemented") +} +func (*UnimplementedMetricsQueryServiceServer) GetCallRates(ctx context.Context, req *GetCallRatesRequest) (*GetMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCallRates not implemented") +} +func (*UnimplementedMetricsQueryServiceServer) GetErrorRates(ctx context.Context, req *GetErrorRatesRequest) (*GetMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetErrorRates not implemented") +} + func RegisterMetricsQueryServiceServer(s *grpc.Server, srv MetricsQueryServiceServer) { s.RegisterService(&_MetricsQueryService_serviceDesc, srv) } @@ -679,7 +699,7 @@ var _MetricsQueryService_serviceDesc = grpc.ServiceDesc{ func (m *MetricsQueryBaseRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -687,102 +707,103 @@ func (m *MetricsQueryBaseRequest) Marshal() (dAtA []byte, err error) { } func (m *MetricsQueryBaseRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricsQueryBaseRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceNames) > 0 { - for _, s := range m.ServiceNames { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SpanKinds) > 0 { + dAtA2 := make([]byte, len(m.SpanKinds)*10) + var j1 int + for _, num := range m.SpanKinds { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintMetricsquery(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0x3a } - if m.GroupByOperation { - dAtA[i] = 0x10 - i++ - if m.GroupByOperation { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.RatePer != nil { + n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.RatePer, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.RatePer):]) + if err3 != nil { + return 0, err3 } - i++ + i -= n3 + i = encodeVarintMetricsquery(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x32 } - if m.EndTime != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i:]) - if err != nil { - return 0, err + if m.Step != nil { + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Step, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Step):]) + if err4 != nil { + return 0, err4 } - i += n1 + i -= n4 + i = encodeVarintMetricsquery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x2a } if m.Lookback != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Lookback))) - n2, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Lookback, dAtA[i:]) - if err != nil { - return 0, err + n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Lookback, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Lookback):]) + if err5 != nil { + return 0, err5 } - i += n2 + i -= n5 + i = encodeVarintMetricsquery(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x22 } - if m.Step != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Step))) - n3, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Step, dAtA[i:]) - if err != nil { - return 0, err + if m.EndTime != nil { + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):]) + if err6 != nil { + return 0, err6 } - i += n3 + i -= n6 + i = encodeVarintMetricsquery(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x1a } - if m.RatePer != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.RatePer))) - n4, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.RatePer, dAtA[i:]) - if err != nil { - return 0, err + if m.GroupByOperation { + i-- + if m.GroupByOperation { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i += n4 + i-- + dAtA[i] = 0x10 } - if len(m.SpanKinds) > 0 { - dAtA6 := make([]byte, len(m.SpanKinds)*10) - var j5 int - for _, num := range m.SpanKinds { - for num >= 1<<7 { - dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j5++ - } - dAtA6[j5] = uint8(num) - j5++ + if len(m.ServiceNames) > 0 { + for iNdEx := len(m.ServiceNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServiceNames[iNdEx]) + copy(dAtA[i:], m.ServiceNames[iNdEx]) + i = encodeVarintMetricsquery(dAtA, i, uint64(len(m.ServiceNames[iNdEx]))) + i-- + dAtA[i] = 0xa } - dAtA[i] = 0x3a - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(j5)) - i += copy(dAtA[i:], dAtA6[:j5]) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetLatenciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -790,36 +811,44 @@ func (m *GetLatenciesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetLatenciesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetLatenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.BaseRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.BaseRequest.Size())) - n7, err := m.BaseRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Quantile != 0 { - dAtA[i] = 0x11 - i++ + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantile)))) - i += 8 + i-- + dAtA[i] = 0x11 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.BaseRequest != nil { + { + size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetCallRatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -827,30 +856,38 @@ func (m *GetCallRatesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetCallRatesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCallRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.BaseRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.BaseRequest.Size())) - n8, err := m.BaseRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) } - i += n8 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetErrorRatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -858,30 +895,38 @@ func (m *GetErrorRatesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetErrorRatesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetErrorRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.BaseRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.BaseRequest.Size())) - n9, err := m.BaseRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.BaseRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) } - i += n9 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetMinStepDurationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -889,20 +934,26 @@ func (m *GetMinStepDurationRequest) Marshal() (dAtA []byte, err error) { } func (m *GetMinStepDurationRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMinStepDurationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetMinStepDurationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -910,28 +961,34 @@ func (m *GetMinStepDurationResponse) Marshal() (dAtA []byte, err error) { } func (m *GetMinStepDurationResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMinStepDurationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.MinStep))) - n10, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MinStep, dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + n10, err10 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MinStep, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MinStep):]) + if err10 != nil { + return 0, err10 } - return i, nil + i -= n10 + i = encodeVarintMetricsquery(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetMetricsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -939,32 +996,42 @@ func (m *GetMetricsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetMetricsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMetricsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintMetricsquery(dAtA, i, uint64(m.Metrics.Size())) - n11, err := m.Metrics.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + { + size, err := m.Metrics.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetricsquery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func encodeVarintMetricsquery(dAtA []byte, offset int, v uint64) int { + offset -= sovMetricsquery(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *MetricsQueryBaseRequest) Size() (n int) { if m == nil { @@ -1102,14 +1169,7 @@ func (m *GetMetricsResponse) Size() (n int) { } func sovMetricsquery(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozMetricsquery(x uint64) (n int) { return sovMetricsquery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1414,10 +1474,7 @@ func (m *MetricsQueryBaseRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1515,10 +1572,7 @@ func (m *GetLatenciesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1605,10 +1659,7 @@ func (m *GetCallRatesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1695,10 +1746,7 @@ func (m *GetErrorRatesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1749,10 +1797,7 @@ func (m *GetMinStepDurationRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1836,10 +1881,7 @@ func (m *GetMinStepDurationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1923,10 +1965,7 @@ func (m *GetMetricsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsquery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsquery } if (iNdEx + skippy) > l { @@ -1945,6 +1984,7 @@ func (m *GetMetricsResponse) Unmarshal(dAtA []byte) error { func skipMetricsquery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1976,10 +2016,8 @@ func skipMetricsquery(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2000,55 +2038,30 @@ func skipMetricsquery(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthMetricsquery } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthMetricsquery - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricsquery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipMetricsquery(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthMetricsquery - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMetricsquery + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthMetricsquery + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthMetricsquery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMetricsquery = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthMetricsquery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMetricsquery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMetricsquery = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/metrics/openmetrics.pb.go b/proto-gen/api_v2/metrics/openmetrics.pb.go index 705ce8aad200..37ed3660c4ec 100644 --- a/proto-gen/api_v2/metrics/openmetrics.pb.go +++ b/proto-gen/api_v2/metrics/openmetrics.pb.go @@ -15,6 +15,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -26,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // The type of a Metric. type MetricType int32 @@ -103,7 +104,7 @@ func (m *MetricSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MetricSet.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -161,7 +162,7 @@ func (m *MetricFamily) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MetricFamily.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -240,7 +241,7 @@ func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Metric.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -299,7 +300,7 @@ func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Label.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -366,7 +367,7 @@ func (m *MetricPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MetricPoint.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -392,25 +393,25 @@ type isMetricPoint_Value interface { } type MetricPoint_UnknownValue struct { - UnknownValue *UnknownValue `protobuf:"bytes,1,opt,name=unknown_value,json=unknownValue,proto3,oneof"` + UnknownValue *UnknownValue `protobuf:"bytes,1,opt,name=unknown_value,json=unknownValue,proto3,oneof" json:"unknown_value,omitempty"` } type MetricPoint_GaugeValue struct { - GaugeValue *GaugeValue `protobuf:"bytes,2,opt,name=gauge_value,json=gaugeValue,proto3,oneof"` + GaugeValue *GaugeValue `protobuf:"bytes,2,opt,name=gauge_value,json=gaugeValue,proto3,oneof" json:"gauge_value,omitempty"` } type MetricPoint_CounterValue struct { - CounterValue *CounterValue `protobuf:"bytes,3,opt,name=counter_value,json=counterValue,proto3,oneof"` + CounterValue *CounterValue `protobuf:"bytes,3,opt,name=counter_value,json=counterValue,proto3,oneof" json:"counter_value,omitempty"` } type MetricPoint_HistogramValue struct { - HistogramValue *HistogramValue `protobuf:"bytes,4,opt,name=histogram_value,json=histogramValue,proto3,oneof"` + HistogramValue *HistogramValue `protobuf:"bytes,4,opt,name=histogram_value,json=histogramValue,proto3,oneof" json:"histogram_value,omitempty"` } type MetricPoint_StateSetValue struct { - StateSetValue *StateSetValue `protobuf:"bytes,5,opt,name=state_set_value,json=stateSetValue,proto3,oneof"` + StateSetValue *StateSetValue `protobuf:"bytes,5,opt,name=state_set_value,json=stateSetValue,proto3,oneof" json:"state_set_value,omitempty"` } type MetricPoint_InfoValue struct { - InfoValue *InfoValue `protobuf:"bytes,6,opt,name=info_value,json=infoValue,proto3,oneof"` + InfoValue *InfoValue `protobuf:"bytes,6,opt,name=info_value,json=infoValue,proto3,oneof" json:"info_value,omitempty"` } type MetricPoint_SummaryValue struct { - SummaryValue *SummaryValue `protobuf:"bytes,7,opt,name=summary_value,json=summaryValue,proto3,oneof"` + SummaryValue *SummaryValue `protobuf:"bytes,7,opt,name=summary_value,json=summaryValue,proto3,oneof" json:"summary_value,omitempty"` } func (*MetricPoint_UnknownValue) isMetricPoint_Value() {} @@ -484,9 +485,9 @@ func (m *MetricPoint) GetTimestamp() *types.Timestamp { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*MetricPoint) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _MetricPoint_OneofMarshaler, _MetricPoint_OneofUnmarshaler, _MetricPoint_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MetricPoint) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*MetricPoint_UnknownValue)(nil), (*MetricPoint_GaugeValue)(nil), (*MetricPoint_CounterValue)(nil), @@ -497,162 +498,6 @@ func (*MetricPoint) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e } } -func _MetricPoint_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*MetricPoint) - // value - switch x := m.Value.(type) { - case *MetricPoint_UnknownValue: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.UnknownValue); err != nil { - return err - } - case *MetricPoint_GaugeValue: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.GaugeValue); err != nil { - return err - } - case *MetricPoint_CounterValue: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CounterValue); err != nil { - return err - } - case *MetricPoint_HistogramValue: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HistogramValue); err != nil { - return err - } - case *MetricPoint_StateSetValue: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.StateSetValue); err != nil { - return err - } - case *MetricPoint_InfoValue: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.InfoValue); err != nil { - return err - } - case *MetricPoint_SummaryValue: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.SummaryValue); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("MetricPoint.Value has unexpected type %T", x) - } - return nil -} - -func _MetricPoint_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*MetricPoint) - switch tag { - case 1: // value.unknown_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(UnknownValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_UnknownValue{msg} - return true, err - case 2: // value.gauge_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(GaugeValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_GaugeValue{msg} - return true, err - case 3: // value.counter_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(CounterValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_CounterValue{msg} - return true, err - case 4: // value.histogram_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HistogramValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_HistogramValue{msg} - return true, err - case 5: // value.state_set_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(StateSetValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_StateSetValue{msg} - return true, err - case 6: // value.info_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(InfoValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_InfoValue{msg} - return true, err - case 7: // value.summary_value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SummaryValue) - err := b.DecodeMessage(msg) - m.Value = &MetricPoint_SummaryValue{msg} - return true, err - default: - return false, nil - } -} - -func _MetricPoint_OneofSizer(msg proto.Message) (n int) { - m := msg.(*MetricPoint) - // value - switch x := m.Value.(type) { - case *MetricPoint_UnknownValue: - s := proto.Size(x.UnknownValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_GaugeValue: - s := proto.Size(x.GaugeValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_CounterValue: - s := proto.Size(x.CounterValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_HistogramValue: - s := proto.Size(x.HistogramValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_StateSetValue: - s := proto.Size(x.StateSetValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_InfoValue: - s := proto.Size(x.InfoValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *MetricPoint_SummaryValue: - s := proto.Size(x.SummaryValue) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for UNKNOWN MetricPoint. type UnknownValue struct { // Required. @@ -680,7 +525,7 @@ func (m *UnknownValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_UnknownValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -706,10 +551,10 @@ type isUnknownValue_Value interface { } type UnknownValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type UnknownValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*UnknownValue_DoubleValue) isUnknownValue_Value() {} @@ -736,70 +581,14 @@ func (m *UnknownValue) GetIntValue() int64 { return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*UnknownValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _UnknownValue_OneofMarshaler, _UnknownValue_OneofUnmarshaler, _UnknownValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*UnknownValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*UnknownValue_DoubleValue)(nil), (*UnknownValue_IntValue)(nil), } } -func _UnknownValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*UnknownValue) - // value - switch x := m.Value.(type) { - case *UnknownValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *UnknownValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("UnknownValue.Value has unexpected type %T", x) - } - return nil -} - -func _UnknownValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*UnknownValue) - switch tag { - case 1: // value.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Value = &UnknownValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // value.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Value = &UnknownValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _UnknownValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*UnknownValue) - // value - switch x := m.Value.(type) { - case *UnknownValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *UnknownValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for GAUGE MetricPoint. type GaugeValue struct { // Required. @@ -827,7 +616,7 @@ func (m *GaugeValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GaugeValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -853,10 +642,10 @@ type isGaugeValue_Value interface { } type GaugeValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type GaugeValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*GaugeValue_DoubleValue) isGaugeValue_Value() {} @@ -883,70 +672,14 @@ func (m *GaugeValue) GetIntValue() int64 { return 0 } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*GaugeValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _GaugeValue_OneofMarshaler, _GaugeValue_OneofUnmarshaler, _GaugeValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*GaugeValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*GaugeValue_DoubleValue)(nil), (*GaugeValue_IntValue)(nil), } } -func _GaugeValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*GaugeValue) - // value - switch x := m.Value.(type) { - case *GaugeValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *GaugeValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("GaugeValue.Value has unexpected type %T", x) - } - return nil -} - -func _GaugeValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*GaugeValue) - switch tag { - case 1: // value.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Value = &GaugeValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // value.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Value = &GaugeValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _GaugeValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*GaugeValue) - // value - switch x := m.Value.(type) { - case *GaugeValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *GaugeValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for COUNTER MetricPoint. type CounterValue struct { // Required. @@ -979,7 +712,7 @@ func (m *CounterValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_CounterValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1005,10 +738,10 @@ type isCounterValue_Total interface { } type CounterValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type CounterValue_IntValue struct { - IntValue uint64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue uint64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*CounterValue_DoubleValue) isCounterValue_Total() {} @@ -1049,70 +782,14 @@ func (m *CounterValue) GetExemplar() *Exemplar { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*CounterValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _CounterValue_OneofMarshaler, _CounterValue_OneofUnmarshaler, _CounterValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*CounterValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*CounterValue_DoubleValue)(nil), (*CounterValue_IntValue)(nil), } } -func _CounterValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*CounterValue) - // total - switch x := m.Total.(type) { - case *CounterValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *CounterValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("CounterValue.Total has unexpected type %T", x) - } - return nil -} - -func _CounterValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*CounterValue) - switch tag { - case 1: // total.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Total = &CounterValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // total.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Total = &CounterValue_IntValue{x} - return true, err - default: - return false, nil - } -} - -func _CounterValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*CounterValue) - // total - switch x := m.Total.(type) { - case *CounterValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *CounterValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Value for HISTOGRAM or GAUGE_HISTOGRAM MetricPoint. type HistogramValue struct { // Optional. @@ -1147,7 +824,7 @@ func (m *HistogramValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_HistogramValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1173,10 +850,10 @@ type isHistogramValue_Sum interface { } type HistogramValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type HistogramValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*HistogramValue_DoubleValue) isHistogramValue_Sum() {} @@ -1224,70 +901,14 @@ func (m *HistogramValue) GetBuckets() []*HistogramValue_Bucket { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*HistogramValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _HistogramValue_OneofMarshaler, _HistogramValue_OneofUnmarshaler, _HistogramValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*HistogramValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*HistogramValue_DoubleValue)(nil), (*HistogramValue_IntValue)(nil), } } -func _HistogramValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*HistogramValue) - // sum - switch x := m.Sum.(type) { - case *HistogramValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *HistogramValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("HistogramValue.Sum has unexpected type %T", x) - } - return nil -} - -func _HistogramValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*HistogramValue) - switch tag { - case 1: // sum.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Sum = &HistogramValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // sum.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Sum = &HistogramValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _HistogramValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*HistogramValue) - // sum - switch x := m.Sum.(type) { - case *HistogramValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *HistogramValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // Bucket is the number of values for a bucket in the histogram // with an optional exemplar. type HistogramValue_Bucket struct { @@ -1316,7 +937,7 @@ func (m *HistogramValue_Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_HistogramValue_Bucket.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1383,7 +1004,7 @@ func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Exemplar.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1446,7 +1067,7 @@ func (m *StateSetValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StateSetValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1496,7 +1117,7 @@ func (m *StateSetValue_State) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_StateSetValue_State.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1552,7 +1173,7 @@ func (m *InfoValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_InfoValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1612,7 +1233,7 @@ func (m *SummaryValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SummaryValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1638,10 +1259,10 @@ type isSummaryValue_Sum interface { } type SummaryValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type SummaryValue_IntValue struct { - IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"` + IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof" json:"int_value,omitempty"` } func (*SummaryValue_DoubleValue) isSummaryValue_Sum() {} @@ -1689,70 +1310,14 @@ func (m *SummaryValue) GetQuantile() []*SummaryValue_Quantile { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SummaryValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SummaryValue_OneofMarshaler, _SummaryValue_OneofUnmarshaler, _SummaryValue_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SummaryValue) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*SummaryValue_DoubleValue)(nil), (*SummaryValue_IntValue)(nil), } } -func _SummaryValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SummaryValue) - // sum - switch x := m.Sum.(type) { - case *SummaryValue_DoubleValue: - _ = b.EncodeVarint(1<<3 | proto.WireFixed64) - _ = b.EncodeFixed64(math.Float64bits(x.DoubleValue)) - case *SummaryValue_IntValue: - _ = b.EncodeVarint(2<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.IntValue)) - case nil: - default: - return fmt.Errorf("SummaryValue.Sum has unexpected type %T", x) - } - return nil -} - -func _SummaryValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SummaryValue) - switch tag { - case 1: // sum.double_value - if wire != proto.WireFixed64 { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeFixed64() - m.Sum = &SummaryValue_DoubleValue{math.Float64frombits(x)} - return true, err - case 2: // sum.int_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Sum = &SummaryValue_IntValue{int64(x)} - return true, err - default: - return false, nil - } -} - -func _SummaryValue_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SummaryValue) - // sum - switch x := m.Sum.(type) { - case *SummaryValue_DoubleValue: - n += 1 // tag and wire - n += 8 - case *SummaryValue_IntValue: - n += 1 // tag and wire - n += proto.SizeVarint(uint64(x.IntValue)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type SummaryValue_Quantile struct { // Required. Quantile float64 `protobuf:"fixed64,1,opt,name=quantile,proto3" json:"quantile,omitempty"` @@ -1777,7 +1342,7 @@ func (m *SummaryValue_Quantile) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_SummaryValue_Quantile.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1901,7 +1466,7 @@ var fileDescriptor_0b803df83757ec01 = []byte{ func (m *MetricSet) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1909,32 +1474,40 @@ func (m *MetricSet) Marshal() (dAtA []byte, err error) { } func (m *MetricSet) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.MetricFamilies) > 0 { - for _, msg := range m.MetricFamilies { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.MetricFamilies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MetricFamilies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *MetricFamily) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1942,55 +1515,66 @@ func (m *MetricFamily) Marshal() (dAtA []byte, err error) { } func (m *MetricFamily) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricFamily) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.Type != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Unit) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Unit))) - i += copy(dAtA[i:], m.Unit) + if len(m.Metrics) > 0 { + for iNdEx := len(m.Metrics) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Metrics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } } if len(m.Help) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Help) + copy(dAtA[i:], m.Help) i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Help))) - i += copy(dAtA[i:], m.Help) + i-- + dAtA[i] = 0x22 } - if len(m.Metrics) > 0 { - for _, msg := range m.Metrics { - dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.Unit) > 0 { + i -= len(m.Unit) + copy(dAtA[i:], m.Unit) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Unit))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Metric) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1998,44 +1582,54 @@ func (m *Metric) Marshal() (dAtA []byte, err error) { } func (m *Metric) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Labels) > 0 { - for _, msg := range m.Labels { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.MetricPoints) > 0 { - for _, msg := range m.MetricPoints { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.MetricPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MetricPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *Label) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2043,32 +1637,40 @@ func (m *Label) Marshal() (dAtA []byte, err error) { } func (m *Label) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Label) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Value) + copy(dAtA[i:], m.Value) i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2076,135 +1678,194 @@ func (m *MetricPoint) Marshal() (dAtA []byte, err error) { } func (m *MetricPoint) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Value != nil { - nn1, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Timestamp != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Timestamp.Size())) - n2, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x42 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Value != nil { + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_UnknownValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_UnknownValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.UnknownValue != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.UnknownValue.Size())) - n3, err := m.UnknownValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.UnknownValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_GaugeValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_GaugeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.GaugeValue != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.GaugeValue.Size())) - n4, err := m.GaugeValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.GaugeValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_CounterValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_CounterValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.CounterValue != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.CounterValue.Size())) - n5, err := m.CounterValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.CounterValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_HistogramValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_HistogramValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HistogramValue != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.HistogramValue.Size())) - n6, err := m.HistogramValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HistogramValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_StateSetValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_StateSetValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.StateSetValue != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.StateSetValue.Size())) - n7, err := m.StateSetValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.StateSetValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_InfoValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_InfoValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.InfoValue != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.InfoValue.Size())) - n8, err := m.InfoValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.InfoValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *MetricPoint_SummaryValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricPoint_SummaryValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.SummaryValue != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.SummaryValue.Size())) - n9, err := m.SummaryValue.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.SummaryValue.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *UnknownValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2212,42 +1873,60 @@ func (m *UnknownValue) Marshal() (dAtA []byte, err error) { } func (m *UnknownValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnknownValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Value != nil { - nn10, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *UnknownValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnknownValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *UnknownValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnknownValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *GaugeValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2255,42 +1934,60 @@ func (m *GaugeValue) Marshal() (dAtA []byte, err error) { } func (m *GaugeValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GaugeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Value != nil { - nn11, err := m.Value.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn11 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GaugeValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GaugeValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *GaugeValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GaugeValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *CounterValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2298,62 +1995,84 @@ func (m *CounterValue) Marshal() (dAtA []byte, err error) { } func (m *CounterValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CounterValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Total != nil { - nn12, err := m.Total.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Exemplar != nil { + { + size, err := m.Exemplar.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += nn12 + i-- + dAtA[i] = 0x22 } if m.Created != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Created.Size())) - n13, err := m.Created.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Created.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n13 + i-- + dAtA[i] = 0x1a } - if m.Exemplar != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Exemplar.Size())) - n14, err := m.Exemplar.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Total != nil { + { + size := m.Total.Size() + i -= size + if _, err := m.Total.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n14 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil +} + +func (m *CounterValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CounterValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ +func (m *CounterValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *CounterValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CounterValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *HistogramValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2361,69 +2080,91 @@ func (m *HistogramValue) Marshal() (dAtA []byte, err error) { } func (m *HistogramValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Sum != nil { - nn15, err := m.Sum.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn15 - } - if m.Count != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) - } - if m.Created != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Created.Size())) - n16, err := m.Created.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Buckets) > 0 { - for _, msg := range m.Buckets { + for iNdEx := len(m.Buckets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Buckets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Created != nil { + { + size, err := m.Created.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Count != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x18 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *HistogramValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *HistogramValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *HistogramValue_Bucket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2431,41 +2172,49 @@ func (m *HistogramValue_Bucket) Marshal() (dAtA []byte, err error) { } func (m *HistogramValue_Bucket) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HistogramValue_Bucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Count != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) - } - if m.UpperBound != 0 { - dAtA[i] = 0x11 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.UpperBound)))) - i += 8 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Exemplar != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Exemplar.Size())) - n17, err := m.Exemplar.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Exemplar.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.UpperBound != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.UpperBound)))) + i-- + dAtA[i] = 0x11 + } + if m.Count != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *Exemplar) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2473,48 +2222,58 @@ func (m *Exemplar) Marshal() (dAtA []byte, err error) { } func (m *Exemplar) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Value != 0 { - dAtA[i] = 0x9 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i += 8 - } - if m.Timestamp != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Timestamp.Size())) - n18, err := m.Timestamp.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Label) > 0 { - for _, msg := range m.Label { + for iNdEx := len(m.Label) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Label[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Value != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func (m *StateSetValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2522,32 +2281,40 @@ func (m *StateSetValue) Marshal() (dAtA []byte, err error) { } func (m *StateSetValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateSetValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.States) > 0 { - for _, msg := range m.States { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.States) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.States[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StateSetValue_State) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2555,36 +2322,43 @@ func (m *StateSetValue_State) Marshal() (dAtA []byte, err error) { } func (m *StateSetValue_State) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateSetValue_State) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } if m.Enabled { - dAtA[i] = 0x8 - i++ + i-- if m.Enabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *InfoValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2592,32 +2366,40 @@ func (m *InfoValue) Marshal() (dAtA []byte, err error) { } func (m *InfoValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InfoValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Info) > 0 { - for _, msg := range m.Info { - dAtA[i] = 0xa - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *SummaryValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2625,69 +2407,91 @@ func (m *SummaryValue) Marshal() (dAtA []byte, err error) { } func (m *SummaryValue) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Sum != nil { - nn19, err := m.Sum.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn19 - } - if m.Count != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) - } - if m.Created != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Created.Size())) - n20, err := m.Created.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Quantile) > 0 { - for _, msg := range m.Quantile { + for iNdEx := len(m.Quantile) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Quantile[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x2a - i++ - i = encodeVarintOpenmetrics(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) + } + } + if m.Created != nil { + { + size, err := m.Created.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } - i += n + i -= size + i = encodeVarintOpenmetrics(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Count != 0 { + i = encodeVarintOpenmetrics(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x18 + } + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *SummaryValue_DoubleValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x9 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) - i += 8 - return i, nil + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil } func (m *SummaryValue_IntValue) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x10 - i++ + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue_IntValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) i = encodeVarintOpenmetrics(dAtA, i, uint64(m.IntValue)) - return i, nil + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil } func (m *SummaryValue_Quantile) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2695,36 +2499,44 @@ func (m *SummaryValue_Quantile) Marshal() (dAtA []byte, err error) { } func (m *SummaryValue_Quantile) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SummaryValue_Quantile) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Quantile != 0 { - dAtA[i] = 0x9 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantile)))) - i += 8 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Value != 0 { - dAtA[i] = 0x11 - i++ + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i += 8 + i-- + dAtA[i] = 0x11 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Quantile != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Quantile)))) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintOpenmetrics(dAtA []byte, offset int, v uint64) int { + offset -= sovOpenmetrics(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *MetricSet) Size() (n int) { if m == nil { @@ -3244,14 +3056,7 @@ func (m *SummaryValue_Quantile) Size() (n int) { } func sovOpenmetrics(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozOpenmetrics(x uint64) (n int) { return sovOpenmetrics(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -3325,10 +3130,7 @@ func (m *MetricSet) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -3528,10 +3330,7 @@ func (m *MetricFamily) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -3650,10 +3449,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -3768,10 +3564,7 @@ func (m *Label) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4103,10 +3896,7 @@ func (m *MetricPoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4188,10 +3978,7 @@ func (m *UnknownValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4273,10 +4060,7 @@ func (m *GaugeValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4430,10 +4214,7 @@ func (m *CounterValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4604,10 +4385,7 @@ func (m *HistogramValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4724,10 +4502,7 @@ func (m *HistogramValue_Bucket) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4859,10 +4634,7 @@ func (m *Exemplar) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -4947,10 +4719,7 @@ func (m *StateSetValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5053,10 +4822,7 @@ func (m *StateSetValue_State) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5141,10 +4907,7 @@ func (m *InfoValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5315,10 +5078,7 @@ func (m *SummaryValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5391,10 +5151,7 @@ func (m *SummaryValue_Quantile) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthOpenmetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthOpenmetrics } if (iNdEx + skippy) > l { @@ -5413,6 +5170,7 @@ func (m *SummaryValue_Quantile) Unmarshal(dAtA []byte) error { func skipOpenmetrics(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -5444,10 +5202,8 @@ func skipOpenmetrics(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -5468,55 +5224,30 @@ func skipOpenmetrics(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthOpenmetrics } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthOpenmetrics - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowOpenmetrics - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipOpenmetrics(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthOpenmetrics - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOpenmetrics + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthOpenmetrics + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthOpenmetrics = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowOpenmetrics = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthOpenmetrics = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOpenmetrics = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOpenmetrics = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/metrics/otelspankind.pb.go b/proto-gen/api_v2/metrics/otelspankind.pb.go index 6647f27c4fd8..9c61619e340a 100644 --- a/proto-gen/api_v2/metrics/otelspankind.pb.go +++ b/proto-gen/api_v2/metrics/otelspankind.pb.go @@ -19,7 +19,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // SpanKind is the type of span. Can be used to specify additional relationships between spans // in addition to a parent/child relationship. diff --git a/proto-gen/api_v2/query.pb.go b/proto-gen/api_v2/query.pb.go index b3c5b815e106..370512c92279 100644 --- a/proto-gen/api_v2/query.pb.go +++ b/proto-gen/api_v2/query.pb.go @@ -14,8 +14,11 @@ import ( github_com_jaegertracing_jaeger_model "github.com/jaegertracing/jaeger/model" model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -29,7 +32,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GetTraceRequest struct { TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` @@ -52,7 +55,7 @@ func (m *GetTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetTraceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -92,7 +95,7 @@ func (m *SpansResponseChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SpansResponseChunk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -139,7 +142,7 @@ func (m *ArchiveTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ArchiveTraceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -178,7 +181,7 @@ func (m *ArchiveTraceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_ArchiveTraceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -225,7 +228,7 @@ func (m *TraceQueryParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_TraceQueryParameters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -321,7 +324,7 @@ func (m *FindTracesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_FindTracesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -367,7 +370,7 @@ func (m *GetServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -407,7 +410,7 @@ func (m *GetServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -455,7 +458,7 @@ func (m *GetOperationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetOperationsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -510,7 +513,7 @@ func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Operation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -565,7 +568,7 @@ func (m *GetOperationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_GetOperationsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -620,7 +623,7 @@ func (m *GetDependenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_GetDependenciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -674,7 +677,7 @@ func (m *GetDependenciesResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_GetDependenciesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -921,6 +924,29 @@ type QueryServiceServer interface { GetDependencies(context.Context, *GetDependenciesRequest) (*GetDependenciesResponse, error) } +// UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServiceServer struct { +} + +func (*UnimplementedQueryServiceServer) GetTrace(req *GetTraceRequest, srv QueryService_GetTraceServer) error { + return status.Errorf(codes.Unimplemented, "method GetTrace not implemented") +} +func (*UnimplementedQueryServiceServer) ArchiveTrace(ctx context.Context, req *ArchiveTraceRequest) (*ArchiveTraceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ArchiveTrace not implemented") +} +func (*UnimplementedQueryServiceServer) FindTraces(req *FindTracesRequest, srv QueryService_FindTracesServer) error { + return status.Errorf(codes.Unimplemented, "method FindTraces not implemented") +} +func (*UnimplementedQueryServiceServer) GetServices(ctx context.Context, req *GetServicesRequest) (*GetServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServices not implemented") +} +func (*UnimplementedQueryServiceServer) GetOperations(ctx context.Context, req *GetOperationsRequest) (*GetOperationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") +} +func (*UnimplementedQueryServiceServer) GetDependencies(ctx context.Context, req *GetDependenciesRequest) (*GetDependenciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDependencies not implemented") +} + func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { s.RegisterService(&_QueryService_serviceDesc, srv) } @@ -1078,7 +1104,7 @@ var _QueryService_serviceDesc = grpc.ServiceDesc{ func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1086,28 +1112,36 @@ func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetTraceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.TraceID.Size())) - n1, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1115,32 +1149,40 @@ func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { } func (m *SpansResponseChunk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpansResponseChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ArchiveTraceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1148,28 +1190,36 @@ func (m *ArchiveTraceRequest) Marshal() (dAtA []byte, err error) { } func (m *ArchiveTraceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArchiveTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.TraceID.Size())) - n2, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *ArchiveTraceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1177,20 +1227,26 @@ func (m *ArchiveTraceResponse) Marshal() (dAtA []byte, err error) { } func (m *ArchiveTraceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ArchiveTraceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1198,86 +1254,96 @@ func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { } func (m *TraceQueryParameters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TraceQueryParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) - } - if len(m.OperationName) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationName))) - i += copy(dAtA[i:], m.OperationName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Tags) > 0 { - for k, _ := range m.Tags { - dAtA[i] = 0x1a - i++ - v := m.Tags[k] - mapSize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + len(v) + sovQuery(uint64(len(v))) - i = encodeVarintQuery(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + if m.SearchDepth != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.SearchDepth)) + i-- + dAtA[i] = 0x40 } - dAtA[i] = 0x22 - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin))) - n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i:]) - if err != nil { - return 0, err + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax):]) + if err1 != nil { + return 0, err1 } - i += n3 - dAtA[i] = 0x2a - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax))) - n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n1 + i = encodeVarintQuery(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x3a + n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin):]) + if err2 != nil { + return 0, err2 } - i += n4 + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- dAtA[i] = 0x32 - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin))) - n5, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i:]) - if err != nil { - return 0, err + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax):]) + if err3 != nil { + return 0, err3 } - i += n5 - dAtA[i] = 0x3a - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax))) - n6, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n3 + i = encodeVarintQuery(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x2a + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin):]) + if err4 != nil { + return 0, err4 } - i += n6 - if m.SearchDepth != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.SearchDepth)) + i -= n4 + i = encodeVarintQuery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x22 + if len(m.Tags) > 0 { + for k := range m.Tags { + v := m.Tags[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintQuery(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationName) > 0 { + i -= len(m.OperationName) + copy(dAtA[i:], m.OperationName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationName))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServiceName) > 0 { + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceName))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1285,30 +1351,38 @@ func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { } func (m *FindTracesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTracesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Query != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(m.Query.Size())) - n7, err := m.Query.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n7 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1316,20 +1390,26 @@ func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetServicesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1337,35 +1417,35 @@ func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetServicesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Services) > 0 { - for _, s := range m.Services { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Services[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1373,32 +1453,40 @@ func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Service) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintQuery(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Operation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1406,32 +1494,40 @@ func (m *Operation) Marshal() (dAtA []byte, err error) { } func (m *Operation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintQuery(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1439,47 +1535,49 @@ func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.OperationNames) > 0 { - for _, s := range m.OperationNames { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Operations) > 0 { - for _, msg := range m.Operations { - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationNames) > 0 { + for iNdEx := len(m.OperationNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OperationNames[iNdEx]) + copy(dAtA[i:], m.OperationNames[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1487,36 +1585,42 @@ func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime))) - n8, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n8 - dAtA[i] = 0x12 - i++ - i = encodeVarintQuery(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime))) - n9, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i:]) - if err != nil { - return 0, err + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err6 != nil { + return 0, err6 } - i += n9 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= n6 + i = encodeVarintQuery(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x12 + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err7 != nil { + return 0, err7 } - return i, nil + i -= n7 + i = encodeVarintQuery(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1524,36 +1628,46 @@ func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Dependencies) > 0 { - for _, msg := range m.Dependencies { - dAtA[i] = 0xa - i++ - i = encodeVarintQuery(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *GetTraceRequest) Size() (n int) { if m == nil { @@ -1797,14 +1911,7 @@ func (m *GetDependenciesResponse) Size() (n int) { } func sovQuery(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1877,10 +1984,7 @@ func (m *GetTraceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1965,10 +2069,7 @@ func (m *SpansResponseChunk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2052,10 +2153,7 @@ func (m *ArchiveTraceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2106,10 +2204,7 @@ func (m *ArchiveTraceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2334,7 +2429,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > postIndex { @@ -2502,10 +2597,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2592,10 +2684,7 @@ func (m *FindTracesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2646,10 +2735,7 @@ func (m *GetServicesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2732,10 +2818,7 @@ func (m *GetServicesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2850,10 +2933,7 @@ func (m *GetOperationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2968,10 +3048,7 @@ func (m *Operation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3088,10 +3165,7 @@ func (m *GetOperationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3208,10 +3282,7 @@ func (m *GetDependenciesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3296,10 +3367,7 @@ func (m *GetDependenciesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3318,6 +3386,7 @@ func (m *GetDependenciesResponse) Unmarshal(dAtA []byte) error { func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -3349,10 +3418,8 @@ func skipQuery(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -3373,55 +3440,30 @@ func skipQuery(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthQuery } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipQuery(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.pb.go index 32d10b3eda17..5571add49bfb 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -11,8 +11,11 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -24,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type SamplingStrategyType int32 @@ -72,7 +75,7 @@ func (m *ProbabilisticSamplingStrategy) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_ProbabilisticSamplingStrategy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -119,7 +122,7 @@ func (m *RateLimitingSamplingStrategy) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RateLimitingSamplingStrategy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +170,7 @@ func (m *OperationSamplingStrategy) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_OperationSamplingStrategy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -224,7 +227,7 @@ func (m *PerOperationSamplingStrategies) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_PerOperationSamplingStrategies.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -295,7 +298,7 @@ func (m *SamplingStrategyResponse) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_SamplingStrategyResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -363,7 +366,7 @@ func (m *SamplingStrategyParameters) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_SamplingStrategyParameters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -478,6 +481,14 @@ type SamplingManagerServer interface { GetSamplingStrategy(context.Context, *SamplingStrategyParameters) (*SamplingStrategyResponse, error) } +// UnimplementedSamplingManagerServer can be embedded to have forward compatible implementations. +type UnimplementedSamplingManagerServer struct { +} + +func (*UnimplementedSamplingManagerServer) GetSamplingStrategy(ctx context.Context, req *SamplingStrategyParameters) (*SamplingStrategyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSamplingStrategy not implemented") +} + func RegisterSamplingManagerServer(s *grpc.Server, srv SamplingManagerServer) { s.RegisterService(&_SamplingManager_serviceDesc, srv) } @@ -516,7 +527,7 @@ var _SamplingManager_serviceDesc = grpc.ServiceDesc{ func (m *ProbabilisticSamplingStrategy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -524,26 +535,32 @@ func (m *ProbabilisticSamplingStrategy) Marshal() (dAtA []byte, err error) { } func (m *ProbabilisticSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProbabilisticSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.SamplingRate != 0 { - dAtA[i] = 0x9 - i++ + i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SamplingRate)))) - i += 8 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func (m *RateLimitingSamplingStrategy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -551,25 +568,31 @@ func (m *RateLimitingSamplingStrategy) Marshal() (dAtA []byte, err error) { } func (m *RateLimitingSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimitingSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.MaxTracesPerSecond != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintSampling(dAtA, i, uint64(m.MaxTracesPerSecond)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *OperationSamplingStrategy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -577,36 +600,45 @@ func (m *OperationSamplingStrategy) Marshal() (dAtA []byte, err error) { } func (m *OperationSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OperationSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Operation) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintSampling(dAtA, i, uint64(len(m.Operation))) - i += copy(dAtA[i:], m.Operation) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProbabilisticSampling != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.ProbabilisticSampling.Size())) - n1, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ProbabilisticSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Operation) > 0 { + i -= len(m.Operation) + copy(dAtA[i:], m.Operation) + i = encodeVarintSampling(dAtA, i, uint64(len(m.Operation))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PerOperationSamplingStrategies) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -614,50 +646,58 @@ func (m *PerOperationSamplingStrategies) Marshal() (dAtA []byte, err error) { } func (m *PerOperationSamplingStrategies) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PerOperationSamplingStrategies) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.DefaultSamplingProbability != 0 { - dAtA[i] = 0x9 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) - i += 8 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.DefaultLowerBoundTracesPerSecond != 0 { - dAtA[i] = 0x11 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) - i += 8 + if m.DefaultUpperBoundTracesPerSecond != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) + i-- + dAtA[i] = 0x21 } if len(m.PerOperationStrategies) > 0 { - for _, msg := range m.PerOperationStrategies { - dAtA[i] = 0x1a - i++ - i = encodeVarintSampling(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.PerOperationStrategies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PerOperationStrategies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if m.DefaultUpperBoundTracesPerSecond != 0 { - dAtA[i] = 0x21 - i++ - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) - i += 8 + if m.DefaultLowerBoundTracesPerSecond != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) + i-- + dAtA[i] = 0x11 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.DefaultSamplingProbability != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) + i-- + dAtA[i] = 0x9 } - return i, nil + return len(dAtA) - i, nil } func (m *SamplingStrategyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -665,55 +705,67 @@ func (m *SamplingStrategyResponse) Marshal() (dAtA []byte, err error) { } func (m *SamplingStrategyResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SamplingStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.StrategyType != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.StrategyType)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.ProbabilisticSampling != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.ProbabilisticSampling.Size())) - n2, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.OperationSampling != nil { + { + size, err := m.OperationSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x22 } if m.RateLimitingSampling != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.RateLimitingSampling.Size())) - n3, err := m.RateLimitingSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.RateLimitingSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x1a } - if m.OperationSampling != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintSampling(dAtA, i, uint64(m.OperationSampling.Size())) - n4, err := m.OperationSampling.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ProbabilisticSampling != nil { + { + size, err := m.ProbabilisticSampling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSampling(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.StrategyType != 0 { + i = encodeVarintSampling(dAtA, i, uint64(m.StrategyType)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *SamplingStrategyParameters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -721,30 +773,39 @@ func (m *SamplingStrategyParameters) Marshal() (dAtA []byte, err error) { } func (m *SamplingStrategyParameters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SamplingStrategyParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) i = encodeVarintSampling(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { + offset -= sovSampling(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ProbabilisticSamplingStrategy) Size() (n int) { if m == nil { @@ -867,14 +928,7 @@ func (m *SamplingStrategyParameters) Size() (n int) { } func sovSampling(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozSampling(x uint64) (n int) { return sovSampling(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -925,10 +979,7 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -998,10 +1049,7 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1120,10 +1168,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1241,10 +1286,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1422,10 +1464,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1508,10 +1547,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { @@ -1530,6 +1566,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { func skipSampling(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1561,10 +1598,8 @@ func skipSampling(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1585,55 +1620,30 @@ func skipSampling(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthSampling } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthSampling - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSampling - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSampling(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthSampling - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSampling + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthSampling + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthSampling = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSampling = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSampling = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSampling = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSampling = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/storage_v1/storage.pb.go b/proto-gen/storage_v1/storage.pb.go index ce1fbf2608e1..9ae71f2bce0d 100644 --- a/proto-gen/storage_v1/storage.pb.go +++ b/proto-gen/storage_v1/storage.pb.go @@ -13,8 +13,11 @@ import ( github_com_jaegertracing_jaeger_model "github.com/jaegertracing/jaeger/model" model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" time "time" ) @@ -28,7 +31,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GetDependenciesRequest struct { StartTime time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` @@ -52,7 +55,7 @@ func (m *GetDependenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_GetDependenciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -106,7 +109,7 @@ func (m *GetDependenciesResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_GetDependenciesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -153,7 +156,7 @@ func (m *WriteSpanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_WriteSpanRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -200,7 +203,7 @@ func (m *WriteSpanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_WriteSpanResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -240,7 +243,7 @@ func (m *GetTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_GetTraceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -279,7 +282,7 @@ func (m *GetServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -319,7 +322,7 @@ func (m *GetServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetServicesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -367,7 +370,7 @@ func (m *GetOperationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetOperationsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -422,7 +425,7 @@ func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Operation.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -477,7 +480,7 @@ func (m *GetOperationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_GetOperationsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -538,7 +541,7 @@ func (m *TraceQueryParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_TraceQueryParameters.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -634,7 +637,7 @@ func (m *FindTracesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_FindTracesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -681,7 +684,7 @@ func (m *SpansResponseChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SpansResponseChunk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -728,7 +731,7 @@ func (m *FindTraceIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_FindTraceIDsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -775,7 +778,7 @@ func (m *FindTraceIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_FindTraceIDsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -815,7 +818,7 @@ func (m *CapabilitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_CapabilitiesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -856,7 +859,7 @@ func (m *CapabilitiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CapabilitiesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1021,6 +1024,14 @@ type SpanWriterPluginServer interface { WriteSpan(context.Context, *WriteSpanRequest) (*WriteSpanResponse, error) } +// UnimplementedSpanWriterPluginServer can be embedded to have forward compatible implementations. +type UnimplementedSpanWriterPluginServer struct { +} + +func (*UnimplementedSpanWriterPluginServer) WriteSpan(ctx context.Context, req *WriteSpanRequest) (*WriteSpanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WriteSpan not implemented") +} + func RegisterSpanWriterPluginServer(s *grpc.Server, srv SpanWriterPluginServer) { s.RegisterService(&_SpanWriterPlugin_serviceDesc, srv) } @@ -1177,6 +1188,26 @@ type SpanReaderPluginServer interface { FindTraceIDs(context.Context, *FindTraceIDsRequest) (*FindTraceIDsResponse, error) } +// UnimplementedSpanReaderPluginServer can be embedded to have forward compatible implementations. +type UnimplementedSpanReaderPluginServer struct { +} + +func (*UnimplementedSpanReaderPluginServer) GetTrace(req *GetTraceRequest, srv SpanReaderPlugin_GetTraceServer) error { + return status.Errorf(codes.Unimplemented, "method GetTrace not implemented") +} +func (*UnimplementedSpanReaderPluginServer) GetServices(ctx context.Context, req *GetServicesRequest) (*GetServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServices not implemented") +} +func (*UnimplementedSpanReaderPluginServer) GetOperations(ctx context.Context, req *GetOperationsRequest) (*GetOperationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") +} +func (*UnimplementedSpanReaderPluginServer) FindTraces(req *FindTracesRequest, srv SpanReaderPlugin_FindTracesServer) error { + return status.Errorf(codes.Unimplemented, "method FindTraces not implemented") +} +func (*UnimplementedSpanReaderPluginServer) FindTraceIDs(ctx context.Context, req *FindTraceIDsRequest) (*FindTraceIDsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindTraceIDs not implemented") +} + func RegisterSpanReaderPluginServer(s *grpc.Server, srv SpanReaderPluginServer) { s.RegisterService(&_SpanReaderPlugin_serviceDesc, srv) } @@ -1340,6 +1371,14 @@ type ArchiveSpanWriterPluginServer interface { WriteArchiveSpan(context.Context, *WriteSpanRequest) (*WriteSpanResponse, error) } +// UnimplementedArchiveSpanWriterPluginServer can be embedded to have forward compatible implementations. +type UnimplementedArchiveSpanWriterPluginServer struct { +} + +func (*UnimplementedArchiveSpanWriterPluginServer) WriteArchiveSpan(ctx context.Context, req *WriteSpanRequest) (*WriteSpanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WriteArchiveSpan not implemented") +} + func RegisterArchiveSpanWriterPluginServer(s *grpc.Server, srv ArchiveSpanWriterPluginServer) { s.RegisterService(&_ArchiveSpanWriterPlugin_serviceDesc, srv) } @@ -1429,6 +1468,14 @@ type ArchiveSpanReaderPluginServer interface { GetArchiveTrace(*GetTraceRequest, ArchiveSpanReaderPlugin_GetArchiveTraceServer) error } +// UnimplementedArchiveSpanReaderPluginServer can be embedded to have forward compatible implementations. +type UnimplementedArchiveSpanReaderPluginServer struct { +} + +func (*UnimplementedArchiveSpanReaderPluginServer) GetArchiveTrace(req *GetTraceRequest, srv ArchiveSpanReaderPlugin_GetArchiveTraceServer) error { + return status.Errorf(codes.Unimplemented, "method GetArchiveTrace not implemented") +} + func RegisterArchiveSpanReaderPluginServer(s *grpc.Server, srv ArchiveSpanReaderPluginServer) { s.RegisterService(&_ArchiveSpanReaderPlugin_serviceDesc, srv) } @@ -1499,6 +1546,14 @@ type DependenciesReaderPluginServer interface { GetDependencies(context.Context, *GetDependenciesRequest) (*GetDependenciesResponse, error) } +// UnimplementedDependenciesReaderPluginServer can be embedded to have forward compatible implementations. +type UnimplementedDependenciesReaderPluginServer struct { +} + +func (*UnimplementedDependenciesReaderPluginServer) GetDependencies(ctx context.Context, req *GetDependenciesRequest) (*GetDependenciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDependencies not implemented") +} + func RegisterDependenciesReaderPluginServer(s *grpc.Server, srv DependenciesReaderPluginServer) { s.RegisterService(&_DependenciesReaderPlugin_serviceDesc, srv) } @@ -1563,6 +1618,14 @@ type PluginCapabilitiesServer interface { Capabilities(context.Context, *CapabilitiesRequest) (*CapabilitiesResponse, error) } +// UnimplementedPluginCapabilitiesServer can be embedded to have forward compatible implementations. +type UnimplementedPluginCapabilitiesServer struct { +} + +func (*UnimplementedPluginCapabilitiesServer) Capabilities(ctx context.Context, req *CapabilitiesRequest) (*CapabilitiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Capabilities not implemented") +} + func RegisterPluginCapabilitiesServer(s *grpc.Server, srv PluginCapabilitiesServer) { s.RegisterService(&_PluginCapabilities_serviceDesc, srv) } @@ -1601,7 +1664,7 @@ var _PluginCapabilities_serviceDesc = grpc.ServiceDesc{ func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1609,36 +1672,42 @@ func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n1 - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime))) - n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i:]) - if err != nil { - return 0, err + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) + if err1 != nil { + return 0, err1 } - i += n2 - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= n1 + i = encodeVarintStorage(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err2 != nil { + return 0, err2 } - return i, nil + i -= n2 + i = encodeVarintStorage(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1646,32 +1715,40 @@ func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetDependenciesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetDependenciesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Dependencies) > 0 { - for _, msg := range m.Dependencies { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *WriteSpanRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1679,30 +1756,38 @@ func (m *WriteSpanRequest) Marshal() (dAtA []byte, err error) { } func (m *WriteSpanRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WriteSpanRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Span != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.Span.Size())) - n3, err := m.Span.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Span.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WriteSpanResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1710,20 +1795,26 @@ func (m *WriteSpanResponse) Marshal() (dAtA []byte, err error) { } func (m *WriteSpanResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WriteSpanResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1731,28 +1822,36 @@ func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { } func (m *GetTraceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.TraceID.Size())) - n4, err := m.TraceID.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + { + size := m.TraceID.Size() + i -= size + if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStorage(dAtA, i, uint64(size)) } - return i, nil + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1760,20 +1859,26 @@ func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { } func (m *GetServicesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1781,35 +1886,35 @@ func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { } func (m *GetServicesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Services) > 0 { - for _, s := range m.Services { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Services[iNdEx]) + copy(dAtA[i:], m.Services[iNdEx]) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Services[iNdEx]))) + i-- dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1817,32 +1922,40 @@ func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Service) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.Service))) - i += copy(dAtA[i:], m.Service) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintStorage(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Operation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1850,32 +1963,40 @@ func (m *Operation) Marshal() (dAtA []byte, err error) { } func (m *Operation) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SpanKind) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SpanKind) + copy(dAtA[i:], m.SpanKind) i = encodeVarintStorage(dAtA, i, uint64(len(m.SpanKind))) - i += copy(dAtA[i:], m.SpanKind) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1883,47 +2004,49 @@ func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetOperationsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.OperationNames) > 0 { - for _, s := range m.OperationNames { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.Operations) > 0 { - for _, msg := range m.Operations { - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationNames) > 0 { + for iNdEx := len(m.OperationNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OperationNames[iNdEx]) + copy(dAtA[i:], m.OperationNames[iNdEx]) + i = encodeVarintStorage(dAtA, i, uint64(len(m.OperationNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1931,86 +2054,96 @@ func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { } func (m *TraceQueryParameters) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TraceQueryParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceName) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.ServiceName))) - i += copy(dAtA[i:], m.ServiceName) - } - if len(m.OperationName) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(m.OperationName))) - i += copy(dAtA[i:], m.OperationName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Tags) > 0 { - for k, _ := range m.Tags { - dAtA[i] = 0x1a - i++ - v := m.Tags[k] - mapSize := 1 + len(k) + sovStorage(uint64(len(k))) + 1 + len(v) + sovStorage(uint64(len(v))) - i = encodeVarintStorage(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintStorage(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + if m.NumTraces != 0 { + i = encodeVarintStorage(dAtA, i, uint64(m.NumTraces)) + i-- + dAtA[i] = 0x40 } - dAtA[i] = 0x22 - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin))) - n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i:]) - if err != nil { - return 0, err + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax):]) + if err4 != nil { + return 0, err4 } - i += n5 - dAtA[i] = 0x2a - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n4 + i = encodeVarintStorage(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin):]) + if err5 != nil { + return 0, err5 } - i += n6 + i -= n5 + i = encodeVarintStorage(dAtA, i, uint64(n5)) + i-- dAtA[i] = 0x32 - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin))) - n7, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i:]) - if err != nil { - return 0, err + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax):]) + if err6 != nil { + return 0, err6 } - i += n7 - dAtA[i] = 0x3a - i++ - i = encodeVarintStorage(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax))) - n8, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i:]) - if err != nil { - return 0, err + i -= n6 + i = encodeVarintStorage(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x2a + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin):]) + if err7 != nil { + return 0, err7 } - i += n8 - if m.NumTraces != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.NumTraces)) + i -= n7 + i = encodeVarintStorage(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x22 + if len(m.Tags) > 0 { + for k := range m.Tags { + v := m.Tags[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintStorage(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintStorage(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintStorage(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.OperationName) > 0 { + i -= len(m.OperationName) + copy(dAtA[i:], m.OperationName) + i = encodeVarintStorage(dAtA, i, uint64(len(m.OperationName))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServiceName) > 0 { + i -= len(m.ServiceName) + copy(dAtA[i:], m.ServiceName) + i = encodeVarintStorage(dAtA, i, uint64(len(m.ServiceName))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2018,30 +2151,38 @@ func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { } func (m *FindTracesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTracesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Query != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.Query.Size())) - n9, err := m.Query.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n9 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2049,32 +2190,40 @@ func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { } func (m *SpansResponseChunk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpansResponseChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Spans) > 0 { - for _, msg := range m.Spans { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *FindTraceIDsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2082,30 +2231,38 @@ func (m *FindTraceIDsRequest) Marshal() (dAtA []byte, err error) { } func (m *FindTraceIDsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTraceIDsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Query != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(m.Query.Size())) - n10, err := m.Query.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n10 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *FindTraceIDsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2113,32 +2270,40 @@ func (m *FindTraceIDsResponse) Marshal() (dAtA []byte, err error) { } func (m *FindTraceIDsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FindTraceIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.TraceIDs) > 0 { - for _, msg := range m.TraceIDs { - dAtA[i] = 0xa - i++ - i = encodeVarintStorage(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.TraceIDs) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.TraceIDs[iNdEx].Size() + i -= size + if _, err := m.TraceIDs[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStorage(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2146,20 +2311,26 @@ func (m *CapabilitiesRequest) Marshal() (dAtA []byte, err error) { } func (m *CapabilitiesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2167,44 +2338,52 @@ func (m *CapabilitiesResponse) Marshal() (dAtA []byte, err error) { } func (m *CapabilitiesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ArchiveSpanReader { - dAtA[i] = 0x8 - i++ - if m.ArchiveSpanReader { + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ArchiveSpanWriter { + i-- + if m.ArchiveSpanWriter { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.ArchiveSpanWriter { + i-- dAtA[i] = 0x10 - i++ - if m.ArchiveSpanWriter { + } + if m.ArchiveSpanReader { + i-- + if m.ArchiveSpanReader { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintStorage(dAtA []byte, offset int, v uint64) int { + offset -= sovStorage(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *GetDependenciesRequest) Size() (n int) { if m == nil { @@ -2514,14 +2693,7 @@ func (m *CapabilitiesResponse) Size() (n int) { } func sovStorage(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozStorage(x uint64) (n int) { return sovStorage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -2627,10 +2799,7 @@ func (m *GetDependenciesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2715,10 +2884,7 @@ func (m *GetDependenciesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2805,10 +2971,7 @@ func (m *WriteSpanRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2859,10 +3022,7 @@ func (m *WriteSpanResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -2946,10 +3106,7 @@ func (m *GetTraceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3000,10 +3157,7 @@ func (m *GetServicesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3086,10 +3240,7 @@ func (m *GetServicesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3204,10 +3355,7 @@ func (m *GetOperationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3322,10 +3470,7 @@ func (m *Operation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3442,10 +3587,7 @@ func (m *GetOperationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3670,7 +3812,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > postIndex { @@ -3838,10 +3980,7 @@ func (m *TraceQueryParameters) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -3928,10 +4067,7 @@ func (m *FindTracesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4016,10 +4152,7 @@ func (m *SpansResponseChunk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4106,10 +4239,7 @@ func (m *FindTraceIDsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4195,10 +4325,7 @@ func (m *FindTraceIDsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4249,10 +4376,7 @@ func (m *CapabilitiesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4343,10 +4467,7 @@ func (m *CapabilitiesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStorage - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStorage } if (iNdEx + skippy) > l { @@ -4365,6 +4486,7 @@ func (m *CapabilitiesResponse) Unmarshal(dAtA []byte) error { func skipStorage(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -4396,10 +4518,8 @@ func skipStorage(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -4420,55 +4540,30 @@ func skipStorage(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthStorage } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStorage - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStorage - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipStorage(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStorage - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStorage + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthStorage + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthStorage = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStorage = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthStorage = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStorage = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStorage = fmt.Errorf("proto: unexpected end of group") ) diff --git a/proto-gen/zipkin/zipkin.pb.go b/proto-gen/zipkin/zipkin.pb.go index 0bfeb29b443c..5c278004f2c5 100644 --- a/proto-gen/zipkin/zipkin.pb.go +++ b/proto-gen/zipkin/zipkin.pb.go @@ -8,6 +8,8 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" math "math" ) @@ -20,7 +22,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // When present, kind clarifies timestamp, duration and remote_endpoint. When // absent, the span is local or incomplete. Unlike client and server, there @@ -618,6 +620,14 @@ type SpanServiceServer interface { Report(context.Context, *ListOfSpans) (*ReportResponse, error) } +// UnimplementedSpanServiceServer can be embedded to have forward compatible implementations. +type UnimplementedSpanServiceServer struct { +} + +func (*UnimplementedSpanServiceServer) Report(ctx context.Context, req *ListOfSpans) (*ReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Report not implemented") +} + func RegisterSpanServiceServer(s *grpc.Server, srv SpanServiceServer) { s.RegisterService(&_SpanService_serviceDesc, srv) } From 140990dca7781e1f42056e1bec6a8571cc3ec348 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Jun 2021 10:16:31 +0200 Subject: [PATCH 12/22] Bump codecov/codecov-action from 1.5.0 to 1.5.2 (#3075) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.5.0 to 1.5.2. - [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/v1.5.0...v1.5.2) --- updated-dependencies: - dependency-name: codecov/codecov-action 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> --- .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 1cb807280101..5761e837d48e 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -23,7 +23,7 @@ jobs: run: make test-ci - name: Upload coverage to codecov - uses: codecov/codecov-action@v1.5.0 + uses: codecov/codecov-action@v1.5.2 with: file: cover.out fail_ci_if_error: true From 7dedc4637eeb80e0605a82720e0c23feabe623b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Jun 2021 10:45:15 +0200 Subject: [PATCH 13/22] Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.2.2 to 1.3.0 (#3076) Bumps [github.com/grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) from 1.2.2 to 1.3.0. - [Release notes](https://github.com/grpc-ecosystem/go-grpc-middleware/releases) - [Changelog](https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/CHANGELOG.md) - [Commits](https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.2.2...v1.3.0) --- updated-dependencies: - dependency-name: github.com/grpc-ecosystem/go-grpc-middleware 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 | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 7ce316a5fae7..a0b67da48c2d 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 github.com/hashicorp/go-hclog v0.16.1 github.com/hashicorp/go-plugin v1.4.2 diff --git a/go.sum b/go.sum index f7370a01dcb6..8989519a041c 100644 --- a/go.sum +++ b/go.sum @@ -40,10 +40,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.14.1 h1:Yh8v0hpCj63p5edXOLaqTJW0IJ1p+eMW6+YSOqw1d6s= -github.com/apache/thrift v0.14.1/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= 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= @@ -154,7 +150,6 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= @@ -352,8 +347,6 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= @@ -363,8 +356,8 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +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.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -779,7 +772,6 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -797,7 +789,6 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= @@ -830,7 +821,6 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL 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= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -880,7 +870,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/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= @@ -891,7 +880,6 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -949,7 +937,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200203023011-6f24f261dadb/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= From 3d1236c3786407b1b03d5bbeffe9f8d54456a5ee Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Thu, 10 Jun 2021 08:16:39 +1000 Subject: [PATCH 14/22] Add metrics query capability to query service (#3061) * Add metrics query capability to query service Signed-off-by: albertteoh * Remove unused function Signed-off-by: albertteoh * Remove QSOption Signed-off-by: albertteoh * Address review comments Signed-off-by: albertteoh --- .../app/querysvc/metrics_query_service.go | 71 ++++++++++ .../querysvc/metrics_query_service_test.go | 130 ++++++++++++++++++ cmd/query/app/querysvc/query_service_test.go | 10 +- 3 files changed, 206 insertions(+), 5 deletions(-) create mode 100644 cmd/query/app/querysvc/metrics_query_service.go create mode 100644 cmd/query/app/querysvc/metrics_query_service_test.go diff --git a/cmd/query/app/querysvc/metrics_query_service.go b/cmd/query/app/querysvc/metrics_query_service.go new file mode 100644 index 000000000000..ac29cb7fc1bd --- /dev/null +++ b/cmd/query/app/querysvc/metrics_query_service.go @@ -0,0 +1,71 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package querysvc + +import ( + "context" + "errors" + "time" + + "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" + "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +// MetricsQueryService contains the underlying reader required for querying the metrics store. +type MetricsQueryService struct { + metricsReader metricsstore.Reader +} + +var errNilReader = errors.New("no reader defined for MetricsQueryService") + +// NewMetricsQueryService returns a new MetricsQueryService. +// A nil reader will result in a nil MetricsQueryService being returned. +func NewMetricsQueryService(reader metricsstore.Reader) *MetricsQueryService { + return &MetricsQueryService{ + metricsReader: reader, + } +} + +// GetLatencies is the queryService implementation of metricsstore.Reader. +func (mqs MetricsQueryService) GetLatencies(ctx context.Context, params *metricsstore.LatenciesQueryParameters) (*metrics.MetricFamily, error) { + if mqs.metricsReader == nil { + return nil, errNilReader + } + return mqs.metricsReader.GetLatencies(ctx, params) +} + +// GetCallRates is the queryService implementation of metricsstore.Reader. +func (mqs MetricsQueryService) GetCallRates(ctx context.Context, params *metricsstore.CallRateQueryParameters) (*metrics.MetricFamily, error) { + if mqs.metricsReader == nil { + return nil, errNilReader + } + return mqs.metricsReader.GetCallRates(ctx, params) +} + +// GetErrorRates is the queryService implementation of metricsstore.Reader. +func (mqs MetricsQueryService) GetErrorRates(ctx context.Context, params *metricsstore.ErrorRateQueryParameters) (*metrics.MetricFamily, error) { + if mqs.metricsReader == nil { + return nil, errNilReader + } + return mqs.metricsReader.GetErrorRates(ctx, params) +} + +// GetMinStepDuration is the queryService implementation of metricsstore.Reader. +func (mqs MetricsQueryService) GetMinStepDuration(ctx context.Context, params *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { + if mqs.metricsReader == nil { + return 0, errNilReader + } + return mqs.metricsReader.GetMinStepDuration(ctx, params) +} diff --git a/cmd/query/app/querysvc/metrics_query_service_test.go b/cmd/query/app/querysvc/metrics_query_service_test.go new file mode 100644 index 000000000000..f75a63954978 --- /dev/null +++ b/cmd/query/app/querysvc/metrics_query_service_test.go @@ -0,0 +1,130 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package querysvc + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + protometrics "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" + "github.com/jaegertracing/jaeger/storage/metricsstore" + metricsmocks "github.com/jaegertracing/jaeger/storage/metricsstore/mocks" +) + +type testMetricsQueryService struct { + queryService *MetricsQueryService + metricsReader *metricsmocks.Reader +} + +func initializeTestMetricsQueryService() *testMetricsQueryService { + metricsReader := &metricsmocks.Reader{} + + tqs := testMetricsQueryService{ + metricsReader: metricsReader, + } + + tqs.queryService = NewMetricsQueryService(metricsReader) + return &tqs +} + +// Test QueryService.GetLatencies() +func TestGetLatencies(t *testing.T) { + tqs := initializeTestMetricsQueryService() + expectedLatencies := &protometrics.MetricFamily{ + Name: "latencies", + Metrics: []*protometrics.Metric{}, + } + qParams := &metricsstore.LatenciesQueryParameters{} + tqs.metricsReader.On("GetLatencies", mock.Anything, qParams).Return(expectedLatencies, nil).Times(1) + + actualLatencies, err := tqs.queryService.GetLatencies(context.Background(), qParams) + assert.NoError(t, err) + assert.Equal(t, expectedLatencies, actualLatencies) +} + +func TestGetLatenciesNilReader(t *testing.T) { + qs := NewMetricsQueryService(nil) + qParams := &metricsstore.LatenciesQueryParameters{} + r, err := qs.GetLatencies(context.Background(), qParams) + assert.Zero(t, r) + assert.EqualError(t, err, errNilReader.Error()) +} + +// Test QueryService.GetCallRates() +func TestGetCallRates(t *testing.T) { + tqs := initializeTestMetricsQueryService() + expectedCallRates := &protometrics.MetricFamily{ + Name: "call rates", + Metrics: []*protometrics.Metric{}, + } + qParams := &metricsstore.CallRateQueryParameters{} + tqs.metricsReader.On("GetCallRates", mock.Anything, qParams).Return(expectedCallRates, nil).Times(1) + + actualCallRates, err := tqs.queryService.GetCallRates(context.Background(), qParams) + assert.NoError(t, err) + assert.Equal(t, expectedCallRates, actualCallRates) +} + +func TestGetCallRatesNilReader(t *testing.T) { + qs := NewMetricsQueryService(nil) + qParams := &metricsstore.CallRateQueryParameters{} + r, err := qs.GetCallRates(context.Background(), qParams) + assert.Zero(t, r) + assert.EqualError(t, err, errNilReader.Error()) +} + +// Test QueryService.GetErrorRates() +func TestGetErrorRates(t *testing.T) { + tqs := initializeTestMetricsQueryService() + expectedErrorRates := &protometrics.MetricFamily{} + qParams := &metricsstore.ErrorRateQueryParameters{} + tqs.metricsReader.On("GetErrorRates", mock.Anything, qParams).Return(expectedErrorRates, nil).Times(1) + + actualErrorRates, err := tqs.queryService.GetErrorRates(context.Background(), qParams) + assert.NoError(t, err) + assert.Equal(t, expectedErrorRates, actualErrorRates) +} + +func TestGetErrorRatesNilReader(t *testing.T) { + qs := NewMetricsQueryService(nil) + qParams := &metricsstore.ErrorRateQueryParameters{} + r, err := qs.GetErrorRates(context.Background(), qParams) + assert.Zero(t, r) + assert.EqualError(t, err, errNilReader.Error()) +} + +// Test QueryService.GetMinStepDurations() +func TestGetMinStepDurations(t *testing.T) { + tqs := initializeTestMetricsQueryService() + expectedMinStep := time.Second + qParams := &metricsstore.MinStepDurationQueryParameters{} + tqs.metricsReader.On("GetMinStepDuration", mock.Anything, qParams).Return(expectedMinStep, nil).Times(1) + + actualMinStep, err := tqs.queryService.GetMinStepDuration(context.Background(), qParams) + assert.NoError(t, err) + assert.Equal(t, expectedMinStep, actualMinStep) +} + +func TestGetMinStepDurationsNilReader(t *testing.T) { + qs := NewMetricsQueryService(nil) + qParams := &metricsstore.MinStepDurationQueryParameters{} + r, err := qs.GetMinStepDuration(context.Background(), qParams) + assert.Zero(t, r) + assert.EqualError(t, err, errNilReader.Error()) +} diff --git a/cmd/query/app/querysvc/query_service_test.go b/cmd/query/app/querysvc/query_service_test.go index 41303a702375..0c3445d57745 100644 --- a/cmd/query/app/querysvc/query_service_test.go +++ b/cmd/query/app/querysvc/query_service_test.go @@ -71,23 +71,23 @@ type testQueryService struct { type testOption func(*testQueryService, *QueryServiceOptions) func withArchiveSpanReader() testOption { - return func(mocks *testQueryService, options *QueryServiceOptions) { + return func(tqs *testQueryService, options *QueryServiceOptions) { r := &spanstoremocks.Reader{} - mocks.archiveSpanReader = r + tqs.archiveSpanReader = r options.ArchiveSpanReader = r } } func withArchiveSpanWriter() testOption { - return func(mocks *testQueryService, options *QueryServiceOptions) { + return func(tqs *testQueryService, options *QueryServiceOptions) { r := &spanstoremocks.Writer{} - mocks.archiveSpanWriter = r + tqs.archiveSpanWriter = r options.ArchiveSpanWriter = r } } func withAdjuster() testOption { - return func(mocks *testQueryService, options *QueryServiceOptions) { + return func(tqs *testQueryService, options *QueryServiceOptions) { options.Adjuster = adjuster.Func(func(trace *model.Trace) (*model.Trace, error) { return trace, errAdjustment }) From 68aeff3df346ceef2a357644c7bcbe3f7121c21f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:15:31 +0200 Subject: [PATCH 15/22] Bump go.uber.org/atomic from 1.7.0 to 1.8.0 (#3081) Bumps [go.uber.org/atomic](https://github.com/uber-go/atomic) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/uber-go/atomic/releases) - [Changelog](https://github.com/uber-go/atomic/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/atomic/compare/v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: go.uber.org/atomic 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 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a0b67da48c2d..e3fc82d6d962 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad github.com/xdg-go/scram v1.0.2 go.mongodb.org/mongo-driver v1.5.2 // indirect - go.uber.org/atomic v1.7.0 + go.uber.org/atomic v1.8.0 go.uber.org/automaxprocs v1.4.0 go.uber.org/zap v1.17.0 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 diff --git a/go.sum b/go.sum index 8989519a041c..301813ae818a 100644 --- a/go.sum +++ b/go.sum @@ -736,8 +736,9 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.8.0 h1:CUhrE4N1rqSE6FM9ecihEjRkLQu8cDfgDyoOs83mEY4= +go.uber.org/atomic v1.8.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= From 3f96a96b9dfcbd5bbeb0f4feb5aa0659b2bf71a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Jun 2021 11:12:56 -0400 Subject: [PATCH 16/22] Bump github.com/prometheus/common from 0.10.0 to 0.29.0 (#3088) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.10.0 to 0.29.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](https://github.com/prometheus/common/compare/v0.10.0...v0.29.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common 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 | 6 +- go.sum | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 176 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index e3fc82d6d962..aa71a1ec88f3 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,6 @@ require ( github.com/gocql/gocql v0.0.0-20200228163523-cd4b606dd2fb github.com/gogo/googleapis v1.4.1 github.com/gogo/protobuf v1.3.2 - github.com/golang/mock v1.4.3 // indirect github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 @@ -43,9 +42,8 @@ require ( github.com/opentracing-contrib/go-grpc v0.0.0-20191001143057-db30781987df github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9 github.com/opentracing/opentracing-go v1.2.0 - github.com/prometheus/client_golang v1.5.1 - github.com/prometheus/common v0.10.0 - github.com/prometheus/procfs v0.1.3 // indirect + github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/common v0.29.0 github.com/rs/cors v1.7.0 github.com/securego/gosec v0.0.0-20200203094520-d13bb6d2420c github.com/soheilhy/cmux v0.1.5 diff --git a/go.sum b/go.sum index 301813ae818a..fbcb46c64046 100644 --- a/go.sum +++ b/go.sum @@ -5,11 +5,32 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +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= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= @@ -39,6 +60,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 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/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= 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= @@ -75,6 +97,9 @@ github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -150,10 +175,13 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -293,16 +321,22 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 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= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -310,6 +344,7 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -324,15 +359,23 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -402,6 +445,7 @@ github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKe github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= @@ -428,15 +472,20 @@ github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqx github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -448,6 +497,7 @@ github.com/klauspost/compress v1.12.2 h1:2KCfW3I9M7nSc5wOqXAlW2v2U6v+w6cbjvbfp+O github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= 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/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= @@ -517,6 +567,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= 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= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -584,8 +636,9 @@ github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA= -github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -598,16 +651,18 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.29.0 h1:3jqPBvKT4OHAbje2Ql7KeaaSicDBCxMYwEJU1zRJceE= +github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= @@ -634,6 +689,7 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -712,7 +768,9 @@ github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -733,6 +791,8 @@ go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= 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= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -773,6 +833,11 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -783,6 +848,8 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +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-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= 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= @@ -790,6 +857,7 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= @@ -815,14 +883,27 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +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-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/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= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -836,6 +917,10 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx 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= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -843,7 +928,10 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -871,22 +959,39 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/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= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-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= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644 h1:CA1DEQ4NdKphKeL70tvsWNdT5oFh1lOjihRcEDROi0I= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -933,12 +1038,34 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200203023011-6f24f261dadb/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= @@ -954,11 +1081,25 @@ google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -970,8 +1111,27 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -988,7 +1148,10 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -999,6 +1162,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= @@ -1044,6 +1208,8 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.2.0 h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE= honnef.co/go/tools v0.2.0/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From e33977e7f3fcd6acaa72fa06555c58e60382cf3b Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Fri, 11 Jun 2021 20:24:45 +0200 Subject: [PATCH 17/22] Use withResolver API in gRPC reporter (#3078) * Use withResolver API in gRPC reporter Signed-off-by: Pavol Loffay * Use manual Signed-off-by: Pavol Loffay * fmt Signed-off-by: Pavol Loffay --- cmd/agent/app/reporter/grpc/builder.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/cmd/agent/app/reporter/grpc/builder.go b/cmd/agent/app/reporter/grpc/builder.go index e228293ab31f..58e83fdd4495 100644 --- a/cmd/agent/app/reporter/grpc/builder.go +++ b/cmd/agent/app/reporter/grpc/builder.go @@ -18,9 +18,7 @@ import ( "context" "errors" "fmt" - "strconv" "strings" - "time" grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" "github.com/uber/jaeger-lib/metrics" @@ -82,7 +80,8 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact return nil, errors.New("at least one collector hostPort address is required when resolver is not available") } if len(b.CollectorHostPorts) > 1 { - r, _ := generateAndRegisterManualResolver() + r := manual.NewBuilderWithScheme("jaeger_manual") + dialOptions = append(dialOptions, grpc.WithResolvers(r)) var resolvedAddrs []resolver.Address for _, addr := range b.CollectorHostPorts { resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: addr}) @@ -125,12 +124,3 @@ func (b *ConnBuilder) CreateConnection(logger *zap.Logger, mFactory metrics.Fact return conn, nil } - -// generateAndRegisterManualResolver was removed from grpc. -// Copied here to keep behavior the same. -func generateAndRegisterManualResolver() (*manual.Resolver, func()) { - scheme := strconv.FormatInt(time.Now().UnixNano(), 36) - r := manual.NewBuilderWithScheme(scheme) - resolver.Register(r) - return r, func() { resolver.UnregisterForTesting(scheme) } -} From 013efad9fb172fc893e52898d16ff4bbef3890ad Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Sun, 13 Jun 2021 01:15:26 +1000 Subject: [PATCH 18/22] Hook up MetricsQueryService to main funcs (#3079) --- cmd/all-in-one/main.go | 34 ++++++++- .../app/querysvc/metrics_query_service.go | 18 +---- .../querysvc/metrics_query_service_test.go | 34 --------- cmd/query/app/server.go | 14 ++-- cmd/query/app/server_test.go | 30 +++++--- cmd/query/main.go | 30 +++++++- plugin/metrics/disabled/factory.go | 48 ++++++++++++ plugin/metrics/disabled/factory_test.go | 42 +++++++++++ plugin/metrics/disabled/reader.go | 64 ++++++++++++++++ plugin/metrics/disabled/reader_test.go | 74 +++++++++++++++++++ plugin/metrics/factory.go | 6 ++ plugin/metrics/factory_test.go | 21 ++++-- 12 files changed, 335 insertions(+), 80 deletions(-) create mode 100644 plugin/metrics/disabled/factory.go create mode 100644 plugin/metrics/disabled/factory_test.go create mode 100644 plugin/metrics/disabled/reader.go create mode 100644 plugin/metrics/disabled/reader_test.go diff --git a/cmd/all-in-one/main.go b/cmd/all-in-one/main.go index 4433194cf474..24e12ddfc1c0 100644 --- a/cmd/all-in-one/main.go +++ b/cmd/all-in-one/main.go @@ -16,6 +16,7 @@ package main import ( + "fmt" "io" "log" "os" @@ -44,10 +45,12 @@ import ( "github.com/jaegertracing/jaeger/cmd/status" "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/version" + metricsPlugin "github.com/jaegertracing/jaeger/plugin/metrics" ss "github.com/jaegertracing/jaeger/plugin/sampling/strategystore" "github.com/jaegertracing/jaeger/plugin/storage" "github.com/jaegertracing/jaeger/ports" "github.com/jaegertracing/jaeger/storage/dependencystore" + "github.com/jaegertracing/jaeger/storage/metricsstore" "github.com/jaegertracing/jaeger/storage/spanstore" storageMetrics "github.com/jaegertracing/jaeger/storage/spanstore/metrics" ) @@ -71,6 +74,12 @@ func main() { log.Fatalf("Cannot initialize sampling strategy store factory: %v", err) } + fc := metricsPlugin.FactoryConfigFromEnv() + metricsReaderFactory, err := metricsPlugin.NewFactory(fc) + if err != nil { + log.Fatalf("Cannot initialize metrics store factory: %v", err) + } + v := viper.New() command := &cobra.Command{ Use: "jaeger-all-in-one", @@ -107,6 +116,11 @@ by default uses only in-memory database.`, logger.Fatal("Failed to create dependency reader", zap.Error(err)) } + metricsReader, err := createMetricsReader(metricsReaderFactory, v, logger) + if err != nil { + logger.Fatal("Failed to create metrics reader", zap.Error(err)) + } + strategyStoreFactory.InitFromViper(v) if err := strategyStoreFactory.Initialize(metricsFactory, logger); err != nil { logger.Fatal("Failed to init sampling strategy store factory", zap.Error(err)) @@ -157,8 +171,8 @@ by default uses only in-memory database.`, // query querySrv := startQuery( svc, qOpts, qOpts.BuildQueryServiceOptions(storageFactory, logger), - spanReader, dependencyReader, - rootMetricsFactory, metricsFactory, + spanReader, dependencyReader, metricsReader, + metricsFactory, ) svc.RunAndThen(func() { @@ -196,6 +210,7 @@ by default uses only in-memory database.`, collectorApp.AddFlags, queryApp.AddFlags, strategyStoreFactory.AddFlags, + metricsReaderFactory.AddFlags, ) if err := command.Execute(); err != nil { @@ -229,12 +244,13 @@ func startQuery( queryOpts *querysvc.QueryServiceOptions, spanReader spanstore.Reader, depReader dependencystore.Reader, - rootFactory metrics.Factory, + metricsReader metricsstore.Reader, baseFactory metrics.Factory, ) *queryApp.Server { spanReader = storageMetrics.NewReadMetricsDecorator(spanReader, baseFactory.Namespace(metrics.NSOptions{Name: "query"})) qs := querysvc.NewQueryService(spanReader, depReader, *queryOpts) - server, err := queryApp.NewServer(svc.Logger, qs, qOpts, opentracing.GlobalTracer()) + mqs := querysvc.NewMetricsQueryService(metricsReader) + server, err := queryApp.NewServer(svc.Logger, qs, mqs, qOpts, opentracing.GlobalTracer()) if err != nil { svc.Logger.Fatal("Could not start jaeger-query service", zap.Error(err)) } @@ -272,3 +288,13 @@ func initTracer(metricsFactory metrics.Factory, logger *zap.Logger) io.Closer { opentracing.SetGlobalTracer(tracer) return closer } + +func createMetricsReader(factory *metricsPlugin.Factory, v *viper.Viper, logger *zap.Logger) (metricsstore.Reader, error) { + if err := factory.Initialize(logger); err != nil { + return nil, fmt.Errorf("failed to init metrics reader factory: %w", err) + } + + // Ensure default parameter values are loaded correctly. + factory.InitFromViper(v) + return factory.CreateMetricsReader() +} diff --git a/cmd/query/app/querysvc/metrics_query_service.go b/cmd/query/app/querysvc/metrics_query_service.go index ac29cb7fc1bd..5596901bb5b0 100644 --- a/cmd/query/app/querysvc/metrics_query_service.go +++ b/cmd/query/app/querysvc/metrics_query_service.go @@ -16,22 +16,18 @@ package querysvc import ( "context" - "errors" "time" "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" "github.com/jaegertracing/jaeger/storage/metricsstore" ) -// MetricsQueryService contains the underlying reader required for querying the metrics store. +// MetricsQueryService provides a means of querying R.E.D metrics from an underlying metrics store. type MetricsQueryService struct { metricsReader metricsstore.Reader } -var errNilReader = errors.New("no reader defined for MetricsQueryService") - // NewMetricsQueryService returns a new MetricsQueryService. -// A nil reader will result in a nil MetricsQueryService being returned. func NewMetricsQueryService(reader metricsstore.Reader) *MetricsQueryService { return &MetricsQueryService{ metricsReader: reader, @@ -40,32 +36,20 @@ func NewMetricsQueryService(reader metricsstore.Reader) *MetricsQueryService { // GetLatencies is the queryService implementation of metricsstore.Reader. func (mqs MetricsQueryService) GetLatencies(ctx context.Context, params *metricsstore.LatenciesQueryParameters) (*metrics.MetricFamily, error) { - if mqs.metricsReader == nil { - return nil, errNilReader - } return mqs.metricsReader.GetLatencies(ctx, params) } // GetCallRates is the queryService implementation of metricsstore.Reader. func (mqs MetricsQueryService) GetCallRates(ctx context.Context, params *metricsstore.CallRateQueryParameters) (*metrics.MetricFamily, error) { - if mqs.metricsReader == nil { - return nil, errNilReader - } return mqs.metricsReader.GetCallRates(ctx, params) } // GetErrorRates is the queryService implementation of metricsstore.Reader. func (mqs MetricsQueryService) GetErrorRates(ctx context.Context, params *metricsstore.ErrorRateQueryParameters) (*metrics.MetricFamily, error) { - if mqs.metricsReader == nil { - return nil, errNilReader - } return mqs.metricsReader.GetErrorRates(ctx, params) } // GetMinStepDuration is the queryService implementation of metricsstore.Reader. func (mqs MetricsQueryService) GetMinStepDuration(ctx context.Context, params *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { - if mqs.metricsReader == nil { - return 0, errNilReader - } return mqs.metricsReader.GetMinStepDuration(ctx, params) } diff --git a/cmd/query/app/querysvc/metrics_query_service_test.go b/cmd/query/app/querysvc/metrics_query_service_test.go index f75a63954978..5783f1e54a14 100644 --- a/cmd/query/app/querysvc/metrics_query_service_test.go +++ b/cmd/query/app/querysvc/metrics_query_service_test.go @@ -34,11 +34,9 @@ type testMetricsQueryService struct { func initializeTestMetricsQueryService() *testMetricsQueryService { metricsReader := &metricsmocks.Reader{} - tqs := testMetricsQueryService{ metricsReader: metricsReader, } - tqs.queryService = NewMetricsQueryService(metricsReader) return &tqs } @@ -58,14 +56,6 @@ func TestGetLatencies(t *testing.T) { assert.Equal(t, expectedLatencies, actualLatencies) } -func TestGetLatenciesNilReader(t *testing.T) { - qs := NewMetricsQueryService(nil) - qParams := &metricsstore.LatenciesQueryParameters{} - r, err := qs.GetLatencies(context.Background(), qParams) - assert.Zero(t, r) - assert.EqualError(t, err, errNilReader.Error()) -} - // Test QueryService.GetCallRates() func TestGetCallRates(t *testing.T) { tqs := initializeTestMetricsQueryService() @@ -81,14 +71,6 @@ func TestGetCallRates(t *testing.T) { assert.Equal(t, expectedCallRates, actualCallRates) } -func TestGetCallRatesNilReader(t *testing.T) { - qs := NewMetricsQueryService(nil) - qParams := &metricsstore.CallRateQueryParameters{} - r, err := qs.GetCallRates(context.Background(), qParams) - assert.Zero(t, r) - assert.EqualError(t, err, errNilReader.Error()) -} - // Test QueryService.GetErrorRates() func TestGetErrorRates(t *testing.T) { tqs := initializeTestMetricsQueryService() @@ -101,14 +83,6 @@ func TestGetErrorRates(t *testing.T) { assert.Equal(t, expectedErrorRates, actualErrorRates) } -func TestGetErrorRatesNilReader(t *testing.T) { - qs := NewMetricsQueryService(nil) - qParams := &metricsstore.ErrorRateQueryParameters{} - r, err := qs.GetErrorRates(context.Background(), qParams) - assert.Zero(t, r) - assert.EqualError(t, err, errNilReader.Error()) -} - // Test QueryService.GetMinStepDurations() func TestGetMinStepDurations(t *testing.T) { tqs := initializeTestMetricsQueryService() @@ -120,11 +94,3 @@ func TestGetMinStepDurations(t *testing.T) { assert.NoError(t, err) assert.Equal(t, expectedMinStep, actualMinStep) } - -func TestGetMinStepDurationsNilReader(t *testing.T) { - qs := NewMetricsQueryService(nil) - qParams := &metricsstore.MinStepDurationQueryParameters{} - r, err := qs.GetMinStepDuration(context.Background(), qParams) - assert.Zero(t, r) - assert.EqualError(t, err, errNilReader.Error()) -} diff --git a/cmd/query/app/server.go b/cmd/query/app/server.go index 52be92b45c40..606f8b12766b 100644 --- a/cmd/query/app/server.go +++ b/cmd/query/app/server.go @@ -52,7 +52,7 @@ type Server struct { } // NewServer creates and initializes Server -func NewServer(logger *zap.Logger, querySvc *querysvc.QueryService, options *QueryOptions, tracer opentracing.Tracer) (*Server, error) { +func NewServer(logger *zap.Logger, querySvc *querysvc.QueryService, metricsQuerySvc *querysvc.MetricsQueryService, options *QueryOptions, tracer opentracing.Tracer) (*Server, error) { _, httpPort, err := net.SplitHostPort(options.HTTPHostPort) if err != nil { @@ -67,12 +67,12 @@ func NewServer(logger *zap.Logger, querySvc *querysvc.QueryService, options *Que return nil, errors.New("server with TLS enabled can not use same host ports for gRPC and HTTP. Use dedicated HTTP and gRPC host ports instead") } - grpcServer, err := createGRPCServer(querySvc, options, logger, tracer) + grpcServer, err := createGRPCServer(querySvc, metricsQuerySvc, options, logger, tracer) if err != nil { return nil, err } - httpServer, err := createHTTPServer(querySvc, options, tracer, logger) + httpServer, err := createHTTPServer(querySvc, metricsQuerySvc, options, tracer, logger) if err != nil { return nil, err } @@ -94,7 +94,7 @@ func (s Server) HealthCheckStatus() chan healthcheck.Status { return s.unavailableChannel } -func createGRPCServer(querySvc *querysvc.QueryService, options *QueryOptions, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, error) { +func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc *querysvc.MetricsQueryService, options *QueryOptions, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, error) { var grpcOpts []grpc.ServerOption if options.TLSGRPC.Enabled { @@ -111,11 +111,15 @@ func createGRPCServer(querySvc *querysvc.QueryService, options *QueryOptions, lo server := grpc.NewServer(grpcOpts...) handler := NewGRPCHandler(querySvc, logger, tracer) + + // TODO: Register MetricsQueryService api_v2.RegisterQueryServiceServer(server, handler) + return server, nil } -func createHTTPServer(querySvc *querysvc.QueryService, queryOpts *QueryOptions, tracer opentracing.Tracer, logger *zap.Logger) (*http.Server, error) { +func createHTTPServer(querySvc *querysvc.QueryService, metricsQuerySvc *querysvc.MetricsQueryService, queryOpts *QueryOptions, tracer opentracing.Tracer, logger *zap.Logger) (*http.Server, error) { + // TODO: Add HandlerOptions.MetricsQueryService 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 9bc3579d8c0f..3ade4591b799 100644 --- a/cmd/query/app/server_test.go +++ b/cmd/query/app/server_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - opentracing "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -64,7 +64,7 @@ func TestCreateTLSServerSinglePortError(t *testing.T) { ClientCAPath: testCertKeyLocation + "/example-CA-cert.pem", } - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8080", TLSGRPC: tlsCfg, TLSHTTP: tlsCfg}, opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -77,7 +77,7 @@ func TestCreateTLSGrpcServerError(t *testing.T) { ClientCAPath: "invalid/path", } - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8081", TLSGRPC: tlsCfg}, opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -90,7 +90,7 @@ func TestCreateTLSHttpServerError(t *testing.T) { ClientCAPath: "invalid/path", } - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8081", TLSHTTP: tlsCfg}, opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -331,7 +331,8 @@ func TestServerHTTPTLS(t *testing.T) { spanReader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) - server, err := NewServer(flagsSvc.Logger, querySvc, + metricsQuerySvc := querysvc.NewMetricsQueryService(nil) + server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, serverOptions, opentracing.NoopTracer{}) assert.Nil(t, err) @@ -491,7 +492,8 @@ func TestServerGRPCTLS(t *testing.T) { spanReader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) - server, err := NewServer(flagsSvc.Logger, querySvc, + metricsQuerySvc := querysvc.NewMetricsQueryService(nil) + server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, serverOptions, opentracing.NoopTracer{}) assert.Nil(t, err) @@ -545,12 +547,12 @@ func TestServerGRPCTLS(t *testing.T) { } func TestServerBadHostPort(t *testing.T) { - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), &QueryOptions{HTTPHostPort: "8080", GRPCHostPort: "127.0.0.1:8081", BearerTokenPropagation: true}, opentracing.NoopTracer{}) assert.NotNil(t, err) - _, err = NewServer(zap.NewNop(), &querysvc.QueryService{}, + _, err = NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), &QueryOptions{HTTPHostPort: "127.0.0.1:8081", GRPCHostPort: "9123", BearerTokenPropagation: true}, opentracing.NoopTracer{}) @@ -576,6 +578,7 @@ func TestServerInUseHostPort(t *testing.T) { server, err := NewServer( zap.NewNop(), &querysvc.QueryService{}, + querysvc.NewMetricsQueryService(nil), &QueryOptions{ HTTPHostPort: tc.httpHostPort, GRPCHostPort: tc.grpcHostPort, @@ -608,8 +611,8 @@ func TestServerSinglePort(t *testing.T) { spanReader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) - - server, err := NewServer(flagsSvc.Logger, querySvc, + metricsQuerySvc := querysvc.NewMetricsQueryService(nil) + server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort, BearerTokenPropagation: true}, opentracing.NoopTracer{}) assert.Nil(t, err) @@ -658,8 +661,10 @@ func TestServerGracefulExit(t *testing.T) { hostPort := ports.PortToHostPort(ports.QueryAdminHTTP) querySvc := &querysvc.QueryService{} + metricsQuerySvc := querysvc.NewMetricsQueryService(nil) tracer := opentracing.NoopTracer{} - server, err := NewServer(flagsSvc.Logger, querySvc, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort}, tracer) + + server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort}, tracer) assert.Nil(t, err) assert.NoError(t, server.Start()) go func() { @@ -685,8 +690,9 @@ func TestServerHandlesPortZero(t *testing.T) { flagsSvc.Logger = zap.New(zapCore) querySvc := &querysvc.QueryService{} + metricsQuerySvc := querysvc.NewMetricsQueryService(nil) tracer := opentracing.NoopTracer{} - server, err := NewServer(flagsSvc.Logger, querySvc, &QueryOptions{GRPCHostPort: ":0", HTTPHostPort: ":0"}, tracer) + server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, &QueryOptions{GRPCHostPort: ":0", HTTPHostPort: ":0"}, tracer) assert.Nil(t, err) assert.NoError(t, server.Start()) server.Close() diff --git a/cmd/query/main.go b/cmd/query/main.go index adbbfe46d086..eec8879b8c21 100644 --- a/cmd/query/main.go +++ b/cmd/query/main.go @@ -37,6 +37,7 @@ import ( "github.com/jaegertracing/jaeger/cmd/status" "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/version" + metricsPlugin "github.com/jaegertracing/jaeger/plugin/metrics" "github.com/jaegertracing/jaeger/plugin/storage" "github.com/jaegertracing/jaeger/ports" "github.com/jaegertracing/jaeger/storage/spanstore" @@ -51,6 +52,12 @@ func main() { log.Fatalf("Cannot initialize storage factory: %v", err) } + fc := metricsPlugin.FactoryConfigFromEnv() + metricsReaderFactory, err := metricsPlugin.NewFactory(fc) + if err != nil { + log.Fatalf("Cannot initialize metrics factory: %v", err) + } + v := viper.New() var command = &cobra.Command{ Use: "jaeger-query", @@ -101,13 +108,17 @@ func main() { if err != nil { logger.Fatal("Failed to create dependency reader", zap.Error(err)) } + + metricsQueryService, err := createMetricsQueryService(metricsReaderFactory, v, logger) + if err != nil { + logger.Fatal("Failed to create metrics query service", zap.Error(err)) + } queryServiceOptions := queryOpts.BuildQueryServiceOptions(storageFactory, logger) queryService := querysvc.NewQueryService( spanReader, dependencyReader, *queryServiceOptions) - - server, err := app.NewServer(svc.Logger, queryService, queryOpts, tracer) + server, err := app.NewServer(svc.Logger, queryService, metricsQueryService, queryOpts, tracer) if err != nil { logger.Fatal("Failed to create server", zap.Error(err)) } @@ -143,6 +154,7 @@ func main() { svc.AddFlags, storageFactory.AddFlags, app.AddFlags, + metricsReaderFactory.AddFlags, ) if err := command.Execute(); err != nil { @@ -150,3 +162,17 @@ func main() { os.Exit(1) } } + +func createMetricsQueryService(factory *metricsPlugin.Factory, v *viper.Viper, logger *zap.Logger) (*querysvc.MetricsQueryService, error) { + if err := factory.Initialize(logger); err != nil { + return nil, fmt.Errorf("failed to init metrics factory: %w", err) + } + + // Ensure default parameter values are loaded correctly. + factory.InitFromViper(v) + metricsReader, err := factory.CreateMetricsReader() + if err != nil { + return nil, fmt.Errorf("failed to create metrics reader: %w", err) + } + return querysvc.NewMetricsQueryService(metricsReader), nil +} diff --git a/plugin/metrics/disabled/factory.go b/plugin/metrics/disabled/factory.go new file mode 100644 index 000000000000..fec3f45c9bf7 --- /dev/null +++ b/plugin/metrics/disabled/factory.go @@ -0,0 +1,48 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package disabled + +import ( + "flag" + + "github.com/spf13/viper" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +// Factory implements storage.Factory that returns a Disabled metrics reader. +type Factory struct{} + +// NewFactory creates a new Factory. +func NewFactory() *Factory { + return &Factory{} +} + +// AddFlags implements plugin.Configurable. +func (f *Factory) AddFlags(_ *flag.FlagSet) {} + +// InitFromViper implements plugin.Configurable. +func (f *Factory) InitFromViper(_ *viper.Viper) {} + +// Initialize implements storage.MetricsFactory. +func (f *Factory) Initialize(_ *zap.Logger) error { + return nil +} + +// CreateMetricsReader implements storage.MetricsFactory. +func (f *Factory) CreateMetricsReader() (metricsstore.Reader, error) { + return NewMetricsReader() +} diff --git a/plugin/metrics/disabled/factory_test.go b/plugin/metrics/disabled/factory_test.go new file mode 100644 index 000000000000..4f1d1444e7b0 --- /dev/null +++ b/plugin/metrics/disabled/factory_test.go @@ -0,0 +1,42 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package disabled + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/storage" +) + +var _ storage.MetricsFactory = new(Factory) + +func TestPrometheusFactory(t *testing.T) { + f := NewFactory() + assert.NoError(t, f.Initialize(zap.NewNop())) + + err := f.Initialize(nil) + require.NoError(t, err) + + f.AddFlags(nil) + f.InitFromViper(nil) + + reader, err := f.CreateMetricsReader() + assert.NoError(t, err) + assert.NotNil(t, reader) +} diff --git a/plugin/metrics/disabled/reader.go b/plugin/metrics/disabled/reader.go new file mode 100644 index 000000000000..8f8a3d9860e1 --- /dev/null +++ b/plugin/metrics/disabled/reader.go @@ -0,0 +1,64 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package disabled + +import ( + "context" + "time" + + "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" + "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +type ( + // MetricsReader represents a "disabled" metricsstore.Reader implementation where + // the METRICS_STORAGE_TYPE has not been set. + MetricsReader struct{} + + // errMetricsQueryDisabled is the error returned by disabledMetricsQueryService. + errMetricsQueryDisabled struct{} +) + +// ErrDisabled is the error returned by a "disabled" MetricsQueryService on all of its endpoints. +var ErrDisabled = &errMetricsQueryDisabled{} + +func (m *errMetricsQueryDisabled) Error() string { + return "metrics querying is currently disabled" +} + +// NewMetricsReader returns a new Disabled MetricsReader. +func NewMetricsReader() (*MetricsReader, error) { + return &MetricsReader{}, nil +} + +// GetLatencies gets the latency metrics for the given set of latency query parameters. +func (m *MetricsReader) GetLatencies(ctx context.Context, requestParams *metricsstore.LatenciesQueryParameters) (*metrics.MetricFamily, error) { + return nil, ErrDisabled +} + +// GetCallRates gets the call rate metrics for the given set of call rate query parameters. +func (m *MetricsReader) GetCallRates(ctx context.Context, requestParams *metricsstore.CallRateQueryParameters) (*metrics.MetricFamily, error) { + return nil, ErrDisabled +} + +// GetErrorRates gets the error rate metrics for the given set of error rate query parameters. +func (m *MetricsReader) GetErrorRates(ctx context.Context, requestParams *metricsstore.ErrorRateQueryParameters) (*metrics.MetricFamily, error) { + return nil, ErrDisabled +} + +// GetMinStepDuration gets the minimum step duration (the smallest possible duration between two data points in a time series) supported. +func (m *MetricsReader) GetMinStepDuration(_ context.Context, _ *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { + return 0, ErrDisabled +} diff --git a/plugin/metrics/disabled/reader_test.go b/plugin/metrics/disabled/reader_test.go new file mode 100644 index 000000000000..b8bc873a1a29 --- /dev/null +++ b/plugin/metrics/disabled/reader_test.go @@ -0,0 +1,74 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package disabled + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/jaegertracing/jaeger/storage/metricsstore" +) + +func TestGetLatencies(t *testing.T) { + reader, err := NewMetricsReader() + require.NoError(t, err) + require.NotNil(t, reader) + + qParams := &metricsstore.LatenciesQueryParameters{} + r, err := reader.GetLatencies(context.Background(), qParams) + assert.Zero(t, r) + assert.True(t, errors.Is(err, ErrDisabled)) + assert.EqualError(t, err, ErrDisabled.Error()) +} + +func TestGetCallRates(t *testing.T) { + reader, err := NewMetricsReader() + require.NoError(t, err) + require.NotNil(t, reader) + + qParams := &metricsstore.CallRateQueryParameters{} + r, err := reader.GetCallRates(context.Background(), qParams) + assert.Zero(t, r) + assert.True(t, errors.Is(err, ErrDisabled)) + assert.EqualError(t, err, ErrDisabled.Error()) +} + +func TestGetErrorRates(t *testing.T) { + reader, err := NewMetricsReader() + require.NoError(t, err) + require.NotNil(t, reader) + + qParams := &metricsstore.ErrorRateQueryParameters{} + r, err := reader.GetErrorRates(context.Background(), qParams) + assert.Zero(t, r) + assert.True(t, errors.Is(err, ErrDisabled)) + assert.EqualError(t, err, ErrDisabled.Error()) +} + +func TestGetMinStepDurations(t *testing.T) { + reader, err := NewMetricsReader() + require.NoError(t, err) + require.NotNil(t, reader) + + qParams := &metricsstore.MinStepDurationQueryParameters{} + r, err := reader.GetMinStepDuration(context.Background(), qParams) + assert.Zero(t, r) + assert.True(t, errors.Is(err, ErrDisabled)) + assert.EqualError(t, err, ErrDisabled.Error()) +} diff --git a/plugin/metrics/factory.go b/plugin/metrics/factory.go index 73153e78732a..433be025b8fb 100644 --- a/plugin/metrics/factory.go +++ b/plugin/metrics/factory.go @@ -22,12 +22,16 @@ import ( "go.uber.org/zap" "github.com/jaegertracing/jaeger/plugin" + "github.com/jaegertracing/jaeger/plugin/metrics/disabled" "github.com/jaegertracing/jaeger/plugin/metrics/prometheus" "github.com/jaegertracing/jaeger/storage" "github.com/jaegertracing/jaeger/storage/metricsstore" ) const ( + // disabledStorageType is the storage type used when METRICS_STORAGE_TYPE is unset. + disabledStorageType = "" + prometheusStorageType = "prometheus" ) @@ -61,6 +65,8 @@ func (f *Factory) getFactoryOfType(factoryType string) (storage.MetricsFactory, switch factoryType { case prometheusStorageType: return prometheus.NewFactory(), nil + case disabledStorageType: + return disabled.NewFactory(), nil } return nil, fmt.Errorf("unknown metrics type %q. Valid types are %v", factoryType, AllStorageTypes) } diff --git a/plugin/metrics/factory_test.go b/plugin/metrics/factory_test.go index 49c770e8320b..fe8c4e1592b7 100644 --- a/plugin/metrics/factory_test.go +++ b/plugin/metrics/factory_test.go @@ -23,20 +23,21 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" + "github.com/jaegertracing/jaeger/plugin/metrics/disabled" "github.com/jaegertracing/jaeger/storage" "github.com/jaegertracing/jaeger/storage/mocks" ) var _ storage.MetricsFactory = new(Factory) -func defaultCfg() FactoryConfig { +func withConfig(storageType string) FactoryConfig { return FactoryConfig{ - MetricsStorageType: prometheusStorageType, + MetricsStorageType: storageType, } } func TestNewFactory(t *testing.T) { - f, err := NewFactory(defaultCfg()) + f, err := NewFactory(withConfig(prometheusStorageType)) require.NoError(t, err) assert.NotEmpty(t, f.factories) assert.NotEmpty(t, f.factories[prometheusStorageType]) @@ -44,14 +45,22 @@ func TestNewFactory(t *testing.T) { } func TestUnsupportedMetricsStorageType(t *testing.T) { - f, err := NewFactory(FactoryConfig{MetricsStorageType: "foo"}) + f, err := NewFactory(withConfig("foo")) require.Error(t, err) assert.Nil(t, f) assert.EqualError(t, err, `unknown metrics type "foo". Valid types are [prometheus]`) } +func TestDisabledMetricsStorageType(t *testing.T) { + f, err := NewFactory(withConfig(disabledStorageType)) + require.NoError(t, err) + assert.NotEmpty(t, f.factories) + assert.Equal(t, &disabled.Factory{}, f.factories[disabledStorageType]) + assert.Equal(t, disabledStorageType, f.MetricsStorageType) +} + func TestCreateMetricsReader(t *testing.T) { - f, err := NewFactory(defaultCfg()) + f, err := NewFactory(withConfig(prometheusStorageType)) require.NoError(t, err) require.NotNil(t, f) @@ -89,7 +98,7 @@ func TestConfigurable(t *testing.T) { clearEnv(t) defer clearEnv(t) - f, err := NewFactory(defaultCfg()) + f, err := NewFactory(withConfig(prometheusStorageType)) require.NoError(t, err) assert.NotEmpty(t, f.factories) assert.NotEmpty(t, f.factories[prometheusStorageType]) From c9d695752fb9360df2227b2d7244a6926879b700 Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Mon, 14 Jun 2021 09:16:58 +1000 Subject: [PATCH 19/22] Convert MetricsQueryService to interface (#3089) * Convert MetricsQueryService to interface Signed-off-by: albertteoh * Simplify and make consistent Signed-off-by: albertteoh --- cmd/all-in-one/main.go | 12 +-- .../app/querysvc/metrics_query_service.go | 39 +------- .../querysvc/metrics_query_service_test.go | 96 ------------------- cmd/query/app/server.go | 6 +- cmd/query/app/server_test.go | 27 +++--- cmd/query/main.go | 10 +- 6 files changed, 25 insertions(+), 165 deletions(-) delete mode 100644 cmd/query/app/querysvc/metrics_query_service_test.go diff --git a/cmd/all-in-one/main.go b/cmd/all-in-one/main.go index 24e12ddfc1c0..8571f829f12d 100644 --- a/cmd/all-in-one/main.go +++ b/cmd/all-in-one/main.go @@ -50,7 +50,6 @@ import ( "github.com/jaegertracing/jaeger/plugin/storage" "github.com/jaegertracing/jaeger/ports" "github.com/jaegertracing/jaeger/storage/dependencystore" - "github.com/jaegertracing/jaeger/storage/metricsstore" "github.com/jaegertracing/jaeger/storage/spanstore" storageMetrics "github.com/jaegertracing/jaeger/storage/spanstore/metrics" ) @@ -116,7 +115,7 @@ by default uses only in-memory database.`, logger.Fatal("Failed to create dependency reader", zap.Error(err)) } - metricsReader, err := createMetricsReader(metricsReaderFactory, v, logger) + metricsQueryService, err := createMetricsQueryService(metricsReaderFactory, v, logger) if err != nil { logger.Fatal("Failed to create metrics reader", zap.Error(err)) } @@ -171,7 +170,7 @@ by default uses only in-memory database.`, // query querySrv := startQuery( svc, qOpts, qOpts.BuildQueryServiceOptions(storageFactory, logger), - spanReader, dependencyReader, metricsReader, + spanReader, dependencyReader, metricsQueryService, metricsFactory, ) @@ -244,13 +243,12 @@ func startQuery( queryOpts *querysvc.QueryServiceOptions, spanReader spanstore.Reader, depReader dependencystore.Reader, - metricsReader metricsstore.Reader, + metricsQueryService querysvc.MetricsQueryService, baseFactory metrics.Factory, ) *queryApp.Server { spanReader = storageMetrics.NewReadMetricsDecorator(spanReader, baseFactory.Namespace(metrics.NSOptions{Name: "query"})) qs := querysvc.NewQueryService(spanReader, depReader, *queryOpts) - mqs := querysvc.NewMetricsQueryService(metricsReader) - server, err := queryApp.NewServer(svc.Logger, qs, mqs, qOpts, opentracing.GlobalTracer()) + server, err := queryApp.NewServer(svc.Logger, qs, metricsQueryService, qOpts, opentracing.GlobalTracer()) if err != nil { svc.Logger.Fatal("Could not start jaeger-query service", zap.Error(err)) } @@ -289,7 +287,7 @@ func initTracer(metricsFactory metrics.Factory, logger *zap.Logger) io.Closer { return closer } -func createMetricsReader(factory *metricsPlugin.Factory, v *viper.Viper, logger *zap.Logger) (metricsstore.Reader, error) { +func createMetricsQueryService(factory *metricsPlugin.Factory, v *viper.Viper, logger *zap.Logger) (querysvc.MetricsQueryService, error) { if err := factory.Initialize(logger); err != nil { return nil, fmt.Errorf("failed to init metrics reader factory: %w", err) } diff --git a/cmd/query/app/querysvc/metrics_query_service.go b/cmd/query/app/querysvc/metrics_query_service.go index 5596901bb5b0..2fafac589fee 100644 --- a/cmd/query/app/querysvc/metrics_query_service.go +++ b/cmd/query/app/querysvc/metrics_query_service.go @@ -14,42 +14,9 @@ package querysvc -import ( - "context" - "time" - - "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" - "github.com/jaegertracing/jaeger/storage/metricsstore" -) +import "github.com/jaegertracing/jaeger/storage/metricsstore" // MetricsQueryService provides a means of querying R.E.D metrics from an underlying metrics store. -type MetricsQueryService struct { - metricsReader metricsstore.Reader -} - -// NewMetricsQueryService returns a new MetricsQueryService. -func NewMetricsQueryService(reader metricsstore.Reader) *MetricsQueryService { - return &MetricsQueryService{ - metricsReader: reader, - } -} - -// GetLatencies is the queryService implementation of metricsstore.Reader. -func (mqs MetricsQueryService) GetLatencies(ctx context.Context, params *metricsstore.LatenciesQueryParameters) (*metrics.MetricFamily, error) { - return mqs.metricsReader.GetLatencies(ctx, params) -} - -// GetCallRates is the queryService implementation of metricsstore.Reader. -func (mqs MetricsQueryService) GetCallRates(ctx context.Context, params *metricsstore.CallRateQueryParameters) (*metrics.MetricFamily, error) { - return mqs.metricsReader.GetCallRates(ctx, params) -} - -// GetErrorRates is the queryService implementation of metricsstore.Reader. -func (mqs MetricsQueryService) GetErrorRates(ctx context.Context, params *metricsstore.ErrorRateQueryParameters) (*metrics.MetricFamily, error) { - return mqs.metricsReader.GetErrorRates(ctx, params) -} - -// GetMinStepDuration is the queryService implementation of metricsstore.Reader. -func (mqs MetricsQueryService) GetMinStepDuration(ctx context.Context, params *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { - return mqs.metricsReader.GetMinStepDuration(ctx, params) +type MetricsQueryService interface { + metricsstore.Reader } diff --git a/cmd/query/app/querysvc/metrics_query_service_test.go b/cmd/query/app/querysvc/metrics_query_service_test.go deleted file mode 100644 index 5783f1e54a14..000000000000 --- a/cmd/query/app/querysvc/metrics_query_service_test.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2021 The Jaeger Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package querysvc - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - protometrics "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" - "github.com/jaegertracing/jaeger/storage/metricsstore" - metricsmocks "github.com/jaegertracing/jaeger/storage/metricsstore/mocks" -) - -type testMetricsQueryService struct { - queryService *MetricsQueryService - metricsReader *metricsmocks.Reader -} - -func initializeTestMetricsQueryService() *testMetricsQueryService { - metricsReader := &metricsmocks.Reader{} - tqs := testMetricsQueryService{ - metricsReader: metricsReader, - } - tqs.queryService = NewMetricsQueryService(metricsReader) - return &tqs -} - -// Test QueryService.GetLatencies() -func TestGetLatencies(t *testing.T) { - tqs := initializeTestMetricsQueryService() - expectedLatencies := &protometrics.MetricFamily{ - Name: "latencies", - Metrics: []*protometrics.Metric{}, - } - qParams := &metricsstore.LatenciesQueryParameters{} - tqs.metricsReader.On("GetLatencies", mock.Anything, qParams).Return(expectedLatencies, nil).Times(1) - - actualLatencies, err := tqs.queryService.GetLatencies(context.Background(), qParams) - assert.NoError(t, err) - assert.Equal(t, expectedLatencies, actualLatencies) -} - -// Test QueryService.GetCallRates() -func TestGetCallRates(t *testing.T) { - tqs := initializeTestMetricsQueryService() - expectedCallRates := &protometrics.MetricFamily{ - Name: "call rates", - Metrics: []*protometrics.Metric{}, - } - qParams := &metricsstore.CallRateQueryParameters{} - tqs.metricsReader.On("GetCallRates", mock.Anything, qParams).Return(expectedCallRates, nil).Times(1) - - actualCallRates, err := tqs.queryService.GetCallRates(context.Background(), qParams) - assert.NoError(t, err) - assert.Equal(t, expectedCallRates, actualCallRates) -} - -// Test QueryService.GetErrorRates() -func TestGetErrorRates(t *testing.T) { - tqs := initializeTestMetricsQueryService() - expectedErrorRates := &protometrics.MetricFamily{} - qParams := &metricsstore.ErrorRateQueryParameters{} - tqs.metricsReader.On("GetErrorRates", mock.Anything, qParams).Return(expectedErrorRates, nil).Times(1) - - actualErrorRates, err := tqs.queryService.GetErrorRates(context.Background(), qParams) - assert.NoError(t, err) - assert.Equal(t, expectedErrorRates, actualErrorRates) -} - -// Test QueryService.GetMinStepDurations() -func TestGetMinStepDurations(t *testing.T) { - tqs := initializeTestMetricsQueryService() - expectedMinStep := time.Second - qParams := &metricsstore.MinStepDurationQueryParameters{} - tqs.metricsReader.On("GetMinStepDuration", mock.Anything, qParams).Return(expectedMinStep, nil).Times(1) - - actualMinStep, err := tqs.queryService.GetMinStepDuration(context.Background(), qParams) - assert.NoError(t, err) - assert.Equal(t, expectedMinStep, actualMinStep) -} diff --git a/cmd/query/app/server.go b/cmd/query/app/server.go index 606f8b12766b..5918dc7ca88e 100644 --- a/cmd/query/app/server.go +++ b/cmd/query/app/server.go @@ -52,7 +52,7 @@ type Server struct { } // NewServer creates and initializes Server -func NewServer(logger *zap.Logger, querySvc *querysvc.QueryService, metricsQuerySvc *querysvc.MetricsQueryService, options *QueryOptions, tracer opentracing.Tracer) (*Server, error) { +func NewServer(logger *zap.Logger, querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, tracer opentracing.Tracer) (*Server, error) { _, httpPort, err := net.SplitHostPort(options.HTTPHostPort) if err != nil { @@ -94,7 +94,7 @@ func (s Server) HealthCheckStatus() chan healthcheck.Status { return s.unavailableChannel } -func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc *querysvc.MetricsQueryService, options *QueryOptions, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, error) { +func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, error) { var grpcOpts []grpc.ServerOption if options.TLSGRPC.Enabled { @@ -118,7 +118,7 @@ func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc *querysvc return server, nil } -func createHTTPServer(querySvc *querysvc.QueryService, metricsQuerySvc *querysvc.MetricsQueryService, queryOpts *QueryOptions, tracer opentracing.Tracer, logger *zap.Logger) (*http.Server, error) { +func createHTTPServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, queryOpts *QueryOptions, tracer opentracing.Tracer, logger *zap.Logger) (*http.Server, error) { // TODO: Add HandlerOptions.MetricsQueryService apiHandlerOptions := []HandlerOption{ HandlerOptions.Logger(logger), diff --git a/cmd/query/app/server_test.go b/cmd/query/app/server_test.go index 3ade4591b799..8ecc85d552c8 100644 --- a/cmd/query/app/server_test.go +++ b/cmd/query/app/server_test.go @@ -64,7 +64,7 @@ func TestCreateTLSServerSinglePortError(t *testing.T) { ClientCAPath: testCertKeyLocation + "/example-CA-cert.pem", } - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8080", TLSGRPC: tlsCfg, TLSHTTP: tlsCfg}, opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -77,7 +77,7 @@ func TestCreateTLSGrpcServerError(t *testing.T) { ClientCAPath: "invalid/path", } - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8081", TLSGRPC: tlsCfg}, opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -90,7 +90,7 @@ func TestCreateTLSHttpServerError(t *testing.T) { ClientCAPath: "invalid/path", } - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: ":8080", GRPCHostPort: ":8081", TLSHTTP: tlsCfg}, opentracing.NoopTracer{}) assert.NotNil(t, err) } @@ -331,8 +331,7 @@ func TestServerHTTPTLS(t *testing.T) { spanReader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) - metricsQuerySvc := querysvc.NewMetricsQueryService(nil) - server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, + server, err := NewServer(flagsSvc.Logger, querySvc, nil, serverOptions, opentracing.NoopTracer{}) assert.Nil(t, err) @@ -492,8 +491,7 @@ func TestServerGRPCTLS(t *testing.T) { spanReader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) - metricsQuerySvc := querysvc.NewMetricsQueryService(nil) - server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, + server, err := NewServer(flagsSvc.Logger, querySvc, nil, serverOptions, opentracing.NoopTracer{}) assert.Nil(t, err) @@ -547,12 +545,12 @@ func TestServerGRPCTLS(t *testing.T) { } func TestServerBadHostPort(t *testing.T) { - _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), + _, err := NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: "8080", GRPCHostPort: "127.0.0.1:8081", BearerTokenPropagation: true}, opentracing.NoopTracer{}) assert.NotNil(t, err) - _, err = NewServer(zap.NewNop(), &querysvc.QueryService{}, querysvc.NewMetricsQueryService(nil), + _, err = NewServer(zap.NewNop(), &querysvc.QueryService{}, nil, &QueryOptions{HTTPHostPort: "127.0.0.1:8081", GRPCHostPort: "9123", BearerTokenPropagation: true}, opentracing.NoopTracer{}) @@ -578,7 +576,7 @@ func TestServerInUseHostPort(t *testing.T) { server, err := NewServer( zap.NewNop(), &querysvc.QueryService{}, - querysvc.NewMetricsQueryService(nil), + nil, &QueryOptions{ HTTPHostPort: tc.httpHostPort, GRPCHostPort: tc.grpcHostPort, @@ -611,8 +609,7 @@ func TestServerSinglePort(t *testing.T) { spanReader.On("GetServices", mock.AnythingOfType("*context.valueCtx")).Return(expectedServices, nil) querySvc := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{}) - metricsQuerySvc := querysvc.NewMetricsQueryService(nil) - server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, + server, err := NewServer(flagsSvc.Logger, querySvc, nil, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort, BearerTokenPropagation: true}, opentracing.NoopTracer{}) assert.Nil(t, err) @@ -661,10 +658,9 @@ func TestServerGracefulExit(t *testing.T) { hostPort := ports.PortToHostPort(ports.QueryAdminHTTP) querySvc := &querysvc.QueryService{} - metricsQuerySvc := querysvc.NewMetricsQueryService(nil) tracer := opentracing.NoopTracer{} - server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort}, tracer) + server, err := NewServer(flagsSvc.Logger, querySvc, nil, &QueryOptions{GRPCHostPort: hostPort, HTTPHostPort: hostPort}, tracer) assert.Nil(t, err) assert.NoError(t, server.Start()) go func() { @@ -690,9 +686,8 @@ func TestServerHandlesPortZero(t *testing.T) { flagsSvc.Logger = zap.New(zapCore) querySvc := &querysvc.QueryService{} - metricsQuerySvc := querysvc.NewMetricsQueryService(nil) tracer := opentracing.NoopTracer{} - server, err := NewServer(flagsSvc.Logger, querySvc, metricsQuerySvc, &QueryOptions{GRPCHostPort: ":0", HTTPHostPort: ":0"}, tracer) + server, err := NewServer(flagsSvc.Logger, querySvc, nil, &QueryOptions{GRPCHostPort: ":0", HTTPHostPort: ":0"}, tracer) assert.Nil(t, err) assert.NoError(t, server.Start()) server.Close() diff --git a/cmd/query/main.go b/cmd/query/main.go index eec8879b8c21..cc012180597d 100644 --- a/cmd/query/main.go +++ b/cmd/query/main.go @@ -163,16 +163,12 @@ func main() { } } -func createMetricsQueryService(factory *metricsPlugin.Factory, v *viper.Viper, logger *zap.Logger) (*querysvc.MetricsQueryService, error) { +func createMetricsQueryService(factory *metricsPlugin.Factory, v *viper.Viper, logger *zap.Logger) (querysvc.MetricsQueryService, error) { if err := factory.Initialize(logger); err != nil { - return nil, fmt.Errorf("failed to init metrics factory: %w", err) + return nil, fmt.Errorf("failed to init metrics reader factory: %w", err) } // Ensure default parameter values are loaded correctly. factory.InitFromViper(v) - metricsReader, err := factory.CreateMetricsReader() - if err != nil { - return nil, fmt.Errorf("failed to create metrics reader: %w", err) - } - return querysvc.NewMetricsQueryService(metricsReader), nil + return factory.CreateMetricsReader() } From e15c981154f23cb236a27bb53cd4d422c0a8ffb2 Mon Sep 17 00:00:00 2001 From: Albert <26584478+albertteoh@users.noreply.github.com> Date: Wed, 16 Jun 2021 13:23:08 +1000 Subject: [PATCH 20/22] Add MetricsQueryService grcp handler (#3091) * Add grcp handler Signed-off-by: albertteoh * Address review comments Signed-off-by: albertteoh * Check nil request Signed-off-by: albertteoh --- cmd/query/app/default_params.go | 32 ++ cmd/query/app/grpc_handler.go | 165 ++++++++- cmd/query/app/grpc_handler_test.go | 386 +++++++++++++++++++- cmd/query/app/http_handler.go | 4 +- cmd/query/app/server.go | 13 +- model/proto/metrics/metricsquery.proto | 2 +- proto-gen/api_v2/metrics/metricsquery.pb.go | 2 +- 7 files changed, 561 insertions(+), 43 deletions(-) create mode 100644 cmd/query/app/default_params.go diff --git a/cmd/query/app/default_params.go b/cmd/query/app/default_params.go new file mode 100644 index 000000000000..581044938793 --- /dev/null +++ b/cmd/query/app/default_params.go @@ -0,0 +1,32 @@ +// Copyright (c) 2021 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Contains default parameter values used by handlers when optional request parameters are missing. + +package app + +import ( + "time" + + "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" +) + +var ( + defaultDependencyLookbackDuration = time.Hour * 24 + defaultTraceQueryLookbackDuration = time.Hour * 24 * 2 + defaultMetricsQueryLookbackDuration = time.Hour + defaultMetricsQueryStepDuration = 5 * time.Second + defaultMetricsQueryRateDuration = 10 * time.Minute + defaultMetricsSpanKinds = []string{metrics.SpanKind_SPAN_KIND_SERVER.String()} +) diff --git a/cmd/query/app/grpc_handler.go b/cmd/query/app/grpc_handler.go index bc223230daeb..33d5e701b004 100644 --- a/cmd/query/app/grpc_handler.go +++ b/cmd/query/app/grpc_handler.go @@ -16,6 +16,8 @@ package app import ( "context" + "errors" + "time" "github.com/opentracing/opentracing-go" "go.uber.org/zap" @@ -24,8 +26,11 @@ import ( "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" "github.com/jaegertracing/jaeger/model" - _ "github.com/jaegertracing/jaeger/pkg/gogocodec" //force gogo codec registration + _ "github.com/jaegertracing/jaeger/pkg/gogocodec" // force gogo codec registration + "github.com/jaegertracing/jaeger/plugin/metrics/disabled" "github.com/jaegertracing/jaeger/proto-gen/api_v2" + "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" + "github.com/jaegertracing/jaeger/storage/metricsstore" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -35,22 +40,20 @@ const ( msgTraceNotFound = "trace not found" ) +var ( + errGRPCMetricsQueryDisabled = status.Error(codes.Unimplemented, "metrics querying is currently disabled") + errNilRequest = status.Error(codes.InvalidArgument, "a nil argument is not allowed") + errMissingServiceNames = status.Error(codes.InvalidArgument, "please provide at least one service name") + errMissingQuantile = status.Error(codes.InvalidArgument, "please provide a quantile between (0, 1]") +) + // GRPCHandler implements the gRPC endpoint of the query service. type GRPCHandler struct { - queryService *querysvc.QueryService - logger *zap.Logger - tracer opentracing.Tracer -} - -// NewGRPCHandler returns a GRPCHandler -func NewGRPCHandler(queryService *querysvc.QueryService, logger *zap.Logger, tracer opentracing.Tracer) *GRPCHandler { - gH := &GRPCHandler{ - queryService: queryService, - logger: logger, - tracer: tracer, - } - - return gH + queryService *querysvc.QueryService + metricsQueryService querysvc.MetricsQueryService + logger *zap.Logger + tracer opentracing.Tracer + nowFn func() time.Time } // GetTrace is the gRPC handler to fetch traces based on trace-id. @@ -177,3 +180,135 @@ func (g *GRPCHandler) GetDependencies(ctx context.Context, r *api_v2.GetDependen return &api_v2.GetDependenciesResponse{Dependencies: dependencies}, nil } + +// GetLatencies is the gRPC handler to fetch latency metrics. +func (g *GRPCHandler) GetLatencies(ctx context.Context, r *metrics.GetLatenciesRequest) (*metrics.GetMetricsResponse, error) { + bqp, err := g.newBaseQueryParameters(r) + if err := g.handleErr("failed to build parameters", err); err != nil { + return nil, err + } + // Check for cases where clients do not provide the Quantile, which defaults to the float64's zero value. + if r.Quantile == 0 { + return nil, errMissingQuantile + } + queryParams := metricsstore.LatenciesQueryParameters{ + BaseQueryParameters: bqp, + Quantile: r.Quantile, + } + m, err := g.metricsQueryService.GetLatencies(ctx, &queryParams) + if err := g.handleErr("failed to fetch latencies", err); err != nil { + return nil, err + } + return &metrics.GetMetricsResponse{Metrics: *m}, nil +} + +// GetCallRates is the gRPC handler to fetch call rate metrics. +func (g *GRPCHandler) GetCallRates(ctx context.Context, r *metrics.GetCallRatesRequest) (*metrics.GetMetricsResponse, error) { + bqp, err := g.newBaseQueryParameters(r) + if err := g.handleErr("failed to build parameters", err); err != nil { + return nil, err + } + queryParams := metricsstore.CallRateQueryParameters{ + BaseQueryParameters: bqp, + } + m, err := g.metricsQueryService.GetCallRates(ctx, &queryParams) + if err := g.handleErr("failed to fetch call rates", err); err != nil { + return nil, err + } + return &metrics.GetMetricsResponse{Metrics: *m}, nil +} + +// GetErrorRates is the gRPC handler to fetch error rate metrics. +func (g *GRPCHandler) GetErrorRates(ctx context.Context, r *metrics.GetErrorRatesRequest) (*metrics.GetMetricsResponse, error) { + bqp, err := g.newBaseQueryParameters(r) + if err := g.handleErr("failed to build parameters", err); err != nil { + return nil, err + } + queryParams := metricsstore.ErrorRateQueryParameters{ + BaseQueryParameters: bqp, + } + m, err := g.metricsQueryService.GetErrorRates(ctx, &queryParams) + if err := g.handleErr("failed to fetch error rates", err); err != nil { + return nil, err + } + return &metrics.GetMetricsResponse{Metrics: *m}, nil +} + +// GetMinStepDuration is the gRPC handler to fetch the minimum step duration supported by the underlying metrics store. +func (g *GRPCHandler) GetMinStepDuration(ctx context.Context, _ *metrics.GetMinStepDurationRequest) (*metrics.GetMinStepDurationResponse, error) { + minStep, err := g.metricsQueryService.GetMinStepDuration(ctx, &metricsstore.MinStepDurationQueryParameters{}) + if err := g.handleErr("failed to fetch min step duration", err); err != nil { + return nil, err + } + return &metrics.GetMinStepDurationResponse{MinStep: minStep}, nil +} + +func (g *GRPCHandler) handleErr(msg string, err error) error { + if err == nil { + return nil + } + g.logger.Error(msg, zap.Error(err)) + + // Avoid wrapping "expected" errors with an "Internal Server" error. + if errors.Is(err, disabled.ErrDisabled) { + return errGRPCMetricsQueryDisabled + } + if _, ok := status.FromError(err); ok { + return err + } + + // Received an "unexpected" error. + return status.Errorf(codes.Internal, "%s: %v", msg, err) +} + +func (g *GRPCHandler) newBaseQueryParameters(r interface{}) (bqp metricsstore.BaseQueryParameters, err error) { + if r == nil { + return bqp, errNilRequest + } + var baseRequest *metrics.MetricsQueryBaseRequest + switch v := r.(type) { + case *metrics.GetLatenciesRequest: + baseRequest = v.BaseRequest + case *metrics.GetCallRatesRequest: + baseRequest = v.BaseRequest + case *metrics.GetErrorRatesRequest: + baseRequest = v.BaseRequest + } + if baseRequest == nil || len(baseRequest.ServiceNames) == 0 { + return bqp, errMissingServiceNames + } + + // Copy non-nullable params. + bqp.GroupByOperation = baseRequest.GroupByOperation + bqp.ServiceNames = baseRequest.ServiceNames + + // Initialize nullable params with defaults. + defaultEndTime := g.nowFn() + bqp.EndTime = &defaultEndTime + bqp.Lookback = &defaultMetricsQueryLookbackDuration + bqp.RatePer = &defaultMetricsQueryRateDuration + bqp.SpanKinds = defaultMetricsSpanKinds + bqp.Step = &defaultMetricsQueryStepDuration + + // ... and override defaults with any provided request params. + if baseRequest.EndTime != nil { + bqp.EndTime = baseRequest.EndTime + } + if baseRequest.Lookback != nil { + bqp.Lookback = baseRequest.Lookback + } + if baseRequest.Step != nil { + bqp.Step = baseRequest.Step + } + if baseRequest.RatePer != nil { + bqp.RatePer = baseRequest.RatePer + } + if len(baseRequest.SpanKinds) > 0 { + spanKinds := make([]string, len(baseRequest.SpanKinds)) + for i, v := range baseRequest.SpanKinds { + spanKinds[i] = v.String() + } + bqp.SpanKinds = spanKinds + } + return bqp, nil +} diff --git a/cmd/query/app/grpc_handler_test.go b/cmd/query/app/grpc_handler_test.go index 98d922e6c113..9e2d3e2900ef 100644 --- a/cmd/query/app/grpc_handler_test.go +++ b/cmd/query/app/grpc_handler_test.go @@ -34,8 +34,12 @@ import ( "github.com/jaegertracing/jaeger/cmd/query/app/querysvc" "github.com/jaegertracing/jaeger/model" + "github.com/jaegertracing/jaeger/plugin/metrics/disabled" "github.com/jaegertracing/jaeger/proto-gen/api_v2" + "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" depsmocks "github.com/jaegertracing/jaeger/storage/dependencystore/mocks" + "github.com/jaegertracing/jaeger/storage/metricsstore" + metricsmocks "github.com/jaegertracing/jaeger/storage/metricsstore/mocks" "github.com/jaegertracing/jaeger/storage/spanstore" spanstoremocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks" ) @@ -118,27 +122,40 @@ var ( }, Warnings: []string{}, } + + now = time.Now() ) type grpcServer struct { - server *grpc.Server - lisAddr net.Addr - spanReader *spanstoremocks.Reader - depReader *depsmocks.Reader - archiveSpanReader *spanstoremocks.Reader - archiveSpanWriter *spanstoremocks.Writer + server *grpc.Server + lisAddr net.Addr + spanReader *spanstoremocks.Reader + depReader *depsmocks.Reader + metricsQueryService querysvc.MetricsQueryService + archiveSpanReader *spanstoremocks.Reader + archiveSpanWriter *spanstoremocks.Writer } type grpcClient struct { api_v2.QueryServiceClient + metrics.MetricsQueryServiceClient conn *grpc.ClientConn } -func newGRPCServer(t *testing.T, q *querysvc.QueryService, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, net.Addr) { +func newGRPCServer(t *testing.T, q *querysvc.QueryService, mq querysvc.MetricsQueryService, logger *zap.Logger, tracer opentracing.Tracer) (*grpc.Server, net.Addr) { lis, _ := net.Listen("tcp", ":0") grpcServer := grpc.NewServer() - grpcHandler := NewGRPCHandler(q, logger, tracer) + grpcHandler := &GRPCHandler{ + queryService: q, + metricsQueryService: mq, + logger: logger, + tracer: tracer, + nowFn: func() time.Time { + return now + }, + } api_v2.RegisterQueryServiceServer(grpcServer, grpcHandler) + metrics.RegisterMetricsQueryServiceServer(grpcServer, grpcHandler) go func() { err := grpcServer.Serve(lis) @@ -155,18 +172,34 @@ func newGRPCClient(t *testing.T, addr string) *grpcClient { require.NoError(t, err) return &grpcClient{ - QueryServiceClient: api_v2.NewQueryServiceClient(conn), - conn: conn, + QueryServiceClient: api_v2.NewQueryServiceClient(conn), + MetricsQueryServiceClient: metrics.NewMetricsQueryServiceClient(conn), + conn: conn, } } -func initializeTestServerGRPCWithOptions(t *testing.T) *grpcServer { +type testOption func(*testQueryService) +type testQueryService struct { + // metricsQueryService is used when creating a new GRPCHandler. + metricsQueryService querysvc.MetricsQueryService +} + +func withMetricsQuery() testOption { + reader := &metricsmocks.Reader{} + return func(ts *testQueryService) { + ts.metricsQueryService = reader + } +} + +func initializeTestServerGRPCWithOptions(t *testing.T, options ...testOption) *grpcServer { archiveSpanReader := &spanstoremocks.Reader{} archiveSpanWriter := &spanstoremocks.Writer{} spanReader := &spanstoremocks.Reader{} dependencyReader := &depsmocks.Reader{} + disabledReader, err := disabled.NewMetricsReader() + require.NoError(t, err) q := querysvc.NewQueryService(spanReader, dependencyReader, querysvc.QueryServiceOptions{ @@ -174,23 +207,32 @@ func initializeTestServerGRPCWithOptions(t *testing.T) *grpcServer { ArchiveSpanWriter: archiveSpanWriter, }) + tqs := &testQueryService{ + // Disable metrics query by default. + metricsQueryService: disabledReader, + } + for _, opt := range options { + opt(tqs) + } + logger := zap.NewNop() tracer := opentracing.NoopTracer{} - server, addr := newGRPCServer(t, q, logger, tracer) + server, addr := newGRPCServer(t, q, tqs.metricsQueryService, logger, tracer) return &grpcServer{ - server: server, - lisAddr: addr, - spanReader: spanReader, - depReader: dependencyReader, - archiveSpanReader: archiveSpanReader, - archiveSpanWriter: archiveSpanWriter, + server: server, + lisAddr: addr, + spanReader: spanReader, + depReader: dependencyReader, + metricsQueryService: tqs.metricsQueryService, + archiveSpanReader: archiveSpanReader, + archiveSpanWriter: archiveSpanWriter, } } -func withServerAndClient(t *testing.T, actualTest func(server *grpcServer, client *grpcClient)) { - server := initializeTestServerGRPCWithOptions(t) +func withServerAndClient(t *testing.T, actualTest func(server *grpcServer, client *grpcClient), options ...testOption) { + server := initializeTestServerGRPCWithOptions(t, options...) client := newGRPCClient(t, server.lisAddr.String()) defer server.server.Stop() defer client.conn.Close() @@ -511,3 +553,307 @@ func TestSendSpanChunksError(t *testing.T) { }) assert.EqualError(t, err, expectedErr.Error()) } + +func TestGetMetricsSuccessGRPC(t *testing.T) { + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + baseQueryParam := &metrics.MetricsQueryBaseRequest{ + ServiceNames: []string{"foo"}, + } + for _, tc := range []struct { + mockMethod string + mockParamType string + testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) + }{ + { + mockMethod: "GetLatencies", + mockParamType: "*metricsstore.LatenciesQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95, BaseRequest: baseQueryParam}) + }, + }, + { + mockMethod: "GetCallRates", + mockParamType: "*metricsstore.CallRateQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{BaseRequest: baseQueryParam}) + }, + }, + { + mockMethod: "GetErrorRates", + mockParamType: "*metricsstore.ErrorRateQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{BaseRequest: baseQueryParam}) + }, + }, + } { + t.Run(tc.mockMethod, func(t *testing.T) { + expectedMetrics := &metrics.MetricFamily{Name: "foo"} + m := server.metricsQueryService.(*metricsmocks.Reader) + m.On(tc.mockMethod, mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType(tc.mockParamType)). + Return(expectedMetrics, nil).Once() + + res, err := tc.testFn(client) + require.NoError(t, err) + assert.Equal(t, expectedMetrics, &res.Metrics) + }) + } + }, withMetricsQuery()) +} + +func TestGetMetricsReaderDisabledGRPC(t *testing.T) { + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + baseQueryParam := &metrics.MetricsQueryBaseRequest{ + ServiceNames: []string{"foo"}, + } + for _, tc := range []struct { + name string + testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) + }{ + { + name: "GetLatencies", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95, BaseRequest: baseQueryParam}) + }, + }, + { + name: "GetCallRates", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{BaseRequest: baseQueryParam}) + }, + }, + { + name: "GetErrorRates", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{BaseRequest: baseQueryParam}) + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + res, err := tc.testFn(client) + require.Error(t, err) + assert.Nil(t, res) + + assertGRPCError(t, err, codes.Unimplemented, "metrics querying is currently disabled") + }) + } + }) +} + +func TestGetMetricsUseDefaultParamsGRPC(t *testing.T) { + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + baseQueryParam := &metrics.MetricsQueryBaseRequest{ + ServiceNames: []string{"foo"}, + } + request := &metrics.GetCallRatesRequest{ + BaseRequest: baseQueryParam, + } + expectedMetrics := &metrics.MetricFamily{Name: "foo"} + expectedParams := &metricsstore.CallRateQueryParameters{ + BaseQueryParameters: metricsstore.BaseQueryParameters{ + ServiceNames: []string{"foo"}, + EndTime: &now, + Lookback: &defaultMetricsQueryLookbackDuration, + Step: &defaultMetricsQueryStepDuration, + RatePer: &defaultMetricsQueryRateDuration, + SpanKinds: defaultMetricsSpanKinds, + }, + } + m := server.metricsQueryService.(*metricsmocks.Reader) + m.On("GetCallRates", mock.AnythingOfType("*context.valueCtx"), expectedParams). + Return(expectedMetrics, nil).Once() + + res, err := client.GetCallRates(context.Background(), request) + require.NoError(t, err) + assert.Equal(t, expectedMetrics, &res.Metrics) + }, withMetricsQuery()) +} + +func TestGetMetricsOverrideDefaultParamsGRPC(t *testing.T) { + loc, _ := time.LoadLocation("UTC") + endTime := time.Now().In(loc) + lookback := time.Minute + step := time.Second + ratePer := time.Hour + spanKinds := []metrics.SpanKind{metrics.SpanKind_SPAN_KIND_CONSUMER} + expectedSpanKinds := []string{metrics.SpanKind_SPAN_KIND_CONSUMER.String()} + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + baseQueryParam := &metrics.MetricsQueryBaseRequest{ + ServiceNames: []string{"foo"}, + EndTime: &endTime, + Lookback: &lookback, + Step: &step, + RatePer: &ratePer, + SpanKinds: spanKinds, + } + request := &metrics.GetCallRatesRequest{ + BaseRequest: baseQueryParam, + } + expectedMetrics := &metrics.MetricFamily{Name: "foo"} + expectedParams := &metricsstore.CallRateQueryParameters{ + BaseQueryParameters: metricsstore.BaseQueryParameters{ + ServiceNames: baseQueryParam.ServiceNames, + EndTime: &endTime, + Lookback: &lookback, + Step: &step, + RatePer: &ratePer, + SpanKinds: expectedSpanKinds, + }, + } + m := server.metricsQueryService.(*metricsmocks.Reader) + m.On("GetCallRates", mock.AnythingOfType("*context.valueCtx"), expectedParams). + Return(expectedMetrics, nil).Once() + + res, err := client.GetCallRates(context.Background(), request) + require.NoError(t, err) + assert.Equal(t, expectedMetrics, &res.Metrics) + }, withMetricsQuery()) +} + +func TestGetMetricsFailureGRPC(t *testing.T) { + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + baseQueryParam := &metrics.MetricsQueryBaseRequest{ + ServiceNames: []string{"foo"}, + } + for _, tc := range []struct { + mockMethod string + mockParamType string + testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) + wantErr string + }{ + { + mockMethod: "GetLatencies", + mockParamType: "*metricsstore.LatenciesQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95, BaseRequest: baseQueryParam}) + }, + wantErr: "failed to fetch latencies: storage error", + }, + { + mockMethod: "GetCallRates", + mockParamType: "*metricsstore.CallRateQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{BaseRequest: baseQueryParam}) + }, + wantErr: "failed to fetch call rates: storage error", + }, + { + mockMethod: "GetErrorRates", + mockParamType: "*metricsstore.ErrorRateQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{BaseRequest: baseQueryParam}) + }, + wantErr: "failed to fetch error rates: storage error", + }, + } { + t.Run(tc.mockMethod, func(t *testing.T) { + m := server.metricsQueryService.(*metricsmocks.Reader) + m.On(tc.mockMethod, mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType(tc.mockParamType)). + Return(nil, errStorageGRPC).Once() + + res, err := tc.testFn(client) + require.Nil(t, res) + require.Error(t, err) + + assertGRPCError(t, err, codes.Internal, tc.wantErr) + }) + } + }, withMetricsQuery()) +} + +func TestGetMinStepDurationSuccessGRPC(t *testing.T) { + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + m := server.metricsQueryService.(*metricsmocks.Reader) + m.On("GetMinStepDuration", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*metricsstore.MinStepDurationQueryParameters")). + Return(time.Hour, nil).Once() + + res, err := client.GetMinStepDuration(context.Background(), &metrics.GetMinStepDurationRequest{}) + require.NoError(t, err) + require.Equal(t, time.Hour, res.MinStep) + }, withMetricsQuery()) +} + +func TestGetMinStepDurationFailureGRPC(t *testing.T) { + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + m := server.metricsQueryService.(*metricsmocks.Reader) + m.On("GetMinStepDuration", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("*metricsstore.MinStepDurationQueryParameters")). + Return(time.Duration(0), errStorageGRPC).Once() + + res, err := client.GetMinStepDuration(context.Background(), &metrics.GetMinStepDurationRequest{}) + require.Nil(t, res) + require.Error(t, err) + + assertGRPCError(t, err, codes.Internal, "failed to fetch min step duration: storage error") + }, withMetricsQuery()) +} + +func TestGetMetricsInvalidParametersGRPC(t *testing.T) { + withServerAndClient(t, func(server *grpcServer, client *grpcClient) { + for _, tc := range []struct { + name string + mockMethod string + mockParamType string + testFn func(client *grpcClient) (*metrics.GetMetricsResponse, error) + wantErr string + }{ + { + name: "GetLatencies missing service names", + mockMethod: "GetLatencies", + mockParamType: "*metricsstore.LatenciesQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{Quantile: 0.95}) + }, + wantErr: "please provide at least one service name", + }, + { + name: "GetLatencies missing quantile", + mockMethod: "GetLatencies", + mockParamType: "*metricsstore.LatenciesQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetLatencies(context.Background(), &metrics.GetLatenciesRequest{ + BaseRequest: &metrics.MetricsQueryBaseRequest{ + ServiceNames: []string{"foo"}, + }, + }) + }, + wantErr: "please provide a quantile between (0, 1]", + }, + { + name: "GetCallRates missing service names", + mockMethod: "GetCallRates", + mockParamType: "*metricsstore.CallRateQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetCallRates(context.Background(), &metrics.GetCallRatesRequest{}) // Test + }, + wantErr: "please provide at least one service name", + }, + { + name: "GetErrorRates nil request", + mockMethod: "GetErrorRates", + mockParamType: "*metricsstore.ErrorRateQueryParameters", + testFn: func(client *grpcClient) (*metrics.GetMetricsResponse, error) { + return client.GetErrorRates(context.Background(), &metrics.GetErrorRatesRequest{}) + }, + wantErr: "please provide at least one service name", + }, + } { + t.Run(tc.name, func(t *testing.T) { + m := server.metricsQueryService.(*metricsmocks.Reader) + m.On(tc.mockMethod, mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType(tc.mockParamType)). + Times(0) + + res, err := tc.testFn(client) + require.Nil(t, res) + require.Error(t, err) + + assertGRPCError(t, err, codes.InvalidArgument, tc.wantErr) + }) + } + }, withMetricsQuery()) +} + +func TestMetricsQueryNilRequestGRPC(t *testing.T) { + grpcHandler := &GRPCHandler{} + bqp, err := grpcHandler.newBaseQueryParameters(nil) + assert.Empty(t, bqp) + assert.EqualError(t, err, errNilRequest.Error()) +} diff --git a/cmd/query/app/http_handler.go b/cmd/query/app/http_handler.go index 1280ab6f8ab8..04d3bea2a9b1 100644 --- a/cmd/query/app/http_handler.go +++ b/cmd/query/app/http_handler.go @@ -42,9 +42,7 @@ const ( endTsParam = "endTs" lookbackParam = "lookback" - defaultDependencyLookbackDuration = time.Hour * 24 - defaultTraceQueryLookbackDuration = time.Hour * 24 * 2 - defaultAPIPrefix = "api" + defaultAPIPrefix = "api" ) // HTTPHandler handles http requests diff --git a/cmd/query/app/server.go b/cmd/query/app/server.go index 5918dc7ca88e..be9a562d7b71 100644 --- a/cmd/query/app/server.go +++ b/cmd/query/app/server.go @@ -19,6 +19,7 @@ import ( "net" "net/http" "strings" + "time" "github.com/gorilla/handlers" "github.com/opentracing/opentracing-go" @@ -32,6 +33,7 @@ import ( "github.com/jaegertracing/jaeger/pkg/netutils" "github.com/jaegertracing/jaeger/pkg/recoveryhandler" "github.com/jaegertracing/jaeger/proto-gen/api_v2" + "github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics" ) // Server runs HTTP, Mux and a grpc server @@ -110,10 +112,15 @@ func createGRPCServer(querySvc *querysvc.QueryService, metricsQuerySvc querysvc. server := grpc.NewServer(grpcOpts...) - handler := NewGRPCHandler(querySvc, logger, tracer) - - // TODO: Register MetricsQueryService + handler := &GRPCHandler{ + queryService: querySvc, + metricsQueryService: metricsQuerySvc, + logger: logger, + tracer: tracer, + nowFn: time.Now, + } api_v2.RegisterQueryServiceServer(server, handler) + metrics.RegisterMetricsQueryServiceServer(server, handler) return server, nil } diff --git a/model/proto/metrics/metricsquery.proto b/model/proto/metrics/metricsquery.proto index ad18f3dba7dc..a3b2d8d4601e 100644 --- a/model/proto/metrics/metricsquery.proto +++ b/model/proto/metrics/metricsquery.proto @@ -84,7 +84,7 @@ message MetricsQueryBaseRequest { message GetLatenciesRequest { MetricsQueryBaseRequest baseRequest = 1; // quantile is the quantile to compute from latency histogram metrics. - // Valid range: 0 - 1 (inclusive). + // Valid range: (0, 1] // // e.g. 0.99 will return the 99th percentile or P99 which is the worst latency // observed from 99% of all spans for the given service (and operation). diff --git a/proto-gen/api_v2/metrics/metricsquery.pb.go b/proto-gen/api_v2/metrics/metricsquery.pb.go index e4cad11ee40b..6725a182733e 100644 --- a/proto-gen/api_v2/metrics/metricsquery.pb.go +++ b/proto-gen/api_v2/metrics/metricsquery.pb.go @@ -150,7 +150,7 @@ func (m *MetricsQueryBaseRequest) GetSpanKinds() []SpanKind { type GetLatenciesRequest struct { BaseRequest *MetricsQueryBaseRequest `protobuf:"bytes,1,opt,name=baseRequest,proto3" json:"baseRequest,omitempty"` // quantile is the quantile to compute from latency histogram metrics. - // Valid range: 0 - 1 (inclusive). + // Valid range: (0, 1] // // e.g. 0.99 will return the 99th percentile or P99 which is the worst latency // observed from 99% of all spans for the given service (and operation). From 2071fee5a274da8d27d4c1fbdbd0cc4d263b6dbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Jun 2021 10:24:46 -0400 Subject: [PATCH 21/22] Bump github.com/spf13/viper from 1.7.1 to 1.8.0 (#3092) --- go.mod | 7 +--- go.sum | 110 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 96 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index aa71a1ec88f3..b0a8063575dd 100644 --- a/go.mod +++ b/go.mod @@ -47,12 +47,9 @@ require ( github.com/rs/cors v1.7.0 github.com/securego/gosec v0.0.0-20200203094520-d13bb6d2420c github.com/soheilhy/cmux v0.1.5 - github.com/spf13/afero v1.2.2 // indirect - github.com/spf13/cast v1.3.1 // indirect github.com/spf13/cobra v0.0.7 - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.7.1 + github.com/spf13/viper v1.8.0 github.com/stretchr/testify v1.7.0 github.com/uber/jaeger-client-go v2.29.1+incompatible github.com/uber/jaeger-lib v2.4.1+incompatible @@ -66,10 +63,8 @@ require ( golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 golang.org/x/net v0.0.0-20210525063256-abc453219eb5 golang.org/x/sys v0.0.0-20210603125802-9665404d3644 - google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 - gopkg.in/ini.v1 v1.52.0 // indirect gopkg.in/yaml.v2 v2.4.0 honnef.co/go/tools v0.2.0 ) diff --git a/go.sum b/go.sum index fbcb46c64046..e6ceee89ab77 100644 --- a/go.sum +++ b/go.sum @@ -13,6 +13,11 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -62,6 +67,7 @@ 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/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= 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= @@ -85,7 +91,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 h1:mXoPYz/Ul5HYEDvkta6I8/rnYM5gSdSV2tJ6XbZuEtY= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bsm/sarama-cluster v2.1.13+incompatible h1:bqU3gMJbWZVxLZ9PGWVKP05yOmFXUlfw61RBwuE3PYU= @@ -103,18 +109,19 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+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 v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= @@ -155,6 +162,8 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -309,6 +318,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-20200228163523-cd4b606dd2fb h1:H3tisfjQwq9FTyWqlKsZpgoYrsvn2pmTWvAiDHa5pho= github.com/gocql/gocql v0.0.0-20200228163523-cd4b606dd2fb/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= @@ -329,8 +339,9 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= 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= @@ -346,6 +357,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -363,12 +375,14 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -376,6 +390,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -396,7 +414,6 @@ 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/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -404,6 +421,7 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +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= @@ -446,6 +464,7 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= 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= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= @@ -498,6 +517,7 @@ github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 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= @@ -514,8 +534,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -616,8 +636,9 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= -github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -628,6 +649,7 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= 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= @@ -668,6 +690,7 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn 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/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -702,8 +725,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -720,8 +743,8 @@ 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.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.8.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0= +github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -776,6 +799,9 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= @@ -793,6 +819,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= 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/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -822,6 +850,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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= @@ -850,6 +879,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= 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 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= 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= @@ -860,6 +890,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -905,11 +937,14 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= @@ -919,6 +954,13 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -984,11 +1026,19 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/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-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1066,6 +1116,11 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= @@ -1092,14 +1147,21 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1126,12 +1188,23 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1152,6 +1225,13 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +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.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1181,9 +1261,8 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= 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.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.52.0 h1:j+Lt/M1oPPejkniCg1TkWE2J3Eh1oZTsHSXzMTzUXn4= -gopkg.in/ini.v1 v1.52.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 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= @@ -1191,6 +1270,7 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 13885e516f3caf774568f2a1f6b088b134962327 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Jun 2021 11:24:34 +0200 Subject: [PATCH 22/22] Bump github.com/apache/thrift from 0.14.1 to 0.14.2 (#3097) Bumps [github.com/apache/thrift](https://github.com/apache/thrift) from 0.14.1 to 0.14.2. - [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.14.1...v0.14.2) --- updated-dependencies: - dependency-name: github.com/apache/thrift 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b0a8063575dd..27918dde9efd 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/HdrHistogram/hdrhistogram-go v0.9.0 // indirect github.com/Shopify/sarama v1.29.0 - github.com/apache/thrift v0.14.1 + github.com/apache/thrift v0.14.2 github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/bsm/sarama-cluster v2.1.13+incompatible github.com/crossdock/crossdock-go v0.0.0-20160816171116-049aabb0122b