From 5bdfeef63aef8bb0a862695ea31f7488498827d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Nov 2021 16:49:49 -0800 Subject: [PATCH 01/38] Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (#4374) Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.26.0 to 0.26.1. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.26.0...zpages/v0.26.1) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 31b241c2d47..883161de815 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 go.opentelemetry.io/collector/model v0.38.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.0 go.opentelemetry.io/contrib/zpages v0.26.1 go.opentelemetry.io/otel v1.1.0 diff --git a/go.sum b/go.sum index 59061397d48..7c4232db3bf 100644 --- a/go.sum +++ b/go.sum @@ -419,8 +419,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.0 h1:1EGNmTL4j/mB2FHejUloEnshwKwhHjfwQerqEJvGu7I= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.0/go.mod h1:4wsfAAW5N9wUHM0QTmZS8z7fvYZ1rv3m+sVeSpf8NhU= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1 h1:puWrOArBwWlr5dq6vyZ6fKykHyS8JgMIVhTBA8XsGuU= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1/go.mod h1:4wsfAAW5N9wUHM0QTmZS8z7fvYZ1rv3m+sVeSpf8NhU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.0 h1:sdwza9BScvbOFaZLhvKDQc54vQ8CWM8jD9BO2t+rP4E= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.0/go.mod h1:4vatbW3QwS11DK0H0SB7FR31/VbthXcYorswdkVXdyg= go.opentelemetry.io/contrib/zpages v0.26.1 h1:QwZSgYO+lbzOXLa/vhD6CHgjGm7INqk3jmmO9mAgqLU= From 34d7f3c3ecce2a6cbc5012fe995aef2cfe8721ce Mon Sep 17 00:00:00 2001 From: Ivan Santos Date: Tue, 9 Nov 2021 11:38:10 -0600 Subject: [PATCH 02/38] fix(builder): fixes ldflags module path for version and date in builder goreleaser (#4382) --- cmd/builder/.goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/builder/.goreleaser.yml b/cmd/builder/.goreleaser.yml index f9143f8b228..89984f02cd4 100644 --- a/cmd/builder/.goreleaser.yml +++ b/cmd/builder/.goreleaser.yml @@ -8,7 +8,7 @@ builds: - flags: - -trimpath ldflags: - - -s -w -X go.opentelemetry.io/collector/builder/cmd.version={{.Version}} -X go.opentelemetry.io/collector/builder/cmd.date={{.Date}} + - -s -w -X go.opentelemetry.io/collector/cmd/builder/internal.version={{.Version}} -X go.opentelemetry.io/collector/cmd/builder/internal.date={{.Date}} env: - CGO_ENABLED=0 goos: From c38c9b9c2866ae67346d91b58d8b04aba61ec154 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 9 Nov 2021 09:45:39 -0800 Subject: [PATCH 03/38] add tests in the service module (#4233) --- service/command_test.go | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 service/command_test.go diff --git a/service/command_test.go b/service/command_test.go new file mode 100644 index 00000000000..d0d57a4b862 --- /dev/null +++ b/service/command_test.go @@ -0,0 +1,51 @@ +// Copyright The OpenTelemetry 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 service // import "go.opentelemetry.io/collector/service" + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/collector/service/defaultcomponents" +) + +func TestNewCommand(t *testing.T) { + set := CollectorSettings{} + cmd := NewCommand(set) + err := cmd.Execute() + require.Error(t, err) + assert.Equal(t, set.BuildInfo.Version, cmd.Version) +} + +func TestNewCommandMapProviderIsNil(t *testing.T) { + settings := CollectorSettings{} + settings.ConfigMapProvider = nil + cmd := NewCommand(settings) + err := cmd.Execute() + require.Error(t, err) +} + +func TestNewCommandInvalidFactories(t *testing.T) { + factories, err := defaultcomponents.Components() + require.NoError(t, err) + f := &badConfigExtensionFactory{} + factories.Extensions[f.Type()] = f + settings := CollectorSettings{Factories: factories} + cmd := NewCommand(settings) + err = cmd.Execute() + require.Error(t, err) +} From 3ef6d7327c2fc241d44edf762c8748cb4d004344 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 09:46:09 -0800 Subject: [PATCH 04/38] Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (#4372) Bumps [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.26.0 to 0.26.1. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.26.0...zpages/v0.26.1) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp 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> Co-authored-by: Bogdan Drutu --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 883161de815..37a7c2be9c4 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( go.opencensus.io v0.23.0 go.opentelemetry.io/collector/model v0.38.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.1 go.opentelemetry.io/contrib/zpages v0.26.1 go.opentelemetry.io/otel v1.1.0 go.opentelemetry.io/otel/exporters/prometheus v0.24.0 diff --git a/go.sum b/go.sum index 7c4232db3bf..932fe69f87d 100644 --- a/go.sum +++ b/go.sum @@ -421,8 +421,8 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1 h1:puWrOArBwWlr5dq6vyZ6fKykHyS8JgMIVhTBA8XsGuU= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1/go.mod h1:4wsfAAW5N9wUHM0QTmZS8z7fvYZ1rv3m+sVeSpf8NhU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.0 h1:sdwza9BScvbOFaZLhvKDQc54vQ8CWM8jD9BO2t+rP4E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.0/go.mod h1:4vatbW3QwS11DK0H0SB7FR31/VbthXcYorswdkVXdyg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.1 h1:/PDcqsmxpbI/3ERJ6s6cwF13ZSH5m9NNCOPsoeazEhA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.1/go.mod h1:4vatbW3QwS11DK0H0SB7FR31/VbthXcYorswdkVXdyg= go.opentelemetry.io/contrib/zpages v0.26.1 h1:QwZSgYO+lbzOXLa/vhD6CHgjGm7INqk3jmmO9mAgqLU= go.opentelemetry.io/contrib/zpages v0.26.1/go.mod h1:NGd/Gf9T4Wn4LsUjTB1rPfKYWZefNNrXYoSWJLvu/rY= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= From 3f43d69b70e0bd529339d8beb26c04baabcfad4a Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Wed, 10 Nov 2021 08:39:36 -0800 Subject: [PATCH 05/38] [test] cleanup in otlp_test (#4386) The `createSingleSpanTrace` makes a single testdata.GenerateTracesOneSpan() call, no point in having a separate function for this. --- receiver/otlpreceiver/otlp_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 25c4822671d..c5cc828f2a4 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -440,10 +440,6 @@ func TestHTTPNewPortAlreadyUsed(t *testing.T) { require.Error(t, r.Start(context.Background(), componenttest.NewNopHost())) } -func createSingleSpanTrace() pdata.Traces { - return testdata.GenerateTracesOneSpan() -} - // TestOTLPReceiverTrace_HandleNextConsumerResponse checks if the trace receiver // is returning the proper response (return and metrics) when the next consumer // in the pipeline reports error. The test changes the responses returned by the @@ -483,7 +479,7 @@ func TestOTLPReceiverTrace_HandleNextConsumerResponse(t *testing.T) { } addr := testutil.GetAvailableLocalAddress(t) - req := createSingleSpanTrace() + req := testdata.GenerateTracesOneSpan() exporters := []struct { receiverTag string @@ -772,12 +768,12 @@ loop: break loop default: } - senderFn(createSingleSpanTrace()) + senderFn(testdata.GenerateTracesOneSpan()) } // After getting the signal to stop, send one more span and then // finally stop. We should never receive this last span. - senderFn(createSingleSpanTrace()) + senderFn(testdata.GenerateTracesOneSpan()) // Indicate that we are done. close(doneSignal) From 5ca57be6c9188b315d7944d25db53e2285ce8267 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Wed, 10 Nov 2021 08:40:30 -0800 Subject: [PATCH 06/38] [tests] adding tests for builder (#4385) Adding builder tests for config and main. --- cmd/builder/internal/builder/config.go | 1 + cmd/builder/internal/builder/config_test.go | 53 +++++++++++++++++--- cmd/builder/internal/builder/main.go | 2 - cmd/builder/internal/builder/main_test.go | 55 +++++++++++++++++++++ 4 files changed, 101 insertions(+), 10 deletions(-) create mode 100644 cmd/builder/internal/builder/main_test.go diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index 04d4cd4c0c3..4dde5bb8248 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -85,6 +85,7 @@ func DefaultConfig() Config { Distribution: Distribution{ OutputPath: outputDir, OtelColVersion: defaultOtelColVersion, + Module: "go.opentelemetry.io/collector/cmd/builder", }, } } diff --git a/cmd/builder/internal/builder/config_test.go b/cmd/builder/internal/builder/config_test.go index 24abb3eb4d1..66e1a1c8257 100644 --- a/cmd/builder/internal/builder/config_test.go +++ b/cmd/builder/internal/builder/config_test.go @@ -111,16 +111,53 @@ func TestDeprecatedCore(t *testing.T) { } func TestInvalidModule(t *testing.T) { + type invalidModuleTest struct { + cfg Config + err error + } // prepare - cfg := Config{ - Extensions: []Module{{ - Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - }}, + configurations := []invalidModuleTest{ + { + cfg: Config{ + Extensions: []Module{{ + Import: "invalid", + }}, + }, + err: ErrInvalidGoMod, + }, + { + cfg: Config{ + Receivers: []Module{{ + Import: "invalid", + }}, + }, + err: ErrInvalidGoMod, + }, + { + cfg: Config{ + Exporters: []Module{{ + Import: "invali", + }}, + }, + err: ErrInvalidGoMod, + }, + { + cfg: Config{ + Processors: []Module{{ + Import: "invalid", + }}, + }, + err: ErrInvalidGoMod, + }, } - // test - err := cfg.ParseModules() + for _, test := range configurations { + assert.True(t, errors.Is(test.cfg.ParseModules(), test.err)) + } +} - // verify - assert.True(t, errors.Is(err, ErrInvalidGoMod)) +func TestDefaultConfig(t *testing.T) { + cfg := DefaultConfig() + require.NoError(t, cfg.ParseModules()) + require.NoError(t, cfg.Validate()) } diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go index af163385e78..6655c4dddd4 100644 --- a/cmd/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -59,7 +59,6 @@ func Generate(cfg Config) error { return fmt.Errorf("failed to create output path: %w", err) } } else if err != nil { - // something else happened return fmt.Errorf("failed to create output path: %w", err) } @@ -79,7 +78,6 @@ func Generate(cfg Config) error { "main_windows.go", scaffold.MainWindows, }, - // components.go { "components.go", scaffold.Components, diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go new file mode 100644 index 00000000000..0ef75657d16 --- /dev/null +++ b/cmd/builder/internal/builder/main_test.go @@ -0,0 +1,55 @@ +// Copyright The OpenTelemetry 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 builder + +import ( + "io/ioutil" + "log" + "os" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestGenerateDefault(t *testing.T) { + require.NoError(t, Generate(DefaultConfig())) +} + +func TestGenerateInvalidCollectorVersion(t *testing.T) { + cfg := DefaultConfig() + cfg.Distribution.OtelColVersion = "invalid" + err := Generate(cfg) + require.NoError(t, err) +} + +func TestGenerateInvalidOutputPath(t *testing.T) { + cfg := DefaultConfig() + cfg.Distribution.OutputPath = "/invalid" + err := Generate(cfg) + require.Error(t, err) + require.Contains(t, err.Error(), "failed to create output path") +} + +func TestGenerateAmdCompileDefault(t *testing.T) { + dir, err := ioutil.TempDir("/tmp", "default") + if err != nil { + log.Fatal(err) + } + defer os.RemoveAll(dir) + cfg := DefaultConfig() + cfg.Distribution.OutputPath = dir + cfg.Validate() + require.NoError(t, GenerateAndCompile(cfg)) +} From da9dff0d7faa9b85c90e9410c992e1b1d8798b77 Mon Sep 17 00:00:00 2001 From: Shree Prakash Date: Wed, 10 Nov 2021 23:42:55 +0530 Subject: [PATCH 07/38] OTLP-4278 Update Kubernetes example to latest version (#4329) * OTLP-4278 Update Kubernetes example to latest version * OTLP-4278 Update Kubernetes example to latest version * Update otel-config.yaml Co-authored-by: Bogdan Drutu --- examples/k8s/otel-config.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/k8s/otel-config.yaml b/examples/k8s/otel-config.yaml index f7a3880bfcc..599ca50b0cb 100644 --- a/examples/k8s/otel-config.yaml +++ b/examples/k8s/otel-config.yaml @@ -65,9 +65,7 @@ spec: - command: - "/otelcol" - "--config=/conf/otel-agent-config.yaml" - # Memory Ballast size should be max 1/3 to 1/2 of memory. - - "--mem-ballast-size-mib=165" - image: otel/opentelemetry-collector-dev:latest + image: otel/opentelemetry-collector:0.38.0 name: otel-agent resources: limits: @@ -177,9 +175,7 @@ spec: - command: - "/otelcol" - "--config=/conf/otel-collector-config.yaml" -# Memory Ballast size should be max 1/3 to 1/2 of memory. - - "--mem-ballast-size-mib=683" - image: otel/opentelemetry-collector-dev:latest + image: otel/opentelemetry-collector:0.38.0 name: otel-collector resources: limits: From 719d371a5636d70fe0c2e12425f220cadcfd9e79 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 10 Nov 2021 13:13:59 -0500 Subject: [PATCH 08/38] copy aggregation temporality and monotonic to new metric batches (#4389) --- processor/batchprocessor/splitmetrics.go | 3 +++ processor/batchprocessor/splitmetrics_test.go | 20 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/processor/batchprocessor/splitmetrics.go b/processor/batchprocessor/splitmetrics.go index 5f87ca47751..3b60ba073f2 100644 --- a/processor/batchprocessor/splitmetrics.go +++ b/processor/batchprocessor/splitmetrics.go @@ -133,8 +133,11 @@ func splitMetric(ms, dest pdata.Metric, size int) (int, bool) { case pdata.MetricDataTypeGauge: return splitNumberDataPoints(ms.Gauge().DataPoints(), dest.Gauge().DataPoints(), size) case pdata.MetricDataTypeSum: + dest.Sum().SetAggregationTemporality(ms.Sum().AggregationTemporality()) + dest.Sum().SetIsMonotonic(ms.Sum().IsMonotonic()) return splitNumberDataPoints(ms.Sum().DataPoints(), dest.Sum().DataPoints(), size) case pdata.MetricDataTypeHistogram: + dest.Histogram().SetAggregationTemporality(ms.Histogram().AggregationTemporality()) return splitHistogramDataPoints(ms.Histogram().DataPoints(), dest.Histogram().DataPoints(), size) case pdata.MetricDataTypeSummary: return splitSummaryDataPoints(ms.Summary().DataPoints(), dest.Summary().DataPoints(), size) diff --git a/processor/batchprocessor/splitmetrics_test.go b/processor/batchprocessor/splitmetrics_test.go index ca10f5370df..66746e22942 100644 --- a/processor/batchprocessor/splitmetrics_test.go +++ b/processor/batchprocessor/splitmetrics_test.go @@ -174,24 +174,36 @@ func TestSplitMetricsBatchSizeSmallerThanDataPointCount(t *testing.T) { splitSize := 1 split := splitMetrics(splitSize, md) + splitMetric := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) assert.Equal(t, 1, split.MetricCount()) assert.Equal(t, 2, md.MetricCount()) - assert.Equal(t, "test-metric-int-0-0", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0).Name()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, splitMetric.Sum().AggregationTemporality()) + assert.Equal(t, true, splitMetric.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-0", splitMetric.Name()) split = splitMetrics(splitSize, md) + splitMetric = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) assert.Equal(t, 1, split.MetricCount()) assert.Equal(t, 1, md.MetricCount()) - assert.Equal(t, "test-metric-int-0-0", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0).Name()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, splitMetric.Sum().AggregationTemporality()) + assert.Equal(t, true, splitMetric.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-0", splitMetric.Name()) split = splitMetrics(splitSize, md) + splitMetric = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) assert.Equal(t, 1, split.MetricCount()) assert.Equal(t, 1, md.MetricCount()) - assert.Equal(t, "test-metric-int-0-1", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0).Name()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, splitMetric.Sum().AggregationTemporality()) + assert.Equal(t, true, splitMetric.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-1", splitMetric.Name()) split = splitMetrics(splitSize, md) + splitMetric = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) assert.Equal(t, 1, split.MetricCount()) assert.Equal(t, 1, md.MetricCount()) - assert.Equal(t, "test-metric-int-0-1", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0).Name()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, splitMetric.Sum().AggregationTemporality()) + assert.Equal(t, true, splitMetric.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-1", splitMetric.Name()) } func TestSplitMetricsMultipleILM(t *testing.T) { From 32274b75500146d706c65f717f34eba62a6293bf Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Wed, 10 Nov 2021 19:17:03 +0100 Subject: [PATCH 09/38] Move `MapProvider` interfaces to `config/configmapprovider` package (#4337) * Move `MapProvider` interfaces to `config/configmapprovider` package * Add PR number to changelog * Address review comment * Address review comment * Fix Windows tests Co-authored-by: Bogdan Drutu --- CHANGELOG.md | 4 ++++ config/configmapprovider/default.go | 14 ++++++-------- config/configmapprovider/default_test.go | 10 +++++----- config/configmapprovider/expand.go | 12 +++++------- config/configmapprovider/expand_test.go | 4 ++-- config/configmapprovider/file.go | 6 +++--- config/configmapprovider/inmemory.go | 6 +++--- config/configmapprovider/merge.go | 8 ++++---- config/configmapprovider/merge_test.go | 6 +++--- config/configmapprovider/properties.go | 6 +++--- config/configmapprovider/properties_test.go | 4 ++-- config/{ => configmapprovider}/provider.go | 10 ++++++---- config/configtest/configtest.go | 2 +- service/collector.go | 5 +++-- service/collector_test.go | 13 ++++++------- service/collector_windows.go | 2 +- service/command.go | 2 +- service/settings.go | 5 +++-- 18 files changed, 61 insertions(+), 58 deletions(-) rename config/{ => configmapprovider}/provider.go (90%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31b13f591e1..a19a2ba88c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,15 @@ - Force usage of `receiverhelper.NewFactory` to implement `component.ReceiverFactory` (#4338) - Force usage of `extensionhelper.NewFactory` to implement `component.ExtensionFactory` (#4338) - Move `service/parserprovider` package to `config/configmapprovider` (#4206) + - Rename `MapProvider` interface to `Provider` + - Remove `MapProvider` from helper names - Renamed slice-valued `pdata` types and functions for consistency. (#4325) - Rename `pdata.AnyValueArray` to `pdata.AttributeValueSlice` - Rename `ArrayVal()` to `SliceVal()` - Rename `SetArrayVal()` to `SetSliceVal()` - Remove `config.Pipeline.Name` (#4326) +- Rename `config.Mapprovider` as `configmapprovider.Provider` (#4337) +- Move `config.WatchableRetrieved` and `config.Retrieved` interfaces to `config/configmapprovider` package (#4337) - Remove `config.Pipeline.InputDataType` (#4343) - otlpexporter: Do not retry on PermissionDenied and Unauthenticated (#4349) - Remove deprecated funcs `consumererror.As[Traces|Metrics|Logs]` (#4364) diff --git a/config/configmapprovider/default.go b/config/configmapprovider/default.go index ec498bdbe07..35d9cfcd924 100644 --- a/config/configmapprovider/default.go +++ b/config/configmapprovider/default.go @@ -14,13 +14,11 @@ package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" -import "go.opentelemetry.io/collector/config" - -// NewDefaultMapProvider returns the default config.MapProvider, and it creates configuration from a file +// NewDefault returns the default Provider, and it creates configuration from a file // defined by the given configFile and overwrites fields using properties. -func NewDefaultMapProvider(configFileName string, properties []string) config.MapProvider { - return NewExpandMapProvider( - NewMergeMapProvider( - NewFileMapProvider(configFileName), - NewPropertiesMapProvider(properties))) +func NewDefault(configFileName string, properties []string) Provider { + return NewExpand( + NewMerge( + NewFile(configFileName), + NewProperties(properties))) } diff --git a/config/configmapprovider/default_test.go b/config/configmapprovider/default_test.go index 10013c69e8f..04e645f4b5e 100644 --- a/config/configmapprovider/default_test.go +++ b/config/configmapprovider/default_test.go @@ -26,7 +26,7 @@ import ( ) func TestDefaultMapProvider(t *testing.T) { - mp := NewDefaultMapProvider("testdata/default-config.yaml", nil) + mp := NewDefault("testdata/default-config.yaml", nil) retr, err := mp.Retrieve(context.Background()) require.NoError(t, err) @@ -43,7 +43,7 @@ exporters: } func TestDefaultMapProvider_AddNewConfig(t *testing.T) { - mp := NewDefaultMapProvider("testdata/default-config.yaml", []string{"processors.batch.timeout=2s"}) + mp := NewDefault("testdata/default-config.yaml", []string{"processors.batch.timeout=2s"}) cp, err := mp.Retrieve(context.Background()) require.NoError(t, err) @@ -61,7 +61,7 @@ exporters: } func TestDefaultMapProvider_OverwriteConfig(t *testing.T) { - mp := NewDefaultMapProvider( + mp := NewDefault( "testdata/default-config.yaml", []string{"processors.batch.timeout=2s", "exporters.otlp.endpoint=localhost:1234"}) cp, err := mp.Retrieve(context.Background()) @@ -81,7 +81,7 @@ exporters: } func TestDefaultMapProvider_InexistentFile(t *testing.T) { - mp := NewDefaultMapProvider("testdata/otelcol-config.yaml", nil) + mp := NewDefault("testdata/otelcol-config.yaml", nil) require.NotNil(t, mp) _, err := mp.Retrieve(context.Background()) require.Error(t, err) @@ -90,7 +90,7 @@ func TestDefaultMapProvider_InexistentFile(t *testing.T) { } func TestDefaultMapProvider_EmptyFileName(t *testing.T) { - mp := NewDefaultMapProvider("", nil) + mp := NewDefault("", nil) _, err := mp.Retrieve(context.Background()) require.Error(t, err) diff --git a/config/configmapprovider/expand.go b/config/configmapprovider/expand.go index 027abfaf70b..dec9f830c98 100644 --- a/config/configmapprovider/expand.go +++ b/config/configmapprovider/expand.go @@ -17,23 +17,21 @@ package configmapprovider // import "go.opentelemetry.io/collector/config/config import ( "context" "os" - - "go.opentelemetry.io/collector/config" ) type expandMapProvider struct { - base config.MapProvider + base Provider } -// NewExpandMapProvider returns a config.MapProvider, that expands all environment variables for a -// config.Map provided by the given config.MapProvider. -func NewExpandMapProvider(base config.MapProvider) config.MapProvider { +// NewExpand returns a Provider, that expands all environment variables for a +// config.Map provided by the given Provider. +func NewExpand(base Provider) Provider { return &expandMapProvider{ base: base, } } -func (emp *expandMapProvider) Retrieve(ctx context.Context) (config.Retrieved, error) { +func (emp *expandMapProvider) Retrieve(ctx context.Context) (Retrieved, error) { retr, err := emp.base.Retrieve(ctx) if err != nil { return nil, err diff --git a/config/configmapprovider/expand_test.go b/config/configmapprovider/expand_test.go index 2dac55ab1bc..42b30b46959 100644 --- a/config/configmapprovider/expand_test.go +++ b/config/configmapprovider/expand_test.go @@ -56,7 +56,7 @@ func TestExpand(t *testing.T) { for _, test := range testCases { t.Run(test.name, func(t *testing.T) { // Retrieve the config - emp := NewExpandMapProvider(NewFileMapProvider(path.Join("testdata", test.name))) + emp := NewExpand(NewFile(path.Join("testdata", test.name))) cp, err := emp.Retrieve(context.Background()) require.NoError(t, err, "Unable to get config") @@ -74,7 +74,7 @@ func TestExpand_EscapedEnvVars(t *testing.T) { }() // Retrieve the config - emp := NewExpandMapProvider(NewFileMapProvider(path.Join("testdata", "expand-escaped-env.yaml"))) + emp := NewExpand(NewFile(path.Join("testdata", "expand-escaped-env.yaml"))) cp, err := emp.Retrieve(context.Background()) require.NoError(t, err, "Unable to get config") diff --git a/config/configmapprovider/file.go b/config/configmapprovider/file.go index 0d2079a8a88..f9838d29168 100644 --- a/config/configmapprovider/file.go +++ b/config/configmapprovider/file.go @@ -26,14 +26,14 @@ type fileMapProvider struct { fileName string } -// NewFileMapProvider returns a new config.MapProvider that reads the configuration from the given file. -func NewFileMapProvider(fileName string) config.MapProvider { +// NewFile returns a new Provider that reads the configuration from the given file. +func NewFile(fileName string) Provider { return &fileMapProvider{ fileName: fileName, } } -func (fmp *fileMapProvider) Retrieve(context.Context) (config.Retrieved, error) { +func (fmp *fileMapProvider) Retrieve(context.Context) (Retrieved, error) { if fmp.fileName == "" { return nil, errors.New("config file not specified") } diff --git a/config/configmapprovider/inmemory.go b/config/configmapprovider/inmemory.go index 5c8e0b07fd0..db54216d503 100644 --- a/config/configmapprovider/inmemory.go +++ b/config/configmapprovider/inmemory.go @@ -25,12 +25,12 @@ type inMemoryMapProvider struct { buf io.Reader } -// NewInMemoryMapProvider returns a new config.MapProvider that reads the configuration, from the provided buffer, as YAML. -func NewInMemoryMapProvider(buf io.Reader) config.MapProvider { +// NewInMemory returns a new Provider that reads the configuration, from the provided buffer, as YAML. +func NewInMemory(buf io.Reader) Provider { return &inMemoryMapProvider{buf: buf} } -func (inp *inMemoryMapProvider) Retrieve(context.Context) (config.Retrieved, error) { +func (inp *inMemoryMapProvider) Retrieve(context.Context) (Retrieved, error) { cfg, err := config.NewMapFromBuffer(inp.buf) if err != nil { return nil, err diff --git a/config/configmapprovider/merge.go b/config/configmapprovider/merge.go index d6f911465e8..1259e6fdba8 100644 --- a/config/configmapprovider/merge.go +++ b/config/configmapprovider/merge.go @@ -25,17 +25,17 @@ import ( // TODO: Add support to "merge" watchable interface. type mergeMapProvider struct { - providers []config.MapProvider + providers []Provider } -// NewMergeMapProvider returns a config.MapProvider, that merges the result from multiple config.MapProvider. +// NewMerge returns a Provider, that merges the result from multiple Provider. // // The ConfigMaps are merged in the given order, by merging all of them in order into an initial empty map. -func NewMergeMapProvider(ps ...config.MapProvider) config.MapProvider { +func NewMerge(ps ...Provider) Provider { return &mergeMapProvider{providers: ps} } -func (mp *mergeMapProvider) Retrieve(ctx context.Context) (config.Retrieved, error) { +func (mp *mergeMapProvider) Retrieve(ctx context.Context) (Retrieved, error) { retCfgMap := config.NewMap() for _, p := range mp.providers { retr, err := p.Retrieve(ctx) diff --git a/config/configmapprovider/merge_test.go b/config/configmapprovider/merge_test.go index b61fc40c691..f5146f022c2 100644 --- a/config/configmapprovider/merge_test.go +++ b/config/configmapprovider/merge_test.go @@ -26,7 +26,7 @@ import ( ) func TestMerge_GetError(t *testing.T) { - pl := NewMergeMapProvider(&errProvider{err: nil}, &errProvider{errors.New("my error")}) + pl := NewMerge(&errProvider{err: nil}, &errProvider{errors.New("my error")}) require.NotNil(t, pl) cp, err := pl.Retrieve(context.Background()) assert.Error(t, err) @@ -34,7 +34,7 @@ func TestMerge_GetError(t *testing.T) { } func TestMerge_CloseError(t *testing.T) { - pl := NewMergeMapProvider(&errProvider{err: nil}, &errProvider{errors.New("my error")}) + pl := NewMerge(&errProvider{err: nil}, &errProvider{errors.New("my error")}) require.NotNil(t, pl) assert.Error(t, pl.Close(context.Background())) } @@ -43,7 +43,7 @@ type errProvider struct { err error } -func (epl *errProvider) Retrieve(context.Context) (config.Retrieved, error) { +func (epl *errProvider) Retrieve(context.Context) (Retrieved, error) { if epl.err == nil { return &simpleRetrieved{confMap: config.NewMap()}, nil } diff --git a/config/configmapprovider/properties.go b/config/configmapprovider/properties.go index 3a57d101f5d..49ded96b4ab 100644 --- a/config/configmapprovider/properties.go +++ b/config/configmapprovider/properties.go @@ -29,18 +29,18 @@ type propertiesMapProvider struct { properties []string } -// NewPropertiesMapProvider returns a config.MapProvider, that provides a config.Map from the given properties. +// NewProperties returns a Provider, that provides a config.Map from the given properties. // // Properties must follow the Java properties format, key-value list separated by equal sign with a "." // as key delimiter. // ["processors.batch.timeout=2s", "processors.batch/foo.timeout=3s"] -func NewPropertiesMapProvider(properties []string) config.MapProvider { +func NewProperties(properties []string) Provider { return &propertiesMapProvider{ properties: properties, } } -func (pmp *propertiesMapProvider) Retrieve(context.Context) (config.Retrieved, error) { +func (pmp *propertiesMapProvider) Retrieve(context.Context) (Retrieved, error) { if len(pmp.properties) == 0 { return &simpleRetrieved{confMap: config.NewMap()}, nil } diff --git a/config/configmapprovider/properties_test.go b/config/configmapprovider/properties_test.go index 39e560e37e3..77caca4dd30 100644 --- a/config/configmapprovider/properties_test.go +++ b/config/configmapprovider/properties_test.go @@ -30,7 +30,7 @@ func TestPropertiesProvider(t *testing.T) { "exporters.kafka.brokers=foo:9200,foo2:9200", } - pmp := NewPropertiesMapProvider(setFlagStr) + pmp := NewProperties(setFlagStr) retr, err := pmp.Retrieve(context.Background()) require.NoError(t, err) cfgMap := retr.Get() @@ -44,7 +44,7 @@ func TestPropertiesProvider(t *testing.T) { } func TestPropertiesProvider_empty(t *testing.T) { - pmp := NewPropertiesMapProvider(nil) + pmp := NewProperties(nil) retr, err := pmp.Retrieve(context.Background()) require.NoError(t, err) cfgMap := retr.Get() diff --git a/config/provider.go b/config/configmapprovider/provider.go similarity index 90% rename from config/provider.go rename to config/configmapprovider/provider.go index bfb1a4b9740..606a62c9cc1 100644 --- a/config/provider.go +++ b/config/configmapprovider/provider.go @@ -12,15 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config // import "go.opentelemetry.io/collector/config" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( "context" + + "go.opentelemetry.io/collector/config" ) -// MapProvider is an interface that helps providing configuration's parser. +// Provider is an interface that helps providing configuration's parser. // Implementations may load the parser from a file, a database or any other source. -type MapProvider interface { +type Provider interface { // Retrieve goes to the configuration source and retrieves the selected data which // contains the value to be injected in the configuration and the corresponding watcher that // will be used to monitor for updates of the retrieved value. @@ -35,7 +37,7 @@ type MapProvider interface { // Retrieved holds the result of a call to the Retrieve method of a Session object. type Retrieved interface { // Get returns the Map. - Get() *Map + Get() *config.Map } // WatchableRetrieved is an extension for Retrieved that if implemented, diff --git a/config/configtest/configtest.go b/config/configtest/configtest.go index 6018bdc93d9..d68b084f7cd 100644 --- a/config/configtest/configtest.go +++ b/config/configtest/configtest.go @@ -35,7 +35,7 @@ var configFieldTagRegExp = regexp.MustCompile("^[a-z0-9][a-z0-9_]*$") // LoadConfig loads a config from file, and does NOT validate the configuration. func LoadConfig(fileName string, factories component.Factories) (*config.Config, error) { // Read yaml config from file - cp, err := configmapprovider.NewExpandMapProvider(configmapprovider.NewFileMapProvider(fileName)).Retrieve(context.Background()) + cp, err := configmapprovider.NewExpand(configmapprovider.NewFile(fileName)).Retrieve(context.Background()) if err != nil { return nil, err } diff --git a/service/collector.go b/service/collector.go index 0234be975f4..04f71426823 100644 --- a/service/collector.go +++ b/service/collector.go @@ -35,6 +35,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/configmapprovider" "go.opentelemetry.io/collector/config/configunmarshaler" "go.opentelemetry.io/collector/config/experimental/configsource" "go.opentelemetry.io/collector/extension/ballastextension" @@ -194,7 +195,7 @@ func (col *Collector) setupConfigurationComponents(ctx context.Context) error { } // If the retrieved value is watchable start a goroutine watching for updates. - if watchable, ok := ret.(config.WatchableRetrieved); ok { + if watchable, ok := ret.(configmapprovider.WatchableRetrieved); ok { go col.watchForConfigUpdates(ctx, watchable) } @@ -281,7 +282,7 @@ func (col *Collector) reloadService(ctx context.Context) error { return nil } -func (col *Collector) watchForConfigUpdates(ctx context.Context, watchable config.WatchableRetrieved) { +func (col *Collector) watchForConfigUpdates(ctx context.Context, watchable configmapprovider.WatchableRetrieved) { err := watchable.WatchForUpdate() if errors.Is(err, configsource.ErrSessionClosed) { // This is the case of shutdown of the whole collector server, nothing to do. diff --git a/service/collector_test.go b/service/collector_test.go index ab502472dbc..6e272984c22 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -35,7 +35,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configmapprovider" "go.opentelemetry.io/collector/config/configunmarshaler" "go.opentelemetry.io/collector/internal/testutil" @@ -78,7 +77,7 @@ func TestCollector_StartAsGoRoutine(t *testing.T) { set := CollectorSettings{ BuildInfo: component.NewDefaultBuildInfo(), Factories: factories, - ConfigMapProvider: configmapprovider.NewInMemoryMapProvider(strings.NewReader(configStr)), + ConfigMapProvider: configmapprovider.NewInMemory(strings.NewReader(configStr)), } col, err := New(set) require.NoError(t, err) @@ -115,7 +114,7 @@ func TestCollector_Start(t *testing.T) { col, err := New(CollectorSettings{ BuildInfo: component.NewDefaultBuildInfo(), Factories: factories, - ConfigMapProvider: configmapprovider.NewFileMapProvider("testdata/otelcol-config.yaml"), + ConfigMapProvider: configmapprovider.NewFile("testdata/otelcol-config.yaml"), LoggingOptions: []zap.Option{zap.Hooks(hook)}, }) require.NoError(t, err) @@ -182,7 +181,7 @@ func TestCollector_ReportError(t *testing.T) { col, err := New(CollectorSettings{ BuildInfo: component.NewDefaultBuildInfo(), Factories: factories, - ConfigMapProvider: configmapprovider.NewFileMapProvider("testdata/otelcol-config.yaml"), + ConfigMapProvider: configmapprovider.NewFile("testdata/otelcol-config.yaml"), }) require.NoError(t, err) @@ -266,7 +265,7 @@ type errParserLoader struct { err error } -func (epl *errParserLoader) Retrieve(_ context.Context) (config.Retrieved, error) { +func (epl *errParserLoader) Retrieve(_ context.Context) (configmapprovider.Retrieved, error) { return nil, epl.err } @@ -282,7 +281,7 @@ func TestCollector_reloadService(t *testing.T) { tests := []struct { name string - parserProvider config.MapProvider + parserProvider configmapprovider.Provider service *service }{ { @@ -302,7 +301,7 @@ func TestCollector_reloadService(t *testing.T) { }, { name: "retire_service_ok_load_ok", - parserProvider: configmapprovider.NewInMemoryMapProvider(strings.NewReader(configStr)), + parserProvider: configmapprovider.NewInMemory(strings.NewReader(configStr)), service: &service{ telemetry: componenttest.NewNopTelemetrySettings(), builtExporters: builder.Exporters{}, diff --git a/service/collector_windows.go b/service/collector_windows.go index 6b1c68b5a8d..87e5f3b4c87 100644 --- a/service/collector_windows.go +++ b/service/collector_windows.go @@ -133,7 +133,7 @@ func openEventLog(serviceName string) (*eventlog.Log, error) { func newWithWindowsEventLogCore(set CollectorSettings, elog *eventlog.Log) (*Collector, error) { if set.ConfigMapProvider == nil { - set.ConfigMapProvider = configmapprovider.NewDefaultMapProvider(getConfigFlag(), getSetFlag()) + set.ConfigMapProvider = configmapprovider.NewDefault(getConfigFlag(), getSetFlag()) } set.LoggingOptions = append( set.LoggingOptions, diff --git a/service/command.go b/service/command.go index 2fcdc0a17c9..c449b93ed52 100644 --- a/service/command.go +++ b/service/command.go @@ -29,7 +29,7 @@ func NewCommand(set CollectorSettings) *cobra.Command { SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { if set.ConfigMapProvider == nil { - set.ConfigMapProvider = configmapprovider.NewDefaultMapProvider(getConfigFlag(), getSetFlag()) + set.ConfigMapProvider = configmapprovider.NewDefault(getConfigFlag(), getSetFlag()) } col, err := New(set) if err != nil { diff --git a/service/settings.go b/service/settings.go index 756899720ee..59a16de4fc5 100644 --- a/service/settings.go +++ b/service/settings.go @@ -20,6 +20,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/configmapprovider" "go.opentelemetry.io/collector/config/configunmarshaler" ) @@ -62,8 +63,8 @@ type CollectorSettings struct { // If it is not provided a default provider is used. The default provider loads the configuration // from a config file define by the --config command line flag and overrides component's configuration // properties supplied via --set command line flag. - // If the provider is config.WatchableRetrieved, collector may reload the configuration upon error. - ConfigMapProvider config.MapProvider + // If the provider is configmapprovider.WatchableRetrieved, collector may reload the configuration upon error. + ConfigMapProvider configmapprovider.Provider // ConfigUnmarshaler unmarshalls the configuration's Parser into the service configuration. // If it is not provided a default unmarshaler is used. From 51e84c24dc71ac4a6d1ed8a0b5403fc9d670a50e Mon Sep 17 00:00:00 2001 From: Gabriel Gravel Date: Wed, 10 Nov 2021 13:25:10 -0500 Subject: [PATCH 10/38] Update memory ballast usage (#4392) Update example configuration to reflect current usage of memory ballast --- examples/k8s/otel-config.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/k8s/otel-config.yaml b/examples/k8s/otel-config.yaml index 599ca50b0cb..b9b9b172014 100644 --- a/examples/k8s/otel-config.yaml +++ b/examples/k8s/otel-config.yaml @@ -26,8 +26,6 @@ data: processors: batch: memory_limiter: - # Same as --mem-ballast-size-mib CLI argument - ballast_size_mib: 165 # 80% of maximum memory up to 2G limit_mib: 400 # 25% of limit up to 2G @@ -35,8 +33,11 @@ data: check_interval: 5s extensions: zpages: {} + memory_ballast: + # Memory Ballast size should be max 1/3 to 1/2 of memory. + size_mib: 165 service: - extensions: [zpages] + extensions: [zpages, memory_ballast] pipelines: traces: receivers: [otlp] @@ -106,8 +107,6 @@ data: processors: batch: memory_limiter: - # Same as --mem-ballast-size-mib CLI argument - ballast_size_mib: 683 # 80% of maximum memory up to 2G limit_mib: 1500 # 25% of limit up to 2G @@ -115,13 +114,16 @@ data: check_interval: 5s extensions: zpages: {} + memory_ballast: + # Memory Ballast size should be max 1/3 to 1/2 of memory. + size_mib: 683 exporters: otlp: endpoint: "http://someotlp.target.com:4317" # Replace with a real endpoint. tls: insecure: true service: - extensions: [zpages] + extensions: [zpages, memory_ballast] pipelines: traces/1: receivers: [otlp] From 4bb261b7b16da8bb578d5ce787aade8504eb84f9 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 10 Nov 2021 10:33:30 -0800 Subject: [PATCH 11/38] Remove support to expand env variables in default configs (#4366) Proven in https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/6122 that this can be done in the component itself, and no need for this complicated logic. No other usage in core/contrib. Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 1 + .../configunmarshaler/defaultunmarshaler.go | 64 ------ .../defaultunmarshaler_test.go | 205 ------------------ 3 files changed, 1 insertion(+), 269 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a19a2ba88c3..026d9c46115 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Remove `config.Pipeline.InputDataType` (#4343) - otlpexporter: Do not retry on PermissionDenied and Unauthenticated (#4349) - Remove deprecated funcs `consumererror.As[Traces|Metrics|Logs]` (#4364) +- Remove support to expand env variables in default configs (#4366) ## 💡 Enhancements 💡 - Supports more compression methods(`snappy` and `zstd`) for configgrpc, in addition to current `gzip` (#4088) diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index c98cd5f77ae..9374e73615a 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -16,8 +16,6 @@ package configunmarshaler // import "go.opentelemetry.io/collector/config/config import ( "fmt" - "os" - "reflect" "go.uber.org/zap/zapcore" @@ -151,7 +149,6 @@ func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, fac // Create the default config for this extension. extensionCfg := factory.CreateDefaultConfig() extensionCfg.SetIDName(id.Name()) - expandEnvLoadedConfig(extensionCfg) // Now that the default config struct is created we can Unmarshal into it, // and it will apply user-defined config on top of the default. @@ -195,7 +192,6 @@ func LoadReceiver(componentConfig *config.Map, id config.ComponentID, factory co // Create the default config for this receiver. receiverCfg := factory.CreateDefaultConfig() receiverCfg.SetIDName(id.Name()) - expandEnvLoadedConfig(receiverCfg) // Now that the default config struct is created we can Unmarshal into it, // and it will apply user-defined config on top of the default. @@ -245,7 +241,6 @@ func unmarshalExporters(exps map[config.ComponentID]map[string]interface{}, fact // Create the default config for this exporter. exporterCfg := factory.CreateDefaultConfig() exporterCfg.SetIDName(id.Name()) - expandEnvLoadedConfig(exporterCfg) // Now that the default config struct is created we can Unmarshal into it, // and it will apply user-defined config on top of the default. @@ -274,7 +269,6 @@ func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, fa // Create the default config for this processor. processorCfg := factory.CreateDefaultConfig() processorCfg.SetIDName(id.Name()) - expandEnvLoadedConfig(processorCfg) // Now that the default config struct is created we can Unmarshal into it, // and it will apply user-defined config on top of the default. @@ -288,64 +282,6 @@ func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, fa return processors, nil } -// expandEnvLoadedConfig is a utility function that goes recursively through a config object -// and tries to expand environment variables in its string fields. -func expandEnvLoadedConfig(s interface{}) { - expandEnvLoadedConfigPointer(s) -} - -func expandEnvLoadedConfigPointer(s interface{}) { - // Check that the value given is indeed a pointer, otherwise safely stop the search here - value := reflect.ValueOf(s) - if value.Kind() != reflect.Ptr { - return - } - // Run expandLoadedConfigValue on the value behind the pointer. - expandEnvLoadedConfigValue(value.Elem()) -} - -func expandEnvLoadedConfigValue(value reflect.Value) { - // The value given is a string, we expand it (if allowed). - if value.Kind() == reflect.String && value.CanSet() { - value.SetString(expandEnv(value.String())) - } - // The value given is a struct, we go through its fields. - if value.Kind() == reflect.Struct { - for i := 0; i < value.NumField(); i++ { - // Returns the content of the field. - field := value.Field(i) - - // Only try to modify a field if it can be modified (eg. skip unexported private fields). - if field.CanSet() { - switch field.Kind() { - case reflect.String: - // The current field is a string, expand env variables in the string. - field.SetString(expandEnv(field.String())) - case reflect.Ptr: - // The current field is a pointer, run the expansion function on the pointer. - expandEnvLoadedConfigPointer(field.Interface()) - case reflect.Struct: - // The current field is a nested struct, go through the nested struct - expandEnvLoadedConfigValue(field) - } - } - } - } -} - -func expandEnv(s string) string { - return os.Expand(s, func(str string) string { - // This allows escaping environment variable substitution via $$, e.g. - // - $FOO will be substituted with env var FOO - // - $$FOO will be replaced with $FOO - // - $$$FOO will be replaced with $ + substituted env var FOO - if str == "$" { - return "$" - } - return os.Getenv(str) - }) -} - func unmarshal(componentSection *config.Map, intoCfg interface{}) error { if cu, ok := intoCfg.(config.Unmarshallable); ok { return cu.Unmarshal(componentSection) diff --git a/config/configunmarshaler/defaultunmarshaler_test.go b/config/configunmarshaler/defaultunmarshaler_test.go index 48648d60559..6ac12ac9d61 100644 --- a/config/configunmarshaler/defaultunmarshaler_test.go +++ b/config/configunmarshaler/defaultunmarshaler_test.go @@ -15,7 +15,6 @@ package configunmarshaler import ( - "os" "path" "testing" @@ -213,207 +212,3 @@ func loadConfigFile(t *testing.T, fileName string, factories component.Factories // Unmarshal the config from the config.Map using the given factories. return NewDefault().Unmarshal(v, factories) } - -type nestedConfig struct { - NestedStringValue string - NestedIntValue int -} - -type testConfig struct { - config.ExporterSettings - - NestedConfigPtr *nestedConfig - NestedConfigValue nestedConfig - StringValue string - StringPtrValue *string - IntValue int -} - -func TestExpandEnvLoadedConfig(t *testing.T) { - assert.NoError(t, os.Setenv("NESTED_VALUE", "replaced_nested_value")) - assert.NoError(t, os.Setenv("VALUE", "replaced_value")) - assert.NoError(t, os.Setenv("PTR_VALUE", "replaced_ptr_value")) - - defer func() { - assert.NoError(t, os.Unsetenv("NESTED_VALUE")) - assert.NoError(t, os.Unsetenv("VALUE")) - assert.NoError(t, os.Unsetenv("PTR_VALUE")) - }() - - testString := "$PTR_VALUE" - - cfg := &testConfig{ - ExporterSettings: config.NewExporterSettings(config.NewComponentID("test")), - NestedConfigPtr: &nestedConfig{ - NestedStringValue: "$NESTED_VALUE", - NestedIntValue: 1, - }, - NestedConfigValue: nestedConfig{ - NestedStringValue: "$NESTED_VALUE", - NestedIntValue: 2, - }, - StringValue: "$VALUE", - StringPtrValue: &testString, - IntValue: 3, - } - - expandEnvLoadedConfig(cfg) - - replacedTestString := "replaced_ptr_value" - - assert.Equal(t, &testConfig{ - ExporterSettings: config.NewExporterSettings(config.NewComponentID("test")), - NestedConfigPtr: &nestedConfig{ - NestedStringValue: "replaced_nested_value", - NestedIntValue: 1, - }, - NestedConfigValue: nestedConfig{ - NestedStringValue: "replaced_nested_value", - NestedIntValue: 2, - }, - StringValue: "replaced_value", - StringPtrValue: &replacedTestString, - IntValue: 3, - }, cfg) -} - -func TestExpandEnvLoadedConfigEscapedEnv(t *testing.T) { - assert.NoError(t, os.Setenv("NESTED_VALUE", "replaced_nested_value")) - assert.NoError(t, os.Setenv("ESCAPED_VALUE", "replaced_escaped_value")) - assert.NoError(t, os.Setenv("ESCAPED_PTR_VALUE", "replaced_escaped_pointer_value")) - - defer func() { - assert.NoError(t, os.Unsetenv("NESTED_VALUE")) - assert.NoError(t, os.Unsetenv("ESCAPED_VALUE")) - assert.NoError(t, os.Unsetenv("ESCAPED_PTR_VALUE")) - }() - - testString := "$$ESCAPED_PTR_VALUE" - - cfg := &testConfig{ - ExporterSettings: config.NewExporterSettings(config.NewComponentID("test")), - NestedConfigPtr: &nestedConfig{ - NestedStringValue: "$NESTED_VALUE", - NestedIntValue: 1, - }, - NestedConfigValue: nestedConfig{ - NestedStringValue: "$NESTED_VALUE", - NestedIntValue: 2, - }, - StringValue: "$$ESCAPED_VALUE", - StringPtrValue: &testString, - IntValue: 3, - } - - expandEnvLoadedConfig(cfg) - - replacedTestString := "$ESCAPED_PTR_VALUE" - - assert.Equal(t, &testConfig{ - ExporterSettings: config.NewExporterSettings(config.NewComponentID("test")), - NestedConfigPtr: &nestedConfig{ - NestedStringValue: "replaced_nested_value", - NestedIntValue: 1, - }, - NestedConfigValue: nestedConfig{ - NestedStringValue: "replaced_nested_value", - NestedIntValue: 2, - }, - StringValue: "$ESCAPED_VALUE", - StringPtrValue: &replacedTestString, - IntValue: 3, - }, cfg) -} - -func TestExpandEnvLoadedConfigMissingEnv(t *testing.T) { - assert.NoError(t, os.Setenv("NESTED_VALUE", "replaced_nested_value")) - - defer func() { - assert.NoError(t, os.Unsetenv("NESTED_VALUE")) - }() - - testString := "$PTR_VALUE" - - cfg := &testConfig{ - ExporterSettings: config.NewExporterSettings(config.NewComponentID("test")), - NestedConfigPtr: &nestedConfig{ - NestedStringValue: "$NESTED_VALUE", - NestedIntValue: 1, - }, - NestedConfigValue: nestedConfig{ - NestedStringValue: "$NESTED_VALUE", - NestedIntValue: 2, - }, - StringValue: "$VALUE", - StringPtrValue: &testString, - IntValue: 3, - } - - expandEnvLoadedConfig(cfg) - - replacedTestString := "" - - assert.Equal(t, &testConfig{ - ExporterSettings: config.NewExporterSettings(config.NewComponentID("test")), - NestedConfigPtr: &nestedConfig{ - NestedStringValue: "replaced_nested_value", - NestedIntValue: 1, - }, - NestedConfigValue: nestedConfig{ - NestedStringValue: "replaced_nested_value", - NestedIntValue: 2, - }, - StringValue: "", - StringPtrValue: &replacedTestString, - IntValue: 3, - }, cfg) -} - -func TestExpandEnvLoadedConfigNil(t *testing.T) { - var cfg *testConfig - - // This should safely do nothing - expandEnvLoadedConfig(cfg) - - assert.Equal(t, (*testConfig)(nil), cfg) -} - -func TestExpandEnvLoadedConfigNoPointer(t *testing.T) { - assert.NoError(t, os.Setenv("VALUE", "replaced_value")) - - cfg := testConfig{ - StringValue: "$VALUE", - } - - // This should do nothing as cfg is not a pointer - expandEnvLoadedConfig(cfg) - - assert.Equal(t, testConfig{StringValue: "$VALUE"}, cfg) -} - -type testUnexportedConfig struct { - config.ExporterSettings - - unexportedStringValue string - ExportedStringValue string -} - -func TestExpandEnvLoadedConfigUnexportedField(t *testing.T) { - assert.NoError(t, os.Setenv("VALUE", "replaced_value")) - - defer func() { - assert.NoError(t, os.Unsetenv("VALUE")) - }() - - cfg := &testUnexportedConfig{ - unexportedStringValue: "$VALUE", - ExportedStringValue: "$VALUE", - } - - expandEnvLoadedConfig(cfg) - - assert.Equal(t, &testUnexportedConfig{ - unexportedStringValue: "$VALUE", - ExportedStringValue: "replaced_value", - }, cfg) -} From 1faf5050f98a7307849a15bb52af3e9374937922 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 10 Nov 2021 16:34:03 -0800 Subject: [PATCH 12/38] obsreporttest: Improve tests, check for all possible errors always (#4395) Signed-off-by: Bogdan Drutu --- obsreport/obsreporttest/obsreporttest.go | 93 ++++++++----------- obsreport/obsreporttest/obsreporttest_test.go | 52 +++++++---- 2 files changed, 71 insertions(+), 74 deletions(-) diff --git a/obsreport/obsreporttest/obsreporttest.go b/obsreport/obsreporttest/obsreporttest.go index b79a6338016..e795e0255e4 100644 --- a/obsreport/obsreporttest/obsreporttest.go +++ b/obsreport/obsreporttest/obsreporttest.go @@ -24,6 +24,7 @@ import ( "go.opencensus.io/tag" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/sdk/trace/tracetest" + "go.uber.org/multierr" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" @@ -102,111 +103,95 @@ func SetupTelemetry() (TestTelemetry, error) { // CheckExporterTraces checks that for the current exported values for trace exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func CheckExporterTraces(_ TestTelemetry, exporter config.ComponentID, acceptedSpans, droppedSpans int64) error { +func CheckExporterTraces(_ TestTelemetry, exporter config.ComponentID, sentSpans, sendFailedSpans int64) error { exporterTags := tagsForExporterView(exporter) - if err := checkValueForView(exporterTags, acceptedSpans, "exporter/sent_spans"); err != nil { - return err - } - return checkValueForView(exporterTags, droppedSpans, "exporter/send_failed_spans") + return multierr.Combine( + checkValueForView(exporterTags, sentSpans, "exporter/sent_spans"), + checkValueForView(exporterTags, sendFailedSpans, "exporter/send_failed_spans")) } // CheckExporterMetrics checks that for the current exported values for metrics exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func CheckExporterMetrics(_ TestTelemetry, exporter config.ComponentID, acceptedMetricsPoints, droppedMetricsPoints int64) error { +func CheckExporterMetrics(_ TestTelemetry, exporter config.ComponentID, sentMetricsPoints, sendFailedMetricsPoints int64) error { exporterTags := tagsForExporterView(exporter) - if err := checkValueForView(exporterTags, acceptedMetricsPoints, "exporter/sent_metric_points"); err != nil { - return err - } - return checkValueForView(exporterTags, droppedMetricsPoints, "exporter/send_failed_metric_points") + return multierr.Combine( + checkValueForView(exporterTags, sentMetricsPoints, "exporter/sent_metric_points"), + checkValueForView(exporterTags, sendFailedMetricsPoints, "exporter/send_failed_metric_points")) } // CheckExporterLogs checks that for the current exported values for logs exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func CheckExporterLogs(_ TestTelemetry, exporter config.ComponentID, acceptedLogRecords, droppedLogRecords int64) error { +func CheckExporterLogs(_ TestTelemetry, exporter config.ComponentID, sentLogRecords, sendFailedLogRecords int64) error { exporterTags := tagsForExporterView(exporter) - if err := checkValueForView(exporterTags, acceptedLogRecords, "exporter/sent_log_records"); err != nil { - return err - } - return checkValueForView(exporterTags, droppedLogRecords, "exporter/send_failed_log_records") + return multierr.Combine( + checkValueForView(exporterTags, sentLogRecords, "exporter/sent_log_records"), + checkValueForView(exporterTags, sendFailedLogRecords, "exporter/send_failed_log_records")) } // CheckProcessorTraces checks that for the current exported values for trace exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. func CheckProcessorTraces(_ TestTelemetry, processor config.ComponentID, acceptedSpans, refusedSpans, droppedSpans int64) error { processorTags := tagsForProcessorView(processor) - if err := checkValueForView(processorTags, acceptedSpans, "processor/accepted_spans"); err != nil { - return err - } - if err := checkValueForView(processorTags, refusedSpans, "processor/refused_spans"); err != nil { - return err - } - return checkValueForView(processorTags, droppedSpans, "processor/dropped_spans") + return multierr.Combine( + checkValueForView(processorTags, acceptedSpans, "processor/accepted_spans"), + checkValueForView(processorTags, refusedSpans, "processor/refused_spans"), + checkValueForView(processorTags, droppedSpans, "processor/dropped_spans")) } // CheckProcessorMetrics checks that for the current exported values for metrics exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. func CheckProcessorMetrics(_ TestTelemetry, processor config.ComponentID, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { processorTags := tagsForProcessorView(processor) - if err := checkValueForView(processorTags, acceptedMetricPoints, "processor/accepted_metric_points"); err != nil { - return err - } - if err := checkValueForView(processorTags, refusedMetricPoints, "processor/refused_metric_points"); err != nil { - return err - } - return checkValueForView(processorTags, droppedMetricPoints, "processor/dropped_metric_points") + return multierr.Combine( + checkValueForView(processorTags, acceptedMetricPoints, "processor/accepted_metric_points"), + checkValueForView(processorTags, refusedMetricPoints, "processor/refused_metric_points"), + checkValueForView(processorTags, droppedMetricPoints, "processor/dropped_metric_points")) } // CheckProcessorLogs checks that for the current exported values for logs exporter metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. func CheckProcessorLogs(_ TestTelemetry, processor config.ComponentID, acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { processorTags := tagsForProcessorView(processor) - if err := checkValueForView(processorTags, acceptedLogRecords, "processor/accepted_log_records"); err != nil { - return err - } - if err := checkValueForView(processorTags, refusedLogRecords, "processor/refused_log_records"); err != nil { - return err - } - return checkValueForView(processorTags, droppedLogRecords, "processor/dropped_log_records") + return multierr.Combine( + checkValueForView(processorTags, acceptedLogRecords, "processor/accepted_log_records"), + checkValueForView(processorTags, refusedLogRecords, "processor/refused_log_records"), + checkValueForView(processorTags, droppedLogRecords, "processor/dropped_log_records")) } // CheckReceiverTraces checks that for the current exported values for trace receiver metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. func CheckReceiverTraces(_ TestTelemetry, receiver config.ComponentID, protocol string, acceptedSpans, droppedSpans int64) error { receiverTags := tagsForReceiverView(receiver, protocol) - if err := checkValueForView(receiverTags, acceptedSpans, "receiver/accepted_spans"); err != nil { - return err - } - return checkValueForView(receiverTags, droppedSpans, "receiver/refused_spans") + return multierr.Combine( + checkValueForView(receiverTags, acceptedSpans, "receiver/accepted_spans"), + checkValueForView(receiverTags, droppedSpans, "receiver/refused_spans")) } // CheckReceiverLogs checks that for the current exported values for logs receiver metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. func CheckReceiverLogs(_ TestTelemetry, receiver config.ComponentID, protocol string, acceptedLogRecords, droppedLogRecords int64) error { receiverTags := tagsForReceiverView(receiver, protocol) - if err := checkValueForView(receiverTags, acceptedLogRecords, "receiver/accepted_log_records"); err != nil { - return err - } - return checkValueForView(receiverTags, droppedLogRecords, "receiver/refused_log_records") + return multierr.Combine( + checkValueForView(receiverTags, acceptedLogRecords, "receiver/accepted_log_records"), + checkValueForView(receiverTags, droppedLogRecords, "receiver/refused_log_records")) } // CheckReceiverMetrics checks that for the current exported values for metrics receiver metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. func CheckReceiverMetrics(_ TestTelemetry, receiver config.ComponentID, protocol string, acceptedMetricPoints, droppedMetricPoints int64) error { receiverTags := tagsForReceiverView(receiver, protocol) - if err := checkValueForView(receiverTags, acceptedMetricPoints, "receiver/accepted_metric_points"); err != nil { - return err - } - return checkValueForView(receiverTags, droppedMetricPoints, "receiver/refused_metric_points") + return multierr.Combine( + checkValueForView(receiverTags, acceptedMetricPoints, "receiver/accepted_metric_points"), + checkValueForView(receiverTags, droppedMetricPoints, "receiver/refused_metric_points")) } // CheckScraperMetrics checks that for the current exported values for metrics scraper metrics match given values. // When this function is called it is required to also call SetupTelemetry as first thing. func CheckScraperMetrics(_ TestTelemetry, receiver config.ComponentID, scraper config.ComponentID, scrapedMetricPoints, erroredMetricPoints int64) error { scraperTags := tagsForScraperView(receiver, scraper) - if err := checkValueForView(scraperTags, scrapedMetricPoints, "scraper/scraped_metric_points"); err != nil { - return err - } - return checkValueForView(scraperTags, erroredMetricPoints, "scraper/errored_metric_points") + return multierr.Combine( + checkValueForView(scraperTags, scrapedMetricPoints, "scraper/scraped_metric_points"), + checkValueForView(scraperTags, erroredMetricPoints, "scraper/errored_metric_points")) } // checkValueForView checks that for the current exported value in the view with the given name @@ -226,12 +211,12 @@ func checkValueForView(wantTags []tag.Tag, value int64, vName string) error { if reflect.DeepEqual(wantTags, row.Tags) { sum := row.Data.(*view.SumData) if float64(value) != sum.Value { - return fmt.Errorf("values did no match, wanted %f got %f", float64(value), sum.Value) + return fmt.Errorf("[%s]: values did no match, wanted %f got %f", vName, float64(value), sum.Value) } return nil } } - return fmt.Errorf("could not find tags, wantTags: %s in rows %v", wantTags, rows) + return fmt.Errorf("[%s]: could not find tags, wantTags: %s in rows %v", vName, wantTags, rows) } // tagsForReceiverView returns the tags that are needed for the receiver views. diff --git a/obsreport/obsreporttest/obsreporttest_test.go b/obsreport/obsreporttest/obsreporttest_test.go index ac01909ad36..be92fc1cad4 100644 --- a/obsreport/obsreporttest/obsreporttest_test.go +++ b/obsreport/obsreporttest/obsreporttest_test.go @@ -48,14 +48,13 @@ func TestCheckReceiverTracesViews(t *testing.T) { ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartTracesOp(context.Background()) - assert.NotNil(t, ctx) - rec.EndTracesOp( - ctx, - format, - 7, - nil) - - require.NoError(t, obsreporttest.CheckReceiverTraces(tt, receiver, transport, 7, 0)) + require.NotNil(t, ctx) + rec.EndTracesOp(ctx, format, 7, nil) + + assert.NoError(t, obsreporttest.CheckReceiverTraces(tt, receiver, transport, 7, 0)) + assert.Error(t, obsreporttest.CheckReceiverTraces(tt, receiver, transport, 7, 7)) + assert.Error(t, obsreporttest.CheckReceiverTraces(tt, receiver, transport, 0, 0)) + assert.Error(t, obsreporttest.CheckReceiverTraces(tt, receiver, transport, 0, 7)) } func TestCheckReceiverMetricsViews(t *testing.T) { @@ -69,10 +68,13 @@ func TestCheckReceiverMetricsViews(t *testing.T) { ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartMetricsOp(context.Background()) - assert.NotNil(t, ctx) + require.NotNil(t, ctx) rec.EndMetricsOp(ctx, format, 7, nil) - require.NoError(t, obsreporttest.CheckReceiverMetrics(tt, receiver, transport, 7, 0)) + assert.NoError(t, obsreporttest.CheckReceiverMetrics(tt, receiver, transport, 7, 0)) + assert.Error(t, obsreporttest.CheckReceiverMetrics(tt, receiver, transport, 7, 7)) + assert.Error(t, obsreporttest.CheckReceiverMetrics(tt, receiver, transport, 0, 0)) + assert.Error(t, obsreporttest.CheckReceiverMetrics(tt, receiver, transport, 0, 7)) } func TestCheckReceiverLogsViews(t *testing.T) { @@ -86,10 +88,13 @@ func TestCheckReceiverLogsViews(t *testing.T) { ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartLogsOp(context.Background()) - assert.NotNil(t, ctx) + require.NotNil(t, ctx) rec.EndLogsOp(ctx, format, 7, nil) - require.NoError(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, 7, 0)) + assert.NoError(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, 7, 0)) + assert.Error(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, 7, 7)) + assert.Error(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, 0, 0)) + assert.Error(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, 0, 7)) } func TestCheckExporterTracesViews(t *testing.T) { @@ -103,11 +108,13 @@ func TestCheckExporterTracesViews(t *testing.T) { ExporterCreateSettings: tt.ToExporterCreateSettings(), }) ctx := obsrep.StartTracesOp(context.Background()) - assert.NotNil(t, ctx) - + require.NotNil(t, ctx) obsrep.EndTracesOp(ctx, 7, nil) - require.NoError(t, obsreporttest.CheckExporterTraces(tt, exporter, 7, 0)) + assert.NoError(t, obsreporttest.CheckExporterTraces(tt, exporter, 7, 0)) + assert.Error(t, obsreporttest.CheckExporterTraces(tt, exporter, 7, 7)) + assert.Error(t, obsreporttest.CheckExporterTraces(tt, exporter, 0, 0)) + assert.Error(t, obsreporttest.CheckExporterTraces(tt, exporter, 0, 7)) } func TestCheckExporterMetricsViews(t *testing.T) { @@ -121,11 +128,13 @@ func TestCheckExporterMetricsViews(t *testing.T) { ExporterCreateSettings: tt.ToExporterCreateSettings(), }) ctx := obsrep.StartMetricsOp(context.Background()) - assert.NotNil(t, ctx) - + require.NotNil(t, ctx) obsrep.EndMetricsOp(ctx, 7, nil) - require.NoError(t, obsreporttest.CheckExporterMetrics(tt, exporter, 7, 0)) + assert.NoError(t, obsreporttest.CheckExporterMetrics(tt, exporter, 7, 0)) + assert.Error(t, obsreporttest.CheckExporterMetrics(tt, exporter, 7, 7)) + assert.Error(t, obsreporttest.CheckExporterMetrics(tt, exporter, 0, 0)) + assert.Error(t, obsreporttest.CheckExporterMetrics(tt, exporter, 0, 7)) } func TestCheckExporterLogsViews(t *testing.T) { @@ -139,8 +148,11 @@ func TestCheckExporterLogsViews(t *testing.T) { ExporterCreateSettings: tt.ToExporterCreateSettings(), }) ctx := obsrep.StartLogsOp(context.Background()) - assert.NotNil(t, ctx) + require.NotNil(t, ctx) obsrep.EndLogsOp(ctx, 7, nil) - require.NoError(t, obsreporttest.CheckExporterLogs(tt, exporter, 7, 0)) + assert.NoError(t, obsreporttest.CheckExporterLogs(tt, exporter, 7, 0)) + assert.Error(t, obsreporttest.CheckExporterLogs(tt, exporter, 7, 7)) + assert.Error(t, obsreporttest.CheckExporterLogs(tt, exporter, 0, 0)) + assert.Error(t, obsreporttest.CheckExporterLogs(tt, exporter, 0, 7)) } From a9df2ae27b6b86a068eea83175754e3e8f39cbad Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 10 Nov 2021 19:34:45 -0500 Subject: [PATCH 13/38] unit test and changelog follow up to batch processor descriptor fix (#4396) --- CHANGELOG.md | 4 + processor/batchprocessor/splitmetrics_test.go | 87 +++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 026d9c46115..30db69bf036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ ## 💡 Enhancements 💡 - Supports more compression methods(`snappy` and `zstd`) for configgrpc, in addition to current `gzip` (#4088) +## 🧰 Bug fixes 🧰 + +- Fix AggregationTemporality and IsMonotonic when metric descriptors are split in the batch processor (#4389) + ## v0.38.0 Beta ## 🛑 Breaking changes 🛑 diff --git a/processor/batchprocessor/splitmetrics_test.go b/processor/batchprocessor/splitmetrics_test.go index 66746e22942..243ccccbb50 100644 --- a/processor/batchprocessor/splitmetrics_test.go +++ b/processor/batchprocessor/splitmetrics_test.go @@ -163,6 +163,93 @@ func TestSplitMetricsUneven(t *testing.T) { assert.Equal(t, "test-metric-int-0-9", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0).Name()) } +func TestSplitMetricsAllTypes(t *testing.T) { + md := testdata.GeneratMetricsAllTypesWithSampleDatapoints() + dataPointCount := 2 + metrics := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() + for i := 0; i < metrics.Len(); i++ { + metrics.At(i).SetName(getTestMetricName(0, i)) + assert.Equal(t, dataPointCount, metricDPC(metrics.At(i))) + } + + splitSize := 2 + // Start with 6 metric types, and 2 points per-metric. Split out the first, + // and then split by 2 for the rest so that each metric is split in half. + // Verify that descriptors are preserved for all data types across splits. + + split := splitMetrics(1, md) + assert.Equal(t, 1, split.MetricCount()) + assert.Equal(t, 6, md.MetricCount()) + gaugeInt := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + assert.Equal(t, 1, gaugeInt.Gauge().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-0", gaugeInt.Name()) + + split = splitMetrics(splitSize, md) + assert.Equal(t, 2, split.MetricCount()) + assert.Equal(t, 5, md.MetricCount()) + gaugeInt = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + gaugeDouble := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + assert.Equal(t, 1, gaugeInt.Gauge().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-0", gaugeInt.Name()) + assert.Equal(t, 1, gaugeDouble.Gauge().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-1", gaugeDouble.Name()) + + split = splitMetrics(splitSize, md) + assert.Equal(t, 2, split.MetricCount()) + assert.Equal(t, 4, md.MetricCount()) + gaugeDouble = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + sumInt := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + assert.Equal(t, 1, gaugeDouble.Gauge().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-1", gaugeDouble.Name()) + assert.Equal(t, 1, sumInt.Sum().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, sumInt.Sum().AggregationTemporality()) + assert.Equal(t, true, sumInt.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-2", sumInt.Name()) + + split = splitMetrics(splitSize, md) + assert.Equal(t, 2, split.MetricCount()) + assert.Equal(t, 3, md.MetricCount()) + sumInt = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + sumDouble := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + assert.Equal(t, 1, sumInt.Sum().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, sumInt.Sum().AggregationTemporality()) + assert.Equal(t, true, sumInt.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-2", sumInt.Name()) + assert.Equal(t, 1, sumDouble.Sum().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, sumDouble.Sum().AggregationTemporality()) + assert.Equal(t, true, sumDouble.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-3", sumDouble.Name()) + + split = splitMetrics(splitSize, md) + assert.Equal(t, 2, split.MetricCount()) + assert.Equal(t, 2, md.MetricCount()) + sumDouble = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + doubleHistogram := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + assert.Equal(t, 1, sumDouble.Sum().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, sumDouble.Sum().AggregationTemporality()) + assert.Equal(t, true, sumDouble.Sum().IsMonotonic()) + assert.Equal(t, "test-metric-int-0-3", sumDouble.Name()) + assert.Equal(t, 1, doubleHistogram.Histogram().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, doubleHistogram.Histogram().AggregationTemporality()) + assert.Equal(t, "test-metric-int-0-4", doubleHistogram.Name()) + + split = splitMetrics(splitSize, md) + assert.Equal(t, 2, split.MetricCount()) + assert.Equal(t, 1, md.MetricCount()) + doubleHistogram = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + doubleSummary := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + assert.Equal(t, 1, doubleHistogram.Histogram().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, doubleHistogram.Histogram().AggregationTemporality()) + assert.Equal(t, "test-metric-int-0-4", doubleHistogram.Name()) + assert.Equal(t, 1, doubleSummary.Summary().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-5", doubleSummary.Name()) + + split = splitMetrics(splitSize, md) + doubleSummary = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + assert.Equal(t, 1, doubleSummary.Summary().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-5", doubleSummary.Name()) +} + func TestSplitMetricsBatchSizeSmallerThanDataPointCount(t *testing.T) { md := testdata.GenerateMetricsManyMetricsSameResource(2) metrics := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() From 93c9cab0a909b59c2365282c9d422c63af1ab1ba Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 10 Nov 2021 16:35:00 -0800 Subject: [PATCH 14/38] Extract configuration wathcing is a separate struct (#4370) * Fix race condition in Collector where multiple goroutines were updating the Collector.service; * Correctly close the RetrievedWatchable values; Signed-off-by: Bogdan Drutu --- service/collector.go | 121 ++++++-------- service/collector_test.go | 82 ---------- service/config_watcher.go | 77 +++++++++ service/config_watcher_test.go | 222 ++++++++++++++++++++++++++ service/testdata/otelcol-invalid.yaml | 15 ++ 5 files changed, 362 insertions(+), 155 deletions(-) create mode 100644 service/config_watcher.go create mode 100644 service/config_watcher_test.go create mode 100644 service/testdata/otelcol-invalid.yaml diff --git a/service/collector.go b/service/collector.go index 04f71426823..06d7fe9bed6 100644 --- a/service/collector.go +++ b/service/collector.go @@ -34,10 +34,7 @@ import ( "go.uber.org/zap" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/config/configmapprovider" "go.opentelemetry.io/collector/config/configunmarshaler" - "go.opentelemetry.io/collector/config/experimental/configsource" "go.opentelemetry.io/collector/extension/ballastextension" "go.opentelemetry.io/collector/service/internal" "go.opentelemetry.io/collector/service/internal/telemetrylogs" @@ -73,6 +70,7 @@ type Collector struct { meterProvider metric.MeterProvider zPagesSpanProcessor *zpages.SpanProcessor + cfgW *configWatcher service *service stateChannel chan State @@ -129,7 +127,7 @@ func (col *Collector) Shutdown() { } // runAndWaitForShutdownEvent waits for one of the shutdown events that can happen. -func (col *Collector) runAndWaitForShutdownEvent() { +func (col *Collector) runAndWaitForShutdownEvent(ctx context.Context) error { col.logger.Info("Everything is ready. Begin running and processing data.") col.signalsChannel = make(chan os.Signal, 1) @@ -140,35 +138,48 @@ func (col *Collector) runAndWaitForShutdownEvent() { col.shutdownChan = make(chan struct{}) col.stateChannel <- Running - select { - case err := <-col.asyncErrorChannel: - col.logger.Error("Asynchronous error received, terminating process", zap.Error(err)) - case s := <-col.signalsChannel: - col.logger.Info("Received signal from OS", zap.String("signal", s.String())) - case <-col.shutdownChan: - col.logger.Info("Received shutdown request") +LOOP: + for { + select { + case err := <-col.cfgW.watcher: + col.logger.Warn("Config updated", zap.Error(err)) + + col.stateChannel <- Closing + + if err = col.cfgW.close(ctx); err != nil { + return fmt.Errorf("failed to close config watcher: %w", err) + } + if err = col.service.Shutdown(ctx); err != nil { + return fmt.Errorf("failed to shutdown the retiring config: %w", err) + } + if err = col.setupConfigurationComponents(ctx); err != nil { + return fmt.Errorf("failed to setup configuration components: %w", err) + } + case err := <-col.asyncErrorChannel: + col.logger.Error("Asynchronous error received, terminating process", zap.Error(err)) + break LOOP + case s := <-col.signalsChannel: + col.logger.Info("Received signal from OS", zap.String("signal", s.String())) + break LOOP + case <-col.shutdownChan: + col.logger.Info("Received shutdown request") + break LOOP + } } - col.stateChannel <- Closing + return col.shutdown(ctx) } // setupConfigurationComponents loads the config and starts the components. If all the steps succeeds it // sets the col.service with the service currently running. func (col *Collector) setupConfigurationComponents(ctx context.Context) error { - ret, err := col.set.ConfigMapProvider.Retrieve(ctx) - if err != nil { - return fmt.Errorf("cannot retrieve the configuration: %w", err) - } - - var cfg *config.Config - if cfg, err = col.set.ConfigUnmarshaler.Unmarshal(ret.Get(), col.set.Factories); err != nil { - return fmt.Errorf("cannot unmarshal the configuration: %w", err) - } + col.stateChannel <- Starting - if err = cfg.Validate(); err != nil { - return fmt.Errorf("invalid configuration: %w", err) + var err error + if col.cfgW, err = newConfigWatcher(ctx, col.set); err != nil { + return err } - if col.logger, err = telemetrylogs.NewLogger(cfg.Service.Telemetry.Logs, col.set.LoggingOptions); err != nil { + if col.logger, err = telemetrylogs.NewLogger(col.cfgW.cfg.Service.Telemetry.Logs, col.set.LoggingOptions); err != nil { return fmt.Errorf("failed to get logger: %w", err) } @@ -177,7 +188,7 @@ func (col *Collector) setupConfigurationComponents(ctx context.Context) error { col.service, err = newService(&svcSettings{ BuildInfo: col.set.BuildInfo, Factories: col.set.Factories, - Config: cfg, + Config: col.cfgW.cfg, Telemetry: component.TelemetrySettings{ Logger: col.logger, TracerProvider: col.tracerProvider, @@ -194,11 +205,6 @@ func (col *Collector) setupConfigurationComponents(ctx context.Context) error { return err } - // If the retrieved value is watchable start a goroutine watching for updates. - if watchable, ok := ret.(configmapprovider.WatchableRetrieved); ok { - go col.watchForConfigUpdates(ctx, watchable) - } - return nil } @@ -216,8 +222,6 @@ func (col *Collector) Run(ctx context.Context) error { col.meterProvider = metric.NewNoopMeterProvider() - col.stateChannel <- Starting - col.asyncErrorChannel = make(chan error) if err := col.setupConfigurationComponents(ctx); err != nil { @@ -234,7 +238,11 @@ func (col *Collector) Run(ctx context.Context) error { ) // Everything is ready, now run until an event requiring shutdown happens. - col.runAndWaitForShutdownEvent() + return col.runAndWaitForShutdownEvent(ctx) +} + +func (col *Collector) shutdown(ctx context.Context) error { + col.stateChannel <- Closing // Accumulate errors and proceed with shutting down remaining components. var errs error @@ -242,14 +250,16 @@ func (col *Collector) Run(ctx context.Context) error { // Begin shutdown sequence. col.logger.Info("Starting shutdown...") + if err := col.cfgW.close(ctx); err != nil { + errs = multierr.Append(errs, fmt.Errorf("failed to close config provider watcher: %w", err)) + } + if err := col.set.ConfigMapProvider.Close(ctx); err != nil { - errs = multierr.Append(errs, fmt.Errorf("failed to close config: %w", err)) + errs = multierr.Append(errs, fmt.Errorf("failed to shutdown config provider: %w", err)) } - if col.service != nil { - if err := col.service.Shutdown(ctx); err != nil { - errs = multierr.Append(errs, fmt.Errorf("failed to shutdown service: %w", err)) - } + if err := col.service.Shutdown(ctx); err != nil { + errs = multierr.Append(errs, fmt.Errorf("failed to shutdown service: %w", err)) } if err := collectorTelemetry.shutdown(); err != nil { @@ -263,41 +273,6 @@ func (col *Collector) Run(ctx context.Context) error { return errs } -// reloadService shutdowns the current col.service and setups a new one according -// to the latest configuration. It requires that col.parserProvider and col.factories -// are properly populated to finish successfully. -func (col *Collector) reloadService(ctx context.Context) error { - if col.service != nil { - retiringService := col.service - col.service = nil - if err := retiringService.Shutdown(ctx); err != nil { - return fmt.Errorf("failed to shutdown the retiring config: %w", err) - } - } - - if err := col.setupConfigurationComponents(ctx); err != nil { - return fmt.Errorf("failed to setup configuration components: %w", err) - } - - return nil -} - -func (col *Collector) watchForConfigUpdates(ctx context.Context, watchable configmapprovider.WatchableRetrieved) { - err := watchable.WatchForUpdate() - if errors.Is(err, configsource.ErrSessionClosed) { - // This is the case of shutdown of the whole collector server, nothing to do. - col.logger.Info("Config WatchForUpdate closed", zap.Error(err)) - return - } - col.logger.Warn("Config WatchForUpdated exited", zap.Error(err)) - if err = watchable.Close(ctx); err != nil { - col.asyncErrorChannel <- err - } - if err = col.reloadService(ctx); err != nil { - col.asyncErrorChannel <- err - } -} - func getBallastSize(host component.Host) uint64 { var ballastSize uint64 extensions := host.GetExtensions() diff --git a/service/collector_test.go b/service/collector_test.go index 6e272984c22..8f1b009671f 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -29,18 +29,13 @@ import ( "github.com/prometheus/common/expfmt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/configmapprovider" - "go.opentelemetry.io/collector/config/configunmarshaler" "go.opentelemetry.io/collector/internal/testutil" "go.opentelemetry.io/collector/service/defaultcomponents" - "go.opentelemetry.io/collector/service/internal/builder" - "go.opentelemetry.io/collector/service/internal/extensions" ) const configStr = ` @@ -150,9 +145,6 @@ func TestCollector_Start(t *testing.T) { assertZPages(t) - // Trigger another configuration load. - require.NoError(t, col.reloadService(context.Background())) - col.signalsChannel <- syscall.SIGTERM <-colDone assert.Equal(t, Closing, <-col.GetStateChannel()) @@ -260,77 +252,3 @@ func assertZPages(t *testing.T) { testZPagePathFn(t, path) } } - -type errParserLoader struct { - err error -} - -func (epl *errParserLoader) Retrieve(_ context.Context) (configmapprovider.Retrieved, error) { - return nil, epl.err -} - -func (epl *errParserLoader) Close(context.Context) error { - return nil -} - -func TestCollector_reloadService(t *testing.T) { - factories, err := defaultcomponents.Components() - require.NoError(t, err) - ctx := context.Background() - sentinelError := errors.New("sentinel error") - - tests := []struct { - name string - parserProvider configmapprovider.Provider - service *service - }{ - { - name: "first_load_err", - parserProvider: &errParserLoader{err: sentinelError}, - }, - { - name: "retire_service_ok_load_err", - parserProvider: &errParserLoader{err: sentinelError}, - service: &service{ - telemetry: componenttest.NewNopTelemetrySettings(), - builtExporters: builder.Exporters{}, - builtPipelines: builder.BuiltPipelines{}, - builtReceivers: builder.Receivers{}, - builtExtensions: extensions.Extensions{}, - }, - }, - { - name: "retire_service_ok_load_ok", - parserProvider: configmapprovider.NewInMemory(strings.NewReader(configStr)), - service: &service{ - telemetry: componenttest.NewNopTelemetrySettings(), - builtExporters: builder.Exporters{}, - builtPipelines: builder.BuiltPipelines{}, - builtReceivers: builder.Receivers{}, - builtExtensions: extensions.Extensions{}, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - col := Collector{ - set: CollectorSettings{ - ConfigMapProvider: tt.parserProvider, - ConfigUnmarshaler: configunmarshaler.NewDefault(), - Factories: factories, - }, - logger: zap.NewNop(), - tracerProvider: trace.NewNoopTracerProvider(), - service: tt.service, - } - - if err = col.reloadService(ctx); err != nil { - assert.ErrorIs(t, err, sentinelError) - return - } - - // If successful need to shutdown active service. - assert.NoError(t, col.service.Shutdown(ctx)) - }) - } -} diff --git a/service/config_watcher.go b/service/config_watcher.go new file mode 100644 index 00000000000..dcf091619cb --- /dev/null +++ b/service/config_watcher.go @@ -0,0 +1,77 @@ +// Copyright The OpenTelemetry 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 service // import "go.opentelemetry.io/collector/service" + +import ( + "context" + "errors" + "fmt" + "sync" + + "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/configmapprovider" + "go.opentelemetry.io/collector/config/experimental/configsource" +) + +type configWatcher struct { + cfg *config.Config + ret configmapprovider.Retrieved + watcher chan error + stopWG sync.WaitGroup +} + +func newConfigWatcher(ctx context.Context, set CollectorSettings) (*configWatcher, error) { + ret, err := set.ConfigMapProvider.Retrieve(ctx) + if err != nil { + return nil, fmt.Errorf("cannot retrieve the configuration: %w", err) + } + + var cfg *config.Config + if cfg, err = set.ConfigUnmarshaler.Unmarshal(ret.Get(), set.Factories); err != nil { + return nil, fmt.Errorf("cannot unmarshal the configuration: %w", err) + } + + if err = cfg.Validate(); err != nil { + return nil, fmt.Errorf("invalid configuration: %w", err) + } + + cm := &configWatcher{cfg: cfg, ret: ret, watcher: make(chan error, 1)} + // If the retrieved value is watchable start a goroutine watching for updates. + if watchable, ok := ret.(configmapprovider.WatchableRetrieved); ok { + cm.stopWG.Add(1) + go func() { + defer cm.stopWG.Done() + err = watchable.WatchForUpdate() + if errors.Is(err, configsource.ErrSessionClosed) { + // This is the case of shutdown of the whole collector server, nothing to do. + return + } + cm.watcher <- err + }() + } + + return cm, nil +} + +func (cm *configWatcher) close(ctx context.Context) error { + defer func() { close(cm.watcher) }() + // If the retrieved value is watchable start a goroutine watching for updates. + if watchable, ok := cm.ret.(configmapprovider.WatchableRetrieved); ok { + return watchable.Close(ctx) + } + + cm.stopWG.Wait() + return nil +} diff --git a/service/config_watcher_test.go b/service/config_watcher_test.go new file mode 100644 index 00000000000..7bb6e1f6854 --- /dev/null +++ b/service/config_watcher_test.go @@ -0,0 +1,222 @@ +// Copyright The OpenTelemetry 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 service + +import ( + "context" + "errors" + "path" + "sync" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/configmapprovider" + "go.opentelemetry.io/collector/config/configunmarshaler" + "go.opentelemetry.io/collector/config/experimental/configsource" +) + +type errConfigMapProvider struct { + ret configmapprovider.Retrieved + err error +} + +func (ecmp *errConfigMapProvider) Retrieve(context.Context) (configmapprovider.Retrieved, error) { + return ecmp.ret, ecmp.err +} + +func (ecmp *errConfigMapProvider) Close(context.Context) error { + return nil +} + +type errConfigUnmarshaler struct { + err error +} + +func (ecu *errConfigUnmarshaler) Unmarshal(*config.Map, component.Factories) (*config.Config, error) { + return nil, ecu.err +} + +type errRetrieved struct { + retM *config.Map + errW error + errC error +} + +func (er *errRetrieved) Get() *config.Map { + return er.retM +} + +func (er *errRetrieved) WatchForUpdate() error { + return er.errW +} + +func (er *errRetrieved) Close(context.Context) error { + return er.errC +} + +func TestConfigWatcher(t *testing.T) { + factories, errF := componenttest.NopFactories() + require.NoError(t, errF) + + tests := []struct { + name string + parserProvider configmapprovider.Provider + configUnmarshaler configunmarshaler.ConfigUnmarshaler + expectNewErr bool + expectWatchErr bool + expectCloseErr bool + }{ + { + name: "retrieve_err", + parserProvider: &errConfigMapProvider{err: errors.New("retrieve_err")}, + configUnmarshaler: configunmarshaler.NewDefault(), + expectNewErr: true, + }, + { + name: "retrieve_ok_unmarshal_err", + parserProvider: configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")), + configUnmarshaler: &errConfigUnmarshaler{err: errors.New("retrieve_ok_unmarshal_err")}, + expectNewErr: true, + }, + { + name: "validation_err", + parserProvider: configmapprovider.NewFile(path.Join("testdata", "otelcol-invalid.yaml")), + configUnmarshaler: configunmarshaler.NewDefault(), + expectNewErr: true, + }, + { + name: "watch_err", + parserProvider: func() configmapprovider.Provider { + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + require.NoError(t, err) + return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get(), errW: errors.New("watch_err")}} + }(), + configUnmarshaler: configunmarshaler.NewDefault(), + expectWatchErr: true, + }, + { + name: "close_err", + parserProvider: func() configmapprovider.Provider { + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + require.NoError(t, err) + return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get(), errC: errors.New("close_err")}} + }(), + configUnmarshaler: configunmarshaler.NewDefault(), + expectCloseErr: true, + }, + { + name: "ok", + parserProvider: func() configmapprovider.Provider { + // Use errRetrieved with nil errors to have Watchable interface implemented. + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + require.NoError(t, err) + return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get()}} + }(), + configUnmarshaler: configunmarshaler.NewDefault(), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + set := CollectorSettings{ + ConfigMapProvider: tt.parserProvider, + ConfigUnmarshaler: tt.configUnmarshaler, + Factories: factories, + } + + cfgW, errN := newConfigWatcher(context.Background(), set) + if tt.expectNewErr { + assert.Error(t, errN) + return + } + assert.NoError(t, errN) + + errW := <-cfgW.watcher + if tt.expectWatchErr { + assert.Error(t, errW) + return + } + assert.NoError(t, errW) + + errC := cfgW.close(context.Background()) + if tt.expectCloseErr { + assert.Error(t, errC) + return + } + assert.NoError(t, errC) + }) + } +} + +func TestConfigWatcherNoWatcher(t *testing.T) { + factories, errF := componenttest.NopFactories() + require.NoError(t, errF) + set := CollectorSettings{ + ConfigMapProvider: configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")), + ConfigUnmarshaler: configunmarshaler.NewDefault(), + Factories: factories, + } + + watcherWG := sync.WaitGroup{} + cfgW, errN := newConfigWatcher(context.Background(), set) + assert.NoError(t, errN) + + watcherWG.Add(1) + go func() { + errW, ok := <-cfgW.watcher + // Channel is closed, no exception + assert.False(t, ok) + assert.NoError(t, errW) + watcherWG.Done() + }() + + assert.NoError(t, cfgW.close(context.Background())) + watcherWG.Wait() +} + +func TestConfigWatcherWhenClosed(t *testing.T) { + factories, errF := componenttest.NopFactories() + require.NoError(t, errF) + set := CollectorSettings{ + ConfigMapProvider: func() configmapprovider.Provider { + // Use errRetrieved with nil errors to have Watchable interface implemented. + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + require.NoError(t, err) + return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get(), errW: configsource.ErrSessionClosed}} + }(), + ConfigUnmarshaler: configunmarshaler.NewDefault(), + Factories: factories, + } + + watcherWG := sync.WaitGroup{} + cfgW, errN := newConfigWatcher(context.Background(), set) + assert.NoError(t, errN) + + watcherWG.Add(1) + go func() { + errW, ok := <-cfgW.watcher + // Channel is closed, no exception + assert.False(t, ok) + assert.NoError(t, errW) + watcherWG.Done() + }() + + assert.NoError(t, cfgW.close(context.Background())) + watcherWG.Wait() +} diff --git a/service/testdata/otelcol-invalid.yaml b/service/testdata/otelcol-invalid.yaml new file mode 100644 index 00000000000..d6cab57658b --- /dev/null +++ b/service/testdata/otelcol-invalid.yaml @@ -0,0 +1,15 @@ +receivers: + nop: + +processors: + nop: + +exporters: + nop: + +service: + pipelines: + traces: + receivers: [nop] + processors: [invalid] + exporters: [nop] From 4535f6dfe1f50731448b6f85ec9ec57935dc9965 Mon Sep 17 00:00:00 2001 From: Hu Shuai Date: Fri, 12 Nov 2021 00:45:26 +0800 Subject: [PATCH 15/38] Fix some golint issues (#4398) Signed-off-by: Hu Shuai --- model/pdata/metrics.go | 2 +- receiver/scrapererror/doc.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/pdata/metrics.go b/model/pdata/metrics.go index f9741294fde..8fbf4322033 100644 --- a/model/pdata/metrics.go +++ b/model/pdata/metrics.go @@ -281,7 +281,7 @@ func (d MetricDataPointFlags) String() string { type MetricDataPointFlag uint32 const ( - // MetricDataPointFlagsNoRecordedValue is flag for a metric aggregator which reports changes since last report time. + // MetricDataPointFlagNoRecordedValue is flag for a metric aggregator which reports changes since last report time. MetricDataPointFlagNoRecordedValue = MetricDataPointFlag(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE) ) diff --git a/receiver/scrapererror/doc.go b/receiver/scrapererror/doc.go index a66d4a30b81..75970a9ce61 100644 --- a/receiver/scrapererror/doc.go +++ b/receiver/scrapererror/doc.go @@ -12,5 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package scraperror provides custom error types for scrapers. +// Package scrapererror provides custom error types for scrapers. package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" From a0d9d438b380cde86e28695f1d3a37dec07375d8 Mon Sep 17 00:00:00 2001 From: Eric Hsueh <39718333+erichsueh3@users.noreply.github.com> Date: Thu, 11 Nov 2021 08:53:24 -0800 Subject: [PATCH 16/38] Add `collector-builder` to `internal/tools`, add collector manifest, add Make rule (#4199) * added collector builder to internal/tools package, added collector manifest, added Make rule * added go sum entry * added go mod and go sum entries * updated versions to 0.37.0 * changed replace directive to use local path * Changed manifest version, add suffix for clarity * ensured that ./bin directories exist before building collector * removed builder from internal/tools * Modified Make rule for using collector builder, modified builder manifest to have correct replaces * fixed accidental change of internal/tools dependency * removed install-tools Make rule dependency --- Makefile | 6 ++++++ internal/buildscripts/builder-config.yaml | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 internal/buildscripts/builder-config.yaml diff --git a/Makefile b/Makefile index dd3ce1e67f2..cca56b17c76 100644 --- a/Makefile +++ b/Makefile @@ -273,6 +273,12 @@ build-binary-internal-unstable: docker build -t otelcol-fpm internal/buildscripts/packaging/fpm docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) otelcol-fpm +# Builds a collector binary of the removed cmd/otelcol directory +.PHONY: build-binary-cmd-otelcol +build-binary-cmd-otelcol: + mkdir -p ./bin + pushd cmd/builder/ && go run ./ --config ../../internal/buildscripts/builder-config.yaml --output-path ../../bin && popd + .PHONY: genmdata genmdata: $(MAKE) for-all CMD="go generate ./..." diff --git a/internal/buildscripts/builder-config.yaml b/internal/buildscripts/builder-config.yaml new file mode 100644 index 00000000000..abf1d9f1d7b --- /dev/null +++ b/internal/buildscripts/builder-config.yaml @@ -0,0 +1,10 @@ +dist: + module: github.com/open-telemetry/opentelemetry-collector-releases/core + name: cmd-otelcol + description: OpenTelemetry Collector Replacing cmd/otelcol + version: 0.38.0-dev + otelcol_version: 0.38.0 + +replaces: + - go.opentelemetry.io/collector => ../ + - go.opentelemetry.io/collector/model => ../model From 12e3b82a4674d455a6546445665eb36d4d9fe727 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 11 Nov 2021 10:23:58 -0800 Subject: [PATCH 17/38] Small nits in logging exporter (#4399) * Use zapcore.Level in config to avoid manual parsing. * Use logger.Core to determine if debug is enabled. Signed-off-by: Bogdan Drutu --- exporter/loggingexporter/config.go | 4 ++- exporter/loggingexporter/config_test.go | 3 ++- exporter/loggingexporter/factory.go | 16 ++++-------- exporter/loggingexporter/logging_exporter.go | 25 ++++++++----------- .../loggingexporter/logging_exporter_test.go | 9 ++++--- 5 files changed, 26 insertions(+), 31 deletions(-) diff --git a/exporter/loggingexporter/config.go b/exporter/loggingexporter/config.go index e7e7c67fd4a..6629e7a824b 100644 --- a/exporter/loggingexporter/config.go +++ b/exporter/loggingexporter/config.go @@ -15,6 +15,8 @@ package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" import ( + "go.uber.org/zap/zapcore" + "go.opentelemetry.io/collector/config" ) @@ -23,7 +25,7 @@ type Config struct { config.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct // LogLevel defines log level of the logging exporter; options are debug, info, warn, error. - LogLevel string `mapstructure:"loglevel"` + LogLevel zapcore.Level `mapstructure:"loglevel"` // SamplingInitial defines how many samples are initially logged during each second. SamplingInitial int `mapstructure:"sampling_initial"` diff --git a/exporter/loggingexporter/config_test.go b/exporter/loggingexporter/config_test.go index b40ec0017c9..f5ffed361fd 100644 --- a/exporter/loggingexporter/config_test.go +++ b/exporter/loggingexporter/config_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config" @@ -44,7 +45,7 @@ func TestLoadConfig(t *testing.T) { assert.Equal(t, e1, &Config{ ExporterSettings: config.NewExporterSettings(config.NewComponentIDWithName(typeStr, "2")), - LogLevel: "debug", + LogLevel: zapcore.DebugLevel, SamplingInitial: 10, SamplingThereafter: 50, }) diff --git a/exporter/loggingexporter/factory.go b/exporter/loggingexporter/factory.go index 26d676ecde2..92412b79cd1 100644 --- a/exporter/loggingexporter/factory.go +++ b/exporter/loggingexporter/factory.go @@ -45,7 +45,7 @@ func NewFactory() component.ExporterFactory { func createDefaultConfig() config.Exporter { return &Config{ ExporterSettings: config.NewExporterSettings(config.NewComponentID(typeStr)), - LogLevel: "info", + LogLevel: zapcore.InfoLevel, SamplingInitial: defaultSamplingInitial, SamplingThereafter: defaultSamplingThereafter, } @@ -59,7 +59,7 @@ func createTracesExporter(_ context.Context, set component.ExporterCreateSetting return nil, err } - return newTracesExporter(config, cfg.LogLevel, exporterLogger, set) + return newTracesExporter(config, exporterLogger, set) } func createMetricsExporter(_ context.Context, set component.ExporterCreateSettings, config config.Exporter) (component.MetricsExporter, error) { @@ -70,7 +70,7 @@ func createMetricsExporter(_ context.Context, set component.ExporterCreateSettin return nil, err } - return newMetricsExporter(config, cfg.LogLevel, exporterLogger, set) + return newMetricsExporter(config, exporterLogger, set) } func createLogsExporter(_ context.Context, set component.ExporterCreateSettings, config config.Exporter) (component.LogsExporter, error) { @@ -81,20 +81,14 @@ func createLogsExporter(_ context.Context, set component.ExporterCreateSettings, return nil, err } - return newLogsExporter(config, cfg.LogLevel, exporterLogger, set) + return newLogsExporter(config, exporterLogger, set) } func createLogger(cfg *Config) (*zap.Logger, error) { - var level zapcore.Level - err := (&level).UnmarshalText([]byte(cfg.LogLevel)) - if err != nil { - return nil, err - } - // We take development config as the base since it matches the purpose // of logging exporter being used for debugging reasons (so e.g. console encoder) conf := zap.NewDevelopmentConfig() - conf.Level = zap.NewAtomicLevelAt(level) + conf.Level = zap.NewAtomicLevelAt(cfg.LogLevel) conf.Sampling = &zap.SamplingConfig{ Initial: cfg.SamplingInitial, Thereafter: cfg.SamplingThereafter, diff --git a/exporter/loggingexporter/logging_exporter.go b/exporter/loggingexporter/logging_exporter.go index 7b31a8c67c1..301e1b372b6 100644 --- a/exporter/loggingexporter/logging_exporter.go +++ b/exporter/loggingexporter/logging_exporter.go @@ -17,9 +17,9 @@ package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggin import ( "context" "os" - "strings" "go.uber.org/zap" + "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" @@ -31,7 +31,6 @@ import ( type loggingExporter struct { logger *zap.Logger - debug bool logsMarshaler pdata.LogsMarshaler metricsMarshaler pdata.MetricsMarshaler tracesMarshaler pdata.TracesMarshaler @@ -39,8 +38,7 @@ type loggingExporter struct { func (s *loggingExporter) pushTraces(_ context.Context, td pdata.Traces) error { s.logger.Info("TracesExporter", zap.Int("#spans", td.SpanCount())) - - if !s.debug { + if !s.logger.Core().Enabled(zapcore.DebugLevel) { return nil } @@ -55,7 +53,7 @@ func (s *loggingExporter) pushTraces(_ context.Context, td pdata.Traces) error { func (s *loggingExporter) pushMetrics(_ context.Context, md pdata.Metrics) error { s.logger.Info("MetricsExporter", zap.Int("#metrics", md.MetricCount())) - if !s.debug { + if !s.logger.Core().Enabled(zapcore.DebugLevel) { return nil } @@ -70,7 +68,7 @@ func (s *loggingExporter) pushMetrics(_ context.Context, md pdata.Metrics) error func (s *loggingExporter) pushLogs(_ context.Context, ld pdata.Logs) error { s.logger.Info("LogsExporter", zap.Int("#logs", ld.LogRecordCount())) - if !s.debug { + if !s.logger.Core().Enabled(zapcore.DebugLevel) { return nil } @@ -82,9 +80,8 @@ func (s *loggingExporter) pushLogs(_ context.Context, ld pdata.Logs) error { return nil } -func newLoggingExporter(level string, logger *zap.Logger) *loggingExporter { +func newLoggingExporter(logger *zap.Logger) *loggingExporter { return &loggingExporter{ - debug: strings.ToLower(level) == "debug", logger: logger, logsMarshaler: otlptext.NewTextLogsMarshaler(), metricsMarshaler: otlptext.NewTextMetricsMarshaler(), @@ -94,8 +91,8 @@ func newLoggingExporter(level string, logger *zap.Logger) *loggingExporter { // newTracesExporter creates an exporter.TracesExporter that just drops the // received data and logs debugging messages. -func newTracesExporter(config config.Exporter, level string, logger *zap.Logger, set component.ExporterCreateSettings) (component.TracesExporter, error) { - s := newLoggingExporter(level, logger) +func newTracesExporter(config config.Exporter, logger *zap.Logger, set component.ExporterCreateSettings) (component.TracesExporter, error) { + s := newLoggingExporter(logger) return exporterhelper.NewTracesExporter( config, set, @@ -111,8 +108,8 @@ func newTracesExporter(config config.Exporter, level string, logger *zap.Logger, // newMetricsExporter creates an exporter.MetricsExporter that just drops the // received data and logs debugging messages. -func newMetricsExporter(config config.Exporter, level string, logger *zap.Logger, set component.ExporterCreateSettings) (component.MetricsExporter, error) { - s := newLoggingExporter(level, logger) +func newMetricsExporter(config config.Exporter, logger *zap.Logger, set component.ExporterCreateSettings) (component.MetricsExporter, error) { + s := newLoggingExporter(logger) return exporterhelper.NewMetricsExporter( config, set, @@ -128,8 +125,8 @@ func newMetricsExporter(config config.Exporter, level string, logger *zap.Logger // newLogsExporter creates an exporter.LogsExporter that just drops the // received data and logs debugging messages. -func newLogsExporter(config config.Exporter, level string, logger *zap.Logger, set component.ExporterCreateSettings) (component.LogsExporter, error) { - s := newLoggingExporter(level, logger) +func newLogsExporter(config config.Exporter, logger *zap.Logger, set component.ExporterCreateSettings) (component.LogsExporter, error) { + s := newLoggingExporter(logger) return exporterhelper.NewLogsExporter( config, set, diff --git a/exporter/loggingexporter/logging_exporter_test.go b/exporter/loggingexporter/logging_exporter_test.go index 71cf601c305..d6ec66b5af5 100644 --- a/exporter/loggingexporter/logging_exporter_test.go +++ b/exporter/loggingexporter/logging_exporter_test.go @@ -21,6 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap" + "go.uber.org/zap/zaptest" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config" @@ -29,7 +30,7 @@ import ( ) func TestLoggingTracesExporterNoErrors(t *testing.T) { - lte, err := newTracesExporter(&config.ExporterSettings{}, "Debug", zap.NewNop(), componenttest.NewNopExporterCreateSettings()) + lte, err := newTracesExporter(&config.ExporterSettings{}, zap.NewNop(), componenttest.NewNopExporterCreateSettings()) require.NotNil(t, lte) assert.NoError(t, err) @@ -40,7 +41,7 @@ func TestLoggingTracesExporterNoErrors(t *testing.T) { } func TestLoggingMetricsExporterNoErrors(t *testing.T) { - lme, err := newMetricsExporter(&config.ExporterSettings{}, "DEBUG", zap.NewNop(), componenttest.NewNopExporterCreateSettings()) + lme, err := newMetricsExporter(&config.ExporterSettings{}, zap.NewNop(), componenttest.NewNopExporterCreateSettings()) require.NotNil(t, lme) assert.NoError(t, err) @@ -53,7 +54,7 @@ func TestLoggingMetricsExporterNoErrors(t *testing.T) { } func TestLoggingLogsExporterNoErrors(t *testing.T) { - lle, err := newLogsExporter(&config.ExporterSettings{}, "debug", zap.NewNop(), componenttest.NewNopExporterCreateSettings()) + lle, err := newLogsExporter(&config.ExporterSettings{}, zap.NewNop(), componenttest.NewNopExporterCreateSettings()) require.NotNil(t, lle) assert.NoError(t, err) @@ -66,7 +67,7 @@ func TestLoggingLogsExporterNoErrors(t *testing.T) { } func TestLoggingExporterErrors(t *testing.T) { - le := newLoggingExporter("Debug", zap.NewNop()) + le := newLoggingExporter(zaptest.NewLogger(t)) require.NotNil(t, le) errWant := errors.New("my error") From 7e7323b021e65848a5b011f03102bf05a1ac3ecb Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 11 Nov 2021 14:17:09 -0800 Subject: [PATCH 18/38] Improve message for New funcs in pdata (#4402) Signed-off-by: Bogdan Drutu --- .../cmd/pdatagen/internal/base_structs.go | 5 +- model/pdata/generated_common.go | 5 +- model/pdata/generated_log.go | 15 ++-- model/pdata/generated_metrics.go | 75 +++++++++++-------- model/pdata/generated_resource.go | 5 +- model/pdata/generated_trace.go | 30 +++++--- 6 files changed, 81 insertions(+), 54 deletions(-) diff --git a/model/internal/cmd/pdatagen/internal/base_structs.go b/model/internal/cmd/pdatagen/internal/base_structs.go index 1312f941f4f..c602219c2fc 100644 --- a/model/internal/cmd/pdatagen/internal/base_structs.go +++ b/model/internal/cmd/pdatagen/internal/base_structs.go @@ -37,13 +37,14 @@ func new${structName}(orig *${originName}) ${structName} { // New${structName} creates a new empty ${structName}. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func New${structName}() ${structName} { return new${structName}(&${originName}{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms ${structName}) MoveTo(dest ${structName}) { *dest.orig = *ms.orig *ms.orig = ${originName}{} diff --git a/model/pdata/generated_common.go b/model/pdata/generated_common.go index d986f223d96..5d099fcca4a 100644 --- a/model/pdata/generated_common.go +++ b/model/pdata/generated_common.go @@ -39,13 +39,14 @@ func newInstrumentationLibrary(orig *otlpcommon.InstrumentationLibrary) Instrume // NewInstrumentationLibrary creates a new empty InstrumentationLibrary. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewInstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&otlpcommon.InstrumentationLibrary{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms InstrumentationLibrary) MoveTo(dest InstrumentationLibrary) { *dest.orig = *ms.orig *ms.orig = otlpcommon.InstrumentationLibrary{} diff --git a/model/pdata/generated_log.go b/model/pdata/generated_log.go index ee46494ecf8..ca338ef59e9 100644 --- a/model/pdata/generated_log.go +++ b/model/pdata/generated_log.go @@ -178,13 +178,14 @@ func newResourceLogs(orig *otlplogs.ResourceLogs) ResourceLogs { // NewResourceLogs creates a new empty ResourceLogs. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewResourceLogs() ResourceLogs { return newResourceLogs(&otlplogs.ResourceLogs{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms ResourceLogs) MoveTo(dest ResourceLogs) { *dest.orig = *ms.orig *ms.orig = otlplogs.ResourceLogs{} @@ -372,13 +373,14 @@ func newInstrumentationLibraryLogs(orig *otlplogs.InstrumentationLibraryLogs) In // NewInstrumentationLibraryLogs creates a new empty InstrumentationLibraryLogs. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewInstrumentationLibraryLogs() InstrumentationLibraryLogs { return newInstrumentationLibraryLogs(&otlplogs.InstrumentationLibraryLogs{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms InstrumentationLibraryLogs) MoveTo(dest InstrumentationLibraryLogs) { *dest.orig = *ms.orig *ms.orig = otlplogs.InstrumentationLibraryLogs{} @@ -567,13 +569,14 @@ func newLogRecord(orig *otlplogs.LogRecord) LogRecord { // NewLogRecord creates a new empty LogRecord. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewLogRecord() LogRecord { return newLogRecord(&otlplogs.LogRecord{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms LogRecord) MoveTo(dest LogRecord) { *dest.orig = *ms.orig *ms.orig = otlplogs.LogRecord{} diff --git a/model/pdata/generated_metrics.go b/model/pdata/generated_metrics.go index 10fc5736cc1..71d36055570 100644 --- a/model/pdata/generated_metrics.go +++ b/model/pdata/generated_metrics.go @@ -178,13 +178,14 @@ func newResourceMetrics(orig *otlpmetrics.ResourceMetrics) ResourceMetrics { // NewResourceMetrics creates a new empty ResourceMetrics. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewResourceMetrics() ResourceMetrics { return newResourceMetrics(&otlpmetrics.ResourceMetrics{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms ResourceMetrics) MoveTo(dest ResourceMetrics) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.ResourceMetrics{} @@ -372,13 +373,14 @@ func newInstrumentationLibraryMetrics(orig *otlpmetrics.InstrumentationLibraryMe // NewInstrumentationLibraryMetrics creates a new empty InstrumentationLibraryMetrics. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewInstrumentationLibraryMetrics() InstrumentationLibraryMetrics { return newInstrumentationLibraryMetrics(&otlpmetrics.InstrumentationLibraryMetrics{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms InstrumentationLibraryMetrics) MoveTo(dest InstrumentationLibraryMetrics) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.InstrumentationLibraryMetrics{} @@ -567,13 +569,14 @@ func newMetric(orig *otlpmetrics.Metric) Metric { // NewMetric creates a new empty Metric. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewMetric() Metric { return newMetric(&otlpmetrics.Metric{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Metric) MoveTo(dest Metric) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.Metric{} @@ -635,13 +638,14 @@ func newGauge(orig *otlpmetrics.Gauge) Gauge { // NewGauge creates a new empty Gauge. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewGauge() Gauge { return newGauge(&otlpmetrics.Gauge{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Gauge) MoveTo(dest Gauge) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.Gauge{} @@ -675,13 +679,14 @@ func newSum(orig *otlpmetrics.Sum) Sum { // NewSum creates a new empty Sum. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewSum() Sum { return newSum(&otlpmetrics.Sum{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Sum) MoveTo(dest Sum) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.Sum{} @@ -737,13 +742,14 @@ func newHistogram(orig *otlpmetrics.Histogram) Histogram { // NewHistogram creates a new empty Histogram. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewHistogram() Histogram { return newHistogram(&otlpmetrics.Histogram{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Histogram) MoveTo(dest Histogram) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.Histogram{} @@ -789,13 +795,14 @@ func newExponentialHistogram(orig *otlpmetrics.ExponentialHistogram) Exponential // NewExponentialHistogram creates a new empty ExponentialHistogram. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewExponentialHistogram() ExponentialHistogram { return newExponentialHistogram(&otlpmetrics.ExponentialHistogram{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms ExponentialHistogram) MoveTo(dest ExponentialHistogram) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.ExponentialHistogram{} @@ -840,13 +847,14 @@ func newSummary(orig *otlpmetrics.Summary) Summary { // NewSummary creates a new empty Summary. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewSummary() Summary { return newSummary(&otlpmetrics.Summary{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Summary) MoveTo(dest Summary) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.Summary{} @@ -1017,13 +1025,14 @@ func newNumberDataPoint(orig *otlpmetrics.NumberDataPoint) NumberDataPoint { // NewNumberDataPoint creates a new empty NumberDataPoint. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewNumberDataPoint() NumberDataPoint { return newNumberDataPoint(&otlpmetrics.NumberDataPoint{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms NumberDataPoint) MoveTo(dest NumberDataPoint) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.NumberDataPoint{} @@ -1264,13 +1273,14 @@ func newHistogramDataPoint(orig *otlpmetrics.HistogramDataPoint) HistogramDataPo // NewHistogramDataPoint creates a new empty HistogramDataPoint. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewHistogramDataPoint() HistogramDataPoint { return newHistogramDataPoint(&otlpmetrics.HistogramDataPoint{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms HistogramDataPoint) MoveTo(dest HistogramDataPoint) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.HistogramDataPoint{} @@ -1527,13 +1537,14 @@ func newExponentialHistogramDataPoint(orig *otlpmetrics.ExponentialHistogramData // NewExponentialHistogramDataPoint creates a new empty ExponentialHistogramDataPoint. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewExponentialHistogramDataPoint() ExponentialHistogramDataPoint { return newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.ExponentialHistogramDataPoint{} @@ -1662,13 +1673,14 @@ func newBuckets(orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets) Buckets // NewBuckets creates a new empty Buckets. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewBuckets() Buckets { return newBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Buckets) MoveTo(dest Buckets) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.ExponentialHistogramDataPoint_Buckets{} @@ -1855,13 +1867,14 @@ func newSummaryDataPoint(orig *otlpmetrics.SummaryDataPoint) SummaryDataPoint { // NewSummaryDataPoint creates a new empty SummaryDataPoint. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewSummaryDataPoint() SummaryDataPoint { return newSummaryDataPoint(&otlpmetrics.SummaryDataPoint{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms SummaryDataPoint) MoveTo(dest SummaryDataPoint) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.SummaryDataPoint{} @@ -2093,13 +2106,14 @@ func newValueAtQuantile(orig *otlpmetrics.SummaryDataPoint_ValueAtQuantile) Valu // NewValueAtQuantile creates a new empty ValueAtQuantile. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewValueAtQuantile() ValueAtQuantile { return newValueAtQuantile(&otlpmetrics.SummaryDataPoint_ValueAtQuantile{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms ValueAtQuantile) MoveTo(dest ValueAtQuantile) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.SummaryDataPoint_ValueAtQuantile{} @@ -2270,13 +2284,14 @@ func newExemplar(orig *otlpmetrics.Exemplar) Exemplar { // NewExemplar creates a new empty Exemplar. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewExemplar() Exemplar { return newExemplar(&otlpmetrics.Exemplar{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Exemplar) MoveTo(dest Exemplar) { *dest.orig = *ms.orig *ms.orig = otlpmetrics.Exemplar{} diff --git a/model/pdata/generated_resource.go b/model/pdata/generated_resource.go index 1a29265e489..5bda46d6dc5 100644 --- a/model/pdata/generated_resource.go +++ b/model/pdata/generated_resource.go @@ -39,13 +39,14 @@ func newResource(orig *otlpresource.Resource) Resource { // NewResource creates a new empty Resource. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewResource() Resource { return newResource(&otlpresource.Resource{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Resource) MoveTo(dest Resource) { *dest.orig = *ms.orig *ms.orig = otlpresource.Resource{} diff --git a/model/pdata/generated_trace.go b/model/pdata/generated_trace.go index 93909bf4e95..4015d0629d6 100644 --- a/model/pdata/generated_trace.go +++ b/model/pdata/generated_trace.go @@ -178,13 +178,14 @@ func newResourceSpans(orig *otlptrace.ResourceSpans) ResourceSpans { // NewResourceSpans creates a new empty ResourceSpans. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewResourceSpans() ResourceSpans { return newResourceSpans(&otlptrace.ResourceSpans{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms ResourceSpans) MoveTo(dest ResourceSpans) { *dest.orig = *ms.orig *ms.orig = otlptrace.ResourceSpans{} @@ -372,13 +373,14 @@ func newInstrumentationLibrarySpans(orig *otlptrace.InstrumentationLibrarySpans) // NewInstrumentationLibrarySpans creates a new empty InstrumentationLibrarySpans. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewInstrumentationLibrarySpans() InstrumentationLibrarySpans { return newInstrumentationLibrarySpans(&otlptrace.InstrumentationLibrarySpans{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms InstrumentationLibrarySpans) MoveTo(dest InstrumentationLibrarySpans) { *dest.orig = *ms.orig *ms.orig = otlptrace.InstrumentationLibrarySpans{} @@ -567,13 +569,14 @@ func newSpan(orig *otlptrace.Span) Span { // NewSpan creates a new empty Span. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewSpan() Span { return newSpan(&otlptrace.Span{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms Span) MoveTo(dest Span) { *dest.orig = *ms.orig *ms.orig = otlptrace.Span{} @@ -884,13 +887,14 @@ func newSpanEvent(orig *otlptrace.Span_Event) SpanEvent { // NewSpanEvent creates a new empty SpanEvent. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewSpanEvent() SpanEvent { return newSpanEvent(&otlptrace.Span_Event{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms SpanEvent) MoveTo(dest SpanEvent) { *dest.orig = *ms.orig *ms.orig = otlptrace.Span_Event{} @@ -1096,13 +1100,14 @@ func newSpanLink(orig *otlptrace.Span_Link) SpanLink { // NewSpanLink creates a new empty SpanLink. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewSpanLink() SpanLink { return newSpanLink(&otlptrace.Span_Link{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms SpanLink) MoveTo(dest SpanLink) { *dest.orig = *ms.orig *ms.orig = otlptrace.Span_Link{} @@ -1181,13 +1186,14 @@ func newSpanStatus(orig *otlptrace.Status) SpanStatus { // NewSpanStatus creates a new empty SpanStatus. // -// This must be used only in testing code since no "Set" method available. +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. func NewSpanStatus() SpanStatus { return newSpanStatus(&otlptrace.Status{}) } // MoveTo moves all properties from the current struct to dest -// reseting the current instance to its zero value +// resetting the current instance to its zero value func (ms SpanStatus) MoveTo(dest SpanStatus) { *dest.orig = *ms.orig *ms.orig = otlptrace.Status{} From 68602ec49d454595d51cfc7cd261e0013da627ea Mon Sep 17 00:00:00 2001 From: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Date: Thu, 11 Nov 2021 20:02:01 -0500 Subject: [PATCH 19/38] Refactor configmapprovider.Provider and Retrieved interfaces (#4403) This uses a callback instead of a blocking WaitForUpdate function to notify about config changes. This simplifies the usage of the Provider, especially when watching for changes is required. A follow up PR will add watching capabilities to existing Provider implementations. --- config/configmapprovider/default_test.go | 32 +++++--- config/configmapprovider/expand.go | 13 +-- config/configmapprovider/expand_test.go | 12 ++- config/configmapprovider/file.go | 4 +- config/configmapprovider/inmemory.go | 4 +- config/configmapprovider/merge.go | 14 ++-- config/configmapprovider/merge_test.go | 8 +- config/configmapprovider/properties.go | 4 +- config/configmapprovider/properties_test.go | 14 ++-- config/configmapprovider/provider.go | 90 ++++++++++++++------- config/configmapprovider/simple.go | 10 ++- config/configtest/configtest.go | 8 +- service/collector.go | 2 +- service/config_watcher.go | 43 ++++------ service/config_watcher_test.go | 49 ++++++----- 15 files changed, 186 insertions(+), 121 deletions(-) diff --git a/config/configmapprovider/default_test.go b/config/configmapprovider/default_test.go index 04e645f4b5e..1f400f2330e 100644 --- a/config/configmapprovider/default_test.go +++ b/config/configmapprovider/default_test.go @@ -27,7 +27,7 @@ import ( func TestDefaultMapProvider(t *testing.T) { mp := NewDefault("testdata/default-config.yaml", nil) - retr, err := mp.Retrieve(context.Background()) + retr, err := mp.Retrieve(context.Background(), nil) require.NoError(t, err) expectedMap, err := config.NewMapFromBuffer(strings.NewReader(` @@ -37,14 +37,16 @@ exporters: otlp: endpoint: "localhost:4317"`)) require.NoError(t, err) - assert.Equal(t, expectedMap, retr.Get()) + m, err := retr.Get(context.Background()) + require.NoError(t, err) + assert.Equal(t, expectedMap, m) - assert.NoError(t, mp.Close(context.Background())) + assert.NoError(t, mp.Shutdown(context.Background())) } func TestDefaultMapProvider_AddNewConfig(t *testing.T) { mp := NewDefault("testdata/default-config.yaml", []string{"processors.batch.timeout=2s"}) - cp, err := mp.Retrieve(context.Background()) + cp, err := mp.Retrieve(context.Background(), nil) require.NoError(t, err) expectedMap, err := config.NewMapFromBuffer(strings.NewReader(` @@ -55,16 +57,18 @@ exporters: otlp: endpoint: "localhost:4317"`)) require.NoError(t, err) - assert.Equal(t, expectedMap, cp.Get()) + m, err := cp.Get(context.Background()) + require.NoError(t, err) + assert.Equal(t, expectedMap, m) - assert.NoError(t, mp.Close(context.Background())) + assert.NoError(t, mp.Shutdown(context.Background())) } func TestDefaultMapProvider_OverwriteConfig(t *testing.T) { mp := NewDefault( "testdata/default-config.yaml", []string{"processors.batch.timeout=2s", "exporters.otlp.endpoint=localhost:1234"}) - cp, err := mp.Retrieve(context.Background()) + cp, err := mp.Retrieve(context.Background(), nil) require.NoError(t, err) expectedMap, err := config.NewMapFromBuffer(strings.NewReader(` @@ -75,24 +79,26 @@ exporters: otlp: endpoint: "localhost:1234"`)) require.NoError(t, err) - assert.Equal(t, expectedMap, cp.Get()) + m, err := cp.Get(context.Background()) + require.NoError(t, err) + assert.Equal(t, expectedMap, m) - assert.NoError(t, mp.Close(context.Background())) + assert.NoError(t, mp.Shutdown(context.Background())) } func TestDefaultMapProvider_InexistentFile(t *testing.T) { mp := NewDefault("testdata/otelcol-config.yaml", nil) require.NotNil(t, mp) - _, err := mp.Retrieve(context.Background()) + _, err := mp.Retrieve(context.Background(), nil) require.Error(t, err) - assert.NoError(t, mp.Close(context.Background())) + assert.NoError(t, mp.Shutdown(context.Background())) } func TestDefaultMapProvider_EmptyFileName(t *testing.T) { mp := NewDefault("", nil) - _, err := mp.Retrieve(context.Background()) + _, err := mp.Retrieve(context.Background(), nil) require.Error(t, err) - assert.NoError(t, mp.Close(context.Background())) + assert.NoError(t, mp.Shutdown(context.Background())) } diff --git a/config/configmapprovider/expand.go b/config/configmapprovider/expand.go index dec9f830c98..fed14bd3256 100644 --- a/config/configmapprovider/expand.go +++ b/config/configmapprovider/expand.go @@ -31,20 +31,23 @@ func NewExpand(base Provider) Provider { } } -func (emp *expandMapProvider) Retrieve(ctx context.Context) (Retrieved, error) { - retr, err := emp.base.Retrieve(ctx) +func (emp *expandMapProvider) Retrieve(ctx context.Context, onChange func(*ChangeEvent)) (Retrieved, error) { + retr, err := emp.base.Retrieve(ctx, onChange) + if err != nil { + return nil, err + } + cfgMap, err := retr.Get(ctx) if err != nil { return nil, err } - cfgMap := retr.Get() for _, k := range cfgMap.AllKeys() { cfgMap.Set(k, expandStringValues(cfgMap.Get(k))) } return &simpleRetrieved{confMap: cfgMap}, nil } -func (emp *expandMapProvider) Close(ctx context.Context) error { - return emp.base.Close(ctx) +func (emp *expandMapProvider) Shutdown(ctx context.Context) error { + return emp.base.Shutdown(ctx) } func expandStringValues(value interface{}) interface{} { diff --git a/config/configmapprovider/expand_test.go b/config/configmapprovider/expand_test.go index 42b30b46959..b743625337e 100644 --- a/config/configmapprovider/expand_test.go +++ b/config/configmapprovider/expand_test.go @@ -57,11 +57,13 @@ func TestExpand(t *testing.T) { t.Run(test.name, func(t *testing.T) { // Retrieve the config emp := NewExpand(NewFile(path.Join("testdata", test.name))) - cp, err := emp.Retrieve(context.Background()) + cp, err := emp.Retrieve(context.Background(), nil) require.NoError(t, err, "Unable to get config") // Test that expanded configs are the same with the simple config with no env vars. - assert.Equal(t, expectedCfgMap.ToStringMap(), cp.Get().ToStringMap()) + m, err := cp.Get(context.Background()) + require.NoError(t, err) + assert.Equal(t, expectedCfgMap.ToStringMap(), m.ToStringMap()) }) } } @@ -75,7 +77,7 @@ func TestExpand_EscapedEnvVars(t *testing.T) { // Retrieve the config emp := NewExpand(NewFile(path.Join("testdata", "expand-escaped-env.yaml"))) - cp, err := emp.Retrieve(context.Background()) + cp, err := emp.Retrieve(context.Background(), nil) require.NoError(t, err, "Unable to get config") expectedMap := map[string]interface{}{ @@ -95,5 +97,7 @@ func TestExpand_EscapedEnvVars(t *testing.T) { // escaped $ alone "recv.7": "$", }} - assert.Equal(t, expectedMap, cp.Get().ToStringMap()) + m, err := cp.Get(context.Background()) + require.NoError(t, err) + assert.Equal(t, expectedMap, m.ToStringMap()) } diff --git a/config/configmapprovider/file.go b/config/configmapprovider/file.go index f9838d29168..fae7e7ad368 100644 --- a/config/configmapprovider/file.go +++ b/config/configmapprovider/file.go @@ -33,7 +33,7 @@ func NewFile(fileName string) Provider { } } -func (fmp *fileMapProvider) Retrieve(context.Context) (Retrieved, error) { +func (fmp *fileMapProvider) Retrieve(_ context.Context, _ func(*ChangeEvent)) (Retrieved, error) { if fmp.fileName == "" { return nil, errors.New("config file not specified") } @@ -46,6 +46,6 @@ func (fmp *fileMapProvider) Retrieve(context.Context) (Retrieved, error) { return &simpleRetrieved{confMap: cp}, nil } -func (*fileMapProvider) Close(context.Context) error { +func (*fileMapProvider) Shutdown(context.Context) error { return nil } diff --git a/config/configmapprovider/inmemory.go b/config/configmapprovider/inmemory.go index db54216d503..4a19ee594e5 100644 --- a/config/configmapprovider/inmemory.go +++ b/config/configmapprovider/inmemory.go @@ -30,7 +30,7 @@ func NewInMemory(buf io.Reader) Provider { return &inMemoryMapProvider{buf: buf} } -func (inp *inMemoryMapProvider) Retrieve(context.Context) (Retrieved, error) { +func (inp *inMemoryMapProvider) Retrieve(_ context.Context, onChange func(*ChangeEvent)) (Retrieved, error) { cfg, err := config.NewMapFromBuffer(inp.buf) if err != nil { return nil, err @@ -38,6 +38,6 @@ func (inp *inMemoryMapProvider) Retrieve(context.Context) (Retrieved, error) { return &simpleRetrieved{confMap: cfg}, nil } -func (inp *inMemoryMapProvider) Close(context.Context) error { +func (inp *inMemoryMapProvider) Shutdown(context.Context) error { return nil } diff --git a/config/configmapprovider/merge.go b/config/configmapprovider/merge.go index 1259e6fdba8..98b0b339686 100644 --- a/config/configmapprovider/merge.go +++ b/config/configmapprovider/merge.go @@ -35,24 +35,28 @@ func NewMerge(ps ...Provider) Provider { return &mergeMapProvider{providers: ps} } -func (mp *mergeMapProvider) Retrieve(ctx context.Context) (Retrieved, error) { +func (mp *mergeMapProvider) Retrieve(ctx context.Context, onChange func(*ChangeEvent)) (Retrieved, error) { retCfgMap := config.NewMap() for _, p := range mp.providers { - retr, err := p.Retrieve(ctx) + retr, err := p.Retrieve(ctx, onChange) if err != nil { return nil, err } - if err = retCfgMap.Merge(retr.Get()); err != nil { + cfgMap, err := retr.Get(ctx) + if err != nil { + return nil, err + } + if err = retCfgMap.Merge(cfgMap); err != nil { return nil, err } } return &simpleRetrieved{confMap: retCfgMap}, nil } -func (mp *mergeMapProvider) Close(ctx context.Context) error { +func (mp *mergeMapProvider) Shutdown(ctx context.Context) error { var errs error for _, p := range mp.providers { - errs = multierr.Append(errs, p.Close(ctx)) + errs = multierr.Append(errs, p.Shutdown(ctx)) } return errs diff --git a/config/configmapprovider/merge_test.go b/config/configmapprovider/merge_test.go index f5146f022c2..c556b4e00cc 100644 --- a/config/configmapprovider/merge_test.go +++ b/config/configmapprovider/merge_test.go @@ -28,7 +28,7 @@ import ( func TestMerge_GetError(t *testing.T) { pl := NewMerge(&errProvider{err: nil}, &errProvider{errors.New("my error")}) require.NotNil(t, pl) - cp, err := pl.Retrieve(context.Background()) + cp, err := pl.Retrieve(context.Background(), nil) assert.Error(t, err) assert.Nil(t, cp) } @@ -36,20 +36,20 @@ func TestMerge_GetError(t *testing.T) { func TestMerge_CloseError(t *testing.T) { pl := NewMerge(&errProvider{err: nil}, &errProvider{errors.New("my error")}) require.NotNil(t, pl) - assert.Error(t, pl.Close(context.Background())) + assert.Error(t, pl.Shutdown(context.Background())) } type errProvider struct { err error } -func (epl *errProvider) Retrieve(context.Context) (Retrieved, error) { +func (epl *errProvider) Retrieve(context.Context, func(*ChangeEvent)) (Retrieved, error) { if epl.err == nil { return &simpleRetrieved{confMap: config.NewMap()}, nil } return nil, epl.err } -func (epl *errProvider) Close(context.Context) error { +func (epl *errProvider) Shutdown(context.Context) error { return epl.err } diff --git a/config/configmapprovider/properties.go b/config/configmapprovider/properties.go index 49ded96b4ab..4cb13e82f3f 100644 --- a/config/configmapprovider/properties.go +++ b/config/configmapprovider/properties.go @@ -40,7 +40,7 @@ func NewProperties(properties []string) Provider { } } -func (pmp *propertiesMapProvider) Retrieve(context.Context) (Retrieved, error) { +func (pmp *propertiesMapProvider) Retrieve(_ context.Context, onChange func(*ChangeEvent)) (Retrieved, error) { if len(pmp.properties) == 0 { return &simpleRetrieved{confMap: config.NewMap()}, nil } @@ -70,6 +70,6 @@ func (pmp *propertiesMapProvider) Retrieve(context.Context) (Retrieved, error) { return &simpleRetrieved{confMap: config.NewMapFromStringMap(prop)}, nil } -func (*propertiesMapProvider) Close(context.Context) error { +func (*propertiesMapProvider) Shutdown(context.Context) error { return nil } diff --git a/config/configmapprovider/properties_test.go b/config/configmapprovider/properties_test.go index 77caca4dd30..239e73ef9f0 100644 --- a/config/configmapprovider/properties_test.go +++ b/config/configmapprovider/properties_test.go @@ -31,23 +31,25 @@ func TestPropertiesProvider(t *testing.T) { } pmp := NewProperties(setFlagStr) - retr, err := pmp.Retrieve(context.Background()) + retr, err := pmp.Retrieve(context.Background(), nil) + require.NoError(t, err) + cfgMap, err := retr.Get(context.Background()) require.NoError(t, err) - cfgMap := retr.Get() keys := cfgMap.AllKeys() assert.Len(t, keys, 4) assert.Equal(t, "2s", cfgMap.Get("processors::batch::timeout")) assert.Equal(t, "3s", cfgMap.Get("processors::batch/foo::timeout")) assert.Equal(t, "foo:9200,foo2:9200", cfgMap.Get("exporters::kafka::brokers")) assert.Equal(t, "localhost:1818", cfgMap.Get("receivers::otlp::protocols::grpc::endpoint")) - require.NoError(t, pmp.Close(context.Background())) + require.NoError(t, pmp.Shutdown(context.Background())) } func TestPropertiesProvider_empty(t *testing.T) { pmp := NewProperties(nil) - retr, err := pmp.Retrieve(context.Background()) + retr, err := pmp.Retrieve(context.Background(), nil) + require.NoError(t, err) + cfgMap, err := retr.Get(context.Background()) require.NoError(t, err) - cfgMap := retr.Get() assert.Equal(t, 0, len(cfgMap.AllKeys())) - require.NoError(t, pmp.Close(context.Background())) + require.NoError(t, pmp.Shutdown(context.Background())) } diff --git a/config/configmapprovider/provider.go b/config/configmapprovider/provider.go index 606a62c9cc1..49c79350ed9 100644 --- a/config/configmapprovider/provider.go +++ b/config/configmapprovider/provider.go @@ -20,42 +20,78 @@ import ( "go.opentelemetry.io/collector/config" ) -// Provider is an interface that helps providing configuration's parser. -// Implementations may load the parser from a file, a database or any other source. +// Provider is an interface that helps to retrieve a config map and watch for any +// changes to the config map. Implementations may load the config from a file, +// a database or any other source. type Provider interface { // Retrieve goes to the configuration source and retrieves the selected data which // contains the value to be injected in the configuration and the corresponding watcher that // will be used to monitor for updates of the retrieved value. - Retrieve(ctx context.Context) (Retrieved, error) + // + // onChange callback is called when the config changes. onChange may be called from + // a different go routine. After onChange is called Retrieved.Get should be called + // to get the new config. See description of Retrieved for more details. + // onChange may be nil, which indicates that the caller is not interested in + // knowing about the changes. + // + // If ctx is cancelled should return immediately with an error. + // Should never be called concurrently with itself or with Shutdown. + Retrieve(ctx context.Context, onChange func(*ChangeEvent)) (Retrieved, error) - // Close signals that the configuration for which it was used to retrieve values is no longer in use - // and the object should close and release any watchers that it may have created. - // This method must be called when the service ends, either in case of success or error. - Close(ctx context.Context) error + // Shutdown signals that the configuration for which this Provider was used to + // retrieve values is no longer in use and the Provider should close and release + // any resources that it may have created. + // + // This method must be called when the Collector service ends, either in case of + // success or error. Retrieve cannot be called after Shutdown. + // + // Should never be called concurrently with itself or with Retrieve. + // If ctx is cancelled should return immediately with an error. + Shutdown(ctx context.Context) error } -// Retrieved holds the result of a call to the Retrieve method of a Session object. +// Retrieved holds the result of a call to the Retrieve method of a Provider object. +// +// The typical usage is the following: +// +// r := mapProvider.Retrieve() +// r.Get() +// // wait for onChange() to be called. +// r.Close() +// r = mapProvider.Retrieve() +// r.Get() +// // wait for onChange() to be called. +// r.Close() +// // repeat Retrieve/Get/wait/Close cycle until it is time to shut down the Collector process. +// // ... +// mapProvider.Shutdown() type Retrieved interface { - // Get returns the Map. - Get() *config.Map -} + // Get returns the config Map. + // If Close is called before Get or concurrently with Get then Get + // should return immediately with ErrSessionClosed error. + // Should never be called concurrently with itself. + // If ctx is cancelled should return immediately with an error. + Get(ctx context.Context) (*config.Map, error) -// WatchableRetrieved is an extension for Retrieved that if implemented, -// the Retrieved value supports monitoring for updates. -type WatchableRetrieved interface { - Retrieved - - // WatchForUpdate waits for updates on any of the values retrieved from config sources. - // It blocks until configuration updates are received and can - // return an error if anything fails. WatchForUpdate is used once during the - // first evaluation of the configuration and is not used to watch configuration - // changes continuously. - WatchForUpdate() error - - // Close signals that the configuration for which it was used to retrieve values is no longer in use - // and the object should close and release any watchers that it may have created. + // Close signals that the configuration for which it was used to retrieve values is + // no longer in use and the object should close and release any watchers that it + // may have created. + // // This method must be called when the service ends, either in case of success or error. - // The method may be called while WatchForUpdate() class is in progress and is blocked. - // In that case WatchForUpdate() method must abort as soon as possible and return ErrSessionClosed. + // + // Should never be called concurrently with itself. + // May be called before, after or concurrently with Get. + // If ctx is cancelled should return immediately with an error. + // + // Calling Close on an already closed object should have no effect and should return nil. Close(ctx context.Context) error } + +// ChangeEvent describes the particular change event that happened with the config. +// TODO: see if this can be eliminated. +type ChangeEvent struct { + // Error is nil if the config is changed and needs to be re-fetched using Get. + // It is set to configsource.ErrSessionClosed if Close was called. + // Any other error indicates that there was a problem with retrieving the config. + Error error +} diff --git a/config/configmapprovider/simple.go b/config/configmapprovider/simple.go index 383313533b3..e289e795002 100644 --- a/config/configmapprovider/simple.go +++ b/config/configmapprovider/simple.go @@ -15,6 +15,8 @@ package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( + "context" + "go.opentelemetry.io/collector/config" ) @@ -23,6 +25,10 @@ type simpleRetrieved struct { confMap *config.Map } -func (sr *simpleRetrieved) Get() *config.Map { - return sr.confMap +func (sr *simpleRetrieved) Get(ctx context.Context) (*config.Map, error) { + return sr.confMap, nil +} + +func (sr *simpleRetrieved) Close(ctx context.Context) error { + return nil } diff --git a/config/configtest/configtest.go b/config/configtest/configtest.go index d68b084f7cd..8cbedef61a8 100644 --- a/config/configtest/configtest.go +++ b/config/configtest/configtest.go @@ -35,12 +35,16 @@ var configFieldTagRegExp = regexp.MustCompile("^[a-z0-9][a-z0-9_]*$") // LoadConfig loads a config from file, and does NOT validate the configuration. func LoadConfig(fileName string, factories component.Factories) (*config.Config, error) { // Read yaml config from file - cp, err := configmapprovider.NewExpand(configmapprovider.NewFile(fileName)).Retrieve(context.Background()) + cp, err := configmapprovider.NewExpand(configmapprovider.NewFile(fileName)).Retrieve(context.Background(), nil) if err != nil { return nil, err } // Unmarshal the config using the given factories. - return configunmarshaler.NewDefault().Unmarshal(cp.Get(), factories) + m, err := cp.Get(context.Background()) + if err != nil { + return nil, err + } + return configunmarshaler.NewDefault().Unmarshal(m, factories) } // LoadConfigAndValidate loads a config from the file, and validates the configuration. diff --git a/service/collector.go b/service/collector.go index 06d7fe9bed6..0439fff287b 100644 --- a/service/collector.go +++ b/service/collector.go @@ -254,7 +254,7 @@ func (col *Collector) shutdown(ctx context.Context) error { errs = multierr.Append(errs, fmt.Errorf("failed to close config provider watcher: %w", err)) } - if err := col.set.ConfigMapProvider.Close(ctx); err != nil { + if err := col.set.ConfigMapProvider.Shutdown(ctx); err != nil { errs = multierr.Append(errs, fmt.Errorf("failed to shutdown config provider: %w", err)) } diff --git a/service/config_watcher.go b/service/config_watcher.go index dcf091619cb..b8bff8a7698 100644 --- a/service/config_watcher.go +++ b/service/config_watcher.go @@ -16,9 +16,7 @@ package service // import "go.opentelemetry.io/collector/service" import ( "context" - "errors" "fmt" - "sync" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configmapprovider" @@ -29,17 +27,22 @@ type configWatcher struct { cfg *config.Config ret configmapprovider.Retrieved watcher chan error - stopWG sync.WaitGroup } func newConfigWatcher(ctx context.Context, set CollectorSettings) (*configWatcher, error) { - ret, err := set.ConfigMapProvider.Retrieve(ctx) + cm := &configWatcher{watcher: make(chan error, 1)} + + ret, err := set.ConfigMapProvider.Retrieve(ctx, cm.onChange) if err != nil { return nil, fmt.Errorf("cannot retrieve the configuration: %w", err) } var cfg *config.Config - if cfg, err = set.ConfigUnmarshaler.Unmarshal(ret.Get(), set.Factories); err != nil { + m, err := ret.Get(ctx) + if err != nil { + return nil, fmt.Errorf("cannot get the configuration: %w", err) + } + if cfg, err = set.ConfigUnmarshaler.Unmarshal(m, set.Factories); err != nil { return nil, fmt.Errorf("cannot unmarshal the configuration: %w", err) } @@ -47,31 +50,19 @@ func newConfigWatcher(ctx context.Context, set CollectorSettings) (*configWatche return nil, fmt.Errorf("invalid configuration: %w", err) } - cm := &configWatcher{cfg: cfg, ret: ret, watcher: make(chan error, 1)} - // If the retrieved value is watchable start a goroutine watching for updates. - if watchable, ok := ret.(configmapprovider.WatchableRetrieved); ok { - cm.stopWG.Add(1) - go func() { - defer cm.stopWG.Done() - err = watchable.WatchForUpdate() - if errors.Is(err, configsource.ErrSessionClosed) { - // This is the case of shutdown of the whole collector server, nothing to do. - return - } - cm.watcher <- err - }() - } + cm.cfg = cfg + cm.ret = ret return cm, nil } -func (cm *configWatcher) close(ctx context.Context) error { - defer func() { close(cm.watcher) }() - // If the retrieved value is watchable start a goroutine watching for updates. - if watchable, ok := cm.ret.(configmapprovider.WatchableRetrieved); ok { - return watchable.Close(ctx) +func (cm *configWatcher) onChange(event *configmapprovider.ChangeEvent) { + if event.Error != configsource.ErrSessionClosed { + cm.watcher <- event.Error } +} - cm.stopWG.Wait() - return nil +func (cm *configWatcher) close(ctx context.Context) error { + close(cm.watcher) + return cm.ret.Close(ctx) } diff --git a/service/config_watcher_test.go b/service/config_watcher_test.go index 7bb6e1f6854..de8821b720d 100644 --- a/service/config_watcher_test.go +++ b/service/config_watcher_test.go @@ -33,15 +33,18 @@ import ( ) type errConfigMapProvider struct { - ret configmapprovider.Retrieved + ret *errRetrieved err error } -func (ecmp *errConfigMapProvider) Retrieve(context.Context) (configmapprovider.Retrieved, error) { +func (ecmp *errConfigMapProvider) Retrieve(_ context.Context, onChange func(*configmapprovider.ChangeEvent)) (configmapprovider.Retrieved, error) { + if ecmp.ret != nil { + ecmp.ret.onChange = onChange + } return ecmp.ret, ecmp.err } -func (ecmp *errConfigMapProvider) Close(context.Context) error { +func (ecmp *errConfigMapProvider) Shutdown(context.Context) error { return nil } @@ -54,17 +57,15 @@ func (ecu *errConfigUnmarshaler) Unmarshal(*config.Map, component.Factories) (*c } type errRetrieved struct { - retM *config.Map - errW error - errC error -} - -func (er *errRetrieved) Get() *config.Map { - return er.retM + retM *config.Map + errW error + errC error + onChange func(event *configmapprovider.ChangeEvent) } -func (er *errRetrieved) WatchForUpdate() error { - return er.errW +func (er *errRetrieved) Get(ctx context.Context) (*config.Map, error) { + er.onChange(&configmapprovider.ChangeEvent{Error: er.errW}) + return er.retM, nil } func (er *errRetrieved) Close(context.Context) error { @@ -104,9 +105,11 @@ func TestConfigWatcher(t *testing.T) { { name: "watch_err", parserProvider: func() configmapprovider.Provider { - ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background(), nil) + require.NoError(t, err) + m, err := ret.Get(context.Background()) require.NoError(t, err) - return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get(), errW: errors.New("watch_err")}} + return &errConfigMapProvider{ret: &errRetrieved{retM: m, errW: errors.New("watch_err")}} }(), configUnmarshaler: configunmarshaler.NewDefault(), expectWatchErr: true, @@ -114,9 +117,11 @@ func TestConfigWatcher(t *testing.T) { { name: "close_err", parserProvider: func() configmapprovider.Provider { - ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background(), nil) require.NoError(t, err) - return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get(), errC: errors.New("close_err")}} + m, err := ret.Get(context.Background()) + require.NoError(t, err) + return &errConfigMapProvider{ret: &errRetrieved{retM: m, errC: errors.New("close_err")}} }(), configUnmarshaler: configunmarshaler.NewDefault(), expectCloseErr: true, @@ -125,9 +130,11 @@ func TestConfigWatcher(t *testing.T) { name: "ok", parserProvider: func() configmapprovider.Provider { // Use errRetrieved with nil errors to have Watchable interface implemented. - ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background(), nil) + require.NoError(t, err) + m, err := ret.Get(context.Background()) require.NoError(t, err) - return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get()}} + return &errConfigMapProvider{ret: &errRetrieved{retM: m}} }(), configUnmarshaler: configunmarshaler.NewDefault(), }, @@ -196,9 +203,11 @@ func TestConfigWatcherWhenClosed(t *testing.T) { set := CollectorSettings{ ConfigMapProvider: func() configmapprovider.Provider { // Use errRetrieved with nil errors to have Watchable interface implemented. - ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background()) + ret, err := configmapprovider.NewFile(path.Join("testdata", "otelcol-nop.yaml")).Retrieve(context.Background(), nil) + require.NoError(t, err) + m, err := ret.Get(context.Background()) require.NoError(t, err) - return &errConfigMapProvider{ret: &errRetrieved{retM: ret.Get(), errW: configsource.ErrSessionClosed}} + return &errConfigMapProvider{ret: &errRetrieved{retM: m, errW: configsource.ErrSessionClosed}} }(), ConfigUnmarshaler: configunmarshaler.NewDefault(), Factories: factories, From bcb90636ae66fada9637b0b71ae4f1c36dacd888 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 11 Nov 2021 17:02:15 -0800 Subject: [PATCH 20/38] Plugin ExponentialHistogram to Metric, add MetricType (#4404) Signed-off-by: Bogdan Drutu --- model/pdata/metrics.go | 20 ++++++++++++++++ model/pdata/metrics_test.go | 46 ++++++++++++++++++++++++++++++++++--- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/model/pdata/metrics.go b/model/pdata/metrics.go index 8fbf4322033..f3d501585a2 100644 --- a/model/pdata/metrics.go +++ b/model/pdata/metrics.go @@ -111,6 +111,8 @@ func (md Metrics) DataPointCount() (dataPointCount int) { dataPointCount += m.Sum().DataPoints().Len() case MetricDataTypeHistogram: dataPointCount += m.Histogram().DataPoints().Len() + case MetricDataTypeExponentialHistogram: + dataPointCount += m.ExponentialHistogram().DataPoints().Len() case MetricDataTypeSummary: dataPointCount += m.Summary().DataPoints().Len() } @@ -128,6 +130,7 @@ const ( MetricDataTypeGauge MetricDataTypeSum MetricDataTypeHistogram + MetricDataTypeExponentialHistogram MetricDataTypeSummary ) @@ -142,6 +145,8 @@ func (mdt MetricDataType) String() string { return "Sum" case MetricDataTypeHistogram: return "Histogram" + case MetricDataTypeExponentialHistogram: + return "ExponentialHistogram" case MetricDataTypeSummary: return "Summary" } @@ -158,6 +163,8 @@ func (ms Metric) DataType() MetricDataType { return MetricDataTypeSum case *otlpmetrics.Metric_Histogram: return MetricDataTypeHistogram + case *otlpmetrics.Metric_ExponentialHistogram: + return MetricDataTypeExponentialHistogram case *otlpmetrics.Metric_Summary: return MetricDataTypeSummary } @@ -174,6 +181,8 @@ func (ms Metric) SetDataType(ty MetricDataType) { ms.orig.Data = &otlpmetrics.Metric_Sum{Sum: &otlpmetrics.Sum{}} case MetricDataTypeHistogram: ms.orig.Data = &otlpmetrics.Metric_Histogram{Histogram: &otlpmetrics.Histogram{}} + case MetricDataTypeExponentialHistogram: + ms.orig.Data = &otlpmetrics.Metric_ExponentialHistogram{ExponentialHistogram: &otlpmetrics.ExponentialHistogram{}} case MetricDataTypeSummary: ms.orig.Data = &otlpmetrics.Metric_Summary{Summary: &otlpmetrics.Summary{}} } @@ -200,6 +209,13 @@ func (ms Metric) Histogram() Histogram { return newHistogram(ms.orig.Data.(*otlpmetrics.Metric_Histogram).Histogram) } +// ExponentialHistogram returns the data as ExponentialHistogram. +// Calling this function when DataType() != MetricDataTypeExponentialHistogram will cause a panic. +// Calling this function on zero-initialized Metric will cause a panic. +func (ms Metric) ExponentialHistogram() ExponentialHistogram { + return newExponentialHistogram(ms.orig.Data.(*otlpmetrics.Metric_ExponentialHistogram).ExponentialHistogram) +} + // Summary returns the data as Summary. // Calling this function when DataType() != MetricDataTypeSummary will cause a panic. // Calling this function on zero-initialized Metric will cause a panic. @@ -221,6 +237,10 @@ func copyData(src, dest *otlpmetrics.Metric) { data := &otlpmetrics.Metric_Histogram{Histogram: &otlpmetrics.Histogram{}} newHistogram(srcData.Histogram).CopyTo(newHistogram(data.Histogram)) dest.Data = data + case *otlpmetrics.Metric_ExponentialHistogram: + data := &otlpmetrics.Metric_ExponentialHistogram{ExponentialHistogram: &otlpmetrics.ExponentialHistogram{}} + newExponentialHistogram(srcData.ExponentialHistogram).CopyTo(newExponentialHistogram(data.ExponentialHistogram)) + dest.Data = data case *otlpmetrics.Metric_Summary: data := &otlpmetrics.Metric_Summary{Summary: &otlpmetrics.Summary{}} newSummary(srcData.Summary).CopyTo(newSummary(data.Summary)) diff --git a/model/pdata/metrics_test.go b/model/pdata/metrics_test.go index f658ced841a..112f7fb2363 100644 --- a/model/pdata/metrics_test.go +++ b/model/pdata/metrics_test.go @@ -62,6 +62,22 @@ func TestCopyData(t *testing.T) { }, }, }, + { + name: "ExponentialHistogram", + src: &otlpmetrics.Metric{ + Data: &otlpmetrics.Metric_ExponentialHistogram{ + ExponentialHistogram: &otlpmetrics.ExponentialHistogram{}, + }, + }, + }, + { + name: "Summary", + src: &otlpmetrics.Metric{ + Data: &otlpmetrics.Metric_Summary{ + Summary: &otlpmetrics.Summary{}, + }, + }, + }, } for _, test := range tests { @@ -77,14 +93,22 @@ func TestCopyData(t *testing.T) { func TestDataType(t *testing.T) { m := NewMetric() + assert.Equal(t, "None", MetricDataTypeNone.String()) assert.Equal(t, MetricDataTypeNone, m.DataType()) m.SetDataType(MetricDataTypeGauge) + assert.Equal(t, "Gauge", MetricDataTypeGauge.String()) assert.Equal(t, MetricDataTypeGauge, m.DataType()) m.SetDataType(MetricDataTypeSum) + assert.Equal(t, "Sum", MetricDataTypeSum.String()) assert.Equal(t, MetricDataTypeSum, m.DataType()) m.SetDataType(MetricDataTypeHistogram) + assert.Equal(t, "Histogram", MetricDataTypeHistogram.String()) assert.Equal(t, MetricDataTypeHistogram, m.DataType()) + m.SetDataType(MetricDataTypeExponentialHistogram) + assert.Equal(t, "ExponentialHistogram", MetricDataTypeExponentialHistogram.String()) + assert.Equal(t, MetricDataTypeExponentialHistogram, m.DataType()) m.SetDataType(MetricDataTypeSummary) + assert.Equal(t, "Summary", MetricDataTypeSummary.String()) assert.Equal(t, MetricDataTypeSummary, m.DataType()) } @@ -189,10 +213,26 @@ func TestMetricAndDataPointCount(t *testing.T) { ilm.AppendEmpty() } assert.EqualValues(t, 0, md.DataPointCount()) - ilm.At(1).SetDataType(MetricDataTypeGauge) - doubleGauge := ilm.At(1).Gauge() - doubleGauge.DataPoints().AppendEmpty() + + ilm.At(0).SetDataType(MetricDataTypeGauge) + ilm.At(0).Gauge().DataPoints().AppendEmpty() assert.EqualValues(t, 1, md.DataPointCount()) + + ilm.At(1).SetDataType(MetricDataTypeSum) + ilm.At(1).Sum().DataPoints().AppendEmpty() + assert.EqualValues(t, 2, md.DataPointCount()) + + ilm.At(2).SetDataType(MetricDataTypeHistogram) + ilm.At(2).Histogram().DataPoints().AppendEmpty() + assert.EqualValues(t, 3, md.DataPointCount()) + + ilm.At(3).SetDataType(MetricDataTypeExponentialHistogram) + ilm.At(3).ExponentialHistogram().DataPoints().AppendEmpty() + assert.EqualValues(t, 4, md.DataPointCount()) + + ilm.At(4).SetDataType(MetricDataTypeSummary) + ilm.At(4).Summary().DataPoints().AppendEmpty() + assert.EqualValues(t, 5, md.DataPointCount()) } func TestDataPointCountWithEmpty(t *testing.T) { From 1a58ddab2ca929025eac415439b5ae60a79e74cd Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 12 Nov 2021 09:25:31 -0800 Subject: [PATCH 21/38] Update batch processor to handle ExponentialHistogram (#4405) Signed-off-by: Bogdan Drutu --- internal/testdata/metric.go | 67 ++++++++++++++----- processor/batchprocessor/splitmetrics.go | 19 ++++++ processor/batchprocessor/splitmetrics_test.go | 52 ++++++++------ 3 files changed, 100 insertions(+), 38 deletions(-) diff --git a/internal/testdata/metric.go b/internal/testdata/metric.go index e30e005e878..a6e8bd5071b 100644 --- a/internal/testdata/metric.go +++ b/internal/testdata/metric.go @@ -32,12 +32,13 @@ var ( ) const ( - TestGaugeDoubleMetricName = "gauge-double" - TestGaugeIntMetricName = "gauge-int" - TestSumDoubleMetricName = "counter-double" - TestSumIntMetricName = "counter-int" - TestDoubleHistogramMetricName = "double-histogram" - TestDoubleSummaryMetricName = "double-summary" + TestGaugeDoubleMetricName = "gauge-double" + TestGaugeIntMetricName = "gauge-int" + TestSumDoubleMetricName = "sum-double" + TestSumIntMetricName = "sum-int" + TestHistogramMetricName = "histogram" + TestExponentialHistogramMetricName = "exponential-histogram" + TestSummaryMetricName = "summary" ) func GenerateMetricsOneEmptyResourceMetrics() pdata.Metrics { @@ -86,7 +87,7 @@ func GenerateMetricsOneCounterOneSummaryMetrics() pdata.Metrics { md := GenerateMetricsOneEmptyInstrumentationLibrary() rm0ils0 := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0) initSumIntMetric(rm0ils0.Metrics().AppendEmpty()) - initDoubleSummaryMetric(rm0ils0.Metrics().AppendEmpty()) + initSummaryMetric(rm0ils0.Metrics().AppendEmpty()) return md } @@ -106,8 +107,8 @@ func GenerateMetricsAllTypesNoDataPoints() pdata.Metrics { initMetric(ms.AppendEmpty(), TestGaugeIntMetricName, pdata.MetricDataTypeGauge) initMetric(ms.AppendEmpty(), TestSumDoubleMetricName, pdata.MetricDataTypeSum) initMetric(ms.AppendEmpty(), TestSumIntMetricName, pdata.MetricDataTypeSum) - initMetric(ms.AppendEmpty(), TestDoubleHistogramMetricName, pdata.MetricDataTypeHistogram) - initMetric(ms.AppendEmpty(), TestDoubleSummaryMetricName, pdata.MetricDataTypeSummary) + initMetric(ms.AppendEmpty(), TestHistogramMetricName, pdata.MetricDataTypeHistogram) + initMetric(ms.AppendEmpty(), TestSummaryMetricName, pdata.MetricDataTypeSummary) return md } @@ -129,10 +130,10 @@ func GenerateMetricsAllTypesEmptyDataPoint() pdata.Metrics { initMetric(intSum, TestSumIntMetricName, pdata.MetricDataTypeSum) intSum.Sum().DataPoints().AppendEmpty() histogram := ms.AppendEmpty() - initMetric(histogram, TestDoubleHistogramMetricName, pdata.MetricDataTypeHistogram) + initMetric(histogram, TestHistogramMetricName, pdata.MetricDataTypeHistogram) histogram.Histogram().DataPoints().AppendEmpty() summary := ms.AppendEmpty() - initMetric(summary, TestDoubleSummaryMetricName, pdata.MetricDataTypeSummary) + initMetric(summary, TestSummaryMetricName, pdata.MetricDataTypeSummary) summary.Summary().DataPoints().AppendEmpty() return md } @@ -153,9 +154,9 @@ func GeneratMetricsAllTypesWithSampleDatapoints() pdata.Metrics { initGaugeDoubleMetric(ms.AppendEmpty()) initSumIntMetric(ms.AppendEmpty()) initSumDoubleMetric(ms.AppendEmpty()) - initDoubleHistogramMetric(ms.AppendEmpty()) - initDoubleSummaryMetric(ms.AppendEmpty()) - + initHistogramMetric(ms.AppendEmpty()) + initExponentialHistogramMetric(ms.AppendEmpty()) + initSummaryMetric(ms.AppendEmpty()) return md } @@ -224,8 +225,8 @@ func initSumDoubleMetric(dm pdata.Metric) { ddp1.SetDoubleVal(4.56) } -func initDoubleHistogramMetric(hm pdata.Metric) { - initMetric(hm, TestDoubleHistogramMetricName, pdata.MetricDataTypeHistogram) +func initHistogramMetric(hm pdata.Metric) { + initMetric(hm, TestHistogramMetricName, pdata.MetricDataTypeHistogram) hdps := hm.Histogram().DataPoints() hdp0 := hdps.AppendEmpty() @@ -234,6 +235,7 @@ func initDoubleHistogramMetric(hm pdata.Metric) { hdp0.SetTimestamp(TestMetricTimestamp) hdp0.SetCount(1) hdp0.SetSum(15) + hdp1 := hdps.AppendEmpty() initMetricAttributes2(hdp1.Attributes()) hdp1.SetStartTimestamp(TestMetricStartTimestamp) @@ -248,8 +250,33 @@ func initDoubleHistogramMetric(hm pdata.Metric) { hdp1.SetExplicitBounds([]float64{1}) } -func initDoubleSummaryMetric(sm pdata.Metric) { - initMetric(sm, TestDoubleSummaryMetricName, pdata.MetricDataTypeSummary) +func initExponentialHistogramMetric(hm pdata.Metric) { + initMetric(hm, TestExponentialHistogramMetricName, pdata.MetricDataTypeExponentialHistogram) + + hdps := hm.ExponentialHistogram().DataPoints() + hdp0 := hdps.AppendEmpty() + initMetricAttributes13(hdp0.Attributes()) + hdp0.SetStartTimestamp(TestMetricStartTimestamp) + hdp0.SetTimestamp(TestMetricTimestamp) + hdp0.SetCount(2) + hdp0.SetSum(15) + hdp0.SetZeroCount(1) + hdp1 := hdps.AppendEmpty() + + initMetricAttributes2(hdp1.Attributes()) + hdp1.SetStartTimestamp(TestMetricStartTimestamp) + hdp1.SetTimestamp(TestMetricTimestamp) + hdp1.SetCount(2) + hdp1.SetSum(15) + hdp1.SetZeroCount(1) + exemplar := hdp1.Exemplars().AppendEmpty() + exemplar.SetTimestamp(TestMetricExemplarTimestamp) + exemplar.SetDoubleVal(15) + initMetricAttachment(exemplar.FilteredAttributes()) +} + +func initSummaryMetric(sm pdata.Metric) { + initMetric(sm, TestSummaryMetricName, pdata.MetricDataTypeSummary) sdps := sm.Summary().DataPoints() sdp0 := sdps.AppendEmpty() @@ -258,6 +285,7 @@ func initDoubleSummaryMetric(sm pdata.Metric) { sdp0.SetTimestamp(TestMetricTimestamp) sdp0.SetCount(1) sdp0.SetSum(15) + sdp1 := sdps.AppendEmpty() initMetricAttributes2(sdp1.Attributes()) sdp1.SetStartTimestamp(TestMetricStartTimestamp) @@ -283,6 +311,9 @@ func initMetric(m pdata.Metric, name string, ty pdata.MetricDataType) { case pdata.MetricDataTypeHistogram: histo := m.Histogram() histo.SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) + case pdata.MetricDataTypeExponentialHistogram: + histo := m.ExponentialHistogram() + histo.SetAggregationTemporality(pdata.MetricAggregationTemporalityDelta) } } diff --git a/processor/batchprocessor/splitmetrics.go b/processor/batchprocessor/splitmetrics.go index 3b60ba073f2..bbf8d33322e 100644 --- a/processor/batchprocessor/splitmetrics.go +++ b/processor/batchprocessor/splitmetrics.go @@ -115,6 +115,8 @@ func metricDPC(ms pdata.Metric) int { return ms.Sum().DataPoints().Len() case pdata.MetricDataTypeHistogram: return ms.Histogram().DataPoints().Len() + case pdata.MetricDataTypeExponentialHistogram: + return ms.ExponentialHistogram().DataPoints().Len() case pdata.MetricDataTypeSummary: return ms.Summary().DataPoints().Len() } @@ -139,6 +141,9 @@ func splitMetric(ms, dest pdata.Metric, size int) (int, bool) { case pdata.MetricDataTypeHistogram: dest.Histogram().SetAggregationTemporality(ms.Histogram().AggregationTemporality()) return splitHistogramDataPoints(ms.Histogram().DataPoints(), dest.Histogram().DataPoints(), size) + case pdata.MetricDataTypeExponentialHistogram: + dest.ExponentialHistogram().SetAggregationTemporality(ms.ExponentialHistogram().AggregationTemporality()) + return splitExponentialHistogramDataPoints(ms.ExponentialHistogram().DataPoints(), dest.ExponentialHistogram().DataPoints(), size) case pdata.MetricDataTypeSummary: return splitSummaryDataPoints(ms.Summary().DataPoints(), dest.Summary().DataPoints(), size) } @@ -173,6 +178,20 @@ func splitHistogramDataPoints(src, dst pdata.HistogramDataPointSlice, size int) return size, false } +func splitExponentialHistogramDataPoints(src, dst pdata.ExponentialHistogramDataPointSlice, size int) (int, bool) { + dst.EnsureCapacity(size) + i := 0 + src.RemoveIf(func(dp pdata.ExponentialHistogramDataPoint) bool { + if i < size { + dp.MoveTo(dst.AppendEmpty()) + i++ + return true + } + return false + }) + return size, false +} + func splitSummaryDataPoints(src, dst pdata.SummaryDataPointSlice, size int) (int, bool) { dst.EnsureCapacity(size) i := 0 diff --git a/processor/batchprocessor/splitmetrics_test.go b/processor/batchprocessor/splitmetrics_test.go index 243ccccbb50..11fffe113d8 100644 --- a/processor/batchprocessor/splitmetrics_test.go +++ b/processor/batchprocessor/splitmetrics_test.go @@ -173,20 +173,20 @@ func TestSplitMetricsAllTypes(t *testing.T) { } splitSize := 2 - // Start with 6 metric types, and 2 points per-metric. Split out the first, + // Start with 7 metric types, and 2 points per-metric. Split out the first, // and then split by 2 for the rest so that each metric is split in half. // Verify that descriptors are preserved for all data types across splits. split := splitMetrics(1, md) assert.Equal(t, 1, split.MetricCount()) - assert.Equal(t, 6, md.MetricCount()) + assert.Equal(t, 7, md.MetricCount()) gaugeInt := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) assert.Equal(t, 1, gaugeInt.Gauge().DataPoints().Len()) assert.Equal(t, "test-metric-int-0-0", gaugeInt.Name()) split = splitMetrics(splitSize, md) assert.Equal(t, 2, split.MetricCount()) - assert.Equal(t, 5, md.MetricCount()) + assert.Equal(t, 6, md.MetricCount()) gaugeInt = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) gaugeDouble := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) assert.Equal(t, 1, gaugeInt.Gauge().DataPoints().Len()) @@ -196,7 +196,7 @@ func TestSplitMetricsAllTypes(t *testing.T) { split = splitMetrics(splitSize, md) assert.Equal(t, 2, split.MetricCount()) - assert.Equal(t, 4, md.MetricCount()) + assert.Equal(t, 5, md.MetricCount()) gaugeDouble = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) sumInt := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) assert.Equal(t, 1, gaugeDouble.Gauge().DataPoints().Len()) @@ -208,7 +208,7 @@ func TestSplitMetricsAllTypes(t *testing.T) { split = splitMetrics(splitSize, md) assert.Equal(t, 2, split.MetricCount()) - assert.Equal(t, 3, md.MetricCount()) + assert.Equal(t, 4, md.MetricCount()) sumInt = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) sumDouble := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) assert.Equal(t, 1, sumInt.Sum().DataPoints().Len()) @@ -222,32 +222,44 @@ func TestSplitMetricsAllTypes(t *testing.T) { split = splitMetrics(splitSize, md) assert.Equal(t, 2, split.MetricCount()) - assert.Equal(t, 2, md.MetricCount()) + assert.Equal(t, 3, md.MetricCount()) sumDouble = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) - doubleHistogram := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + histogram := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) assert.Equal(t, 1, sumDouble.Sum().DataPoints().Len()) assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, sumDouble.Sum().AggregationTemporality()) assert.Equal(t, true, sumDouble.Sum().IsMonotonic()) assert.Equal(t, "test-metric-int-0-3", sumDouble.Name()) - assert.Equal(t, 1, doubleHistogram.Histogram().DataPoints().Len()) - assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, doubleHistogram.Histogram().AggregationTemporality()) - assert.Equal(t, "test-metric-int-0-4", doubleHistogram.Name()) + assert.Equal(t, 1, histogram.Histogram().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, histogram.Histogram().AggregationTemporality()) + assert.Equal(t, "test-metric-int-0-4", histogram.Name()) + + split = splitMetrics(splitSize, md) + assert.Equal(t, 2, split.MetricCount()) + assert.Equal(t, 2, md.MetricCount()) + histogram = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + exponentialHistogram := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + assert.Equal(t, 1, histogram.Histogram().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, histogram.Histogram().AggregationTemporality()) + assert.Equal(t, "test-metric-int-0-4", histogram.Name()) + assert.Equal(t, 1, exponentialHistogram.ExponentialHistogram().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityDelta, exponentialHistogram.ExponentialHistogram().AggregationTemporality()) + assert.Equal(t, "test-metric-int-0-5", exponentialHistogram.Name()) split = splitMetrics(splitSize, md) assert.Equal(t, 2, split.MetricCount()) assert.Equal(t, 1, md.MetricCount()) - doubleHistogram = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) - doubleSummary := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) - assert.Equal(t, 1, doubleHistogram.Histogram().DataPoints().Len()) - assert.Equal(t, pdata.MetricAggregationTemporalityCumulative, doubleHistogram.Histogram().AggregationTemporality()) - assert.Equal(t, "test-metric-int-0-4", doubleHistogram.Name()) - assert.Equal(t, 1, doubleSummary.Summary().DataPoints().Len()) - assert.Equal(t, "test-metric-int-0-5", doubleSummary.Name()) + exponentialHistogram = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + summary := split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(1) + assert.Equal(t, 1, exponentialHistogram.ExponentialHistogram().DataPoints().Len()) + assert.Equal(t, pdata.MetricAggregationTemporalityDelta, exponentialHistogram.ExponentialHistogram().AggregationTemporality()) + assert.Equal(t, "test-metric-int-0-5", exponentialHistogram.Name()) + assert.Equal(t, 1, summary.Summary().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-6", summary.Name()) split = splitMetrics(splitSize, md) - doubleSummary = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) - assert.Equal(t, 1, doubleSummary.Summary().DataPoints().Len()) - assert.Equal(t, "test-metric-int-0-5", doubleSummary.Name()) + summary = split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0) + assert.Equal(t, 1, summary.Summary().DataPoints().Len()) + assert.Equal(t, "test-metric-int-0-6", summary.Name()) } func TestSplitMetricsBatchSizeSmallerThanDataPointCount(t *testing.T) { From f0ef52c2ca8182c53e8cda4b5a66ae2e0ff20db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Fri, 12 Nov 2021 18:26:22 +0100 Subject: [PATCH 22/38] builder: fix installation instructions in readme (#4414) --- cmd/builder/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/builder/README.md b/cmd/builder/README.md index bb3cc6239fb..80980932f48 100644 --- a/cmd/builder/README.md +++ b/cmd/builder/README.md @@ -4,8 +4,9 @@ This program generates a custom OpenTelemetry Collector binary based on a given configuration. ## TL;DR + ```console -$ GO111MODULE=on go install go.opentelemetry.io/collector/cmd/builder +$ GO111MODULE=on go install go.opentelemetry.io/collector/cmd/builder@latest $ cat > ~/.otelcol-builder.yaml < Date: Fri, 12 Nov 2021 10:18:33 -0800 Subject: [PATCH 23/38] Improve MetricValueType usage and add String() (#4406) Signed-off-by: Bogdan Drutu --- model/pdata/metrics.go | 19 +++++++++++++------ model/pdata/metrics_test.go | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/model/pdata/metrics.go b/model/pdata/metrics.go index f3d501585a2..42eb455734d 100644 --- a/model/pdata/metrics.go +++ b/model/pdata/metrics.go @@ -314,12 +314,22 @@ const ( MetricValueTypeDouble ) +// String returns the string representation of the MetricValueType. +func (mdt MetricValueType) String() string { + switch mdt { + case MetricValueTypeNone: + return "None" + case MetricValueTypeInt: + return "Int" + case MetricValueTypeDouble: + return "Double" + } + return "" +} + // Type returns the type of the value for this NumberDataPoint. // Calling this function on zero-initialized NumberDataPoint will cause a panic. func (ms NumberDataPoint) Type() MetricValueType { - if ms.orig.Value == nil { - return MetricValueTypeNone - } switch ms.orig.Value.(type) { case *otlpmetrics.NumberDataPoint_AsDouble: return MetricValueTypeDouble @@ -332,9 +342,6 @@ func (ms NumberDataPoint) Type() MetricValueType { // Type returns the type of the value for this Exemplar. // Calling this function on zero-initialized Exemplar will cause a panic. func (ms Exemplar) Type() MetricValueType { - if ms.orig.Value == nil { - return MetricValueTypeNone - } switch ms.orig.Value.(type) { case *otlpmetrics.Exemplar_AsDouble: return MetricValueTypeDouble diff --git a/model/pdata/metrics_test.go b/model/pdata/metrics_test.go index 112f7fb2363..621f7e4e37d 100644 --- a/model/pdata/metrics_test.go +++ b/model/pdata/metrics_test.go @@ -91,7 +91,17 @@ func TestCopyData(t *testing.T) { } } -func TestDataType(t *testing.T) { +func TestMetricDataTypeString(t *testing.T) { + assert.Equal(t, "None", MetricDataTypeNone.String()) + assert.Equal(t, "Gauge", MetricDataTypeGauge.String()) + assert.Equal(t, "Sum", MetricDataTypeSum.String()) + assert.Equal(t, "Histogram", MetricDataTypeHistogram.String()) + assert.Equal(t, "ExponentialHistogram", MetricDataTypeExponentialHistogram.String()) + assert.Equal(t, "Summary", MetricDataTypeSummary.String()) + assert.Equal(t, "", (MetricDataTypeSummary + 1).String()) +} + +func TestMetricDataType(t *testing.T) { m := NewMetric() assert.Equal(t, "None", MetricDataTypeNone.String()) assert.Equal(t, MetricDataTypeNone, m.DataType()) @@ -112,6 +122,31 @@ func TestDataType(t *testing.T) { assert.Equal(t, MetricDataTypeSummary, m.DataType()) } +func TestPointMetricValueTypeString(t *testing.T) { + assert.Equal(t, "None", MetricValueTypeNone.String()) + assert.Equal(t, "Int", MetricValueTypeInt.String()) + assert.Equal(t, "Double", MetricValueTypeDouble.String()) + assert.Equal(t, "", (MetricValueTypeDouble + 1).String()) +} + +func TestPointMetricValueType(t *testing.T) { + m := NewNumberDataPoint() + assert.Equal(t, MetricValueTypeNone, m.Type()) + m.SetIntVal(10) + assert.Equal(t, MetricValueTypeInt, m.Type()) + m.SetDoubleVal(10.0) + assert.Equal(t, MetricValueTypeDouble, m.Type()) +} + +func TestExemplarMetricValueType(t *testing.T) { + m := NewExemplar() + assert.Equal(t, MetricValueTypeNone, m.Type()) + m.SetIntVal(10) + assert.Equal(t, MetricValueTypeInt, m.Type()) + m.SetDoubleVal(10.0) + assert.Equal(t, MetricValueTypeDouble, m.Type()) +} + func TestResourceMetricsWireCompatibility(t *testing.T) { // This test verifies that OTLP ProtoBufs generated using goproto lib in // opentelemetry-proto repository OTLP ProtoBufs generated using gogoproto lib in From 57ecd4ff8dc5a37c6f353c7d6f72f49e5dec18c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Fri, 12 Nov 2021 22:11:06 +0100 Subject: [PATCH 24/38] Prepare core release v0.39.0 (#4415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prepare core release v0.39.0 Fixes #4409 Signed-off-by: Juraci Paixão Kröhling * Fix builder test, broken during releases Signed-off-by: Juraci Paixão Kröhling --- CHANGELOG.md | 3 +++ cmd/builder/internal/builder/config.go | 2 +- cmd/builder/internal/builder/config_test.go | 4 ++-- cmd/builder/internal/builder/main_test.go | 6 +++++- go.mod | 2 +- versions.yaml | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30db69bf036..b2412ffbcd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## v0.39.0 Beta + ## 🛑 Breaking changes 🛑 - Remove deprecated config (already no-op) `ballast_size_mib` in memorylimiterprocessor (#4365) @@ -27,6 +29,7 @@ ## 💡 Enhancements 💡 - Supports more compression methods(`snappy` and `zstd`) for configgrpc, in addition to current `gzip` (#4088) +- Moved the OpenTelemetry Collector Builder to core (#4307) ## 🧰 Bug fixes 🧰 diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index 4dde5bb8248..bc201f4e3d2 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -25,7 +25,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.38.0" +const defaultOtelColVersion = "0.39.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/cmd/builder/internal/builder/config_test.go b/cmd/builder/internal/builder/config_test.go index 66e1a1c8257..00dafa2da9b 100644 --- a/cmd/builder/internal/builder/config_test.go +++ b/cmd/builder/internal/builder/config_test.go @@ -68,11 +68,11 @@ func TestModuleFromCore(t *testing.T) { Extensions: []Module{ // see issue-12 { Import: "go.opentelemetry.io/collector/receiver/otlpreceiver", - GoMod: "go.opentelemetry.io/collector v0.38.0", + GoMod: "go.opentelemetry.io/collector v0.0.0", }, { Import: "go.opentelemetry.io/collector/receiver/otlpreceiver", - GoMod: "go.opentelemetry.io/collector v0.38.0", + GoMod: "go.opentelemetry.io/collector v0.0.0", Core: nil, }, }, diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index 0ef75657d16..be44b6cbffc 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -42,7 +42,7 @@ func TestGenerateInvalidOutputPath(t *testing.T) { require.Contains(t, err.Error(), "failed to create output path") } -func TestGenerateAmdCompileDefault(t *testing.T) { +func TestGenerateAndCompileDefault(t *testing.T) { dir, err := ioutil.TempDir("/tmp", "default") if err != nil { log.Fatal(err) @@ -50,6 +50,10 @@ func TestGenerateAmdCompileDefault(t *testing.T) { defer os.RemoveAll(dir) cfg := DefaultConfig() cfg.Distribution.OutputPath = dir + + // we override this version, otherwise this would break during releases + cfg.Distribution.OtelColVersion = "0.38.0" + cfg.Validate() require.NoError(t, GenerateAndCompile(cfg)) } diff --git a/go.mod b/go.mod index 37a7c2be9c4..7ed80ec9481 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 - go.opentelemetry.io/collector/model v0.38.0 + go.opentelemetry.io/collector/model v0.39.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.1 go.opentelemetry.io/contrib/zpages v0.26.1 diff --git a/versions.yaml b/versions.yaml index e525790af94..b0f8079b3c9 100644 --- a/versions.yaml +++ b/versions.yaml @@ -14,7 +14,7 @@ module-sets: collector-base: - version: v0.38.0 + version: v0.39.0 modules: - go.opentelemetry.io/collector - go.opentelemetry.io/collector/cmd/builder From e9eac1b55f6bf85af23a601651cb2ce370b2b111 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 12 Nov 2021 15:42:07 -0800 Subject: [PATCH 25/38] Update otel dependencies to latest (#4425) Signed-off-by: Bogdan Drutu --- go.mod | 16 ++++++++-------- go.sum | 31 ++++++++++++++++++------------- service/telemetry.go | 4 ++-- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 7ed80ec9481..e2e6689c954 100644 --- a/go.mod +++ b/go.mod @@ -23,13 +23,13 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.1 go.opentelemetry.io/contrib/zpages v0.26.1 - go.opentelemetry.io/otel v1.1.0 - go.opentelemetry.io/otel/exporters/prometheus v0.24.0 - go.opentelemetry.io/otel/metric v0.24.0 - go.opentelemetry.io/otel/sdk v1.1.0 - go.opentelemetry.io/otel/sdk/export/metric v0.24.0 - go.opentelemetry.io/otel/sdk/metric v0.24.0 - go.opentelemetry.io/otel/trace v1.1.0 + go.opentelemetry.io/otel v1.2.0 + go.opentelemetry.io/otel/exporters/prometheus v0.25.0 + go.opentelemetry.io/otel/metric v0.25.0 + go.opentelemetry.io/otel/sdk v1.2.0 + go.opentelemetry.io/otel/sdk/export/metric v0.25.0 + go.opentelemetry.io/otel/sdk/metric v0.25.0 + go.opentelemetry.io/otel/trace v1.2.0 go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.7.0 go.uber.org/zap v1.19.1 @@ -67,7 +67,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.9 // indirect github.com/tklauser/numcpus v0.3.0 // indirect - go.opentelemetry.io/otel/internal/metric v0.24.0 // indirect + go.opentelemetry.io/otel/internal/metric v0.25.0 // indirect golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect golang.org/x/text v0.3.6 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 932fe69f87d..e95c36f6f4a 100644 --- a/go.sum +++ b/go.sum @@ -63,8 +63,9 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.2.0 h1:9Re3G2TWxkE06LdMWMpcY6KV81GLXMGiYpPYUPkFAws= +github.com/benbjohnson/clock v1.2.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -426,24 +427,28 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.1/go.mod h1: go.opentelemetry.io/contrib/zpages v0.26.1 h1:QwZSgYO+lbzOXLa/vhD6CHgjGm7INqk3jmmO9mAgqLU= go.opentelemetry.io/contrib/zpages v0.26.1/go.mod h1:NGd/Gf9T4Wn4LsUjTB1rPfKYWZefNNrXYoSWJLvu/rY= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= -go.opentelemetry.io/otel v1.1.0 h1:8p0uMLcyyIx0KHNTgO8o3CW8A1aA+dJZJW6PvnMz0Wc= go.opentelemetry.io/otel v1.1.0/go.mod h1:7cww0OW51jQ8IaZChIEdqLwgh+44+7uiTdWsAL0wQpA= -go.opentelemetry.io/otel/exporters/prometheus v0.24.0 h1:lfVirQkD4jPMh7m6i9sHDHweYZyWA0NDU6NszkbtFSE= -go.opentelemetry.io/otel/exporters/prometheus v0.24.0/go.mod h1:jfc9W1hVK0w9zrsE+C2ELje/M+K67cGinzeg8qQ8oog= -go.opentelemetry.io/otel/internal/metric v0.24.0 h1:O5lFy6kAl0LMWBjzy3k//M8VjEaTDWL9DPJuqZmWIAA= +go.opentelemetry.io/otel v1.2.0 h1:YOQDvxO1FayUcT9MIhJhgMyNO1WqoduiyvQHzGN0kUQ= +go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= +go.opentelemetry.io/otel/exporters/prometheus v0.25.0 h1:8f9PiHQ2yqRRWktEJ/u2cIPLD8yUagIuNOaFpSsCefI= +go.opentelemetry.io/otel/exporters/prometheus v0.25.0/go.mod h1:TmEyKmTplB/cdILsJBqD9/JDK9ssGXWjsrpmMHodFLw= go.opentelemetry.io/otel/internal/metric v0.24.0/go.mod h1:PSkQG+KuApZjBpC6ea6082ZrWUUy/w132tJ/LOU3TXk= -go.opentelemetry.io/otel/metric v0.24.0 h1:Rg4UYHS6JKR1Sw1TxnI13z7q/0p/XAbgIqUTagvLJuU= +go.opentelemetry.io/otel/internal/metric v0.25.0 h1:w/7RXe16WdPylaIXDgcYM6t/q0K5lXgSdZOEbIEyliE= +go.opentelemetry.io/otel/internal/metric v0.25.0/go.mod h1:Nhuw26QSX7d6n4duoqAFi5KOQR4AuzyMcl5eXOgwxtc= go.opentelemetry.io/otel/metric v0.24.0/go.mod h1:tpMFnCD9t+BEGiWY2bWF5+AwjuAdM0lSowQ4SBA3/K4= -go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI= -go.opentelemetry.io/otel/sdk v1.1.0 h1:j/1PngUJIDOddkCILQYTevrTIbWd494djgGkSsMit+U= +go.opentelemetry.io/otel/metric v0.25.0 h1:7cXOnCADUsR3+EOqxPaSKwhEuNu0gz/56dRN1hpIdKw= +go.opentelemetry.io/otel/metric v0.25.0/go.mod h1:E884FSpQfnJOMMUaq+05IWlJ4rjZpk2s/F1Ju+TEEm8= go.opentelemetry.io/otel/sdk v1.1.0/go.mod h1:3aQvM6uLm6C4wJpHtT8Od3vNzeZ34Pqc6bps8MywWzo= -go.opentelemetry.io/otel/sdk/export/metric v0.24.0 h1:innKi8LQebwPI+WEuEKEWMjhWC5mXQG1/WpSm5mffSY= -go.opentelemetry.io/otel/sdk/export/metric v0.24.0/go.mod h1:chmxXGVNcpCih5XyniVkL4VUyaEroUbOdvjVlQ8M29Y= -go.opentelemetry.io/otel/sdk/metric v0.24.0 h1:LLHrZikGdEHoHihwIPvfFRJX+T+NdrU2zgEqf7tQ7Oo= -go.opentelemetry.io/otel/sdk/metric v0.24.0/go.mod h1:KDgJgYzsIowuIDbPM9sLDZY9JJ6gqIDWCx92iWV8ejk= +go.opentelemetry.io/otel/sdk v1.2.0 h1:wKN260u4DesJYhyjxDa7LRFkuhH7ncEVKU37LWcyNIo= +go.opentelemetry.io/otel/sdk v1.2.0/go.mod h1:jNN8QtpvbsKhgaC6V5lHiejMoKD+V8uadoSafgHPx1U= +go.opentelemetry.io/otel/sdk/export/metric v0.25.0 h1:6UjAFmVB5Fza3K5qUJpYWGrk8QMPIqlSnya5FI46VBY= +go.opentelemetry.io/otel/sdk/export/metric v0.25.0/go.mod h1:Ej7NOa+WpN49EIcr1HMUYRvxXXCCnQCg2+ovdt2z8Pk= +go.opentelemetry.io/otel/sdk/metric v0.25.0 h1:J+Ta+4IAA5W9AdWhGQLfciEpavBqqSkBzTDeYvJLFNU= +go.opentelemetry.io/otel/sdk/metric v0.25.0/go.mod h1:G4xzj4LvC6xDDSsVXpvRVclQCbofGGg4ZU2VKKtDRfg= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= -go.opentelemetry.io/otel/trace v1.1.0 h1:N25T9qCL0+7IpOT8RrRy0WYlL7y6U0WiUJzXcVdXY/o= go.opentelemetry.io/otel/trace v1.1.0/go.mod h1:i47XtdcBQiktu5IsrPqOHe8w+sBmnLwwHt8wiUsWGTI= +go.opentelemetry.io/otel/trace v1.2.0 h1:Ys3iqbqZhcf28hHzrm5WAquMkDHNZTUkw7KHbuNjej0= +go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= diff --git a/service/telemetry.go b/service/telemetry.go index a281fd5a8a0..efa462242fc 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -26,7 +26,7 @@ import ( "go.opencensus.io/stats/view" otelprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric/global" - export "go.opentelemetry.io/otel/sdk/export/metric" + "go.opentelemetry.io/otel/sdk/export/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/aggregator/histogram" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" processor "go.opentelemetry.io/otel/sdk/metric/processor/basic" @@ -189,7 +189,7 @@ func (tel *colTelemetry) initOpenTelemetry() (http.Handler, error) { selector.NewWithHistogramDistribution( histogram.WithExplicitBoundaries(config.DefaultHistogramBoundaries), ), - export.CumulativeExportKindSelector(), + aggregation.CumulativeTemporalitySelector(), processor.WithMemory(true), ), ) From f72de797aa49d612c3b53109db4a0b31a462a53c Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 12 Nov 2021 15:47:28 -0800 Subject: [PATCH 26/38] [cmd/builder] Assert if config not valid (#4426) Signed-off-by: Bogdan Drutu --- cmd/builder/internal/builder/main_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index be44b6cbffc..5cee3de3f6f 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -20,6 +20,7 @@ import ( "os" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -54,6 +55,6 @@ func TestGenerateAndCompileDefault(t *testing.T) { // we override this version, otherwise this would break during releases cfg.Distribution.OtelColVersion = "0.38.0" - cfg.Validate() + assert.NoError(t, cfg.Validate()) require.NoError(t, GenerateAndCompile(cfg)) } From 5971c1d1897c60b3f19056a14e92c6d7f4c4617c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Sat, 13 Nov 2021 17:53:25 +0100 Subject: [PATCH 27/38] Remove workdir from builder release workflow, restrict to builder tags (#4432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- .github/workflows/builder-release.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/builder-release.yaml b/.github/workflows/builder-release.yaml index bbcf2c1c625..3f1faf0af05 100644 --- a/.github/workflows/builder-release.yaml +++ b/.github/workflows/builder-release.yaml @@ -3,7 +3,7 @@ name: Builder - Release on: push: tags: - - 'v*' + - 'cmd/builder/v*' jobs: goreleaser: @@ -26,7 +26,6 @@ jobs: distribution: goreleaser-pro version: latest args: release --rm-dist - workdir: cmd/builder env: GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From bd47456651e777eef8a5c3294d2db6a4e6210651 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Sun, 14 Nov 2021 12:17:17 -0800 Subject: [PATCH 28/38] Use go embed instead of constants for templates (#4427) * Use go embed instead of constants for templates Signed-off-by: Bogdan Drutu * Update templates.go * Update templates.go --- cmd/builder/internal/builder/main.go | 25 +-- cmd/builder/internal/builder/templates.go | 46 +++++ .../templates/components.go.tmpl} | 34 +--- .../templates/go.mod.tmpl} | 18 +- .../internal/builder/templates/main.go.tmpl | 39 +++++ .../builder/templates/main_others.go.tmpl | 12 ++ .../builder/templates/main_windows.go.tmpl | 49 ++++++ cmd/builder/internal/scaffold/main.go | 160 ------------------ 8 files changed, 158 insertions(+), 225 deletions(-) create mode 100644 cmd/builder/internal/builder/templates.go rename cmd/builder/internal/{scaffold/components.go => builder/templates/components.go.tmpl} (62%) rename cmd/builder/internal/{scaffold/gomod.go => builder/templates/go.mod.tmpl} (54%) create mode 100644 cmd/builder/internal/builder/templates/main.go.tmpl create mode 100644 cmd/builder/internal/builder/templates/main_others.go.tmpl create mode 100644 cmd/builder/internal/builder/templates/main_windows.go.tmpl delete mode 100644 cmd/builder/internal/scaffold/main.go diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go index 6655c4dddd4..8e71c861f5c 100644 --- a/cmd/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -24,8 +24,6 @@ import ( "time" "go.uber.org/zap" - - "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" ) var ( @@ -64,31 +62,31 @@ func Generate(cfg Config) error { for _, file := range []struct { outFile string - tmpl string + tmpl *template.Template }{ { "main.go", - scaffold.Main, + mainTemplate, }, { "main_others.go", - scaffold.MainOthers, + mainOthersTemplate, }, { "main_windows.go", - scaffold.MainWindows, + mainWindowsTemplate, }, { "components.go", - scaffold.Components, + componentsTemplate, }, { "go.mod", - scaffold.Gomod, + goModTemplate, }, } { if err := processAndWrite(cfg, file.tmpl, file.outFile, cfg); err != nil { - return fmt.Errorf("failed to generate source file with destination %q, source: %q: %w", file.outFile, file.tmpl, err) + return fmt.Errorf("failed to generate source file with destination %q, source: %q: %w", file.outFile, file.tmpl.Name(), err) } } @@ -144,16 +142,11 @@ func GetModules(cfg Config) error { return fmt.Errorf("failed to download go modules: %s", failReason) } -func processAndWrite(cfg Config, tmpl string, outFile string, tmplParams interface{}) error { - t, err := template.New("template").Parse(tmpl) - if err != nil { - return err - } - +func processAndWrite(cfg Config, tmpl *template.Template, outFile string, tmplParams interface{}) error { out, err := os.Create(filepath.Join(cfg.Distribution.OutputPath, outFile)) if err != nil { return err } - return t.Execute(out, tmplParams) + return tmpl.Execute(out, tmplParams) } diff --git a/cmd/builder/internal/builder/templates.go b/cmd/builder/internal/builder/templates.go new file mode 100644 index 00000000000..d3c549ea754 --- /dev/null +++ b/cmd/builder/internal/builder/templates.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry 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 builder // import "go.opentelemetry.io/collector/cmd/builder/internal/builder" + +import ( + _ "embed" + "text/template" +) + +var ( + //go:embed templates/components.go.tmpl + componentsBytes []byte + componentsTemplate = parseTemplate("component_header.go.tmpl", componentsBytes) + + //go:embed templates/main.go.tmpl + mainBytes []byte + mainTemplate = parseTemplate("main.go.tmpl", mainBytes) + + //go:embed templates/main_others.go.tmpl + mainOthersBytes []byte + mainOthersTemplate = parseTemplate("main_others.go.tmpl", mainOthersBytes) + + //go:embed templates/main_windows.go.tmpl + mainWindowsBytes []byte + mainWindowsTemplate = parseTemplate("main_windows.go.tmpl", mainWindowsBytes) + + //go:embed templates/go.mod.tmpl + goModBytes []byte + goModTemplate = parseTemplate("go.mod.tmpl", goModBytes) +) + +func parseTemplate(name string, bytes []byte) *template.Template { + return template.Must(template.New(name).Parse(string(bytes))) +} diff --git a/cmd/builder/internal/scaffold/components.go b/cmd/builder/internal/builder/templates/components.go.tmpl similarity index 62% rename from cmd/builder/internal/scaffold/components.go rename to cmd/builder/internal/builder/templates/components.go.tmpl index 78103e806ea..7ba2604bbd8 100644 --- a/cmd/builder/internal/scaffold/components.go +++ b/cmd/builder/internal/builder/templates/components.go.tmpl @@ -1,33 +1,4 @@ -// Copyright The OpenTelemetry 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 scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" - -const Components = ` -// Copyright The OpenTelemetry 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 "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. package main @@ -43,7 +14,7 @@ import ( {{.Name}} "{{.Import}}" {{- end}} - // receivers + // receivers {{- range .Receivers}} {{.Name}} "{{.Import}}" {{- end}} @@ -127,4 +98,3 @@ func components() (component.Factories, error) { return factories, consumererror.Combine(errs) } -` diff --git a/cmd/builder/internal/scaffold/gomod.go b/cmd/builder/internal/builder/templates/go.mod.tmpl similarity index 54% rename from cmd/builder/internal/scaffold/gomod.go rename to cmd/builder/internal/builder/templates/go.mod.tmpl index 80b86738e48..8fe6378765c 100644 --- a/cmd/builder/internal/scaffold/gomod.go +++ b/cmd/builder/internal/builder/templates/go.mod.tmpl @@ -1,20 +1,5 @@ -// Copyright The OpenTelemetry 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 "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. -package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" - -const Gomod = ` module {{.Distribution.Module}} go 1.17 @@ -53,4 +38,3 @@ replace {{.}} {{- range .Excludes}} exclude {{.}} {{- end}} -` diff --git a/cmd/builder/internal/builder/templates/main.go.tmpl b/cmd/builder/internal/builder/templates/main.go.tmpl new file mode 100644 index 00000000000..876b6159928 --- /dev/null +++ b/cmd/builder/internal/builder/templates/main.go.tmpl @@ -0,0 +1,39 @@ +// Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. + +// Program otelcontribcol is an extension to the OpenTelemetry Collector +// that includes additional components, some vendor-specific, contributed +// from the wider community. +package main + +import ( + "log" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/service" +) + +func main() { + factories, err := components() + if err != nil { + log.Fatalf("failed to build components: %v", err) + } + + info := component.BuildInfo{ + Command: "{{ .Distribution.Name }}", + Description: "{{ .Distribution.Description }}", + Version: "{{ .Distribution.Version }}", + } + + if err := run(service.CollectorSettings{BuildInfo: info, Factories: factories}); err != nil { + log.Fatal(err) + } +} + +func runInteractive(params service.CollectorSettings) error { + cmd := service.NewCommand(params) + if err := cmd.Execute(); err != nil { + log.Fatalf("collector server run finished with error: %v", err) + } + + return nil +} diff --git a/cmd/builder/internal/builder/templates/main_others.go.tmpl b/cmd/builder/internal/builder/templates/main_others.go.tmpl new file mode 100644 index 00000000000..5b77780a7e2 --- /dev/null +++ b/cmd/builder/internal/builder/templates/main_others.go.tmpl @@ -0,0 +1,12 @@ +// Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. + +//go:build !windows +// +build !windows + +package main + +import "go.opentelemetry.io/collector/service" + +func run(params service.CollectorSettings) error { + return runInteractive(params) +} diff --git a/cmd/builder/internal/builder/templates/main_windows.go.tmpl b/cmd/builder/internal/builder/templates/main_windows.go.tmpl new file mode 100644 index 00000000000..43e832c9ff6 --- /dev/null +++ b/cmd/builder/internal/builder/templates/main_windows.go.tmpl @@ -0,0 +1,49 @@ +// Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT. + +//go:build windows +// +build windows + +package main + +import ( + "fmt" + "os" + + "go.opentelemetry.io/collector/service" + "golang.org/x/sys/windows/svc" +) + +func run(params service.CollectorSettings) error { + if useInteractiveMode, err := checkUseInteractiveMode(); err != nil { + return err + } else if useInteractiveMode { + return runInteractive(params) + } else { + return runService(params) + } +} + +func checkUseInteractiveMode() (bool, error) { + // If environment variable NO_WINDOWS_SERVICE is set with any value other + // than 0, use interactive mode instead of running as a service. This should + // be set in case running as a service is not possible or desired even + // though the current session is not detected to be interactive + if value, present := os.LookupEnv("NO_WINDOWS_SERVICE"); present && value != "0" { + return true, nil + } + + if isInteractiveSession, err := svc.IsAnInteractiveSession(); err != nil { + return false, fmt.Errorf("failed to determine if we are running in an interactive session %w", err) + } else { + return isInteractiveSession, nil + } +} + +func runService(params service.CollectorSettings) error { + // do not need to supply service name when startup is invoked through Service Control Manager directly + if err := svc.Run("", service.NewWindowsService(params)); err != nil { + return fmt.Errorf("failed to start collector server: %w", err) + } + + return nil +} diff --git a/cmd/builder/internal/scaffold/main.go b/cmd/builder/internal/scaffold/main.go deleted file mode 100644 index 17d9066df65..00000000000 --- a/cmd/builder/internal/scaffold/main.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright The OpenTelemetry 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 scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" - -const Main = ` -// Copyright The OpenTelemetry 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. - -// Program otelcontribcol is an extension to the OpenTelemetry Collector -// that includes additional components, some vendor-specific, contributed -// from the wider community. -package main - -import ( - "log" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/service" -) - -func main() { - factories, err := components() - if err != nil { - log.Fatalf("failed to build components: %v", err) - } - - info := component.BuildInfo{ - Command: "{{ .Distribution.Name }}", - Description: "{{ .Distribution.Description }}", - Version: "{{ .Distribution.Version }}", - } - - if err := run(service.CollectorSettings{BuildInfo: info, Factories: factories}); err != nil { - log.Fatal(err) - } -} - -func runInteractive(params service.CollectorSettings) error { - cmd := service.NewCommand(params) - if err := cmd.Execute(); err != nil { - log.Fatalf("collector server run finished with error: %v", err) - } - - return nil -} -` - -const MainOthers = ` -// Copyright The OpenTelemetry 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. - -//go:build !windows -// +build !windows - -package main - -import "go.opentelemetry.io/collector/service" - -func run(params service.CollectorSettings) error { - return runInteractive(params) -} -` - -const MainWindows = ` -// Copyright The OpenTelemetry 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. - -//go:build windows -// +build windows - -package main - -import ( - "fmt" - "os" - - "go.opentelemetry.io/collector/service" - "golang.org/x/sys/windows/svc" -) - -func run(params service.CollectorSettings) error { - if useInteractiveMode, err := checkUseInteractiveMode(); err != nil { - return err - } else if useInteractiveMode { - return runInteractive(params) - } else { - return runService(params) - } -} - -func checkUseInteractiveMode() (bool, error) { - // If environment variable NO_WINDOWS_SERVICE is set with any value other - // than 0, use interactive mode instead of running as a service. This should - // be set in case running as a service is not possible or desired even - // though the current session is not detected to be interactive - if value, present := os.LookupEnv("NO_WINDOWS_SERVICE"); present && value != "0" { - return true, nil - } - - if isInteractiveSession, err := svc.IsAnInteractiveSession(); err != nil { - return false, fmt.Errorf("failed to determine if we are running in an interactive session %w", err) - } else { - return isInteractiveSession, nil - } -} - -func runService(params service.CollectorSettings) error { - // do not need to supply service name when startup is invoked through Service Control Manager directly - if err := svc.Run("", service.NewWindowsService(params)); err != nil { - return fmt.Errorf("failed to start collector server: %w", err) - } - - return nil -} -` From e9f7b1a381080d4f2cad3ab5101438097df04a23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 08:37:26 -0800 Subject: [PATCH 29/38] Bump github.com/cenkalti/backoff/v4 from 4.1.1 to 4.1.2 (#4435) Bumps [github.com/cenkalti/backoff/v4](https://github.com/cenkalti/backoff) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/cenkalti/backoff/releases) - [Commits](https://github.com/cenkalti/backoff/compare/v4.1.1...v4.1.2) --- updated-dependencies: - dependency-name: github.com/cenkalti/backoff/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e2e6689c954..4ce36365ee4 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( contrib.go.opencensus.io/exporter/prometheus v0.4.0 - github.com/cenkalti/backoff/v4 v4.1.1 + github.com/cenkalti/backoff/v4 v4.1.2 github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index e95c36f6f4a..bb7bece42ea 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= +github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 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= From 92a6cb9fee7ddd236f4e637620329293b9e8eedf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 08:37:35 -0800 Subject: [PATCH 30/38] Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /model (#4433) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.41.0 to 1.42.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.41.0...v1.42.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc 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> --- model/go.mod | 2 +- model/go.sum | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/model/go.mod b/model/go.mod index 97f96074950..1e2f4475d8e 100644 --- a/model/go.mod +++ b/model/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/gogo/protobuf v1.3.2 github.com/stretchr/testify v1.7.0 - google.golang.org/grpc v1.41.0 + google.golang.org/grpc v1.42.0 google.golang.org/protobuf v1.27.1 ) diff --git a/model/go.sum b/model/go.sum index f25b37f8da7..cb6df091c3f 100644 --- a/model/go.sum +++ b/model/go.sum @@ -7,7 +7,10 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -149,8 +152,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 184206f8377e90341cc2da899752b2d33d4ebb1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 08:37:50 -0800 Subject: [PATCH 31/38] Bump github.com/mostynb/go-grpc-compression from 1.1.14 to 1.1.15 (#4434) Bumps [github.com/mostynb/go-grpc-compression](https://github.com/mostynb/go-grpc-compression) from 1.1.14 to 1.1.15. - [Release notes](https://github.com/mostynb/go-grpc-compression/releases) - [Commits](https://github.com/mostynb/go-grpc-compression/compare/v1.1.14...v1.1.15) --- updated-dependencies: - dependency-name: github.com/mostynb/go-grpc-compression dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 4ce36365ee4..e7d9b6b1d37 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/knadh/koanf v1.3.2 github.com/magiconair/properties v1.8.5 github.com/mitchellh/mapstructure v1.4.2 - github.com/mostynb/go-grpc-compression v1.1.14 + github.com/mostynb/go-grpc-compression v1.1.15 github.com/prometheus/common v0.32.1 github.com/rs/cors v1.8.0 github.com/shirou/gopsutil/v3 v3.21.10 diff --git a/go.sum b/go.sum index bb7bece42ea..a5608e24ab8 100644 --- a/go.sum +++ b/go.sum @@ -37,6 +37,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo 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= +code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= contrib.go.opencensus.io/exporter/prometheus v0.4.0 h1:0QfIkj9z/iVZgK31D9H9ohjjIDApI2GOPScCKwxedbs= contrib.go.opencensus.io/exporter/prometheus v0.4.0/go.mod h1:o7cosnyfuPVK0tB8q0QmaQNhGnptITnPQB+z1+qeFB0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -107,7 +108,9 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -245,6 +248,7 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= @@ -293,6 +297,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -315,18 +320,22 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mostynb/go-grpc-compression v1.1.14 h1:dxtryvqLCzScC6mIpw5oWZqyBgucdMmnVWRNFkVX9DY= -github.com/mostynb/go-grpc-compression v1.1.14/go.mod h1:z6FFnn1nEs6zxqgicvXTqb9IFVmb+R9zdr2BvaYH8tU= +github.com/mostynb/go-grpc-compression v1.1.15 h1:9pLWmZldgo3vstd3yGyNgpCzY5gvhCrCj3PyvnvlDiY= +github.com/mostynb/go-grpc-compression v1.1.15/go.mod h1:OTK+ha9cKfSY0Pb3ESCzvGhzStJrudBxXPzuC3PaA5A= 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/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.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/pierrec/cmdflag v0.0.2/go.mod h1:a3zKGZ3cdQUfxjd0RGMLZr8xI3nvpJOB+m6o/1X5BmU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v3 v3.3.4/go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -369,6 +378,7 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/schollz/progressbar/v2 v2.13.2/go.mod h1:6YZjqdthH6SCZKv2rqGryrxPtfmRB/DWZxSMfCXPyD8= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil/v3 v3.21.10 h1:flTg1DrnV/UVrBqjLgVgDJzx6lf+91rC64/dBHmO2IA= github.com/shirou/gopsutil/v3 v3.21.10/go.mod h1:t75NhzCZ/dYyPQjyQmrAYP6c8+LCdFANeBMdLPCNnew= @@ -506,6 +516,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -574,6 +585,7 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ 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= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -822,10 +834,12 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 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= From a62a7e410b6298f60592dff914f1703f4d3f6837 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 15 Nov 2021 09:20:17 -0800 Subject: [PATCH 32/38] Upgrade golintci and fix errors (#4428) Signed-off-by: Bogdan Drutu --- internal/tools/go.mod | 78 ++++---- internal/tools/go.sum | 274 ++++++++++++++++++++-------- model/internal/data/spanid_test.go | 2 - model/internal/data/traceid_test.go | 4 +- model/pdata/common_test.go | 1 - 5 files changed, 237 insertions(+), 122 deletions(-) diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 5c44d62fb1b..0343570404c 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/client9/misspell v0.3.4 - github.com/golangci/golangci-lint v1.42.1 + github.com/golangci/golangci-lint v1.43.0 github.com/google/addlicense v1.0.0 github.com/jcchavezs/porto v0.4.0 github.com/ory/go-acc v0.2.6 @@ -19,8 +19,9 @@ require ( ) require ( - 4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a // indirect - github.com/Antonboom/errname v0.1.4 // indirect + 4d63.com/gochecknoglobals v0.1.0 // indirect + github.com/Antonboom/errname v0.1.5 // indirect + github.com/Antonboom/nilnil v0.1.0 // indirect github.com/BurntSushi/toml v0.4.1 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/Masterminds/semver v1.5.0 // indirect @@ -34,30 +35,33 @@ require ( github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bkielbasa/cyclop v1.2.0 // indirect + github.com/blizzy78/varnamelen v0.3.0 // indirect github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect github.com/bombsimon/wsl/v3 v3.3.0 // indirect + github.com/breml/bidichk v0.1.1 // indirect + github.com/butuzov/ireturn v0.1.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/charithe/durationcheck v0.0.8 // indirect + github.com/charithe/durationcheck v0.0.9 // indirect github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af // indirect github.com/daixiang0/gci v0.2.9 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/denis-tingajkin/go-header v0.4.2 // indirect github.com/dgraph-io/ristretto v0.0.2 // indirect github.com/emirpasic/gods v1.12.0 // indirect - github.com/esimonov/ifshort v1.0.2 // indirect + github.com/esimonov/ifshort v1.0.3 // indirect github.com/ettle/strcase v0.1.1 // indirect - github.com/fatih/color v1.12.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/fatih/structtag v1.2.0 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/fzipp/gocyclo v0.3.1 // indirect - github.com/go-critic/go-critic v0.5.6 // indirect + github.com/go-critic/go-critic v0.6.1 // indirect github.com/go-git/gcfg v1.5.0 // indirect github.com/go-git/go-billy/v5 v5.3.1 // indirect github.com/go-git/go-git/v5 v5.4.2 // indirect github.com/go-toolsmith/astcast v1.0.0 // indirect github.com/go-toolsmith/astcopy v1.0.0 // indirect - github.com/go-toolsmith/astequal v1.0.0 // indirect + github.com/go-toolsmith/astequal v1.0.1 // indirect github.com/go-toolsmith/astfmt v1.0.0 // indirect github.com/go-toolsmith/astp v1.0.0 // indirect github.com/go-toolsmith/strparse v1.0.0 // indirect @@ -73,15 +77,15 @@ require ( github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect github.com/golangci/misspell v0.3.5 // indirect - github.com/golangci/revgrep v0.0.0-20210208091834-cd28932614b5 // indirect + github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect - github.com/google/go-cmp v0.5.5 // indirect + github.com/google/go-cmp v0.5.6 // indirect github.com/google/go-github v17.0.0+incompatible // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/google/uuid v1.2.0 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254 // indirect - github.com/gostaticanalysis/analysisutil v0.4.1 // indirect - github.com/gostaticanalysis/comment v1.4.1 // indirect + github.com/gostaticanalysis/analysisutil v0.7.1 // indirect + github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect @@ -92,39 +96,39 @@ require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jgautheron/goconst v1.5.1 // indirect - github.com/jingyugao/rowserrcheck v1.1.0 // indirect + github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d // indirect github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect github.com/kisielk/errcheck v1.6.0 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/kulti/thelper v0.4.0 // indirect - github.com/kunwardeep/paralleltest v1.0.2 // indirect + github.com/kunwardeep/paralleltest v1.0.3 // indirect github.com/kyoh86/exportloopref v0.1.8 // indirect github.com/ldez/gomoddirectives v0.2.2 // indirect github.com/ldez/tagliatelle v0.2.0 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/maratori/testpackage v1.0.1 // indirect github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.13 // indirect + github.com/mattn/go-colorable v0.1.11 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81 // indirect - github.com/mgechev/revive v1.1.1 // indirect + github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect + github.com/mgechev/revive v1.1.2 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mitchellh/mapstructure v1.4.2 // indirect github.com/moricho/tparallel v0.2.1 // indirect - github.com/nakabonne/nestif v0.3.0 // indirect + github.com/nakabonne/nestif v0.3.1 // indirect github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect github.com/nishanths/exhaustive v0.2.3 // indirect github.com/nishanths/predeclared v0.2.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/ory/viper v1.7.5 // indirect github.com/pborman/uuid v1.2.0 // indirect - github.com/pelletier/go-toml v1.9.3 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -133,33 +137,35 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.10.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect - github.com/quasilyte/go-ruleguard v0.3.4 // indirect + github.com/quasilyte/go-ruleguard v0.3.13 // indirect github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect github.com/ryancurrah/gomodguard v1.2.3 // indirect github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect - github.com/securego/gosec/v2 v2.8.1 // indirect + github.com/securego/gosec/v2 v2.9.1 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.8.1 // indirect + github.com/sivchari/tenv v1.4.7 // indirect github.com/sonatard/noctx v0.0.1 // indirect github.com/sourcegraph/go-diff v0.6.1 // indirect github.com/spf13/afero v1.6.0 // indirect - github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/cast v1.4.1 // indirect github.com/spf13/cobra v1.2.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.8.1 // indirect - github.com/ssgreg/nlreturn/v2 v2.1.0 // indirect + github.com/spf13/viper v1.9.0 // indirect + github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stretchr/objx v0.1.1 // indirect github.com/stretchr/testify v1.7.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect + github.com/sylvia7788/contextcheck v1.0.4 // indirect github.com/tcnksm/go-gitconfig v0.1.2 // indirect github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b // indirect - github.com/tetafro/godot v1.4.9 // indirect + github.com/tetafro/godot v1.4.11 // indirect github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 // indirect - github.com/tomarrell/wrapcheck/v2 v2.3.0 // indirect + github.com/tomarrell/wrapcheck/v2 v2.4.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.4.0 // indirect github.com/ultraware/funlen v0.0.3 // indirect github.com/ultraware/whitespace v0.0.4 // indirect @@ -167,17 +173,17 @@ require ( github.com/xanzy/ssh-agent v0.3.0 // indirect github.com/yeya24/promlinter v0.1.0 // indirect go.opentelemetry.io/build-tools v0.0.0-20210719163622-92017e64f35b // indirect - golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect golang.org/x/mod v0.5.1 // indirect golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect - golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect + golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect - golang.org/x/text v0.3.6 // indirect + golang.org/x/sys v0.0.0-20211013075003-97ac67df715c // indirect + golang.org/x/text v0.3.7 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.26.0 // indirect - gopkg.in/ini.v1 v1.62.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/ini.v1 v1.63.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 9232d79a1fb..64220604749 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -1,5 +1,5 @@ -4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a h1:wFEQiK85fRsEVF0CRrPAos5LoAryUsIX1kPW/WrIqFw= -4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= +4d63.com/gochecknoglobals v0.1.0 h1:zeZSRqj5yCg28tCkIV/z/lWbwvNm5qnKVS15PI8nhD0= +4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -22,6 +22,11 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW 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 v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= 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= @@ -31,6 +36,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 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/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= 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= @@ -44,8 +50,10 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Antonboom/errname v0.1.4 h1:lGSlI42Gm4bI1e+IITtXJXvxFM8N7naWimVFKcb0McY= -github.com/Antonboom/errname v0.1.4/go.mod h1:jRXo3m0E0EuCnK3wbsSVH3X55Z4iTDLl6ZfCxwFj4TM= +github.com/Antonboom/errname v0.1.5 h1:IM+A/gz0pDhKmlt5KSNTVAvfLMb+65RxavBXpRtCUEg= +github.com/Antonboom/errname v0.1.5/go.mod h1:DugbBstvPFQbv/5uLcRRzfrNqKE9tVdVCqWCLp6Cifo= +github.com/Antonboom/nilnil v0.1.0 h1:DLDavmg0a6G/F4Lt9t7Enrbgb3Oph6LnDE6YVsmTt74= +github.com/Antonboom/nilnil v0.1.0/go.mod h1:PhHLvRPSghY5Y7mX4TW+BHZQYo1A8flE5H20D3IPZBo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -78,7 +86,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= -github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= @@ -88,6 +97,7 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/ashanbrown/forbidigo v1.2.0 h1:RMlEFupPCxQ1IogYOQUnIQwGEUGK8g5vAPMRyJoSxbc= @@ -102,21 +112,26 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -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/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= +github.com/blizzy78/varnamelen v0.3.0 h1:80mYO7Y5ppeEefg1Jzu+NBg16iwToOQVnDnNIoWSShs= +github.com/blizzy78/varnamelen v0.3.0/go.mod h1:hbwRdBvoBqxk34XyQ6HA0UH3G0/1TKuv5AC4eaBT0Ec= github.com/bmatcuk/doublestar/v4 v4.0.2 h1:X0krlUVAVmtr2cRoTqR8aDMrDqnB36ht8wpWTiQ3jsA= github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/breml/bidichk v0.1.1 h1:Qpy8Rmgos9qdJxhka0K7ADEE5bQZX9PQUthkgggHpFM= +github.com/breml/bidichk v0.1.1/go.mod h1:zbfeitpevDUGI7V91Uzzuwrn4Vls8MoBMrwtt78jmso= +github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= +github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 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/charithe/durationcheck v0.0.8 h1:cnZrThioNW9gSV5JsRIXmkyHUbcDH7Y9hkzFDVc9/j0= -github.com/charithe/durationcheck v0.0.8/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= +github.com/charithe/durationcheck v0.0.9 h1:mPP4ucLrf/rKZiIG/a9IPXHGlh8p4CzgpyTy6EEutYk= +github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af h1:spmv8nSH9h5oCQf40jt/ufBCt9j0/58u4G+rkeMqXGI= github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af/go.mod h1:Qjyv4H3//PWVzTeCezG2b9IRn6myJxJSr4TD/xo6ojU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -127,10 +142,10 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk 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/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= 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= @@ -170,31 +185,33 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/esimonov/ifshort v1.0.2 h1:K5s1W2fGfkoWXsFlxBNqT6J0ZCncPaKrGM5qe0bni68= -github.com/esimonov/ifshort v1.0.2/go.mod h1:yZqNJUrNn20K8Q9n2CrjTKYyVEmX209Hgu+M1LBpeZE= +github.com/esimonov/ifshort v1.0.3 h1:JD6x035opqGec5fZ0TLjXeROD2p5H7oLGn8MKfy9HTM= +github.com/esimonov/ifshort v1.0.3/go.mod h1:yZqNJUrNn20K8Q9n2CrjTKYyVEmX209Hgu+M1LBpeZE= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.3.1 h1:A9UeX3HJSXTBzvHzhqoYVuE0eAhe+aM8XBCCwsPMZOc= github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-critic/go-critic v0.5.6 h1:siUR1+322iVikWXoV75I1YRfNaC/yaLzhdF9Zwd8Tus= -github.com/go-critic/go-critic v0.5.6/go.mod h1:cVjj0DfqewQVIlIAGexPCaGaZDAqGE29PYDDADIVNEo= +github.com/go-critic/go-critic v0.6.1 h1:lS8B9LH/VVsvQQP7Ao5TJyQqteVKVs3E4dXiHMyubtI= +github.com/go-critic/go-critic v0.6.1/go.mod h1:SdNCfU0yF3UBjtaZGw6586/WocupMOJuiqgom5DsQxM= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= @@ -212,6 +229,7 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 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-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -221,8 +239,9 @@ github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= github.com/go-toolsmith/astcopy v1.0.0 h1:OMgl1b1MEpjFQ1m5ztEO06rz5CUd3oBv9RF7+DyvdG8= github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= -github.com/go-toolsmith/astequal v1.0.0 h1:4zxD8j3JRFNyLN46lodQuqz3xdKSrur7U/sr0SDS/gQ= github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= +github.com/go-toolsmith/astequal v1.0.1 h1:JbSszi42Jiqu36Gnf363HWS9MTEAz67vTQLponh3Moc= +github.com/go-toolsmith/astequal v1.0.1/go.mod h1:4oGA3EZXTVItV/ipGiOx7NWkY5veFfcsOJVS2YxltLw= github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= @@ -261,6 +280,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= @@ -280,6 +300,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS 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.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= @@ -288,16 +309,16 @@ github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZB github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.42.1 h1:nC4WyrbdnNdohDVUoNKjy/4N4FTM1gCFaVeXecy6vzM= -github.com/golangci/golangci-lint v1.42.1/go.mod h1:MuInrVlgg2jq4do6XI1jbkErbVHVbwdrLLtGv6p2wPI= +github.com/golangci/golangci-lint v1.43.0 h1:SLwZFEmDgopqZpfP495zCtV9REUf551JJlJ51Ql7NZA= +github.com/golangci/golangci-lint v1.43.0/go.mod h1:VIFlUqidx5ggxDfQagdvd9E67UjMXtTHBkBQ7sHoC5Q= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= github.com/golangci/misspell v0.3.5 h1:pLzmVdl3VxTOncgzHcvLOKirdvcx/TydsClUQXTehjo= github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/revgrep v0.0.0-20210208091834-cd28932614b5 h1:c9Mqqrm/Clj5biNaG7rABrmwUq88nHh0uABo2b/WYmc= -github.com/golangci/revgrep v0.0.0-20210208091834-cd28932614b5/go.mod h1:LK+zW4MpyytAWQRz0M4xnzEk50lSvqDQKfx304apFkY= +github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2 h1:SgM7GDZTxtTTQPU84heOxy34iG5Du7F2jcoZnvp+fXI= +github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2/go.mod h1:LK+zW4MpyytAWQRz0M4xnzEk50lSvqDQKfx304apFkY= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/addlicense v1.0.0 h1:cqvo5suPWlsk6r6o42Fs2K66xYCl2tnhVPUYoP3EnO4= @@ -316,8 +337,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ 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/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -326,6 +348,7 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ 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/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= 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= @@ -338,18 +361,21 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe 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/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/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/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254 h1:Nb2aRlC404yz7gQIfRZxX9/MLvQiqXyiBTJtgAy6yrI= @@ -359,19 +385,23 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7 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.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= -github.com/gostaticanalysis/analysisutil v0.4.1 h1:/7clKqrVfiVwiBQLM0Uke4KvXnO6JcCTS7HwF2D6wG8= github.com/gostaticanalysis/analysisutil v0.4.1/go.mod h1:18U/DLpRgIUd459wGxVHE0fRgmo1UgHDcbw7F5idXu0= +github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= +github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= -github.com/gostaticanalysis/comment v1.4.1 h1:xHopR5L2lRz6OsjH4R2HG5wRhW9ySl3FsHIvi5pcXwc= github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= +github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5 h1:rx8127mFPqXXsfPSo8BwnIU97MKFZc89WHAHt8PwDVY= github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= +github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= +github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= +github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 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= @@ -382,20 +412,26 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= @@ -406,8 +442,11 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -427,8 +466,8 @@ github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= -github.com/jingyugao/rowserrcheck v1.1.0 h1:u6h4eiNuCLqk73Ic5TXQq9yZS+uEXTdusn7c3w1Mr6A= -github.com/jingyugao/rowserrcheck v1.1.0/go.mod h1:TOQpc2SLx6huPfoFGK3UOnEG+u02D3C1GeosjupAKCA= +github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= +github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -437,13 +476,13 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/txtarfs v0.0.0-20210218200122-0702f000015a/go.mod h1:izVPOvVRsHiKkeGCT6tYBNWyDVuzj9wAaBb5R9qamfw= 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.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -459,8 +498,8 @@ github.com/kisielk/errcheck v1.6.0 h1:YTDO4pNy7AUN/021p+JGHycQyYNIyMoenM1YDVK6Rl github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= 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= @@ -476,8 +515,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.4.0 h1:2Nx7XbdbE/BYZeoip2mURKUdtHQRuy6Ug+wR7K9ywNM= github.com/kulti/thelper v0.4.0/go.mod h1:vMu2Cizjy/grP+jmsvOFDx1kYP6+PD1lqg4Yu5exl2U= -github.com/kunwardeep/paralleltest v1.0.2 h1:/jJRv0TiqPoEy/Y8dQxCFJhD56uS/pnvtatgTZBHokU= -github.com/kunwardeep/paralleltest v1.0.2/go.mod h1:ZPqNm1fVHPllh5LPVujzbVz1JN2GhLxSfY+oqUsvG30= +github.com/kunwardeep/paralleltest v1.0.3 h1:UdKIkImEAXjR1chUWLn+PNXqWUGs//7tzMeWuP7NhmI= +github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77LoN/M= github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= @@ -489,8 +528,9 @@ github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= @@ -499,20 +539,25 @@ github.com/maratori/testpackage v1.0.1 h1:QtJ5ZjqapShm0w5DosRjg0PRlSdAdlx+W6cCKo github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 h1:pWxk9e//NbPwfxat7RXkts09K+dEBJWakUWwICVqYbA= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= +github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -524,15 +569,17 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81 h1:QASJXOGm2RZ5Ardbc86qNFvby9AqkLDibfChMtAg5QM= -github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.1.1 h1:mkXNHP14Y6tfq+ocnQaiKEtgJDM41yaoyQq4qn6TD/4= -github.com/mgechev/revive v1.1.1/go.mod h1:PKqk4L74K6wVNwY2b6fr+9Qqr/3hIsHVfZCJdbvozrY= +github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8ceC6BxnoG8TBrhgAvRg8obzup0= +github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= +github.com/mgechev/revive v1.1.2 h1:MiYA/o9M7REjvOF20QN43U8OtXDDHQFKLCtJnxLGLog= +github.com/mgechev/revive v1.1.2/go.mod h1:bnXsMr+ZTH09V5rssEI+jHAZ4z+ZdyhgO/zsy3EhK+0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -546,8 +593,9 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -562,8 +610,8 @@ github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1: github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= github.com/mwitkow/go-proto-validators v0.2.0/go.mod h1:ZfA1hW+UH/2ZHOWvQ3HnQaU0DtnpXu850MZiy+YUgcc= -github.com/nakabonne/nestif v0.3.0 h1:+yOViDGhg8ygGrmII72nV9B/zGxY188TYpfolntsaPw= -github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= +github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= +github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -584,19 +632,24 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= +github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= +github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/ory/go-acc v0.2.6 h1:YfI+L9dxI7QCtWn2RbawqO0vXhiThdXu/RgizJBbaq0= github.com/ory/go-acc v0.2.6/go.mod h1:4Kb/UnPcT8qRAk3IAxta+hvVapdxTLWtrr7bFLlEgpw= github.com/ory/viper v1.7.5 h1:+xVdq7SU3e1vNaCsk/ixsfxE4zylk1TJUiJrY647jUE= github.com/ory/viper v1.7.5/go.mod h1:ypOuyJmEUb3oENywQZRgeAMwqgOyDqwboO1tj3DjTaM= +github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= +github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pavius/impi v0.0.3 h1:DND6MzU+BLABhOZXbELR3FU8b+zDgcq4dOCNLhiTYuI= github.com/pavius/impi v0.0.3/go.mod h1:x/hU0bfdWIhuOT1SKwiJg++yvkk6EuOtJk8WtDZqgr8= @@ -604,8 +657,9 @@ github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= 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.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= -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/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= @@ -620,6 +674,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/polyfloyd/go-errorlint v0.0.0-20210722154253-910bb7978349 h1:Kq/3kL0k033ds3tyez5lFPrfQ74fNJ+OqCclRipubwA= github.com/polyfloyd/go-errorlint v0.0.0-20210722154253-910bb7978349/go.mod h1:wi9BfjxjF/bwiZ701TzmfKu6UKC357IOAtNr0Td0Lvw= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 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= @@ -646,12 +701,12 @@ github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= -github.com/quasilyte/go-ruleguard v0.3.4 h1:F6l5p6+7WBcTKS7foNQ4wqA39zjn2+RbdbyzGxIq1B0= -github.com/quasilyte/go-ruleguard v0.3.4/go.mod h1:57FZgMnoo6jqxkYKmVj5Fc8vOt0rVzoE/UNAmFFIPqA= +github.com/quasilyte/go-ruleguard v0.3.13 h1:O1G41cq1jUr3cJmqp7vOUT0SokqjzmS9aESWJuIDRaY= +github.com/quasilyte/go-ruleguard v0.3.13/go.mod h1:Ul8wwdqR6kBVOCt2dipDBkE+T6vAV/iixkrKuRTN1oQ= github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.2/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/dsl v0.3.10/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20210203162857-b223e0831f88/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= +github.com/quasilyte/go-ruleguard/rules v0.0.0-20210428214800-545e0d2e0bf7/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 h1:L8QM9bvf68pVdQ3bCFZMDmnt9yqcMBro1pC7F+IPYMY= github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -666,16 +721,17 @@ github.com/ryancurrah/gomodguard v1.2.3/go.mod h1:rYbA/4Tg5c54mV1sv4sQTP5WOPBcoL github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= github.com/sanposhiho/wastedassign/v2 v2.0.6 h1:+6/hQIHKNJAUixEj6EmOngGIisyeI+T3335lYTyxRoA= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/securego/gosec/v2 v2.8.1 h1:Tyy/nsH39TYCOkqf5HAgRE+7B5D8sHDwPdXRgFWokh8= -github.com/securego/gosec/v2 v2.8.1/go.mod h1:pUmsq6+VyFEElJMUX+QB3p3LWNHXg1R3xh2ssVJPs8Q= +github.com/securego/gosec/v2 v2.9.1 h1:anHKLS/ApTYU6NZkKa/5cQqqcbKZURjvc+MtR++S4EQ= +github.com/securego/gosec/v2 v2.9.1/go.mod h1:oDcDLcatOJxkCGaCaq8lua1jTnYf6Sou4wdiJ1n4iHc= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil/v3 v3.21.7/go.mod h1:RGl11Y7XMTQPmHh8F0ayC6haKNBgH4PXMJuTAcMOlz4= +github.com/shirou/gopsutil/v3 v3.21.10/go.mod h1:t75NhzCZ/dYyPQjyQmrAYP6c8+LCdFANeBMdLPCNnew= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -686,9 +742,9 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/sivchari/tenv v1.4.7 h1:FdTpgRlTue5eb5nXIYgS/lyVXSjugU8UUVDwhP1NLU8= +github.com/sivchari/tenv v1.4.7/go.mod h1:5nF+bITvkebQVanjU6IuMbvIot/7ReNsUV7I5NbprB0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= @@ -702,8 +758,9 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd 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= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= @@ -718,11 +775,11 @@ 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/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/ssgreg/nlreturn/v2 v2.1.0 h1:6/s4Rc49L6Uo6RLjhWZGBpWWjfzk2yrf1nIW8m4wgVA= -github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= +github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= +github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= +github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -737,6 +794,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/sylvia7788/contextcheck v1.0.4 h1:MsiVqROAdr0efZc/fOCt0c235qm9XJqHtWwM+2h2B04= +github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ= github.com/tcnksm/ghr v0.14.0 h1:3iCanOmn2xDgLnbbTy3ifzHiJ8/gCzYv6K5YWW+1P1s= github.com/tcnksm/ghr v0.14.0/go.mod h1:6FdZv7a1yCKqJGwA4srq5ZtqGzEUnSCtRQOfGuuzSd4= github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw= @@ -745,17 +804,21 @@ github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e h1:IWllFTiDjjLIf2 github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e/go.mod h1:d7u6HkTYKSv5m6MCKkOQlHwaShTMl3HjqSGW3XtVhXM= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b h1:HxLVTlqcHhFAz3nWUcuvpH7WuOMv8LQoCWmruLfFH2U= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tetafro/godot v1.4.9 h1:wsNd0RuUxISqqudFqchsSsMqsM188DoZVPBeKl87tP0= -github.com/tetafro/godot v1.4.9/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= +github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= +github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= +github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= +github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 h1:ig99OeTyDwQWhPe2iw9lwfQVF1KB3Q4fpP3X7/2VBG8= github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/tklauser/go-sysconf v0.3.7/go.mod h1:JZIdXh4RmBvZDBZ41ld2bGxRV3n4daiiqA3skYhAoQ4= -github.com/tklauser/numcpus v0.2.3/go.mod h1:vpEPS/JC+oZGGQ/My/vJnNsvMDQL6PwOqt8dsCw5j+E= +github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= +github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck/v2 v2.3.0 h1:i3DNjtyyL1xwaBQOsPPk8LAcpayWfQv2rxNi9b/eEx4= -github.com/tomarrell/wrapcheck/v2 v2.3.0/go.mod h1:aF5rnkdtqNWP/gC7vPUO5pKsB0Oac2FDTQP4F+dpZMU= +github.com/tomarrell/wrapcheck/v2 v2.4.0 h1:mU4H9KsqqPZUALOUbVOpjy8qNQbWLoLI9fV68/1tq30= +github.com/tomarrell/wrapcheck/v2 v2.4.0/go.mod h1:68bQ/eJg55BROaRTbMjC7vuhL2OgfoG8bLp9ZyoBfyY= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= github.com/tommy-muehle/go-mnd/v2 v2.4.0 h1:1t0f8Uiaq+fqKteUR4N9Umr6E99R+lDnLnq7PwX2PPE= github.com/tommy-muehle/go-mnd/v2 v2.4.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= @@ -770,9 +833,9 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/uudashr/gocognit v1.0.5 h1:rrSex7oHr3/pPLQ0xoWq108XMU8s678FJcQ+aSfOHa4= github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= -github.com/valyala/quicktemplate v1.6.3/go.mod h1:fwPzK2fHuYEODzJ9pkw0ipCPNHZ2tD5KW4lOuSdPKzY= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= +github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= @@ -815,6 +878,7 @@ go.opentelemetry.io/build-tools/multimod v0.0.0-20210920164323-2ceabab23375 h1:5 go.opentelemetry.io/build-tools/multimod v0.0.0-20210920164323-2ceabab23375/go.mod h1:mPh1L/tfTGyVNnSQOTlTSi2CBpci13Ft8jE4Glik2es= go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210813222030-0139980e9794 h1:bmZVQJ2hfEkjdYda0B7FPNrHiV+XWVmRpdm7YIYvhAI= go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210813222030-0139980e9794/go.mod h1:QJyAzHKDKGDl52AUIAZhWKx3nOPBZJ3dD44utso2FPE= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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= @@ -836,14 +900,17 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -881,6 +948,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -918,7 +986,6 @@ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/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= @@ -932,6 +999,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -947,8 +1016,11 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ 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/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/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= @@ -983,6 +1055,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1028,10 +1101,20 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/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-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210915083310-ed5796bab164/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211013075003-97ac67df715c h1:taxlMj0D/1sOAuv/CbSD+MMDof2vbyPTqz5FNYKpXt8= +golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1042,8 +1125,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= @@ -1071,6 +1155,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1140,10 +1225,14 @@ golang.org/x/tools v0.0.0-20210104081019-d8d6ddbec6ee/go.mod h1:emZCQorbCU4vsT4f 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.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.6/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1174,6 +1263,12 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR 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/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 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= @@ -1229,7 +1324,18 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D 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-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1254,7 +1360,13 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 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.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= 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= @@ -1266,8 +1378,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD 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= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/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= @@ -1282,8 +1395,9 @@ 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/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.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/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c= +gopkg.in/ini.v1 v1.63.2/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= diff --git a/model/internal/data/spanid_test.go b/model/internal/data/spanid_test.go index 5d4526649f6..24e1c9e7acd 100644 --- a/model/internal/data/spanid_test.go +++ b/model/internal/data/spanid_test.go @@ -41,12 +41,10 @@ func TestSpanIDHexString(t *testing.T) { func TestSpanIDEqual(t *testing.T) { sid := NewSpanID([8]byte{}) - assert.True(t, sid.Equal(sid)) assert.True(t, sid.Equal(NewSpanID([8]byte{}))) assert.False(t, sid.Equal(NewSpanID([8]byte{1, 2, 3, 4, 5, 6, 7, 8}))) sid = NewSpanID([8]byte{1, 2, 3, 4, 5, 6, 7, 8}) - assert.True(t, sid.Equal(sid)) assert.False(t, sid.Equal(NewSpanID([8]byte{}))) assert.True(t, sid.Equal(NewSpanID([8]byte{1, 2, 3, 4, 5, 6, 7, 8}))) } diff --git a/model/internal/data/traceid_test.go b/model/internal/data/traceid_test.go index 1a16c455dc2..b57ab8defb7 100644 --- a/model/internal/data/traceid_test.go +++ b/model/internal/data/traceid_test.go @@ -41,14 +41,12 @@ func TestTraceIDHexString(t *testing.T) { func TestTraceIDEqual(t *testing.T) { tid := NewTraceID([16]byte{}) - assert.True(t, tid.Equal(tid)) assert.True(t, tid.Equal(NewTraceID([16]byte{}))) assert.False(t, tid.Equal(NewTraceID([16]byte{1}))) tid = NewTraceID([16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78}) - assert.True(t, tid.Equal(tid)) - assert.False(t, tid.Equal(NewTraceID([16]byte{}))) assert.True(t, tid.Equal(NewTraceID([16]byte{0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78}))) + assert.False(t, tid.Equal(NewTraceID([16]byte{}))) } func TestTraceIDMarshal(t *testing.T) { diff --git a/model/pdata/common_test.go b/model/pdata/common_test.go index 59909093b13..74633882173 100644 --- a/model/pdata/common_test.go +++ b/model/pdata/common_test.go @@ -246,7 +246,6 @@ func TestAttributeValueEqual(t *testing.T) { av1.CopyTo(av2.SliceVal().AppendEmpty()) assert.False(t, av1.Equal(av2)) - assert.True(t, av1.Equal(av1)) av1 = NewAttributeValueMap() av1.MapVal().InitFromMap(map[string]AttributeValue{ From 9c32cb3044f6db6896b4c18cf425a7424e3cf984 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 15 Nov 2021 09:28:26 -0800 Subject: [PATCH 33/38] Remove deprecated func in pdata (#4429) Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 4 ++++ model/pdata/common.go | 22 ---------------------- model/pdata/common_test.go | 8 ++------ 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2412ffbcd6..6c73148ccd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## 🛑 Breaking changes 🛑 + +- Remove `pdata.AttributeMap.InitFromMap` (#4429) + ## v0.39.0 Beta ## 🛑 Breaking changes 🛑 diff --git a/model/pdata/common.go b/model/pdata/common.go index fd6b0735adf..0311e42e841 100644 --- a/model/pdata/common.go +++ b/model/pdata/common.go @@ -492,28 +492,6 @@ func newAttributeMap(orig *[]otlpcommon.KeyValue) AttributeMap { return AttributeMap{orig} } -// InitFromMap overwrites the entire AttributeMap and reconstructs the AttributeMap -// with values from the given map[string]AttributeValue. -// -// Returns the same instance to allow nicer code like: -// assert.EqualValues(t, NewAttributeMap().InitFromMap(map[string]AttributeValue{...}), actual) -// Deprecated: use NewAttributeMapFromMap instead. -func (am AttributeMap) InitFromMap(attrMap map[string]AttributeValue) AttributeMap { - if len(attrMap) == 0 { - *am.orig = []otlpcommon.KeyValue(nil) - return am - } - origs := make([]otlpcommon.KeyValue, len(attrMap)) - ix := 0 - for k, v := range attrMap { - origs[ix].Key = k - v.copyTo(&origs[ix].Value) - ix++ - } - *am.orig = origs - return am -} - // Clear erases any existing entries in this AttributeMap instance. func (am AttributeMap) Clear() { *am.orig = nil diff --git a/model/pdata/common_test.go b/model/pdata/common_test.go index 74633882173..8002353a93a 100644 --- a/model/pdata/common_test.go +++ b/model/pdata/common_test.go @@ -248,16 +248,12 @@ func TestAttributeValueEqual(t *testing.T) { assert.False(t, av1.Equal(av2)) av1 = NewAttributeValueMap() - av1.MapVal().InitFromMap(map[string]AttributeValue{ - "foo": NewAttributeValueString("bar"), - }) + av1.MapVal().UpsertString("foo", "bar") assert.False(t, av1.Equal(av2)) assert.False(t, av2.Equal(av1)) av2 = NewAttributeValueMap() - av2.MapVal().InitFromMap(map[string]AttributeValue{ - "foo": NewAttributeValueString("bar"), - }) + av2.MapVal().UpsertString("foo", "bar") assert.True(t, av1.Equal(av2)) fooVal, ok := av2.MapVal().Get("foo") From 30e6bf6eeee544e869411bf50c57447323d259d9 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 15 Nov 2021 11:36:40 -0800 Subject: [PATCH 34/38] Remove Set[Map|Slice]Val. They were added in a PR focused on other change (#4430) Unfortunately during the code review of the https://github.com/open-telemetry/opentelemetry-collector/pull/3980 I missed this because was kind of "hiden" in a PR that was supposed to just do a rename of NULL -> Empty. This is yet another example why collector maintainers MUST always ask for small focused PRs and never allow other different changes. The reason to not allow this is because user need to either "CopyTo" or "MoveTo", right now the way how Set was implemented would share the same memory and is not thread safe since changes in the copied value will be reflected in the destination. Signed-off-by: Bogdan Drutu --- model/pdata/common.go | 14 -------------- model/pdata/common_test.go | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/model/pdata/common.go b/model/pdata/common.go index 0311e42e841..fe69020769f 100644 --- a/model/pdata/common.go +++ b/model/pdata/common.go @@ -255,20 +255,6 @@ func (a AttributeValue) SetBytesVal(v []byte) { a.orig.Value = &otlpcommon.AnyValue_BytesValue{BytesValue: v} } -// SetMapVal replaces the AttributeMap value associated with this AttributeValue, -// it also changes the type to be AttributeValueTypeMap. -// Calling this function on zero-initialized AttributeValue will cause a panic. -func (a AttributeValue) SetMapVal(v AttributeMap) { - a.orig.Value = &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{Values: *v.orig}} -} - -// SetSliceVal replaces the AttributeValueSlice value associated with this AttributeValue, -// it also changes the type to be AttributeValueTypeArray. -// Calling this function on zero-initialized AttributeValue will cause a panic. -func (a AttributeValue) SetSliceVal(v AttributeValueSlice) { - a.orig.Value = &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{Values: *v.orig}} -} - // copyTo copies the value to AnyValue. Will panic if dest is nil. func (a AttributeValue) copyTo(dest *otlpcommon.AnyValue) { switch v := a.orig.Value.(type) { diff --git a/model/pdata/common_test.go b/model/pdata/common_test.go index 8002353a93a..e6390495285 100644 --- a/model/pdata/common_test.go +++ b/model/pdata/common_test.go @@ -894,7 +894,7 @@ func TestAttributeValueArray(t *testing.T) { assert.EqualValues(t, NewAttributeValueString("somestr"), a2.SliceVal().At(0)) // Insert the second array as a child. - a1.SliceVal().AppendEmpty().SetSliceVal(a2.SliceVal()) + a2.CopyTo(a1.SliceVal().AppendEmpty()) assert.EqualValues(t, 2, a1.SliceVal().Len()) assert.EqualValues(t, NewAttributeValueDouble(123), a1.SliceVal().At(0)) assert.EqualValues(t, a2, a1.SliceVal().At(1)) From db4aa87dcf261c65478a9925b8fcc561ebf8e096 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Mon, 15 Nov 2021 16:25:08 -0800 Subject: [PATCH 35/38] add changelog step in cicd (#4332) This check ensures the label "skip changelog" has been applied or that the changelog has been updated. This follows the same pattern as the opentelemetry-go and opentelemetry-python SIGs. --- .github/workflows/changelog.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/changelog.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000000..f11751142b4 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,33 @@ +# This action requires that any PR targeting the main branch should touch at +# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip +# Changelog" label to disable this action. + +name: changelog + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + branches: + - main +jobs: + changelog: + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')" + + steps: + - uses: actions/checkout@v2 + + - name: Check for CHANGELOG changes + run: | + # Only the latest commit of the feature branch is available + # automatically. To diff with the base branch, we need to + # fetch that too (and we only need its latest commit). + git fetch origin ${{ github.base_ref }} --depth=1 + if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]] + then + echo "A CHANGELOG was modified. Looks good!" + else + echo "No CHANGELOG was modified." + echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required." + false + fi From 7dbf1b857c1a66e77575f0a5fc3ee0f4dcb6abaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Wed, 17 Nov 2021 17:49:27 +0100 Subject: [PATCH 36/38] Rename client.Client to client.Info (#4416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Includes documentation and how it's expected to be used by both providers and consumers. Fixes #4058 Signed-off-by: Juraci Paixão Kröhling --- client/client.go | 91 +++++++++++++++++++++++++++++++------------ client/client_test.go | 75 +++++++++++++++++++++++++++++------ client/doc_test.go | 61 +++++++++++++++++++++++++++++ 3 files changed, 191 insertions(+), 36 deletions(-) create mode 100644 client/doc_test.go diff --git a/client/client.go b/client/client.go index bdd37eca8e8..dcb8238ddb2 100644 --- a/client/client.go +++ b/client/client.go @@ -12,7 +12,44 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package client contains generic representations of clients connecting to different receivers +// Package client contains generic representations of clients connecting to +// different receivers. Components, such as processors or exporters, can make +// use of this information to make decisions related to grouping of batches, +// tenancy, load balancing, tagging, among others. +// +// The structs defined here are typically used within the context that is +// propagated down the pipeline, with the values being produced by receivers, +// and consumed by processors and exporters. +// +// Producers +// +// Receivers are responsible for obtaining a client.Info from the current +// context and enhancing the client.Info with the net.Addr from the peer, +// storing a new client.Info into the context that it passes down. For HTTP +// requests, the net.Addr is typically the IP address of the client. +// +// Typically, however, receivers would delegate this processing to helpers such +// as the confighttp or configgrpc packages: both contain interceptors that will +// enhance the context with the client.Info, such that no actions are needed by +// receivers that are built using confighttp.HTTPServerSettings or +// configgrpc.GRPCServerSettings. +// +// Consumers +// +// Provided that the pipeline does not contain processors that would discard or +// rewrite the context, such as the batch processor, processors and exporters +// have access to the client.Info via client.FromContext. Among other usages, +// this data can be used to: +// +// - annotate data points with authentication data (username, tenant, ...) +// +// - route data points based on authentication data +// +// - rate limit client calls based on IP addresses +// +// Processors and exporters relying on the existence of data from the +// client.Info, should clearly document this as part of the component's README +// file. package client // import "go.opentelemetry.io/collector/client" import ( @@ -25,50 +62,56 @@ import ( type ctxKey struct{} -// Client represents a generic client that sends data to any receiver supported by the OT receiver -type Client struct { - IP string +// Info contains data related to the clients connecting to receivers. +type Info struct { + // Addr for the client connecting to this collector. Available in a + // best-effort basis, and generally reliable for receivers making use of + // confighttp.ToServer and configgrpc.ToServerOption. + Addr net.Addr } -// NewContext takes an existing context and derives a new context with the client value stored on it -func NewContext(ctx context.Context, c *Client) context.Context { +// NewContext takes an existing context and derives a new context with the +// client.Info value stored on it. +func NewContext(ctx context.Context, c Info) context.Context { return context.WithValue(ctx, ctxKey{}, c) } -// FromContext takes a context and returns a Client value from it, if present. -func FromContext(ctx context.Context) (*Client, bool) { - c, ok := ctx.Value(ctxKey{}).(*Client) - return c, ok +// FromContext takes a context and returns a ClientInfo from it. +// When a ClientInfo isn't present, a new empty one is returned. +func FromContext(ctx context.Context) Info { + c, ok := ctx.Value(ctxKey{}).(Info) + if !ok { + c = Info{} + } + return c } // FromGRPC takes a GRPC context and tries to extract client information from it -func FromGRPC(ctx context.Context) (*Client, bool) { +func FromGRPC(ctx context.Context) (Info, bool) { if p, ok := peer.FromContext(ctx); ok { ip := parseIP(p.Addr.String()) - if ip != "" { - return &Client{ip}, true + if ip != nil { + return Info{ip}, true } } - return nil, false + return Info{}, false } // FromHTTP takes a net/http Request object and tries to extract client information from it -func FromHTTP(r *http.Request) (*Client, bool) { +func FromHTTP(r *http.Request) (Info, bool) { ip := parseIP(r.RemoteAddr) - if ip == "" { - return nil, false + if ip == nil { + return Info{}, false } - return &Client{ip}, true + return Info{ip}, true } -func parseIP(source string) string { +func parseIP(source string) net.Addr { ipstr, _, err := net.SplitHostPort(source) if err == nil { - return ipstr + source = ipstr } - ip := net.ParseIP(source) - if ip != nil { - return ip.String() + return &net.IPAddr{ + IP: net.ParseIP(source), } - return "" } diff --git a/client/client_test.go b/client/client_test.go index 2aaa13f4544..b8656669cc5 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package client contains generic representations of clients connecting to different receivers +// Package client contains generic representations of clients connecting to +// different receivers package client import ( @@ -25,16 +26,66 @@ import ( "google.golang.org/grpc/peer" ) -func TestClientContext(t *testing.T) { - ips := []string{ - "1.1.1.1", "127.0.0.1", "1111", "ip", +func TestNewContext(t *testing.T) { + testCases := []struct { + desc string + cl Info + }{ + { + desc: "valid client", + cl: Info{ + Addr: &net.IPAddr{ + IP: net.IPv4(1, 2, 3, 4), + }, + }, + }, + { + desc: "nil client", + cl: Info{}, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + ctx := NewContext(context.Background(), tC.cl) + assert.Equal(t, ctx.Value(ctxKey{}), tC.cl) + }) + } +} + +func TestFromContext(t *testing.T) { + testCases := []struct { + desc string + input context.Context + expected Info + }{ + { + desc: "context with client", + input: context.WithValue(context.Background(), ctxKey{}, Info{ + Addr: &net.IPAddr{ + IP: net.IPv4(1, 2, 3, 4), + }, + }), + expected: Info{ + Addr: &net.IPAddr{ + IP: net.IPv4(1, 2, 3, 4), + }, + }, + }, + { + desc: "context without client", + input: context.Background(), + expected: Info{}, + }, + { + desc: "context with something else in the key", + input: context.WithValue(context.Background(), ctxKey{}, "unexpected!"), + expected: Info{}, + }, } - for _, ip := range ips { - ctx := NewContext(context.Background(), &Client{ip}) - c, ok := FromContext(ctx) - assert.True(t, ok) - assert.NotNil(t, c) - assert.Equal(t, c.IP, ip) + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + assert.Equal(t, FromContext(tC.input), tC.expected) + }) } } @@ -49,12 +100,12 @@ func TestParsingGRPC(t *testing.T) { client, ok := FromGRPC(grpcCtx) assert.True(t, ok) assert.NotNil(t, client) - assert.Equal(t, client.IP, "192.168.1.1") + assert.Equal(t, client.Addr.String(), "192.168.1.1") } func TestParsingHTTP(t *testing.T) { client, ok := FromHTTP(&http.Request{RemoteAddr: "192.168.1.2"}) assert.True(t, ok) assert.NotNil(t, client) - assert.Equal(t, client.IP, "192.168.1.2") + assert.Equal(t, client.Addr.String(), "192.168.1.2") } diff --git a/client/doc_test.go b/client/doc_test.go new file mode 100644 index 00000000000..19d990d557d --- /dev/null +++ b/client/doc_test.go @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry 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 client_test + +import ( + "context" + "fmt" + "net" + + "go.opentelemetry.io/collector/client" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/model/pdata" +) + +func Example_receiver() { + // Your receiver get a next consumer when it's constructed + var next consumer.Traces + + // You'll convert the incoming data into pipeline data + td := pdata.NewTraces() + + // You probably have a context with client metadata from your listener or + // scraper + ctx := context.Background() + + // Get the client from the context: if it doesn't exist, FromContext will + // create one + cl := client.FromContext(ctx) + + // Extract the client information based on your original context and set it + // to Addr + cl.Addr = &net.IPAddr{ // nolint + IP: net.IPv4(1, 2, 3, 4), + } + + // When you are done, propagate the context down the pipeline to the next + // consumer + next.ConsumeTraces(ctx, td) // nolint +} + +func Example_processor() { + // Your processor or exporter will receive a context, from which you get the + // client information + ctx := context.Background() + cl := client.FromContext(ctx) + + // And use the information from the client as you need + fmt.Println(cl.Addr) +} From 733ad583293559bf16f1d4b6ddb7eece0803b6f5 Mon Sep 17 00:00:00 2001 From: Eric Hsueh <39718333+erichsueh3@users.noreply.github.com> Date: Wed, 17 Nov 2021 11:04:52 -0800 Subject: [PATCH 37/38] Removed `cmd/otelcol`, removed Make targets and github actions workflow (#4200) * removed cmd/otelcol, removed Make targets and github actions workflow * Added make run target back in * change to Makefile run target * removed docker-otelcol make rule * removed docker-component make rule * added back in build-binary-cmd-otelcol make rule --- .github/workflows/build-and-test.yml | 38 ------------ Makefile | 89 +--------------------------- cmd/otelcol/Dockerfile | 20 ------- cmd/otelcol/config.yaml | 34 ----------- cmd/otelcol/main.go | 52 ---------------- cmd/otelcol/main_others.go | 24 -------- cmd/otelcol/main_windows.go | 62 ------------------- 7 files changed, 3 insertions(+), 316 deletions(-) delete mode 100644 cmd/otelcol/Dockerfile delete mode 100644 cmd/otelcol/config.yaml delete mode 100644 cmd/otelcol/main.go delete mode 100644 cmd/otelcol/main_others.go delete mode 100644 cmd/otelcol/main_windows.go diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0e6179506f4..10679cc1d52 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -152,41 +152,3 @@ jobs: file: ./coverage.txt fail_ci_if_error: true verbose: true - cross-compile: - runs-on: ubuntu-latest - needs: [setup-environment] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v2.1.4 - with: - go-version: 1.17 - - name: Setup Go Environment - run: | - echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - - name: Cache Go - id: module-cache - uses: actions/cache@v2 - with: - path: /home/runner/go/pkg/mod - key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }} - - name: Build Collector for All Architectures - run: make binaries-all-sys - - name: Create Collector Binaries Archive - run: tar -cvf bin.tar ./bin - - name: Upload Collector Binaries - uses: actions/upload-artifact@v2.2.4 - with: - name: collector-binaries - path: ./bin.tar - - name: Build Unstable Collector for All Architectures - run: make binaries-all-sys-unstable - - name: Create Unstable Collector Binaries Archive - run: tar -cvf bin-unstable.tar ./bin/*unstable - - name: Upload Unstable Collector Binaries - uses: actions/upload-artifact@v2.2.4 - with: - name: collector-binaries-unstable - path: ./bin-unstable.tar diff --git a/Makefile b/Makefile index cca56b17c76..457f92ae91c 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ version: @echo ${VERSION} .PHONY: all -all: checklicense checkdoc misspell goimpi golint gotest otelcol +all: checklicense checkdoc misspell goimpi golint gotest all-modules: @echo $(ALL_MODULES) | tr ' ' '\n' | sort @@ -140,26 +140,9 @@ install-tools: cd $(TOOLS_MOD_DIR) && go install github.com/jcchavezs/porto/cmd/porto cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/build-tools/multimod -.PHONY: otelcol -otelcol: - go generate ./... - $(MAKE) build-binary-internal - -.PHONY: otelcol-unstable -otelcol-unstable: - go generate ./... - $(MAKE) build-binary-internal-unstable - .PHONY: run -run: - GO111MODULE=on go run --race ./cmd/otelcol/... --config ${RUN_CONFIG} ${RUN_ARGS} - -.PHONY: docker-component # Not intended to be used directly -docker-component: check-component - GOOS=linux $(MAKE) $(COMPONENT) - cp ./bin/$(COMPONENT)_linux_amd64 ./cmd/$(COMPONENT)/$(COMPONENT) - docker build -t $(COMPONENT) ./cmd/$(COMPONENT)/ - rm ./cmd/$(COMPONENT)/$(COMPONENT) +run: build-binary-cmd-otelcol + ./bin/cmd-otelcol --config ${RUN_CONFIG} ${RUN_ARGS} .PHONY: for-all for-all: @@ -207,72 +190,6 @@ delete-tag: git tag -d "$${dir:2}/$${TAG}" ); \ done -.PHONY: docker-otelcol -docker-otelcol: - COMPONENT=otelcol $(MAKE) docker-component - -# build collector binaries with different OS and Architecture -.PHONY: binaries-all-sys -binaries-all-sys: binaries-darwin_amd64 binaries-darwin_arm64 binaries-linux_amd64 binaries-linux_arm64 binaries-windows_amd64 - -.PHONY: binaries-all-sys-unstable -binaries-all-sys-unstable: binaries-darwin_amd64-unstable binaries-darwin_arm64-unstable binaries-linux_amd64-unstable binaries-linux_arm64-unstable binaries-windows_amd64-unstable - -.PHONY: binaries-darwin_amd64 -binaries-darwin_amd64: - GOOS=darwin GOARCH=amd64 $(MAKE) build-binary-internal - -.PHONY: binaries-darwin_arm64 -binaries-darwin_arm64: - GOOS=darwin GOARCH=arm64 $(MAKE) build-binary-internal - -.PHONY: binaries-linux_amd64 -binaries-linux_amd64: - GOOS=linux GOARCH=amd64 $(MAKE) build-binary-internal - -.PHONY: binaries-linux_arm64 -binaries-linux_arm64: - GOOS=linux GOARCH=arm64 $(MAKE) build-binary-internal - -.PHONY: binaries-windows_amd64 -binaries-windows_amd64: - GOOS=windows GOARCH=amd64 EXTENSION=.exe $(MAKE) build-binary-internal - -.PHONY: binaries-darwin_amd64-unstable -binaries-darwin_amd64-unstable: - GOOS=darwin GOARCH=amd64 $(MAKE) build-binary-internal-unstable - -.PHONY: binaries-darwin_arm64-unstable -binaries-darwin_arm64-unstable: - GOOS=darwin GOARCH=arm64 $(MAKE) build-binary-internal-unstable - -.PHONY: binaries-linux_amd64-unstable -binaries-linux_amd64-unstable: - GOOS=linux GOARCH=amd64 $(MAKE) build-binary-internal-unstable - -.PHONY: binaries-linux_arm64-unstable -binaries-linux_arm64-unstable: - GOOS=linux GOARCH=arm64 $(MAKE) build-binary-internal-unstable - -.PHONY: binaries-windows_amd64-unstable -binaries-windows_amd64-unstable: - GOOS=windows GOARCH=amd64 EXTENSION=.exe $(MAKE) build-binary-internal-unstable - -.PHONY: build-binary-internal -build-binary-internal: - GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ./bin/otelcol_$(GOOS)_$(GOARCH)$(EXTENSION) $(BUILD_INFO) ./cmd/otelcol - -.PHONY: build-binary-internal-unstable -build-binary-internal-unstable: - GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ./bin/otelcol_$(GOOS)_$(GOARCH)$(EXTENSION)_unstable $(BUILD_INFO) -tags enable_unstable ./cmd/otelcol - -.PHONY: deb-rpm-package -%-package: ARCH ?= amd64 -%-package: - $(MAKE) binaries-linux_$(ARCH) - docker build -t otelcol-fpm internal/buildscripts/packaging/fpm - docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) otelcol-fpm - # Builds a collector binary of the removed cmd/otelcol directory .PHONY: build-binary-cmd-otelcol build-binary-cmd-otelcol: diff --git a/cmd/otelcol/Dockerfile b/cmd/otelcol/Dockerfile deleted file mode 100644 index f80bab5f790..00000000000 --- a/cmd/otelcol/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM alpine:3.13 as certs -RUN apk --update add ca-certificates - -FROM alpine:3.13 AS otelcol -COPY otelcol / -# Note that this shouldn't be necessary, but in some cases the file seems to be -# copied with the execute bit lost (see #1317) -RUN chmod 755 /otelcol - -FROM scratch - -ARG USER_UID=10001 -USER ${USER_UID} - -COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=otelcol /otelcol / -COPY config.yaml /etc/otel/config.yaml -ENTRYPOINT ["/otelcol"] -CMD ["--config", "/etc/otel/config.yaml"] -EXPOSE 4317 55678 55679 diff --git a/cmd/otelcol/config.yaml b/cmd/otelcol/config.yaml deleted file mode 100644 index 967dcebb40a..00000000000 --- a/cmd/otelcol/config.yaml +++ /dev/null @@ -1,34 +0,0 @@ -extensions: - memory_ballast: - size_mib: 512 - zpages: - endpoint: 0.0.0.0:55679 - -receivers: - otlp: - protocols: - grpc: - http: - -processors: - batch: - -exporters: - logging: - logLevel: debug - -service: - - pipelines: - - traces: - receivers: [otlp] - processors: [batch] - exporters: [logging] - - metrics: - receivers: [otlp] - processors: [batch] - exporters: [logging] - - extensions: [memory_ballast, zpages] diff --git a/cmd/otelcol/main.go b/cmd/otelcol/main.go deleted file mode 100644 index 963e698afc1..00000000000 --- a/cmd/otelcol/main.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright The OpenTelemetry 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. - -// Program otelcol is the OpenTelemetry Collector that collects stats -// and traces and exports to a configured backend. -package main - -import ( - "fmt" - "log" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/internal/version" - "go.opentelemetry.io/collector/service" - "go.opentelemetry.io/collector/service/defaultcomponents" -) - -func main() { - factories, err := defaultcomponents.Components() - if err != nil { - log.Fatalf("failed to build default components: %v", err) - } - info := component.BuildInfo{ - Command: "otelcol", - Description: "OpenTelemetry Collector", - Version: version.Version, - } - - if err = run(service.CollectorSettings{BuildInfo: info, Factories: factories}); err != nil { - log.Fatal(err) - } -} - -func runInteractive(settings service.CollectorSettings) error { - cmd := service.NewCommand(settings) - if err := cmd.Execute(); err != nil { - return fmt.Errorf("collector server run finished with error: %w", err) - } - - return nil -} diff --git a/cmd/otelcol/main_others.go b/cmd/otelcol/main_others.go deleted file mode 100644 index 5f7a442d9ac..00000000000 --- a/cmd/otelcol/main_others.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The OpenTelemetry 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. - -//go:build !windows -// +build !windows - -package main - -import "go.opentelemetry.io/collector/service" - -func run(settings service.CollectorSettings) error { - return runInteractive(settings) -} diff --git a/cmd/otelcol/main_windows.go b/cmd/otelcol/main_windows.go deleted file mode 100644 index 96b6d303051..00000000000 --- a/cmd/otelcol/main_windows.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright The OpenTelemetry 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. - -//go:build windows -// +build windows - -package main - -import ( - "fmt" - "os" - - "golang.org/x/sys/windows/svc" - - "go.opentelemetry.io/collector/service" -) - -func run(set service.CollectorSettings) error { - if useInteractiveMode, err := checkWindowsService(); err != nil { - return err - } else if useInteractiveMode { - return runInteractive(set) - } else { - return runService(set) - } -} - -func checkWindowsService() (bool, error) { - // If environment variable NO_WINDOWS_SERVICE is set with any value other - // than 0, use interactive mode instead of running as a service. This should - // be set in case running as a service is not possible or desired even - // though the current session is not detected to be interactive - if value, present := os.LookupEnv("NO_WINDOWS_SERVICE"); present && value != "0" { - return true, nil - } - - if isWindowsService, err := svc.IsWindowsService(); err != nil { - return false, fmt.Errorf("failed to determine if we are running as a Windows service %w", err) - } else { - return isWindowsService, nil - } -} - -func runService(set service.CollectorSettings) error { - // do not need to supply service name when startup is invoked through Service Control Manager directly - if err := svc.Run("", service.NewWindowsService(set)); err != nil { - return fmt.Errorf("failed to start service %w", err) - } - - return nil -} From e23c9d0a01834a64162acb1677b7d69aa5be46f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Wed, 17 Nov 2021 21:32:39 +0100 Subject: [PATCH 38/38] Include local builder config to release procedure (#4446) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4445 Signed-off-by: Juraci Paixão Kröhling --- docs/release.md | 1 + internal/buildscripts/builder-config.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release.md b/docs/release.md index 088fdad811c..bd85b677e32 100644 --- a/docs/release.md +++ b/docs/release.md @@ -23,6 +23,7 @@ We release both core and contrib collectors with the same versions where the con * Update [versions.yaml](https://github.com/open-telemetry/opentelemetry-collector/blob/main/versions.yaml) * Run `make multimod-prerelease` * Update the collector version in the collector builder to the new release in `./cmd/builder/internal/builder/config.go`. + * Update the collector version in the manifest used by `make run` to the new release in `./internal/buildscripts/builder-config.yaml`. 1. Make sure the current main branch build successfully passes (Core and Contrib). For Contrib also check that the spawn-stability-tests-job triggered by the main build-publish job also passes. Check that the corresponding "-dev" images exist in Dockerhub (Core and Contrib). diff --git a/internal/buildscripts/builder-config.yaml b/internal/buildscripts/builder-config.yaml index abf1d9f1d7b..27073dda7fa 100644 --- a/internal/buildscripts/builder-config.yaml +++ b/internal/buildscripts/builder-config.yaml @@ -2,8 +2,8 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-releases/core name: cmd-otelcol description: OpenTelemetry Collector Replacing cmd/otelcol - version: 0.38.0-dev - otelcol_version: 0.38.0 + version: 0.39.0-dev + otelcol_version: 0.39.0 replaces: - go.opentelemetry.io/collector => ../