From d402d9a08df2497c866c216b22010ec9e759cecc Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 27 Jan 2021 15:48:37 -0800 Subject: [PATCH 001/149] Initial commit --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 + 2 files changed, 203 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/README.md b/README.md new file mode 100644 index 00000000000..ffa766b4450 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# opentelemetry-collector-builder +OpenTelemetry Collector Builder From 3c1dd9e8b0bfd1c9545c214e334d05c6024690be Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 29 Jan 2021 11:29:42 -0800 Subject: [PATCH 002/149] Add CODEOWNERS file (#2) * Add CODEOWNERS file * Update CODEOWNERS --- .github/CODEOWNERS | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000..09c8dc2a8f8 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,15 @@ +##################################################### +# +# List of approvers for OpenTelemetry Collector Builder +# +##################################################### +# +# Learn about membership in OpenTelemetry community: +# https://github.com/open-telemetry/community/blob/master/community-membership.md +# +# +# Learn about CODEOWNERS file format: +# https://help.github.com/en/articles/about-code-owners +# + +* @open-telemetry/collector-approvers @open-telemetry/collector-builder-approvers From fb510a9d2e5763c97c89887a84cd3f1347c04ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Tue, 2 Feb 2021 16:54:23 +0100 Subject: [PATCH 003/149] Moved from github.com/observatorium/opentelemetry-collector-builder (#3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- .github/mergify.yml | 19 ++ .github/workflows/go.yaml | 56 ++++ .github/workflows/integration-test.yaml | 24 ++ .github/workflows/release.yml | 29 ++ .gitignore | 37 +++ .golangci.yaml | 18 ++ .goreleaser.yml | 33 +++ LICENSE | 1 + README.md | 89 ++++++- RELEASE.md | 12 + cmd/root.go | 106 ++++++++ go.mod | 26 ++ go.sum | 334 ++++++++++++++++++++++++ header.txt | 13 + internal/builder/config.go | 150 +++++++++++ internal/builder/config_test.go | 96 +++++++ internal/builder/main.go | 120 +++++++++ internal/scaffold/components.go | 130 +++++++++ internal/scaffold/gomod.go | 53 ++++ internal/scaffold/main.go | 66 +++++ main.go | 23 ++ test/README.md | 3 + test/nocore.builder.yaml | 14 + test/nocore.otel.yaml | 25 ++ test/replaces.builder.yaml | 10 + test/replaces.otel.yaml | 36 +++ test/test.sh | 88 +++++++ 27 files changed, 1609 insertions(+), 2 deletions(-) create mode 100644 .github/mergify.yml create mode 100644 .github/workflows/go.yaml create mode 100644 .github/workflows/integration-test.yaml create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 .golangci.yaml create mode 100644 .goreleaser.yml create mode 100644 RELEASE.md create mode 100644 cmd/root.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 header.txt create mode 100644 internal/builder/config.go create mode 100644 internal/builder/config_test.go create mode 100644 internal/builder/main.go create mode 100644 internal/scaffold/components.go create mode 100644 internal/scaffold/gomod.go create mode 100644 internal/scaffold/main.go create mode 100644 main.go create mode 100644 test/README.md create mode 100644 test/nocore.builder.yaml create mode 100644 test/nocore.otel.yaml create mode 100644 test/replaces.builder.yaml create mode 100755 test/replaces.otel.yaml create mode 100755 test/test.sh diff --git a/.github/mergify.yml b/.github/mergify.yml new file mode 100644 index 00000000000..084d9f068c6 --- /dev/null +++ b/.github/mergify.yml @@ -0,0 +1,19 @@ +pull_request_rules: + - name: remove outdated reviews + conditions: + - base=master + actions: + dismiss_reviews: {} + + - name: Automatic merge when all checks pass and the PR is approved + conditions: + - "#approved-reviews-by>=1" + - "-draft" + - "status-success=Unit tests" + - "status-success=Code standards (linting)" + - "status-success=Security" + - "status-success=Integration test" + actions: + merge: + method: squash + commit_message: title+body diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml new file mode 100644 index 00000000000..b53263ea2a0 --- /dev/null +++ b/.github/workflows/go.yaml @@ -0,0 +1,56 @@ +name: "Continuous Integration" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + unit-tests: + name: Unit tests + runs-on: ubuntu-20.04 + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Test + run: go test -v ./... + + lint: + name: Code standards (linting) + runs-on: ubuntu-20.04 + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.29 + args: --enable=gosec,maligned,misspell + only-new-issues: true + + security: + name: Security + runs-on: ubuntu-20.04 + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: go + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml new file mode 100644 index 00000000000..4cb08817590 --- /dev/null +++ b/.github/workflows/integration-test.yaml @@ -0,0 +1,24 @@ +name: Integration tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + integration-test: + name: Integration test + runs-on: ubuntu-20.04 + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Test + run: ./test/test.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..206c02421a8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + tags: + - 'v*' + +jobs: + goreleaser: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..a5555a370fb --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/go,vscode +# Edit at https://www.toptal.com/developers/gitignore?templates=go,vscode + +### Go ### +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +### Go Patch ### +/vendor/ +/Godeps/ + +### vscode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# End of https://www.toptal.com/developers/gitignore/api/go,vscode + +/dist/ +opentelemetry-collector-builder diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 00000000000..7a659b2ad8b --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,18 @@ +# all available settings of specific linters +linters-settings: + goheader: + template-path: header.txt + goimports: + local-prefixes: github.com/open-telemetry/opentelemetry-collector-builder + maligned: + suggest-new: true + misspell: + locale: US + +linters: + enable: + - goheader + - goimports + - maligned + - misspell + - gosec diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000000..1c068ac733f --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,33 @@ +before: + hooks: + - go mod download +builds: + - flags: + - -trimpath + ldflags: + - -s -w -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.version={{.Version}} -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.date={{.Date}} + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm + - arm64 + goarm: + - 6 + - 7 +archives: + - format: binary +checksum: + name_template: "checksums.txt" +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/LICENSE b/LICENSE index 261eeb9e9f8..d6456956733 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index ffa766b4450..e6738f2f806 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,87 @@ -# opentelemetry-collector-builder -OpenTelemetry Collector Builder +# OpenTelemetry Collector builder + +This program generates a custom OpenTelemetry Collector binary based on a given configuration. + +## TL;DR +```console +$ go get github.com/open-telemetry/opentelemetry-collector-builder +$ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.19.0 +``` diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000000..b0552500521 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,12 @@ +# Releasing the OpenTelemetry Collector Builder + +This project uses [`goreleaser`](https://github.com/goreleaser/goreleaser) to manage the release of new versions. + +To release a new version, simply add a tag named `vX.Y.Z`, like: + +``` +git tag -a v0.1.1 -m "Release v0.1.1" +git push upstream v0.1.1 +``` + +A new GitHub workflow should be started, and at the end, a GitHub release should have been created, similar with the ["Release v0.1.0"](https://github.com/open-telemetry/opentelemetry-collector-builder/releases/tag/v0.1.0). \ No newline at end of file diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 00000000000..ce702b5e45d --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,106 @@ +// Copyright 2020 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 cmd + +import ( + "fmt" + "strings" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "github.com/open-telemetry/opentelemetry-collector-builder/internal/builder" +) + +var ( + version = "dev" + date = "unknown" + + cfgFile string + cfg = builder.DefaultConfig() +) + +// Execute is the main entrypoint for this application +func Execute() { + cobra.OnInitialize(initConfig) + + cmd := &cobra.Command{ + Use: "opentelemetry-collector-builder", + Long: fmt.Sprintf("OpenTelemetry Collector distribution builder (%s)", version), + RunE: func(cmd *cobra.Command, args []string) error { + + if err := cfg.Validate(); err != nil { + cfg.Logger.Error(err, "invalid configuration: %w", err) + return nil + } + + if err := cfg.ParseModules(); err != nil { + cfg.Logger.Error(err, "invalid module configuration: %w", err) + return nil + } + + return builder.GenerateAndCompile(cfg) + }, + } + + // the external config file + cmd.Flags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.otelcol-builder.yaml)") + + // the distribution parameters, which we accept as CLI flags as well + cmd.Flags().StringVar(&cfg.Distribution.ExeName, "name", "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") + cmd.Flags().StringVar(&cfg.Distribution.LongName, "description", "Custom OpenTelemetry Collector distribution", "A descriptive name for the OpenTelemetry Collector distribution") + cmd.Flags().StringVar(&cfg.Distribution.Version, "version", "1.0.0", "The version for the OpenTelemetry Collector distribution") + cmd.Flags().BoolVar(&cfg.Distribution.IncludeCore, "include-core", true, "Whether the core components should be included in the distribution") + cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") + cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files") + cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "/usr/bin/go", "The Go binary to use during the compilation phase") + cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/jpkroehling/opentelemetry-collector-builder", "The Go module for the new distribution") + + // tie Viper to flags + if err := viper.BindPFlags(cmd.Flags()); err != nil { + cfg.Logger.Error(err, "failed to bind flags") + } + + if err := cmd.Execute(); err != nil { + cfg.Logger.Error(err, "failed to run") + } +} + +func initConfig() { + cfg.Logger.Info("OpenTelemetry Collector distribution builder", "version", version, "date", date) + + // a couple of Viper goodies, to make it easier to use env vars when flags are not desirable + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + viper.AutomaticEnv() + + // load values from config file -- required for the modules configuration + if cfgFile != "" { + viper.SetConfigFile(cfgFile) + } else { + viper.AddConfigPath("$HOME") + viper.SetConfigName(".otelcol-builder") + } + + // load the config file + if err := viper.ReadInConfig(); err == nil { + cfg.Logger.Info("Using config file", "path", viper.ConfigFileUsed()) + } + + // convert Viper's internal state into our configuration object + if err := viper.Unmarshal(&cfg); err != nil { + cfg.Logger.Error(err, "failed to parse the config") + return + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 00000000000..88564c61048 --- /dev/null +++ b/go.mod @@ -0,0 +1,26 @@ +// Copyright 2020 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. + +module github.com/open-telemetry/opentelemetry-collector-builder + +go 1.14 + +require ( + github.com/go-logr/logr v0.2.1 + github.com/go-logr/zapr v0.2.0 + github.com/spf13/cobra v1.0.0 + github.com/spf13/viper v1.7.1 + github.com/stretchr/testify v1.6.1 + go.uber.org/zap v1.10.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000000..2cb2945559a --- /dev/null +++ b/go.sum @@ -0,0 +1,334 @@ +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= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/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/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/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +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-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +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= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +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-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= +github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= +github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +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-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-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +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.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +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/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/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_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/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-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= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +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-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/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= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +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 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/header.txt b/header.txt new file mode 100644 index 00000000000..1038a144623 --- /dev/null +++ b/header.txt @@ -0,0 +1,13 @@ +Copyright 2020 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. \ No newline at end of file diff --git a/internal/builder/config.go b/internal/builder/config.go new file mode 100644 index 00000000000..a7ea82dd868 --- /dev/null +++ b/internal/builder/config.go @@ -0,0 +1,150 @@ +// Copyright 2020 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 ( + "errors" + "fmt" + "io/ioutil" + "os" + "strings" + + "github.com/go-logr/logr" + "github.com/go-logr/zapr" + "go.uber.org/zap" +) + +const defaultOtelColVersion = "0.19.0" + +// ErrInvalidGoMod indicates an invalid gomod +var ErrInvalidGoMod = errors.New("invalid gomod specification for module") + +// Config holds the builder's configuration +type Config struct { + Logger logr.Logger + + Distribution Distribution `mapstructure:"dist"` + Exporters []Module `mapstructure:"exporters"` + Extensions []Module `mapstructure:"extensions"` + Receivers []Module `mapstructure:"receivers"` + Processors []Module `mapstructure:"processors"` + Replaces []string `mapstructure:"replaces"` +} + +// Distribution holds the parameters for the final binary +type Distribution struct { + Module string `mapstructure:"module"` + ExeName string `mapstructure:"name"` + Go string `mapstructure:"go"` + LongName string `mapstructure:"description"` + OtelColVersion string `mapstructure:"otelcol_version"` + IncludeCore bool `mapstructure:"include_core"` + OutputPath string `mapstructure:"output_path"` + Version string `mapstructure:"version"` +} + +// Module represents a receiver, exporter, processor or extension for the distribution +type Module struct { + Name string `mapstructure:"name"` // if not specified, this is package part of the go mod (last part of the path) + Import string `mapstructure:"import"` // if not specified, this is the path part of the go mods + GoMod string `mapstructure:"gomod"` // a gomod-compatible spec for the module + Path string `mapstructure:"path"` // an optional path to the local version of this module + Core bool `mapstructure:"core"` // whether this module comes from core, meaning that no further dependencies will be added +} + +// DefaultConfig creates a new config, with default values +func DefaultConfig() Config { + zapLog, err := zap.NewDevelopment() + if err != nil { + panic(fmt.Sprintf("failed to obtain a logger instance: %v", err)) + } + log := zapr.NewLogger(zapLog) + + outputDir, err := ioutil.TempDir("", "otelcol-distribution") + if err != nil { + log.Error(err, "failed to obtain a temporary directory") + } + + return Config{ + Logger: log, + Distribution: Distribution{ + OutputPath: outputDir, + OtelColVersion: defaultOtelColVersion, + }, + } +} + +// Validate checks whether the current configuration is valid +func (c Config) Validate() error { + return nil +} + +// ParseModules will parse the Modules entries and populate the missing values +func (c *Config) ParseModules() error { + var err error + + c.Extensions, err = parseModules(c.Extensions) + if err != nil { + return err + } + + c.Receivers, err = parseModules(c.Receivers) + if err != nil { + return err + } + + c.Exporters, err = parseModules(c.Exporters) + if err != nil { + return err + } + + c.Processors, err = parseModules(c.Processors) + if err != nil { + return err + } + + return nil +} + +func parseModules(mods []Module) ([]Module, error) { + parsedModules := []Module{} + for _, mod := range mods { + if len(mod.GoMod) == 0 && !mod.Core { + return mods, fmt.Errorf("%w, module: %q", ErrInvalidGoMod, mod.GoMod) + } + + if len(mod.Import) == 0 { + mod.Import = strings.Split(mod.GoMod, " ")[0] + } + + if len(mod.Name) == 0 { + parts := strings.Split(mod.Import, "/") + mod.Name = parts[len(parts)-1] + } + + if strings.HasPrefix(mod.Path, "./") { + path, err := os.Getwd() + if err != nil { + return mods, fmt.Errorf("module has a relative Path element, but we couldn't get the current working dir: %v", err) + } + + mod.Path = fmt.Sprintf("%s/%s", path, mod.Path[2:]) + } + + parsedModules = append(parsedModules, mod) + } + + return parsedModules, nil +} diff --git a/internal/builder/config_test.go b/internal/builder/config_test.go new file mode 100644 index 00000000000..08fab22c821 --- /dev/null +++ b/internal/builder/config_test.go @@ -0,0 +1,96 @@ +// Copyright 2020 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 ( + "errors" + "os" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestParseModules(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{{ + GoMod: "github.com/org/repo v0.1.2", + }}, + } + + // test + err := cfg.ParseModules() + assert.NoError(t, err) + + // verify + assert.Equal(t, "github.com/org/repo v0.1.2", cfg.Extensions[0].GoMod) + assert.Equal(t, "github.com/org/repo", cfg.Extensions[0].Import) + assert.Equal(t, "repo", cfg.Extensions[0].Name) +} + +func TestRelativePath(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{{ + GoMod: "some-module", + Path: "./some-module", + }}, + } + + // test + err := cfg.ParseModules() + assert.NoError(t, err) + + // verify + cwd, err := os.Getwd() + require.NoError(t, err) + assert.True(t, strings.HasPrefix(cfg.Extensions[0].Path, "/")) + assert.True(t, strings.HasPrefix(cfg.Extensions[0].Path, cwd)) +} + +func TestModuleFromCore(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{{ + Core: true, + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + }}, + } + + // test + err := cfg.ParseModules() + assert.NoError(t, err) + + // verify + assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "jaegerreceiver")) + assert.Empty(t, cfg.Extensions[0].GoMod) +} + +func TestInvalidModule(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{{ + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + }}, + } + + // test + err := cfg.ParseModules() + + // verify + assert.True(t, errors.Is(err, ErrInvalidGoMod)) +} diff --git a/internal/builder/main.go b/internal/builder/main.go new file mode 100644 index 00000000000..45bebb2ee38 --- /dev/null +++ b/internal/builder/main.go @@ -0,0 +1,120 @@ +// Copyright 2020 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 ( + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "text/template" + + "github.com/open-telemetry/opentelemetry-collector-builder/internal/scaffold" +) + +var ( + // ErrFailedToGenerateSourceFromTemplate indicates a failure in writing the final contents to the destination file + ErrFailedToGenerateSourceFromTemplate = errors.New("failed to generate source from template") + + // ErrGoNotFound is returned when a Go binary hasn't been found + ErrGoNotFound = errors.New("Go binary not found") +) + +// GenerateAndCompile will generate the source files based on the given configuration and will compile it into a binary +func GenerateAndCompile(cfg Config) error { + if err := Generate(cfg); err != nil { + return err + } + + return Compile(cfg) +} + +// Generate assembles a new distribution based on the given configuration +func Generate(cfg Config) error { + // if the file does not exist, try to create it + if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) { + if err := os.Mkdir(cfg.Distribution.OutputPath, 0755); err != nil { + 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) + } + + for _, file := range []struct { + outFile string + tmpl string + }{ + { + "main.go", + scaffold.Main, + }, + // components.go + { + "components.go", + scaffold.Components, + }, + { + "go.mod", + scaffold.Gomod, + }, + } { + 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) + } + } + + cfg.Logger.Info("Sources created", "path", cfg.Distribution.OutputPath) + return nil +} + +// Compile generates a binary from the sources based on the configuration +func Compile(cfg Config) error { + goBinary := cfg.Distribution.Go + // first, we test to check if we have Go at all + if _, err := exec.Command(goBinary, "env").CombinedOutput(); err != nil { + path, err := exec.LookPath("go") + if err != nil { + return ErrGoNotFound + } + goBinary = path + cfg.Logger.Info("Using go from PATH", "Go executable", path) + } + + cfg.Logger.Info("Compiling") + cmd := exec.Command(goBinary, "build", "-ldflags=-s -w", "-trimpath", "-o", cfg.Distribution.ExeName) + cmd.Dir = cfg.Distribution.OutputPath + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("failed to compile the OpenTelemetry Collector distribution: %w. Output: %q", err, out) + } + cfg.Logger.Info("Compiled", "binary", fmt.Sprintf("%s/%s", cfg.Distribution.OutputPath, cfg.Distribution.ExeName)) + + return nil +} + +func processAndWrite(cfg Config, tmpl string, outFile string, tmplParams interface{}) error { + t, err := template.New("template").Parse(tmpl) + if err != nil { + return err + } + + out, err := os.Create(filepath.Join(cfg.Distribution.OutputPath, outFile)) + if err != nil { + return err + } + + return t.Execute(out, tmplParams) +} diff --git a/internal/scaffold/components.go b/internal/scaffold/components.go new file mode 100644 index 00000000000..0354eae1c31 --- /dev/null +++ b/internal/scaffold/components.go @@ -0,0 +1,130 @@ +// Copyright 2020 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 + +const Components = ` +// Copyright 2020 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 main + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenterror" + {{- if .Distribution.IncludeCore}} + "go.opentelemetry.io/collector/service/defaultcomponents" + {{- end}} + + // extensions + {{- range .Extensions}} + {{.Name}} "{{.Import}}" + {{- end}} + + // receivers + {{- range .Receivers}} + {{.Name}} "{{.Import}}" + {{- end}} + + // exporters + {{- range .Exporters}} + {{.Name}} "{{.Import}}" + {{- end}} + + // processors + {{- range .Processors}} + {{.Name}} "{{.Import}}" + {{- end}} +) + +func components() (component.Factories, error) { + var errs []error + var err error + var factories component.Factories + + {{- if .Distribution.IncludeCore}} + factories, err = defaultcomponents.Components() + if err != nil { + return component.Factories{}, err + } + {{- else}} + factories = component.Factories{} + {{- end}} + + extensions := []component.ExtensionFactory{ + {{- range .Extensions}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, ext := range factories.Extensions { + extensions = append(extensions, ext) + } + factories.Extensions, err = component.MakeExtensionFactoryMap(extensions...) + if err != nil { + errs = append(errs, err) + } + + receivers := []component.ReceiverFactory{ + {{- range .Receivers}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, rcv := range factories.Receivers { + receivers = append(receivers, rcv) + } + factories.Receivers, err = component.MakeReceiverFactoryMap(receivers...) + if err != nil { + errs = append(errs, err) + } + + exporters := []component.ExporterFactory{ + {{- range .Exporters}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, exp := range factories.Exporters { + exporters = append(exporters, exp) + } + factories.Exporters, err = component.MakeExporterFactoryMap(exporters...) + if err != nil { + errs = append(errs, err) + } + + processors := []component.ProcessorFactory{ + {{- range .Processors}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, pr := range factories.Processors { + processors = append(processors, pr) + } + factories.Processors, err = component.MakeProcessorFactoryMap(processors...) + if err != nil { + errs = append(errs, err) + } + + return factories, componenterror.CombineErrors(errs) +} +` diff --git a/internal/scaffold/gomod.go b/internal/scaffold/gomod.go new file mode 100644 index 00000000000..741352e939c --- /dev/null +++ b/internal/scaffold/gomod.go @@ -0,0 +1,53 @@ +// Copyright 2020 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 + +const Gomod = ` +module {{.Distribution.Module}} + +go 1.15 + +require ( + {{- range .Extensions}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + {{- range .Receivers}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + {{- range .Exporters}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + {{- range .Processors}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + go.opentelemetry.io/collector v{{.Distribution.OtelColVersion}} +) + +{{- range .Extensions}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Receivers}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Exporters}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Processors}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Replaces}} +replace {{.}} +{{- end}} +` diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go new file mode 100644 index 00000000000..5adb0d58b2b --- /dev/null +++ b/internal/scaffold/main.go @@ -0,0 +1,66 @@ +// Copyright 2020 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 + +const Main = ` +// Copyright 2020 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.ApplicationStartInfo{ + ExeName: "{{ .Distribution.ExeName }}", + LongName: "{{ .Distribution.LongName }}", + Version: "{{ .Distribution.Version }}", + } + + app, err := service.New(service.Parameters{ApplicationStartInfo: info, Factories: factories}) + if err != nil { + log.Fatal("failed to construct the application: %w", err) + } + + err = app.Run() + if err != nil { + log.Fatal("application run finished with error: %w", err) + } +} +` diff --git a/main.go b/main.go new file mode 100644 index 00000000000..2399c22a679 --- /dev/null +++ b/main.go @@ -0,0 +1,23 @@ +// Copyright 2020 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 main + +import ( + "github.com/open-telemetry/opentelemetry-collector-builder/cmd" +) + +func main() { + cmd.Execute() +} diff --git a/test/README.md b/test/README.md new file mode 100644 index 00000000000..8c2b6f06bea --- /dev/null +++ b/test/README.md @@ -0,0 +1,3 @@ += Testing for the OpenTelemetry Collector Builder + +This is a set of end-to-end tests for the builder. As such, it includes only positive tests, based on the manifest files in this directory. Each manifest is expected to be in a working state and should yield an OpenTelemetry Collector instance that is ready within a time interval. "Ready" is defined by calling its healthcheck endpoint. diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml new file mode 100644 index 00000000000..0bf868cd054 --- /dev/null +++ b/test/nocore.builder.yaml @@ -0,0 +1,14 @@ +dist: + module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore + otelcol_version: 0.19.0 + include_core: false + +receivers: + - import: go.opentelemetry.io/collector/receiver/jaegerreceiver + core: true +exporters: + - import: go.opentelemetry.io/collector/exporter/loggingexporter + core: true +extensions: + - import: go.opentelemetry.io/collector/extension/healthcheckextension + core: true diff --git a/test/nocore.otel.yaml b/test/nocore.otel.yaml new file mode 100644 index 00000000000..8f8093839b6 --- /dev/null +++ b/test/nocore.otel.yaml @@ -0,0 +1,25 @@ +extensions: + health_check: + +receivers: + jaeger: + protocols: + grpc: + thrift_http: + thrift_compact: + thrift_binary: + +processors: + +exporters: + logging: + +service: + extensions: [health_check] + pipelines: + traces: + receivers: + - jaeger + processors: [] + exporters: + - logging diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml new file mode 100644 index 00000000000..26e0121c1ca --- /dev/null +++ b/test/replaces.builder.yaml @@ -0,0 +1,10 @@ +dist: + module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces + otelcol_version: 0.19.0 + +processors: + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.19.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.19.0 + +replaces: + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.19.0 diff --git a/test/replaces.otel.yaml b/test/replaces.otel.yaml new file mode 100755 index 00000000000..04e3d5053fd --- /dev/null +++ b/test/replaces.otel.yaml @@ -0,0 +1,36 @@ +extensions: + health_check: + +receivers: + otlp: + protocols: + grpc: + endpoint: localhost:4317 + +processors: + resourcedetection: + detectors: + - env + routing: + default_exporters: + - logging + from_attribute: X-Tenant + table: + - value: acme + exporters: + - logging + +exporters: + logging: + +service: + extensions: [health_check] + pipelines: + traces: + receivers: + - otlp + processors: + - resourcedetection + - routing + exporters: + - logging diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 00000000000..d03c508f85a --- /dev/null +++ b/test/test.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +# each attempt pauses for 100ms before retrying +max_retries=50 + +tests="replaces nocore" + +base=`mktemp -d` +echo "Running the tests in ${base}" + +failed=false +for test in $tests +do + out="${base}/${test}" + mkdir -p "${out}" + if [ $? != 0 ]; then + echo "❌ FAIL ${test}. Failed to create test directory for the test. Aborting tests." + exit 2 + fi + + echo "Starting test '${test}' at `date`" >> "${out}/test.log" + + go run . --config "./test/${test}.builder.yaml" --output-path "${out}" --name otelcol-built-test > "${out}/builder.log" 2>&1 + if [ $? != 0 ]; then + echo "❌ FAIL ${test}. Failed to compile the test ${test}. Build logs:" + cat "${out}/builder.log" + failed=true + continue + fi + + if [ ! -f "${out}/otelcol-built-test" ]; then + echo "❌ FAIL ${test}. Binary not found for ${test} at '${out}/otelcol-built-test'. Build logs:" + cat "${out}/builder.log" + failed=true + continue + fi + + # start the distribution + "${out}/otelcol-built-test" --config "./test/${test}.otel.yaml" > "${out}/otelcol.log" 2>&1 & + pid=$! + + retries=0 + while true + do + kill -0 "${pid}" >/dev/null 2>&1 + if [ $? != 0 ]; then + echo "❌ FAIL ${test}. The OpenTelemetry Collector isn't running. Startup log:" + cat "${out}/otelcol.log" + failed=true + break + fi + + curl -s localhost:13133 | grep "Server available" > /dev/null + if [ $? == 0 ]; then + echo "✅ PASS ${test}" + + kill "${pid}" + if [ $? != 0 ]; then + echo "Failed to stop the running instance for test ${test}. Return code: $? . Skipping tests." + exit 4 + fi + break + fi + + echo "Server still unavailable for test '${test}'" >> "${out}/test.log" + + let "retries++" + if [ "$retries" -gt "$max_retries" ]; then + echo "❌ FAIL ${test}. Server wasn't up after about 5s." + failed=true + + kill "${pid}" + if [ $? != 0 ]; then + echo "Failed to stop the running instance for test ${test}. Return code: $? . Skipping tests." + exit 8 + fi + break + fi + sleep 0.1s + done + + echo "Stopping server for '${test}' (pid: ${pid})" >> "${out}/test.log" + wait ${pid} +done + +if [[ "$failed" == "true" ]]; then + exit 1 +fi From fdf9416d4fdd3eab2740de63c4f32a615007daa7 Mon Sep 17 00:00:00 2001 From: Joe Elliott Date: Thu, 11 Feb 2021 07:26:09 -0500 Subject: [PATCH 004/149] fixed panics (#6) Signed-off-by: Joe Elliott --- cmd/root.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index ce702b5e45d..27cbb15c983 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -42,12 +42,12 @@ func Execute() { RunE: func(cmd *cobra.Command, args []string) error { if err := cfg.Validate(); err != nil { - cfg.Logger.Error(err, "invalid configuration: %w", err) + cfg.Logger.Error(err, "invalid configuration") return nil } if err := cfg.ParseModules(); err != nil { - cfg.Logger.Error(err, "invalid module configuration: %w", err) + cfg.Logger.Error(err, "invalid module configuration") return nil } From 40a858ed96294ed686250a947e6fdbaa42e8abf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 11 Feb 2021 15:27:06 +0100 Subject: [PATCH 005/149] Replace master with main in CI and mergify files (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- .github/mergify.yml | 2 +- .github/workflows/go.yaml | 6 +++--- .github/workflows/integration-test.yaml | 6 +++--- .github/workflows/release.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 084d9f068c6..ca5b7649f62 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,7 +1,7 @@ pull_request_rules: - name: remove outdated reviews conditions: - - base=master + - base=main actions: dismiss_reviews: {} diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index b53263ea2a0..8a7d6f9dfce 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -2,9 +2,9 @@ name: "Continuous Integration" on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: unit-tests: @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.14 + go-version: 1.15 - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 4cb08817590..7f1c852aa52 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -2,9 +2,9 @@ name: Integration tests on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: integration-test: @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.14 + go-version: 1.15 - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 206c02421a8..0ef63d06c43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.14 + go-version: 1.15 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 From 1da8f731dbd7ce56405f7d9e083739cbb1cb35e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 11 Feb 2021 17:07:55 +0100 Subject: [PATCH 006/149] Bump to OpenTelemetry Collector 0.20.0 (#10) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #9 Signed-off-by: Juraci Paixão Kröhling --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e6738f2f806..8fa123b918d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.19.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.20.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index a7ea82dd868..794ab60efb5 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.19.0" +const defaultOtelColVersion = "0.20.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 0bf868cd054..fefa29595d1 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.19.0 + otelcol_version: 0.20.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 26e0121c1ca..d2241e279d6 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.19.0 + otelcol_version: 0.20.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.19.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.19.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.20.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.20.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.19.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.20.0 From f29b566da56fc0e0d5365ceef2c0072b4b5ba41b Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Wed, 3 Mar 2021 00:49:56 -0800 Subject: [PATCH 007/149] Explicitly enable Go modules in quickstart instructions (#13) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fa123b918d..7481aa63145 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given ## TL;DR ```console -$ go get github.com/open-telemetry/opentelemetry-collector-builder +$ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < Date: Tue, 9 Mar 2021 17:46:17 +0100 Subject: [PATCH 008/149] Update to collector v0.21.0 (#17) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #16 Signed-off-by: Juraci Paixão Kröhling --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7481aa63145..13d7c5df671 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.20.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.21.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 794ab60efb5..83efd4c68f0 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.20.0" +const defaultOtelColVersion = "0.21.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index fefa29595d1..93dcad22b97 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.20.0 + otelcol_version: 0.21.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index d2241e279d6..7f26be7509f 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.20.0 + otelcol_version: 0.21.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.20.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.20.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.21.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.21.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.20.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.21.0 From c9fe6966eba55a28368caccb589b9c913adba7e5 Mon Sep 17 00:00:00 2001 From: Brian Gibbins Date: Thu, 11 Mar 2021 09:47:42 +0000 Subject: [PATCH 009/149] Update to collector v0.22.0 (#19) --- README.md | 8 +- go.sum | 132 ++++++++++++++++++++++++++++++++ internal/builder/config.go | 2 +- internal/scaffold/components.go | 4 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 +- 6 files changed, 144 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 13d7c5df671..ee2b538e0ae 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.21.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.22.0 ``` diff --git a/go.sum b/go.sum index 2cb2945559a..32e9164ff0e 100644 --- a/go.sum +++ b/go.sum @@ -4,141 +4,230 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1 h1:hL+ycaJpVE9M7nLoiXb/Pn10ENE2u+oddxbD8uu0ZVU= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0 h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1 h1:W9tAK3E57P75u0XLLR82LZyw8VpAnhmyTOxW9qzmyj8= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0 h1:VV2nUM3wwLLGh9lSABFgZMjInyUbJeaRSE64WuAIQ+4= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= 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 h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f h1:Jnx61latede7zDD3DiiP4gmNz33uK0U5HDUaF0a/HVQ= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1 h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +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 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= 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 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0 h1:ZqfnKyx9KGpRcW04j5nnPDgRgoXUeLh2YFBeFzphcA0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +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/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -147,28 +236,43 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -184,6 +288,7 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/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= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -191,12 +296,18 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= @@ -210,13 +321,16 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 h1:A1gGSx58LAGVHUUsOf7IiR0u8Xb6W51gRwfDBhkdcaw= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -224,10 +338,13 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0 h1:sfUMP1Gu8qASkorDVjnMuvgJzwFbTZSeXFiGBYAVdl4= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 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= @@ -243,14 +360,17 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -271,6 +391,7 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -288,16 +409,20 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc h1:NCy3Ohtk6Iny5V/reW2Ktypo4zIpWBdRJ1uFMjBxdg8= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 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= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -307,18 +432,23 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= 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 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -330,5 +460,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/internal/builder/config.go b/internal/builder/config.go index 83efd4c68f0..50f04c706f3 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.21.0" +const defaultOtelColVersion = "0.22.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/scaffold/components.go b/internal/scaffold/components.go index 0354eae1c31..74b105c8644 100644 --- a/internal/scaffold/components.go +++ b/internal/scaffold/components.go @@ -33,7 +33,7 @@ package main import ( "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/component/componenterror" + "go.opentelemetry.io/collector/consumer/consumererror" {{- if .Distribution.IncludeCore}} "go.opentelemetry.io/collector/service/defaultcomponents" {{- end}} @@ -125,6 +125,6 @@ func components() (component.Factories, error) { errs = append(errs, err) } - return factories, componenterror.CombineErrors(errs) + return factories, consumererror.CombineErrors(errs) } ` diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 93dcad22b97..083d6acda11 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.21.0 + otelcol_version: 0.22.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 7f26be7509f..8a129e96863 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.21.0 + otelcol_version: 0.22.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.21.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.21.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.22.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.22.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.21.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.22.0 From 7c67d1e86b570a02d2f14be24c37ff44df1a03ca Mon Sep 17 00:00:00 2001 From: Brian Gibbins Date: Mon, 15 Mar 2021 16:02:54 +0000 Subject: [PATCH 010/149] Download go modules before building (#20) Fixes #14 --- internal/builder/main.go | 62 ++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/internal/builder/main.go b/internal/builder/main.go index 45bebb2ee38..b199c012897 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -21,6 +21,7 @@ import ( "os/exec" "path/filepath" "text/template" + "time" "github.com/open-telemetry/opentelemetry-collector-builder/internal/scaffold" ) @@ -33,12 +34,17 @@ var ( ErrGoNotFound = errors.New("Go binary not found") ) -// GenerateAndCompile will generate the source files based on the given configuration and will compile it into a binary +// GenerateAndCompile will generate the source files based on the given configuration, update go mod, and will compile into a binary func GenerateAndCompile(cfg Config) error { if err := Generate(cfg); err != nil { return err } + // run go get to update go.mod and go.sum files + if err := GetModules(cfg); err != nil { + return err + } + return Compile(cfg) } @@ -83,15 +89,10 @@ func Generate(cfg Config) error { // Compile generates a binary from the sources based on the configuration func Compile(cfg Config) error { - goBinary := cfg.Distribution.Go // first, we test to check if we have Go at all - if _, err := exec.Command(goBinary, "env").CombinedOutput(); err != nil { - path, err := exec.LookPath("go") - if err != nil { - return ErrGoNotFound - } - goBinary = path - cfg.Logger.Info("Using go from PATH", "Go executable", path) + goBinary, err := getGoPath(cfg) + if err != nil { + return err } cfg.Logger.Info("Compiling") @@ -105,6 +106,49 @@ func Compile(cfg Config) error { return nil } +// GetModules retrieves the go modules, updating go.mod and go.sum in the process +func GetModules(cfg Config) error { + // first, we test to check if we have Go at all + goBinary, err := getGoPath(cfg) + if err != nil { + return err + } + + cfg.Logger.Info("Getting go modules") + cmd := exec.Command(goBinary, "mod", "download") + cmd.Dir = cfg.Distribution.OutputPath + + // basic retry if error from go mod command (in case of transient network error). This could be improved + // retry 3 times with 5 second spacing interval + retries := 3 + failReason := "unknown" + for i := 1; i <= retries; i++ { + if out, err := cmd.CombinedOutput(); err != nil { + failReason = fmt.Sprintf("%s. Output: %q", err, out) + cfg.Logger.Info("Failed modules download", "retry", fmt.Sprintf("%d/%d", i, retries)) + time.Sleep(5 * time.Second) + continue + } + return nil + } + return fmt.Errorf("failed to download go modules: %s", failReason) +} + +// getGoPath checks if go is present and correct, and returns a useable go bin location +func getGoPath(cfg Config) (string, error) { + goBinary := cfg.Distribution.Go + if _, err := exec.Command(goBinary, "env").CombinedOutput(); err != nil { + path, err := exec.LookPath("go") + if err != nil { + return "", ErrGoNotFound + } + goBinary = path + cfg.Logger.Info("Using go from PATH", "Go executable", path) + } + + return goBinary, nil +} + func processAndWrite(cfg Config, tmpl string, outFile string, tmplParams interface{}) error { t, err := template.New("template").Parse(tmpl) if err != nil { From a6b22d382b9054f0323fe60fc9ad9baa34f19f18 Mon Sep 17 00:00:00 2001 From: Ashmita Date: Tue, 23 Mar 2021 02:53:32 +1100 Subject: [PATCH 011/149] Add version command (#25) Signed-off-by: Ashmita Bohara --- .gitignore | 3 +++ cmd/root.go | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index a5555a370fb..011870efb61 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,9 @@ !.vscode/extensions.json *.code-workspace +### goland ### +.idea + # End of https://www.toptal.com/developers/gitignore/api/go,vscode /dist/ diff --git a/cmd/root.go b/cmd/root.go index 27cbb15c983..2ef0b491217 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -30,6 +30,15 @@ var ( cfgFile string cfg = builder.DefaultConfig() + + versionCmd = &cobra.Command{ + Use: "version", + Short: "Version of opentelemetry-collector-builder", + Long: "Prints the version of opentelemetry-collector-builder binary", + Run: func(cmd *cobra.Command, args []string) { + fmt.Println(version) + }, + } ) // Execute is the main entrypoint for this application @@ -68,6 +77,9 @@ func Execute() { cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "/usr/bin/go", "The Go binary to use during the compilation phase") cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/jpkroehling/opentelemetry-collector-builder", "The Go module for the new distribution") + // version of this binary + cmd.AddCommand(versionCmd) + // tie Viper to flags if err := viper.BindPFlags(cmd.Flags()); err != nil { cfg.Logger.Error(err, "failed to bind flags") From 5b9df7b448911f8b45fb17fb4d514b9adba79c0c Mon Sep 17 00:00:00 2001 From: Brian Gibbins Date: Tue, 30 Mar 2021 21:12:15 +0100 Subject: [PATCH 012/149] Pass errors from cobra Execute back to main for correct exit code (#28) * pass errors from cobra execute back to main * print the error --- cmd/root.go | 11 ++++++++--- go.mod | 2 +- go.sum | 7 +++++++ main.go | 8 +++++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 2ef0b491217..5a6b3bc60f1 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -42,7 +42,7 @@ var ( ) // Execute is the main entrypoint for this application -func Execute() { +func Execute() error { cobra.OnInitialize(initConfig) cmd := &cobra.Command{ @@ -52,12 +52,12 @@ func Execute() { if err := cfg.Validate(); err != nil { cfg.Logger.Error(err, "invalid configuration") - return nil + return err } if err := cfg.ParseModules(); err != nil { cfg.Logger.Error(err, "invalid module configuration") - return nil + return err } return builder.GenerateAndCompile(cfg) @@ -83,11 +83,15 @@ func Execute() { // tie Viper to flags if err := viper.BindPFlags(cmd.Flags()); err != nil { cfg.Logger.Error(err, "failed to bind flags") + return err } if err := cmd.Execute(); err != nil { cfg.Logger.Error(err, "failed to run") + return err } + + return nil } func initConfig() { @@ -113,6 +117,7 @@ func initConfig() { // convert Viper's internal state into our configuration object if err := viper.Unmarshal(&cfg); err != nil { cfg.Logger.Error(err, "failed to parse the config") + cobra.CheckErr(err) return } } diff --git a/go.mod b/go.mod index 88564c61048..3f9b8c4b946 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ go 1.14 require ( github.com/go-logr/logr v0.2.1 github.com/go-logr/zapr v0.2.0 - github.com/spf13/cobra v1.0.0 + github.com/spf13/cobra v1.1.3 github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.6.1 go.uber.org/zap v1.10.0 diff --git a/go.sum b/go.sum index 32e9164ff0e..8d5755607db 100644 --- a/go.sum +++ b/go.sum @@ -280,11 +280,16 @@ github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +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.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -455,6 +460,8 @@ 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.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go index 2399c22a679..0ef002a58d7 100644 --- a/main.go +++ b/main.go @@ -15,9 +15,15 @@ package main import ( + "fmt" + "os" + "github.com/open-telemetry/opentelemetry-collector-builder/cmd" ) func main() { - cmd.Execute() + if err := cmd.Execute(); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } } From 3d8003917fc52e128e14830d5fe0eb266e210a16 Mon Sep 17 00:00:00 2001 From: Brian Gibbins Date: Tue, 30 Mar 2021 21:13:15 +0100 Subject: [PATCH 013/149] Update to collector v0.23.0 (#27) --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ee2b538e0ae..1b19c6a6e2b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.22.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.23.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 50f04c706f3..766209c5c16 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.22.0" +const defaultOtelColVersion = "0.23.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 083d6acda11..874cb4dd116 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.22.0 + otelcol_version: 0.23.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 8a129e96863..06638fbb7ac 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.22.0 + otelcol_version: 0.23.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.22.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.22.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.23.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.23.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.22.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.23.0 From 8ad7683f2f1087bf11c697ee0c78850ddf89c4cd Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Tue, 6 Apr 2021 12:58:00 +0100 Subject: [PATCH 014/149] Generate a warning if the builder and collector base version mismatch (#30) * Generate a warning if the builder and collector base version mismatch * Show current default version in the warning message --- internal/builder/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/builder/main.go b/internal/builder/main.go index b199c012897..1b514023179 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -50,6 +50,10 @@ func GenerateAndCompile(cfg Config) error { // Generate assembles a new distribution based on the given configuration func Generate(cfg Config) error { + // create a warning message for non-aligned builder and collector base + if cfg.Distribution.OtelColVersion != defaultOtelColVersion { + cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", "builder-version", defaultOtelColVersion) + } // if the file does not exist, try to create it if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) { if err := os.Mkdir(cfg.Distribution.OutputPath, 0755); err != nil { From 35f8b0d8e811897093e62d39e15a337df23d36ad Mon Sep 17 00:00:00 2001 From: Shaun Creary <65406540+crearys@users.noreply.github.com> Date: Tue, 13 Apr 2021 10:36:38 +0100 Subject: [PATCH 015/149] Update to OpenTelemetry Collector 0.24.0 --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/scaffold/components.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1b19c6a6e2b..d2f9259da16 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.23.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.24.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 766209c5c16..2a1c0387d2f 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.23.0" +const defaultOtelColVersion = "0.24.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/scaffold/components.go b/internal/scaffold/components.go index 74b105c8644..4173576ee48 100644 --- a/internal/scaffold/components.go +++ b/internal/scaffold/components.go @@ -125,6 +125,6 @@ func components() (component.Factories, error) { errs = append(errs, err) } - return factories, consumererror.CombineErrors(errs) + return factories, consumererror.Combine(errs) } ` diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 874cb4dd116..7c75e77fbef 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.23.0 + otelcol_version: 0.24.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 06638fbb7ac..8b974d7270f 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.23.0 + otelcol_version: 0.24.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.23.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.23.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.24.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.24.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.23.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.24.0 From bd48b7d2adf390f91f35a39ebaca098d677cfa65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= <69143962+pmalek-sumo@users.noreply.github.com> Date: Thu, 15 Apr 2021 13:08:12 +0200 Subject: [PATCH 016/149] Don't use %w formatting with log.Fatal (#35) --- internal/scaffold/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index 5adb0d58b2b..10a180f587d 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -55,12 +55,12 @@ func main() { app, err := service.New(service.Parameters{ApplicationStartInfo: info, Factories: factories}) if err != nil { - log.Fatal("failed to construct the application: %w", err) + log.Fatalf("failed to construct the application: %v", err) } err = app.Run() if err != nil { - log.Fatal("application run finished with error: %w", err) + log.Fatalf("application run finished with error: %v", err) } } ` From 4056de97124fbc912981aab87a5a3766cd062229 Mon Sep 17 00:00:00 2001 From: Serge Catudal Date: Wed, 21 Apr 2021 10:57:33 -0400 Subject: [PATCH 017/149] Update to OpenTelemetry Collector 0.25.0 (#36) Signed-off-by: Serge Catudal --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d2f9259da16..3d3d96dc9b9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.24.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.25.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 2a1c0387d2f..e1f8aacb5af 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.24.0" +const defaultOtelColVersion = "0.25.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 7c75e77fbef..f05c09d8322 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.24.0 + otelcol_version: 0.25.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 8b974d7270f..38009943b89 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.24.0 + otelcol_version: 0.25.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.24.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.24.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.25.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.25.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.24.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.25.0 From fe3af5d7ca9898ac43c73459350aa9f5a1326ead Mon Sep 17 00:00:00 2001 From: Shaun Creary <65406540+crearys@users.noreply.github.com> Date: Mon, 10 May 2021 13:38:23 +0100 Subject: [PATCH 018/149] Update to 0.26.0 and update BuildInfo (#39) --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/scaffold/main.go | 8 ++++---- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3d3d96dc9b9..2856d50b068 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.25.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.26.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index e1f8aacb5af..0fecfccd1b3 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.25.0" +const defaultOtelColVersion = "0.26.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index 10a180f587d..fd6de23a66d 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -47,13 +47,13 @@ func main() { log.Fatalf("failed to build components: %v", err) } - info := component.ApplicationStartInfo{ - ExeName: "{{ .Distribution.ExeName }}", - LongName: "{{ .Distribution.LongName }}", + info := component.BuildInfo{ + Command: "{{ .Distribution.ExeName }}", + Description: "{{ .Distribution.LongName }}", Version: "{{ .Distribution.Version }}", } - app, err := service.New(service.Parameters{ApplicationStartInfo: info, Factories: factories}) + app, err := service.New(service.Parameters{BuildInfo: info, Factories: factories}) if err != nil { log.Fatalf("failed to construct the application: %v", err) } diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index f05c09d8322..fe1e076e702 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.25.0 + otelcol_version: 0.26.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 38009943b89..465d8a55e1b 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.25.0 + otelcol_version: 0.26.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.25.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.25.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.26.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.26.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.25.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.26.0 From 4f061ca264b426091f796fbb535407cdf3b88a17 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Tue, 11 May 2021 08:53:55 -0700 Subject: [PATCH 019/149] Sync build and CI Go versions at latest 1.16 (#34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Sync build and CI Go versions at latest 1.16 * Run go mod tidy * Set go binary to use in the compilation phase in tests Signed-off-by: Juraci Paixão Kröhling Co-authored-by: Juraci Paixão Kröhling --- .github/workflows/go.yaml | 2 +- .github/workflows/integration-test.yaml | 2 +- .github/workflows/release.yml | 4 +- go.mod | 2 +- go.sum | 147 ------------------------ internal/scaffold/gomod.go | 2 +- test/test.sh | 14 ++- 7 files changed, 19 insertions(+), 154 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 8a7d6f9dfce..05844862b99 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 7f1c852aa52..f0116cd3a6c 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ef63d06c43..a54664e95e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 @@ -26,4 +26,4 @@ jobs: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/go.mod b/go.mod index 3f9b8c4b946..ac7af80d741 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ module github.com/open-telemetry/opentelemetry-collector-builder -go 1.14 +go 1.16 require ( github.com/go-logr/logr v0.2.1 diff --git a/go.sum b/go.sum index 8d5755607db..a8b2e2225e9 100644 --- a/go.sum +++ b/go.sum @@ -4,230 +4,136 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go/bigquery v1.0.1 h1:hL+ycaJpVE9M7nLoiXb/Pn10ENE2u+oddxbD8uu0ZVU= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/firestore v1.1.0 h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1 h1:W9tAK3E57P75u0XLLR82LZyw8VpAnhmyTOxW9qzmyj8= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0 h1:VV2nUM3wwLLGh9lSABFgZMjInyUbJeaRSE64WuAIQ+4= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= 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 h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f h1:Jnx61latede7zDD3DiiP4gmNz33uK0U5HDUaF0a/HVQ= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1 h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -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 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= 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 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0 h1:ZqfnKyx9KGpRcW04j5nnPDgRgoXUeLh2YFBeFzphcA0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -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/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -236,64 +142,44 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/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= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -301,18 +187,10 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= @@ -326,16 +204,13 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 h1:A1gGSx58LAGVHUUsOf7IiR0u8Xb6W51gRwfDBhkdcaw= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -343,13 +218,10 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0 h1:sfUMP1Gu8qASkorDVjnMuvgJzwFbTZSeXFiGBYAVdl4= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 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= @@ -363,19 +235,15 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -396,7 +264,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -414,20 +281,16 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc h1:NCy3Ohtk6Iny5V/reW2Ktypo4zIpWBdRJ1uFMjBxdg8= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 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= -google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -437,28 +300,20 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= 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 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -467,7 +322,5 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/internal/scaffold/gomod.go b/internal/scaffold/gomod.go index 741352e939c..9890c408bb9 100644 --- a/internal/scaffold/gomod.go +++ b/internal/scaffold/gomod.go @@ -17,7 +17,7 @@ package scaffold const Gomod = ` module {{.Distribution.Module}} -go 1.15 +go 1.16 require ( {{- range .Extensions}} diff --git a/test/test.sh b/test/test.sh index d03c508f85a..cd7a498336d 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,5 +1,17 @@ #!/bin/bash +GOBIN=$(go env GOBIN) +if [[ "$GO" == "" ]]; then + GOBIN=$(which go) +fi + +if [[ "$GOBIN" == "" ]]; then + echo "Could not determine which Go binary to use." + exit 1 +fi + +echo "Using ${GOBIN} to compile the distributions." + # each attempt pauses for 100ms before retrying max_retries=50 @@ -20,7 +32,7 @@ do echo "Starting test '${test}' at `date`" >> "${out}/test.log" - go run . --config "./test/${test}.builder.yaml" --output-path "${out}" --name otelcol-built-test > "${out}/builder.log" 2>&1 + go run . --go "${GOBIN}" --config "./test/${test}.builder.yaml" --output-path "${out}" --name otelcol-built-test > "${out}/builder.log" 2>&1 if [ $? != 0 ]; then echo "❌ FAIL ${test}. Failed to compile the test ${test}. Build logs:" cat "${out}/builder.log" From 5b5d3fbbf6da92c41ebe53fcc4db91f25206c583 Mon Sep 17 00:00:00 2001 From: Brian Gibbins Date: Wed, 12 May 2021 14:07:22 +0100 Subject: [PATCH 020/149] Add option to generate go code only (no compile) (#40) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Issue#24 Add option to generate go code only (no compile) * Update cmd/root.go logging Suggested by @jpkkrohling Co-authored-by: Juraci Paixão Kröhling * remove verbose help .. created by corba * suggestion by jpkrohling to keep generateandcompile * lint error: remove unused var * reword cmd option and add back help message for default Co-authored-by: Juraci Paixão Kröhling --- cmd/root.go | 1 + internal/builder/config.go | 3 ++- internal/builder/main.go | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 5a6b3bc60f1..0eb823b23a3 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -68,6 +68,7 @@ func Execute() error { cmd.Flags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.otelcol-builder.yaml)") // the distribution parameters, which we accept as CLI flags as well + cmd.Flags().BoolVar(&cfg.SkipCompilation, "skip-compilation", false, "Whether builder should only generate go code with no compile of the collector (default false)") cmd.Flags().StringVar(&cfg.Distribution.ExeName, "name", "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") cmd.Flags().StringVar(&cfg.Distribution.LongName, "description", "Custom OpenTelemetry Collector distribution", "A descriptive name for the OpenTelemetry Collector distribution") cmd.Flags().StringVar(&cfg.Distribution.Version, "version", "1.0.0", "The version for the OpenTelemetry Collector distribution") diff --git a/internal/builder/config.go b/internal/builder/config.go index 0fecfccd1b3..8b9bc865797 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -33,7 +33,8 @@ var ErrInvalidGoMod = errors.New("invalid gomod specification for module") // Config holds the builder's configuration type Config struct { - Logger logr.Logger + Logger logr.Logger + SkipCompilation bool Distribution Distribution `mapstructure:"dist"` Exporters []Module `mapstructure:"exporters"` diff --git a/internal/builder/main.go b/internal/builder/main.go index 1b514023179..12228414a54 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -93,6 +93,11 @@ func Generate(cfg Config) error { // Compile generates a binary from the sources based on the configuration func Compile(cfg Config) error { + if cfg.SkipCompilation { + cfg.Logger.Info("Generating source codes only, the distribution will not be compiled.") + return nil + } + // first, we test to check if we have Go at all goBinary, err := getGoPath(cfg) if err != nil { From d8500e6ddc8bc45ab955dd8bd53cbd274fbe4b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Tue, 18 May 2021 15:59:21 +0200 Subject: [PATCH 021/149] Don't reuse exec.Cmd (#42) --- internal/builder/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/builder/main.go b/internal/builder/main.go index 12228414a54..1d22f43452f 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -124,14 +124,14 @@ func GetModules(cfg Config) error { } cfg.Logger.Info("Getting go modules") - cmd := exec.Command(goBinary, "mod", "download") - cmd.Dir = cfg.Distribution.OutputPath // basic retry if error from go mod command (in case of transient network error). This could be improved // retry 3 times with 5 second spacing interval retries := 3 failReason := "unknown" for i := 1; i <= retries; i++ { + cmd := exec.Command(goBinary, "mod", "download") + cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { failReason = fmt.Sprintf("%s. Output: %q", err, out) cfg.Logger.Info("Failed modules download", "retry", fmt.Sprintf("%d/%d", i, retries)) From 7e4aa7ff252c33b8630ab3513ef435fa5058c8b9 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Wed, 19 May 2021 01:52:58 -0700 Subject: [PATCH 022/149] Update to OpenTelemetry Collector 0.27.0 (#43) --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2856d50b068..0387fb73c0c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.26.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 8b9bc865797..b0c3da6a217 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.26.0" +const defaultOtelColVersion = "0.27.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index fe1e076e702..6fbc32844b2 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.26.0 + otelcol_version: 0.27.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 465d8a55e1b..06acd8f32e9 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.26.0 + otelcol_version: 0.27.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.26.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.26.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.27.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.27.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.26.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0 From 78e8560c7572e70c67eb4f5464313337cb1170e5 Mon Sep 17 00:00:00 2001 From: Kelvin Lo Date: Wed, 26 May 2021 03:32:24 -0700 Subject: [PATCH 023/149] Add CI Badge (#47) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0387fb73c0c..e044ce179f1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # OpenTelemetry Collector builder +[![CI](https://github.com/open-telemetry/opentelemetry-collector-builder/actions/workflows/go.yaml/badge.svg)](https://github.com/open-telemetry/opentelemetry-collector-builder/actions/workflows/go.yaml?query=branch%3Amain) This program generates a custom OpenTelemetry Collector binary based on a given configuration. From 16563b62eb5b22680947e2ec127f966a56ec1aeb Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Thu, 24 Jun 2021 16:54:13 +0800 Subject: [PATCH 024/149] Update to Collector v0.28.0 (#49) * Update to Collector v0.28.0 Closes #48 Addresses the breaking API change in https://github.com/open-telemetry/opentelemetry-collector/pull/3163, besides the usual version number changes. Signed-off-by: Fangyi Zhou * Use `go mod tidy` instead of `go mod download` It appears that this magically resolves the go.mod file issue. https://stackoverflow.com/questions/67203641/missing-go-sum-entry-for-module-providing-package-package-name Signed-off-by: Fangyi Zhou --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/builder/main.go | 2 +- internal/scaffold/main.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e044ce179f1..3de3ec472a5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index b0c3da6a217..73eaf2b56e0 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.27.0" +const defaultOtelColVersion = "0.28.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/builder/main.go b/internal/builder/main.go index 1d22f43452f..ff17bcccf8e 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -130,7 +130,7 @@ func GetModules(cfg Config) error { retries := 3 failReason := "unknown" for i := 1; i <= retries; i++ { - cmd := exec.Command(goBinary, "mod", "download") + cmd := exec.Command(goBinary, "mod", "tidy") cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { failReason = fmt.Sprintf("%s. Output: %q", err, out) diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index fd6de23a66d..e7a55d82e4f 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -53,7 +53,7 @@ func main() { Version: "{{ .Distribution.Version }}", } - app, err := service.New(service.Parameters{BuildInfo: info, Factories: factories}) + app, err := service.New(service.AppSettings{BuildInfo: info, Factories: factories}) if err != nil { log.Fatalf("failed to construct the application: %v", err) } diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 6fbc32844b2..aed07139568 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.27.0 + otelcol_version: 0.28.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 06acd8f32e9..832851b543a 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.27.0 + otelcol_version: 0.28.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.27.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.27.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.28.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.28.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0 From a468961ec2882aeebe60293dd86696fd057c1ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Thu, 24 Jun 2021 11:55:20 +0200 Subject: [PATCH 025/149] Account for go mod download in go1.17 not updating go.sum (#50) --- internal/builder/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/builder/main.go b/internal/builder/main.go index ff17bcccf8e..a1a79710f64 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -130,7 +130,7 @@ func GetModules(cfg Config) error { retries := 3 failReason := "unknown" for i := 1; i <= retries; i++ { - cmd := exec.Command(goBinary, "mod", "tidy") + cmd := exec.Command(goBinary, "mod", "download", "all") cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { failReason = fmt.Sprintf("%s. Output: %q", err, out) From 9225b86b630982547da980a1d81460d943cd733d Mon Sep 17 00:00:00 2001 From: Himanshu Date: Fri, 25 Jun 2021 20:04:35 +0530 Subject: [PATCH 026/149] Update to collector v0.29.0 (#54) * Update replaces.builder.yaml * Update nocore.builder.yaml * Update config.go * Update README.md * Update main.go --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/scaffold/main.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3de3ec472a5..8bcb45da663 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.29.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 73eaf2b56e0..6502b044a0c 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.28.0" +const defaultOtelColVersion = "0.29.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index e7a55d82e4f..78760b6b9c6 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -53,7 +53,7 @@ func main() { Version: "{{ .Distribution.Version }}", } - app, err := service.New(service.AppSettings{BuildInfo: info, Factories: factories}) + app, err := service.New(service.CollectorSettings{BuildInfo: info, Factories: factories}) if err != nil { log.Fatalf("failed to construct the application: %v", err) } diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index aed07139568..e3a2d845e30 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.28.0 + otelcol_version: 0.29.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 832851b543a..7dd6f00acbc 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.28.0 + otelcol_version: 0.29.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.28.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.28.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.29.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.29.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.29.0 From 4afd9184f3849ba6ca4e062b61d1e5e7db0853e9 Mon Sep 17 00:00:00 2001 From: "Y.Horie" Date: Thu, 15 Jul 2021 22:32:02 +0900 Subject: [PATCH 027/149] Update to collector v0.30.0 (#57) --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8bcb45da663..aa9de735780 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.29.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.30.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 6502b044a0c..3a813df6eb4 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.29.0" +const defaultOtelColVersion = "0.30.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index e3a2d845e30..773e613cc3b 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.29.0 + otelcol_version: 0.30.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 7dd6f00acbc..d9854c29eec 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.29.0 + otelcol_version: 0.30.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.29.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.29.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.30.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.30.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.29.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.30.0 From c50c4775c0fd445d622ee2332e4a2981898dc71b Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Mon, 19 Jul 2021 16:30:08 +0900 Subject: [PATCH 028/149] cmd: fix module flag default value to github.com/open-telemetry (#58) Signed-off-by: Koichi Shiraishi --- cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 0eb823b23a3..626db0e702a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -76,7 +76,7 @@ func Execute() error { cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files") cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "/usr/bin/go", "The Go binary to use during the compilation phase") - cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/jpkroehling/opentelemetry-collector-builder", "The Go module for the new distribution") + cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/open-telemetry/opentelemetry-collector-builder", "The Go module for the new distribution") // version of this binary cmd.AddCommand(versionCmd) From f6a51444ca6cae19e91b8248a3b298cf25e0eddc Mon Sep 17 00:00:00 2001 From: Shaun Creary <65406540+crearys@users.noreply.github.com> Date: Tue, 3 Aug 2021 08:04:00 +0100 Subject: [PATCH 029/149] Update to collector v0.31.0 (#60) --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index aa9de735780..51a224e3b68 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.30.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.31.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 3a813df6eb4..9c4aba5438a 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.30.0" +const defaultOtelColVersion = "0.31.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 773e613cc3b..514e1ddd07a 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.30.0 + otelcol_version: 0.31.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index d9854c29eec..120f20643e9 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.30.0 + otelcol_version: 0.31.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.30.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.30.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.31.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.31.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.30.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.31.0 From 10e9c076f935986a195fc5bfdaff072d3d98abfd Mon Sep 17 00:00:00 2001 From: Anthony Mirabella Date: Wed, 25 Aug 2021 03:35:59 -0400 Subject: [PATCH 030/149] Update to v0.33.0 (#62) Signed-off-by: Anthony J Mirabella --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 51a224e3b68..9c766a5a90f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.31.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.33.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index 9c4aba5438a..2aecfdc763a 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.31.0" +const defaultOtelColVersion = "0.33.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 514e1ddd07a..f982f24030c 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.31.0 + otelcol_version: 0.33.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 120f20643e9..8956e2174cc 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.31.0 + otelcol_version: 0.33.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.31.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.31.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.33.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.33.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.31.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.33.0 From 6689c36182b3fe23a78ef63bf6014c91fbf3886b Mon Sep 17 00:00:00 2001 From: Anthony Mirabella Date: Wed, 25 Aug 2021 03:40:13 -0400 Subject: [PATCH 031/149] Add excludes support to generated go.mod (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anthony J Mirabella Co-authored-by: Juraci Paixão Kröhling --- internal/builder/config.go | 1 + internal/scaffold/gomod.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/internal/builder/config.go b/internal/builder/config.go index 2aecfdc763a..fd0a7eac9c7 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -42,6 +42,7 @@ type Config struct { Receivers []Module `mapstructure:"receivers"` Processors []Module `mapstructure:"processors"` Replaces []string `mapstructure:"replaces"` + Excludes []string `mapstructure:"excludes"` } // Distribution holds the parameters for the final binary diff --git a/internal/scaffold/gomod.go b/internal/scaffold/gomod.go index 9890c408bb9..2f49578647e 100644 --- a/internal/scaffold/gomod.go +++ b/internal/scaffold/gomod.go @@ -50,4 +50,7 @@ require ( {{- range .Replaces}} replace {{.}} {{- end}} +{{- range .Excludes}} +exclude {{.}} +{{- end}} ` From 08d2c20ca10b02b69e6dac6c17651a4a82897b27 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 1 Sep 2021 00:20:04 -0700 Subject: [PATCH 032/149] Small cleanup for the builder files (#64) Signed-off-by: Bogdan Drutu --- internal/builder/config.go | 8 ++++---- internal/builder/main.go | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/internal/builder/config.go b/internal/builder/config.go index fd0a7eac9c7..06da30cc6bc 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -121,17 +121,17 @@ func (c *Config) ParseModules() error { } func parseModules(mods []Module) ([]Module, error) { - parsedModules := []Module{} + var parsedModules []Module for _, mod := range mods { - if len(mod.GoMod) == 0 && !mod.Core { + if mod.GoMod == "" && !mod.Core { return mods, fmt.Errorf("%w, module: %q", ErrInvalidGoMod, mod.GoMod) } - if len(mod.Import) == 0 { + if mod.Import == "" { mod.Import = strings.Split(mod.GoMod, " ")[0] } - if len(mod.Name) == 0 { + if mod.Name == "" { parts := strings.Split(mod.Import, "/") mod.Name = parts[len(parts)-1] } diff --git a/internal/builder/main.go b/internal/builder/main.go index a1a79710f64..142b6273bba 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -27,11 +27,8 @@ import ( ) var ( - // ErrFailedToGenerateSourceFromTemplate indicates a failure in writing the final contents to the destination file - ErrFailedToGenerateSourceFromTemplate = errors.New("failed to generate source from template") - // ErrGoNotFound is returned when a Go binary hasn't been found - ErrGoNotFound = errors.New("Go binary not found") + ErrGoNotFound = errors.New("go binary not found") ) // GenerateAndCompile will generate the source files based on the given configuration, update go mod, and will compile into a binary From 5bb41375483cd28c2f4d4bdad37c6644db432dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Wed, 1 Sep 2021 20:51:45 +0200 Subject: [PATCH 033/149] Support building with Go 1.17 (#66) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support building with Go 1.17 Fixes #65 Signed-off-by: Juraci Paixão Kröhling * Update workflows to use Go 1.17 Signed-off-by: Juraci Paixão Kröhling * Add gosec exceptions for exec.Command Signed-off-by: Juraci Paixão Kröhling --- .github/workflows/go.yaml | 2 +- .github/workflows/integration-test.yaml | 2 +- .github/workflows/release.yml | 2 +- cmd/root.go | 2 +- go.mod | 25 ++++++++++++++++- internal/builder/config.go | 13 ++++++++- internal/builder/main.go | 37 ++++++------------------- internal/scaffold/gomod.go | 2 +- 8 files changed, 50 insertions(+), 35 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 05844862b99..f7893d6fb4f 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index f0116cd3a6c..7fbe81bcbac 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a54664e95e9..8cb55ebb47a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 diff --git a/cmd/root.go b/cmd/root.go index 626db0e702a..229853ff798 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -75,7 +75,7 @@ func Execute() error { cmd.Flags().BoolVar(&cfg.Distribution.IncludeCore, "include-core", true, "Whether the core components should be included in the distribution") cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files") - cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "/usr/bin/go", "The Go binary to use during the compilation phase") + cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "", "The Go binary to use during the compilation phase. Default: go from the PATH") cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/open-telemetry/opentelemetry-collector-builder", "The Go module for the new distribution") // version of this binary diff --git a/go.mod b/go.mod index ac7af80d741..a6374f62af0 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ module github.com/open-telemetry/opentelemetry-collector-builder -go 1.16 +go 1.17 require ( github.com/go-logr/logr v0.2.1 @@ -24,3 +24,26 @@ require ( github.com/stretchr/testify v1.6.1 go.uber.org/zap v1.10.0 ) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/spf13/afero v1.1.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + go.uber.org/atomic v1.4.0 // indirect + go.uber.org/multierr v1.1.0 // indirect + golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect + golang.org/x/text v0.3.2 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/internal/builder/config.go b/internal/builder/config.go index 06da30cc6bc..f8af3a42d26 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -19,6 +19,7 @@ import ( "fmt" "io/ioutil" "os" + "os/exec" "strings" "github.com/go-logr/logr" @@ -89,7 +90,17 @@ func DefaultConfig() Config { } // Validate checks whether the current configuration is valid -func (c Config) Validate() error { +func (c *Config) Validate() error { + // #nosec G204 + if _, err := exec.Command(c.Distribution.Go, "env").CombinedOutput(); err != nil { + path, err := exec.LookPath("go") + if err != nil { + return ErrGoNotFound + } + c.Distribution.Go = path + } + c.Logger.Info("Using go", "Go executable", c.Distribution.Go) + return nil } diff --git a/internal/builder/main.go b/internal/builder/main.go index 142b6273bba..2b8ab7773c1 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -95,14 +95,9 @@ func Compile(cfg Config) error { return nil } - // first, we test to check if we have Go at all - goBinary, err := getGoPath(cfg) - if err != nil { - return err - } - cfg.Logger.Info("Compiling") - cmd := exec.Command(goBinary, "build", "-ldflags=-s -w", "-trimpath", "-o", cfg.Distribution.ExeName) + // #nosec G204 + cmd := exec.Command(cfg.Distribution.Go, "build", "-ldflags=-s -w", "-trimpath", "-o", cfg.Distribution.ExeName) cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("failed to compile the OpenTelemetry Collector distribution: %w. Output: %q", err, out) @@ -114,20 +109,21 @@ func Compile(cfg Config) error { // GetModules retrieves the go modules, updating go.mod and go.sum in the process func GetModules(cfg Config) error { - // first, we test to check if we have Go at all - goBinary, err := getGoPath(cfg) - if err != nil { - return err + // #nosec G204 + cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy") + cmd.Dir = cfg.Distribution.OutputPath + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("failed to update go.mod: %w. Output: %q", err, out) } cfg.Logger.Info("Getting go modules") - // basic retry if error from go mod command (in case of transient network error). This could be improved // retry 3 times with 5 second spacing interval retries := 3 failReason := "unknown" for i := 1; i <= retries; i++ { - cmd := exec.Command(goBinary, "mod", "download", "all") + // #nosec G204 + cmd := exec.Command(cfg.Distribution.Go, "mod", "download", "all") cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { failReason = fmt.Sprintf("%s. Output: %q", err, out) @@ -140,21 +136,6 @@ func GetModules(cfg Config) error { return fmt.Errorf("failed to download go modules: %s", failReason) } -// getGoPath checks if go is present and correct, and returns a useable go bin location -func getGoPath(cfg Config) (string, error) { - goBinary := cfg.Distribution.Go - if _, err := exec.Command(goBinary, "env").CombinedOutput(); err != nil { - path, err := exec.LookPath("go") - if err != nil { - return "", ErrGoNotFound - } - goBinary = path - cfg.Logger.Info("Using go from PATH", "Go executable", path) - } - - return goBinary, nil -} - func processAndWrite(cfg Config, tmpl string, outFile string, tmplParams interface{}) error { t, err := template.New("template").Parse(tmpl) if err != nil { diff --git a/internal/scaffold/gomod.go b/internal/scaffold/gomod.go index 2f49578647e..275f5c92a15 100644 --- a/internal/scaffold/gomod.go +++ b/internal/scaffold/gomod.go @@ -17,7 +17,7 @@ package scaffold const Gomod = ` module {{.Distribution.Module}} -go 1.16 +go 1.17 require ( {{- range .Extensions}} From 5ada61a99b0d9112936a2f94ed47b070600a4a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 2 Sep 2021 09:00:46 +0200 Subject: [PATCH 034/149] Update to OpenTelemetry core 0.34.0 (#68) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #67 Signed-off-by: Juraci Paixão Kröhling --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/builder/main.go | 2 +- test/nocore.builder.yaml | 6 +++--- test/nocore.otel.yaml | 11 ++++------- test/replaces.builder.yaml | 8 ++++---- test/replaces.otel.yaml | 4 ++-- test/test.sh | 2 +- 8 files changed, 20 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9c766a5a90f..f22694d600a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.33.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.34.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index f8af3a42d26..a7bcba5cba3 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -27,7 +27,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.33.0" +const defaultOtelColVersion = "0.34.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/builder/main.go b/internal/builder/main.go index 2b8ab7773c1..8a8ca6c012d 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -110,7 +110,7 @@ func Compile(cfg Config) error { // GetModules retrieves the go modules, updating go.mod and go.sum in the process func GetModules(cfg Config) error { // #nosec G204 - cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy") + cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.17") cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("failed to update go.mod: %w. Output: %q", err, out) diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index f982f24030c..80d57877c9d 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,14 +1,14 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.33.0 + otelcol_version: 0.34.0 include_core: false receivers: - - import: go.opentelemetry.io/collector/receiver/jaegerreceiver + - import: go.opentelemetry.io/collector/receiver/otlpreceiver core: true exporters: - import: go.opentelemetry.io/collector/exporter/loggingexporter core: true extensions: - - import: go.opentelemetry.io/collector/extension/healthcheckextension + - import: go.opentelemetry.io/collector/extension/zpagesextension core: true diff --git a/test/nocore.otel.yaml b/test/nocore.otel.yaml index 8f8093839b6..e0d615cd3d9 100644 --- a/test/nocore.otel.yaml +++ b/test/nocore.otel.yaml @@ -1,13 +1,10 @@ extensions: - health_check: + zpages: receivers: - jaeger: + otlp: protocols: grpc: - thrift_http: - thrift_compact: - thrift_binary: processors: @@ -15,11 +12,11 @@ exporters: logging: service: - extensions: [health_check] + extensions: [zpages] pipelines: traces: receivers: - - jaeger + - otlp processors: [] exporters: - logging diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 8956e2174cc..bf603e85b96 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.33.0 + otelcol_version: 0.34.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.33.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.33.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.34.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.34.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.33.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.34.0 diff --git a/test/replaces.otel.yaml b/test/replaces.otel.yaml index 04e3d5053fd..ebf08a2d925 100755 --- a/test/replaces.otel.yaml +++ b/test/replaces.otel.yaml @@ -1,5 +1,5 @@ extensions: - health_check: + zpages: receivers: otlp: @@ -24,7 +24,7 @@ exporters: logging: service: - extensions: [health_check] + extensions: [zpages] pipelines: traces: receivers: diff --git a/test/test.sh b/test/test.sh index cd7a498336d..bc4d598a8dc 100755 --- a/test/test.sh +++ b/test/test.sh @@ -62,7 +62,7 @@ do break fi - curl -s localhost:13133 | grep "Server available" > /dev/null + curl -s http://localhost:55679/debug/servicez | grep Uptime > /dev/null if [ $? == 0 ]; then echo "✅ PASS ${test}" From eb82ae43fcc4855ab101936eada3d69c6ea699dc Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Tue, 14 Sep 2021 10:01:50 +0100 Subject: [PATCH 035/149] Upgrade to OpenTelemetry Collector 0.35.0 (#70) Signed-off-by: Fangyi Zhou --- README.md | 8 ++++---- internal/builder/config.go | 2 +- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f22694d600a..b8548efc8a8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.34.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.35.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index a7bcba5cba3..b6d0ecdd9c4 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -27,7 +27,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.34.0" +const defaultOtelColVersion = "0.35.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 80d57877c9d..b68c19acf21 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.34.0 + otelcol_version: 0.35.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index bf603e85b96..d03e04794ae 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.34.0 + otelcol_version: 0.35.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.34.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.34.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.35.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.35.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.34.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.35.0 From 66efd8054f83c44a2a7de6d170d8985bcc572948 Mon Sep 17 00:00:00 2001 From: Pavan Krishna Date: Thu, 30 Sep 2021 08:30:54 -0700 Subject: [PATCH 036/149] [Minor] Fixed receiverbuilder error log statement to include CreateLogsReceiver (#4152) * [Minor] fixed error log statement to include CreateLogsReceiver also needs to return the same receiver pointer * go fmt --- service/internal/builder/receivers_builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/internal/builder/receivers_builder.go b/service/internal/builder/receivers_builder.go index fc69866aca6..f3adbff993c 100644 --- a/service/internal/builder/receivers_builder.go +++ b/service/internal/builder/receivers_builder.go @@ -214,8 +214,8 @@ func attachReceiverToPipelines( if rcv.receiver != createdReceiver { return fmt.Errorf( "factory for %v is implemented incorrectly: "+ - "CreateTracesReceiver and CreateMetricsReceiver must return the same "+ - "receiver pointer when creating receivers of different data types", + "CreateTracesReceiver, CreateMetricsReceiver and CreateLogsReceiver must return "+ + "the same receiver pointer when creating receivers of different data types", cfg.ID(), ) } From ee7fa0eeed0213fc8927368f12f31581148751cc Mon Sep 17 00:00:00 2001 From: Anthony Mirabella Date: Thu, 30 Sep 2021 12:15:50 -0400 Subject: [PATCH 037/149] obsreport: wire up ProcessorCreateSettings for processors using obsreport (#4148) * obsreport: wire up ProcessorCreateSettings for processors using obsreport Signed-off-by: Anthony J Mirabella * Add ToProcessorCreateSettings() to obsreporttest settings Signed-off-by: Anthony J Mirabella * Fix lint issue Signed-off-by: Anthony J Mirabella --- obsreport/obsreport_processor.go | 6 ++++-- obsreport/obsreport_test.go | 18 +++++++++++++++--- obsreport/obsreporttest/obsreporttest.go | 7 +++++++ processor/memorylimiterprocessor/factory.go | 6 +++--- .../memorylimiterprocessor/memorylimiter.go | 8 +++++--- .../memorylimiter_test.go | 2 +- 6 files changed, 35 insertions(+), 12 deletions(-) diff --git a/obsreport/obsreport_processor.go b/obsreport/obsreport_processor.go index f5df4b4ffd8..94b0149f439 100644 --- a/obsreport/obsreport_processor.go +++ b/obsreport/obsreport_processor.go @@ -21,6 +21,7 @@ import ( "go.opencensus.io/stats" "go.opencensus.io/tag" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" @@ -48,8 +49,9 @@ type Processor struct { // ProcessorSettings are settings for creating a Processor. type ProcessorSettings struct { - Level configtelemetry.Level - ProcessorID config.ComponentID + Level configtelemetry.Level + ProcessorID config.ComponentID + ProcessorCreateSettings component.ProcessorCreateSettings } // NewProcessor creates a new Processor. diff --git a/obsreport/obsreport_test.go b/obsreport/obsreport_test.go index 3bffcde04e0..86c8be0701b 100644 --- a/obsreport/obsreport_test.go +++ b/obsreport/obsreport_test.go @@ -464,7 +464,11 @@ func TestProcessorTraceData(t *testing.T) { const refusedSpans = 19 const droppedSpans = 13 - obsrep := NewProcessor(ProcessorSettings{Level: configtelemetry.LevelNormal, ProcessorID: processor}) + obsrep := NewProcessor(ProcessorSettings{ + Level: configtelemetry.LevelNormal, + ProcessorID: processor, + ProcessorCreateSettings: set.ToProcessorCreateSettings(), + }) obsrep.TracesAccepted(context.Background(), acceptedSpans) obsrep.TracesRefused(context.Background(), refusedSpans) obsrep.TracesDropped(context.Background(), droppedSpans) @@ -481,7 +485,11 @@ func TestProcessorMetricsData(t *testing.T) { const refusedPoints = 11 const droppedPoints = 17 - obsrep := NewProcessor(ProcessorSettings{Level: configtelemetry.LevelNormal, ProcessorID: processor}) + obsrep := NewProcessor(ProcessorSettings{ + Level: configtelemetry.LevelNormal, + ProcessorID: processor, + ProcessorCreateSettings: set.ToProcessorCreateSettings(), + }) obsrep.MetricsAccepted(context.Background(), acceptedPoints) obsrep.MetricsRefused(context.Background(), refusedPoints) obsrep.MetricsDropped(context.Background(), droppedPoints) @@ -520,7 +528,11 @@ func TestProcessorLogRecords(t *testing.T) { const refusedRecords = 11 const droppedRecords = 17 - obsrep := NewProcessor(ProcessorSettings{Level: configtelemetry.LevelNormal, ProcessorID: processor}) + obsrep := NewProcessor(ProcessorSettings{ + Level: configtelemetry.LevelNormal, + ProcessorID: processor, + ProcessorCreateSettings: set.ToProcessorCreateSettings(), + }) obsrep.LogsAccepted(context.Background(), acceptedRecords) obsrep.LogsRefused(context.Background(), refusedRecords) obsrep.LogsDropped(context.Background(), droppedRecords) diff --git a/obsreport/obsreporttest/obsreporttest.go b/obsreport/obsreporttest/obsreporttest.go index aa0292ac894..1b4171dae91 100644 --- a/obsreport/obsreporttest/obsreporttest.go +++ b/obsreport/obsreporttest/obsreporttest.go @@ -59,6 +59,13 @@ func (tts *TestTelemetrySettings) ToExporterCreateSettings() component.ExporterC return exporterSettings } +// ToProcessorCreateSettings returns ProcessorCreateSettings with configured TelemetrySettings +func (tts *TestTelemetrySettings) ToProcessorCreateSettings() component.ProcessorCreateSettings { + processorSettings := componenttest.NewNopProcessorCreateSettings() + processorSettings.TelemetrySettings = tts.TelemetrySettings + return processorSettings +} + // ToReceiverCreateSettings returns ReceiverCreateSettings with configured TelemetrySettings func (tts *TestTelemetrySettings) ToReceiverCreateSettings() component.ReceiverCreateSettings { receiverSettings := componenttest.NewNopReceiverCreateSettings() diff --git a/processor/memorylimiterprocessor/factory.go b/processor/memorylimiterprocessor/factory.go index 419d8da2c64..532e45efae4 100644 --- a/processor/memorylimiterprocessor/factory.go +++ b/processor/memorylimiterprocessor/factory.go @@ -54,7 +54,7 @@ func createTracesProcessor( cfg config.Processor, nextConsumer consumer.Traces, ) (component.TracesProcessor, error) { - ml, err := newMemoryLimiter(set.Logger, cfg.(*Config)) + ml, err := newMemoryLimiter(set, cfg.(*Config)) if err != nil { return nil, err } @@ -73,7 +73,7 @@ func createMetricsProcessor( cfg config.Processor, nextConsumer consumer.Metrics, ) (component.MetricsProcessor, error) { - ml, err := newMemoryLimiter(set.Logger, cfg.(*Config)) + ml, err := newMemoryLimiter(set, cfg.(*Config)) if err != nil { return nil, err } @@ -91,7 +91,7 @@ func createLogsProcessor( cfg config.Processor, nextConsumer consumer.Logs, ) (component.LogsProcessor, error) { - ml, err := newMemoryLimiter(set.Logger, cfg.(*Config)) + ml, err := newMemoryLimiter(set, cfg.(*Config)) if err != nil { return nil, err } diff --git a/processor/memorylimiterprocessor/memorylimiter.go b/processor/memorylimiterprocessor/memorylimiter.go index 9093c11bde0..89475054af0 100644 --- a/processor/memorylimiterprocessor/memorylimiter.go +++ b/processor/memorylimiterprocessor/memorylimiter.go @@ -89,7 +89,7 @@ type memoryLimiter struct { const minGCIntervalWhenSoftLimited = 10 * time.Second // newMemoryLimiter returns a new memorylimiter processor. -func newMemoryLimiter(logger *zap.Logger, cfg *Config) (*memoryLimiter, error) { +func newMemoryLimiter(set component.ProcessorCreateSettings, cfg *Config) (*memoryLimiter, error) { if cfg.CheckInterval <= 0 { return nil, errCheckIntervalOutOfRange } @@ -97,6 +97,7 @@ func newMemoryLimiter(logger *zap.Logger, cfg *Config) (*memoryLimiter, error) { return nil, errLimitOutOfRange } + logger := set.Logger usageChecker, err := getMemUsageChecker(cfg, logger) if err != nil { return nil, err @@ -114,8 +115,9 @@ func newMemoryLimiter(logger *zap.Logger, cfg *Config) (*memoryLimiter, error) { readMemStatsFn: runtime.ReadMemStats, logger: logger, obsrep: obsreport.NewProcessor(obsreport.ProcessorSettings{ - Level: configtelemetry.GetMetricsLevelFlagValue(), - ProcessorID: cfg.ID(), + Level: configtelemetry.GetMetricsLevelFlagValue(), + ProcessorID: cfg.ID(), + ProcessorCreateSettings: set, }), } diff --git a/processor/memorylimiterprocessor/memorylimiter_test.go b/processor/memorylimiterprocessor/memorylimiter_test.go index b3563e62658..95b55b32ba4 100644 --- a/processor/memorylimiterprocessor/memorylimiter_test.go +++ b/processor/memorylimiterprocessor/memorylimiter_test.go @@ -89,7 +89,7 @@ func TestNew(t *testing.T) { cfg.CheckInterval = tt.args.checkInterval cfg.MemoryLimitMiB = tt.args.memoryLimitMiB cfg.MemorySpikeLimitMiB = tt.args.memorySpikeLimitMiB - got, err := newMemoryLimiter(zap.NewNop(), cfg) + got, err := newMemoryLimiter(componenttest.NewNopProcessorCreateSettings(), cfg) if err != tt.wantErr { t.Errorf("newMemoryLimiter() error = %v, wantErr %v", err, tt.wantErr) return From e2d7f320bfd89b8755996f8609128c0383ae74c9 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 30 Sep 2021 09:44:57 -0700 Subject: [PATCH 038/149] Add more details about collector status (#4040) * Add more details about collector status Signed-off-by: Bogdan Drutu * Update README.md * Update README.md * Update README.md * Update README.md --- README.md | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 76bc3350758..e7a2c090437 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,13 @@

- Go Report Card - + Go Report Card - Build Status - + Build Status - Codecov Status - + Codecov Status - GitHub release (latest by date including pre-releases) - - Beta + GitHub release (latest by date including pre-releases)

@@ -62,6 +57,36 @@ Objectives: - Extensible: Customizable without touching the core code. - Unified: Single codebase, deployable as an agent or collector with support for traces, metrics and logs. +## Status + +The collector components and implementation are in different stages of stability, and usually split between +functionality and configuration: + +| Signal | Component | Status | +|--------|-----------|--------| +|Trace | OTLP protocol | Stable | +|| OTLP receiver functionality | Stable | +|| OTLP receiver configuration | Beta | +|| OTLP exporter functionality | Stable | +|| OTLP exporter configuration | Beta | +|Metric | OTLP protocol | Stable | +|| OTLP receiver functionality | Stable | +|| OTLP receiver configuration | Beta | +|| OTLP exporter functionality | Stable | +|| OTLP exporter configuration | Beta | +|Logs | OTLP protocol | Beta | +|| OTLP receiver functionality | Beta | +|| OTLP receiver configuration | Beta | +|| OTLP exporter functionality | Beta | +|| OTLP exporter configuration | Beta | +|Common| Logging exporter | unstable | +|| Batch processor functionality | Beta | +|| Batch processor configuration | Beta | +|| MemoryLimiter processor functionality | Beta | +|| MemoryLimiter processor configuration | Beta | + +We follow the production maturity level defined [here](https://github.com/open-telemetry/community/blob/47813530864b9fe5a5146f466a58bd2bb94edc72/maturity-matrix.yaml#L31) + ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md). From d193b03f47b51164dc1d4a56c0a970dee31da834 Mon Sep 17 00:00:00 2001 From: Eyal Maderer Date: Fri, 1 Oct 2021 03:09:28 -0700 Subject: [PATCH 039/149] Add version to the internal telemetry metrics (#4140) Added a version tag to the collector's own telemetry metrics because today when looking at those metrics there is no way to know the collector's version, this can also help to know what collector versions are running out there. I based the "flag" to control this on [PR 3816](https://github.com/open-telemetry/opentelemetry-collector/pull/3816) --- service/telemetry.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/service/telemetry.go b/service/telemetry.go index fb5975f4e18..61cf01cbc28 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -36,6 +36,7 @@ import ( "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/internal/collector/telemetry" "go.opentelemetry.io/collector/internal/obsreportconfig" + "go.opentelemetry.io/collector/internal/version" semconv "go.opentelemetry.io/collector/model/semconv/v1.5.0" "go.opentelemetry.io/collector/processor/batchprocessor" telemetry2 "go.opentelemetry.io/collector/service/internal/telemetry" @@ -44,6 +45,9 @@ import ( // collectorTelemetry is collector's own telemetry. var collectorTelemetry collectorTelemetryExporter = &colTelemetry{} +// AddCollectorVersionTag indicates if the collector version tag should be added to all telemetry metrics +const AddCollectorVersionTag = true + type collectorTelemetryExporter interface { init(asyncErrorChannel chan<- error, ballastSizeBytes uint64, logger *zap.Logger) error shutdown() error @@ -79,6 +83,7 @@ func (tel *colTelemetry) initOnce(asyncErrorChannel chan<- error, ballastSizeByt } var instanceID string + if telemetry.GetAddInstanceID() { instanceUUID, _ := uuid.NewRandom() instanceID = instanceUUID.String() @@ -104,6 +109,7 @@ func (tel *colTelemetry) initOnce(asyncErrorChannel chan<- error, ballastSizeByt zap.String("address", metricsAddr), zap.Int8("level", int8(level)), // TODO: make it human friendly zap.String(semconv.AttributeServiceInstanceID, instanceID), + zap.String(semconv.AttributeServiceVersion, version.Version), ) mux := http.NewServeMux() @@ -148,10 +154,14 @@ func (tel *colTelemetry) initOpenCensus(level configtelemetry.Level, instanceID Namespace: telemetry.GetMetricsPrefix(), } + opts.ConstLabels = make(map[string]string) + if telemetry.GetAddInstanceID() { - opts.ConstLabels = map[string]string{ - sanitizePrometheusKey(semconv.AttributeServiceInstanceID): instanceID, - } + opts.ConstLabels[sanitizePrometheusKey(semconv.AttributeServiceInstanceID)] = instanceID + } + + if AddCollectorVersionTag { + opts.ConstLabels[sanitizePrometheusKey(semconv.AttributeServiceVersion)] = version.Version } pe, err := prometheus.NewExporter(opts) From 506090baaa56a0303b4282778aab141f03984874 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 1 Oct 2021 10:07:04 -0700 Subject: [PATCH 040/149] Move telemetry flags to the same file as config flags (#4154) Signed-off-by: Bogdan Drutu --- internal/collector/telemetry/telemetry.go | 73 ----------------------- service/flags.go | 44 +++++++++++++- service/telemetry.go | 9 ++- 3 files changed, 45 insertions(+), 81 deletions(-) delete mode 100644 internal/collector/telemetry/telemetry.go diff --git a/internal/collector/telemetry/telemetry.go b/internal/collector/telemetry/telemetry.go deleted file mode 100644 index 14110d33eb3..00000000000 --- a/internal/collector/telemetry/telemetry.go +++ /dev/null @@ -1,73 +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 telemetry controls the telemetry settings to be used in the collector. -package telemetry - -import ( - "flag" -) - -const ( - metricsAddrCfg = "metrics-addr" - metricsPrefixCfg = "metrics-prefix" -) - -var ( - metricsAddrDefault = ":8888" - metricsPrefixDefault = "otelcol" - addInstanceIDDefault = true - // Command-line flags that control publication of telemetry data. - metricsAddrPtr = &metricsAddrDefault - metricsPrefixPtr = &metricsPrefixDefault - - addInstanceIDPtr = &addInstanceIDDefault -) - -func Flags(flags *flag.FlagSet) { - // At least until we can use a generic, i.e.: OpenCensus, metrics exporter - // we default to Prometheus at port 8888, if not otherwise specified. - metricsAddrPtr = flags.String( - metricsAddrCfg, - GetMetricsAddrDefault(), - "[address]:port for exposing collector telemetry.") - - metricsPrefixPtr = flags.String( - metricsPrefixCfg, - metricsPrefixDefault, - "Prefix to the metrics generated by the collector.") - - addInstanceIDPtr = flags.Bool( - "add-instance-id", - addInstanceIDDefault, - "Flag to control the addition of 'service.instance.id' to the collector metrics.") -} - -// GetMetricsAddrDefault returns the default metrics bind address and port depending on -// the current build type. -func GetMetricsAddrDefault() string { - return metricsAddrDefault -} - -func GetAddInstanceID() bool { - return *addInstanceIDPtr -} - -func GetMetricsAddr() string { - return *metricsAddrPtr -} - -func GetMetricsPrefix() string { - return *metricsPrefixPtr -} diff --git a/service/flags.go b/service/flags.go index 4d6cc865e48..76945d66800 100644 --- a/service/flags.go +++ b/service/flags.go @@ -19,15 +19,22 @@ import ( "strings" "go.opentelemetry.io/collector/config/configtelemetry" - "go.opentelemetry.io/collector/internal/collector/telemetry" "go.opentelemetry.io/collector/service/internal/telemetrylogs" ) var ( - defaultConfig = "" + defaultMetricsAddr = ":8888" + defaultMetricsPrefix = "otelcol" + defaultAddInstanceID = true + defaultConfig = "" + // Command-line flag that control the configuration file. configFlag = &defaultConfig setFlag = new(stringArrayValue) + // Command-line flags that control publication of telemetry data. + metricsAddrPtr = &defaultMetricsAddr + metricsPrefixPtr = &defaultMetricsPrefix + addInstanceIDPtr = &defaultAddInstanceID ) type stringArrayValue struct { @@ -47,17 +54,36 @@ func flags() *flag.FlagSet { flagSet := new(flag.FlagSet) addFlagsFns := []func(*flag.FlagSet){ configtelemetry.Flags, - telemetry.Flags, telemetrylogs.Flags, } for _, addFlags := range addFlagsFns { addFlags(flagSet) } + + // At least until we can use a generic, i.e.: OpenCensus, metrics exporter + // we default to Prometheus at port 8888, if not otherwise specified. + metricsAddrPtr = flagSet.String( + "metrics-addr", + defaultMetricsAddr, + "[address]:port for exposing collector telemetry.") + + metricsPrefixPtr = flagSet.String( + "metrics-prefix", + defaultMetricsPrefix, + "Prefix to the metrics generated by the collector.") + + addInstanceIDPtr = flagSet.Bool( + "add-instance-id", + defaultAddInstanceID, + "Flag to control the addition of 'service.instance.id' to the collector metrics.") + configFlag = flagSet.String("config", defaultConfig, "Path to the config file") + flagSet.Var(setFlag, "set", "Set arbitrary component config property. The component has to be defined in the config file and the flag"+ " has a higher precedence. Array config properties are overridden and maps are joined, note that only a single"+ " (first) array property can be set e.g. -set=processors.attributes.actions.key=some_key. Example --set=processors.batch.timeout=2s") + return flagSet } @@ -68,3 +94,15 @@ func getConfigFlag() string { func getSetFlag() []string { return setFlag.values } + +func getAddInstanceID() bool { + return *addInstanceIDPtr +} + +func getMetricsAddr() string { + return *metricsAddrPtr +} + +func getMetricsPrefix() string { + return *metricsPrefixPtr +} diff --git a/service/telemetry.go b/service/telemetry.go index 61cf01cbc28..baed123c9a1 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -34,7 +34,6 @@ import ( "go.uber.org/zap" "go.opentelemetry.io/collector/config/configtelemetry" - "go.opentelemetry.io/collector/internal/collector/telemetry" "go.opentelemetry.io/collector/internal/obsreportconfig" "go.opentelemetry.io/collector/internal/version" semconv "go.opentelemetry.io/collector/model/semconv/v1.5.0" @@ -76,7 +75,7 @@ func (tel *colTelemetry) initOnce(asyncErrorChannel chan<- error, ballastSizeByt logger.Info("Setting up own telemetry...") level := configtelemetry.GetMetricsLevelFlagValue() - metricsAddr := telemetry.GetMetricsAddr() + metricsAddr := getMetricsAddr() if level == configtelemetry.LevelNone || metricsAddr == "" { return nil @@ -84,7 +83,7 @@ func (tel *colTelemetry) initOnce(asyncErrorChannel chan<- error, ballastSizeByt var instanceID string - if telemetry.GetAddInstanceID() { + if getAddInstanceID() { instanceUUID, _ := uuid.NewRandom() instanceID = instanceUUID.String() } @@ -151,12 +150,12 @@ func (tel *colTelemetry) initOpenCensus(level configtelemetry.Level, instanceID // Until we can use a generic metrics exporter, default to Prometheus. opts := prometheus.Options{ - Namespace: telemetry.GetMetricsPrefix(), + Namespace: getMetricsPrefix(), } opts.ConstLabels = make(map[string]string) - if telemetry.GetAddInstanceID() { + if getAddInstanceID() { opts.ConstLabels[sanitizePrometheusKey(semconv.AttributeServiceInstanceID)] = instanceID } From 6a76e7c9510e0ee3efee16ccd03688d9b0dc9c71 Mon Sep 17 00:00:00 2001 From: alrex Date: Fri, 1 Oct 2021 10:24:50 -0700 Subject: [PATCH 041/149] add DataPointFlags to Number/Histogram/Summary datapoints (#4081) * add DataPointFlags to Number/Histogram/Summary datapoints * rename DataPointFlags -> MetricDataPointFlags * add HasFlag + NewMetricDataPointFlags methods * cleanup * Update model/pdata/metrics.go Co-authored-by: Bogdan Drutu Co-authored-by: Bogdan Drutu --- CHANGELOG.md | 5 +++ cmd/pdatagen/internal/metrics_structs.go | 12 ++++++++ model/pdata/generated_metrics.go | 33 ++++++++++++++++++++ model/pdata/generated_metrics_test.go | 27 ++++++++++++++++ model/pdata/metrics.go | 39 ++++++++++++++++++++++++ model/pdata/metrics_test.go | 14 +++++++++ 6 files changed, 130 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3439521e6d2..b6459d2429e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ - Add Gen dependabot into CI (#4083) +## 💡 Enhancements 💡 + +- Update OTLP to v0.10.0 (#4045). +- Add Flags field to NumberDataPoint, HistogramDataPoint, SummaryDataPoint (#4081). + ## v0.36.0 Beta ## 🛑 Breaking changes 🛑 diff --git a/cmd/pdatagen/internal/metrics_structs.go b/cmd/pdatagen/internal/metrics_structs.go index 56ec119b06f..0cb11b7044e 100644 --- a/cmd/pdatagen/internal/metrics_structs.go +++ b/cmd/pdatagen/internal/metrics_structs.go @@ -213,6 +213,7 @@ var numberDataPoint = &messageValueStruct{ }, }, exemplarsField, + dataPointFlagsField, }, } @@ -234,6 +235,7 @@ var histogramDataPoint = &messageValueStruct{ bucketCountsField, explicitBoundsField, exemplarsField, + dataPointFlagsField, }, } @@ -257,6 +259,7 @@ var summaryDataPoint = &messageValueStruct{ originFieldName: "QuantileValues", returnSlice: quantileValuesSlice, }, + dataPointFlagsField, }, } @@ -398,3 +401,12 @@ var oneofDataField = &oneofField{ testVal: "&otlpmetrics.Metric_Gauge{Gauge: &otlpmetrics.Gauge{}}", fillTestName: "Gauge", } + +var dataPointFlagsField = &primitiveTypedField{ + fieldName: "Flags", + originFieldName: "Flags", + returnType: "MetricDataPointFlags", + rawType: "uint32", + defaultVal: "MetricDataPointFlagsNone", + testVal: "MetricDataPointFlagsNone", +} diff --git a/model/pdata/generated_metrics.go b/model/pdata/generated_metrics.go index 0d15e16f993..047d1614f00 100644 --- a/model/pdata/generated_metrics.go +++ b/model/pdata/generated_metrics.go @@ -975,6 +975,16 @@ func (ms NumberDataPoint) Exemplars() ExemplarSlice { return newExemplarSlice(&(*ms.orig).Exemplars) } +// Flags returns the flags associated with this NumberDataPoint. +func (ms NumberDataPoint) Flags() MetricDataPointFlags { + return MetricDataPointFlags((*ms.orig).Flags) +} + +// SetFlags replaces the flags associated with this NumberDataPoint. +func (ms NumberDataPoint) SetFlags(v MetricDataPointFlags) { + (*ms.orig).Flags = uint32(v) +} + // CopyTo copies all properties from the current struct to the dest. func (ms NumberDataPoint) CopyTo(dest NumberDataPoint) { ms.Attributes().CopyTo(dest.Attributes()) @@ -988,6 +998,7 @@ func (ms NumberDataPoint) CopyTo(dest NumberDataPoint) { } ms.Exemplars().CopyTo(dest.Exemplars()) + dest.SetFlags(ms.Flags()) } // HistogramDataPointSlice logically represents a slice of HistogramDataPoint. @@ -1220,6 +1231,16 @@ func (ms HistogramDataPoint) Exemplars() ExemplarSlice { return newExemplarSlice(&(*ms.orig).Exemplars) } +// Flags returns the flags associated with this HistogramDataPoint. +func (ms HistogramDataPoint) Flags() MetricDataPointFlags { + return MetricDataPointFlags((*ms.orig).Flags) +} + +// SetFlags replaces the flags associated with this HistogramDataPoint. +func (ms HistogramDataPoint) SetFlags(v MetricDataPointFlags) { + (*ms.orig).Flags = uint32(v) +} + // CopyTo copies all properties from the current struct to the dest. func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint) { ms.Attributes().CopyTo(dest.Attributes()) @@ -1230,6 +1251,7 @@ func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint) { dest.SetBucketCounts(ms.BucketCounts()) dest.SetExplicitBounds(ms.ExplicitBounds()) ms.Exemplars().CopyTo(dest.Exemplars()) + dest.SetFlags(ms.Flags()) } // SummaryDataPointSlice logically represents a slice of SummaryDataPoint. @@ -1442,6 +1464,16 @@ func (ms SummaryDataPoint) QuantileValues() ValueAtQuantileSlice { return newValueAtQuantileSlice(&(*ms.orig).QuantileValues) } +// Flags returns the flags associated with this SummaryDataPoint. +func (ms SummaryDataPoint) Flags() MetricDataPointFlags { + return MetricDataPointFlags((*ms.orig).Flags) +} + +// SetFlags replaces the flags associated with this SummaryDataPoint. +func (ms SummaryDataPoint) SetFlags(v MetricDataPointFlags) { + (*ms.orig).Flags = uint32(v) +} + // CopyTo copies all properties from the current struct to the dest. func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint) { ms.Attributes().CopyTo(dest.Attributes()) @@ -1450,6 +1482,7 @@ func (ms SummaryDataPoint) CopyTo(dest SummaryDataPoint) { dest.SetCount(ms.Count()) dest.SetSum(ms.Sum()) ms.QuantileValues().CopyTo(dest.QuantileValues()) + dest.SetFlags(ms.Flags()) } // ValueAtQuantileSlice logically represents a slice of ValueAtQuantile. diff --git a/model/pdata/generated_metrics_test.go b/model/pdata/generated_metrics_test.go index 015637d8592..9306166c5a8 100644 --- a/model/pdata/generated_metrics_test.go +++ b/model/pdata/generated_metrics_test.go @@ -684,6 +684,14 @@ func TestNumberDataPoint_Exemplars(t *testing.T) { assert.EqualValues(t, testValExemplars, ms.Exemplars()) } +func TestNumberDataPoint_Flags(t *testing.T) { + ms := NewNumberDataPoint() + assert.EqualValues(t, MetricDataPointFlagsNone, ms.Flags()) + testValFlags := MetricDataPointFlagsNone + ms.SetFlags(testValFlags) + assert.EqualValues(t, testValFlags, ms.Flags()) +} + func TestHistogramDataPointSlice(t *testing.T) { es := NewHistogramDataPointSlice() assert.EqualValues(t, 0, es.Len()) @@ -864,6 +872,14 @@ func TestHistogramDataPoint_Exemplars(t *testing.T) { assert.EqualValues(t, testValExemplars, ms.Exemplars()) } +func TestHistogramDataPoint_Flags(t *testing.T) { + ms := NewHistogramDataPoint() + assert.EqualValues(t, MetricDataPointFlagsNone, ms.Flags()) + testValFlags := MetricDataPointFlagsNone + ms.SetFlags(testValFlags) + assert.EqualValues(t, testValFlags, ms.Flags()) +} + func TestSummaryDataPointSlice(t *testing.T) { es := NewSummaryDataPointSlice() assert.EqualValues(t, 0, es.Len()) @@ -1028,6 +1044,14 @@ func TestSummaryDataPoint_QuantileValues(t *testing.T) { assert.EqualValues(t, testValQuantileValues, ms.QuantileValues()) } +func TestSummaryDataPoint_Flags(t *testing.T) { + ms := NewSummaryDataPoint() + assert.EqualValues(t, MetricDataPointFlagsNone, ms.Flags()) + testValFlags := MetricDataPointFlagsNone + ms.SetFlags(testValFlags) + assert.EqualValues(t, testValFlags, ms.Flags()) +} + func TestValueAtQuantileSlice(t *testing.T) { es := NewValueAtQuantileSlice() assert.EqualValues(t, 0, es.Len()) @@ -1464,6 +1488,7 @@ func fillTestNumberDataPoint(tv NumberDataPoint) { tv.SetDoubleVal(float64(17.13)) fillTestExemplarSlice(tv.Exemplars()) + tv.SetFlags(MetricDataPointFlagsNone) } func generateTestHistogramDataPointSlice() HistogramDataPointSlice { @@ -1495,6 +1520,7 @@ func fillTestHistogramDataPoint(tv HistogramDataPoint) { tv.SetBucketCounts([]uint64{1, 2, 3}) tv.SetExplicitBounds([]float64{1, 2, 3}) fillTestExemplarSlice(tv.Exemplars()) + tv.SetFlags(MetricDataPointFlagsNone) } func generateTestSummaryDataPointSlice() SummaryDataPointSlice { @@ -1524,6 +1550,7 @@ func fillTestSummaryDataPoint(tv SummaryDataPoint) { tv.SetCount(uint64(17)) tv.SetSum(float64(17.13)) fillTestValueAtQuantileSlice(tv.QuantileValues()) + tv.SetFlags(MetricDataPointFlagsNone) } func generateTestValueAtQuantileSlice() ValueAtQuantileSlice { diff --git a/model/pdata/metrics.go b/model/pdata/metrics.go index 850ac444dcc..5c23cdd22eb 100644 --- a/model/pdata/metrics.go +++ b/model/pdata/metrics.go @@ -247,6 +247,45 @@ func (at MetricAggregationTemporality) String() string { return otlpmetrics.AggregationTemporality(at).String() } +// MetricDataPointFlags defines how a metric aggregator reports aggregated values. +// It describes how those values relate to the time interval over which they are aggregated. +type MetricDataPointFlags uint32 + +const ( + // MetricDataPointFlagsNone is the default MetricDataPointFlags. + MetricDataPointFlagsNone = MetricDataPointFlags(otlpmetrics.DataPointFlags_FLAG_NONE) +) + +// NewMetricDataPointFlags returns a new MetricDataPointFlags combining the flags passed +// in as parameters. +func NewMetricDataPointFlags(flags ...MetricDataPointFlag) MetricDataPointFlags { + var flag MetricDataPointFlags + for _, f := range flags { + flag |= MetricDataPointFlags(f) + } + return flag +} + +// HasFlag returns true if the MetricDataPointFlags contains the specified flag +func (d MetricDataPointFlags) HasFlag(flag MetricDataPointFlag) bool { + return d&MetricDataPointFlags(flag) != 0 +} + +// String returns the string representation of the MetricDataPointFlags. +func (d MetricDataPointFlags) String() string { + return otlpmetrics.DataPointFlags(d).String() +} + +// MetricDataPointFlag allow users to configure DataPointFlags. This is achieved via NewMetricDataPointFlags. +// The separation between MetricDataPointFlags and MetricDataPointFlag exists to prevent users accidentally +// comparing the value of individual flags with MetricDataPointFlags. Instead, users must use the HasFlag method. +type MetricDataPointFlag uint32 + +const ( + // MetricDataPointFlagsNoRecordedValue is flag for a metric aggregator which reports changes since last report time. + MetricDataPointFlagNoRecordedValue = MetricDataPointFlag(otlpmetrics.DataPointFlags_FLAG_NO_RECORDED_VALUE) +) + // MetricValueType specifies the type of NumberDataPoint. type MetricValueType int32 diff --git a/model/pdata/metrics_test.go b/model/pdata/metrics_test.go index 23a5a88109c..05ee3f30665 100644 --- a/model/pdata/metrics_test.go +++ b/model/pdata/metrics_test.go @@ -591,6 +591,20 @@ func TestMetricsClone(t *testing.T) { assert.EqualValues(t, metrics, metrics.Clone()) } +func TestMetricsDataPointFlags(t *testing.T) { + gauge := generateTestGauge() + + gauge.DataPoints().At(0).SetFlags(NewMetricDataPointFlags()) + assert.True(t, gauge.DataPoints().At(0).Flags() == MetricDataPointFlagsNone) + assert.False(t, gauge.DataPoints().At(0).Flags().HasFlag(MetricDataPointFlagNoRecordedValue)) + assert.Equal(t, "FLAG_NONE", gauge.DataPoints().At(0).Flags().String()) + + gauge.DataPoints().At(0).SetFlags(NewMetricDataPointFlags(MetricDataPointFlagNoRecordedValue)) + assert.False(t, gauge.DataPoints().At(0).Flags() == MetricDataPointFlagsNone) + assert.True(t, gauge.DataPoints().At(0).Flags().HasFlag(MetricDataPointFlagNoRecordedValue)) + assert.Equal(t, "FLAG_NO_RECORDED_VALUE", gauge.DataPoints().At(0).Flags().String()) +} + func BenchmarkMetricsClone(b *testing.B) { metrics := NewMetrics() fillTestResourceMetricsSlice(metrics.ResourceMetrics()) From 0e65d954f27c3d34e28c0b62f21e569126c4a9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Fri, 1 Oct 2021 19:40:13 +0200 Subject: [PATCH 042/149] Upgrade to OpenTelemetry Collector 0.36.0 (#76) --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/scaffold/main.go | 4 ++-- test/nocore.builder.yaml | 2 +- test/replaces.builder.yaml | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b8548efc8a8..c991a5abca4 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.35.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.36.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index b6d0ecdd9c4..fa253e8822a 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -27,7 +27,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.35.0" +const defaultOtelColVersion = "0.36.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index 78760b6b9c6..ddf60f52bbf 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -58,8 +58,8 @@ func main() { log.Fatalf("failed to construct the application: %v", err) } - err = app.Run() - if err != nil { + cmd := service.NewCommand(app) + if err = cmd.Execute(); err != nil { log.Fatalf("application run finished with error: %v", err) } } diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index b68c19acf21..49dec4b2002 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,6 +1,6 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.35.0 + otelcol_version: 0.36.0 include_core: false receivers: diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index d03e04794ae..939912e2730 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.35.0 + otelcol_version: 0.36.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.35.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.35.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.36.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.36.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.35.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.36.0 From 105f1e11bb4affbc4145e8a8623acb32f69380ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 08:25:20 -0700 Subject: [PATCH 043/149] Bump github.com/prometheus/common from 0.31.0 to 0.31.1 (#4163) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.31.0 to 0.31.1. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](https://github.com/prometheus/common/compare/v0.31.0...v0.31.1) --- updated-dependencies: - dependency-name: github.com/prometheus/common 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 211acab92f9..927a59d7c85 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/knadh/koanf v1.2.3 github.com/magiconair/properties v1.8.5 github.com/mitchellh/mapstructure v1.4.2 - github.com/prometheus/common v0.31.0 + github.com/prometheus/common v0.31.1 github.com/rs/cors v1.8.0 github.com/shirou/gopsutil v3.21.8+incompatible github.com/spf13/cast v1.4.1 diff --git a/go.sum b/go.sum index 7fd4c012151..78227f50fb2 100644 --- a/go.sum +++ b/go.sum @@ -327,8 +327,8 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.31.0 h1:FTJdLTjtrh4dXlCjpzdZJXMnejSTL5F/nVQm5sNwD34= -github.com/prometheus/common v0.31.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.31.1 h1:d18hG4PkHnNAKNMOmFuXFaiY8Us0nird/2m60uS1AMs= +github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= From 443c2e10d1f7ef3b1d3106a6302e774471de6388 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 08:25:42 -0700 Subject: [PATCH 044/149] Bump golang.org/x/tools from 0.1.6 to 0.1.7 in /internal/tools (#4164) Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.6 to 0.1.7. - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.1.6...v0.1.7) --- updated-dependencies: - dependency-name: golang.org/x/tools 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> --- internal/tools/go.mod | 2 +- internal/tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 995214cda3a..cb711675ef1 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/build-tools/checkdoc v0.0.0-20210826185254-a20c5b1e2d7c go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210813222030-0139980e9794 golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 - golang.org/x/tools v0.1.6 + golang.org/x/tools v0.1.7 ) require ( diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 25b9965b6b7..62a1433db7a 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -1094,8 +1094,8 @@ 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 h1:SIasE1FVIQOWz2GEAHFOmoW7xchJcqlucjSULTL0Ag4= -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= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From f08f85a3a7994f1fcee2e16075d0c46ddbd1d82f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 08:26:04 -0700 Subject: [PATCH 045/149] Bump codecov/codecov-action from 2.0.3 to 2.1.0 (#4159) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v2.0.3...v2.1.0) --- updated-dependencies: - dependency-name: codecov/codecov-action 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> --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 48d851b6481..7ca2c4a6822 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -159,7 +159,7 @@ jobs: - name: Run Unit Tests With Coverage run: make gotest-with-cover - name: Upload coverage report - uses: codecov/codecov-action@v2.0.3 + uses: codecov/codecov-action@v2.1.0 with: file: ./coverage.txt fail_ci_if_error: true From 9f94a77f0f7abbbdc3d863c37751a0287f3d78db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 08:46:00 -0700 Subject: [PATCH 046/149] Bump github.com/knadh/koanf from 1.2.3 to 1.2.4 (#4166) Bumps [github.com/knadh/koanf](https://github.com/knadh/koanf) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/knadh/koanf/releases) - [Commits](https://github.com/knadh/koanf/compare/v1.2.3...v1.2.4) --- updated-dependencies: - dependency-name: github.com/knadh/koanf 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 927a59d7c85..101dfda9548 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 - github.com/knadh/koanf v1.2.3 + github.com/knadh/koanf v1.2.4 github.com/magiconair/properties v1.8.5 github.com/mitchellh/mapstructure v1.4.2 github.com/prometheus/common v0.31.1 diff --git a/go.sum b/go.sum index 78227f50fb2..3dc28a03ba6 100644 --- a/go.sum +++ b/go.sum @@ -250,8 +250,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/knadh/koanf v1.2.3 h1:2Rkr0YhhYk+4QEOm800Q3Pu0Wi87svTxM6uuEb4WhYw= -github.com/knadh/koanf v1.2.3/go.mod h1:xpPTwMhsA/aaQLAilyCCqfpEiY1gpa160AiCuWHJUjY= +github.com/knadh/koanf v1.2.4 h1:AQYoGbNwphHd63E//SkDkqEGcogARxGspHWqoJw6O8k= +github.com/knadh/koanf v1.2.4/go.mod h1:xpPTwMhsA/aaQLAilyCCqfpEiY1gpa160AiCuWHJUjY= 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.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= From 4bd1262f004856bea556a41f6b0f06669a67224a Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 4 Oct 2021 08:48:06 -0700 Subject: [PATCH 047/149] Bump otel dependencies to latest (#4167) Signed-off-by: Bogdan Drutu --- component/componenttest/nop_telemetry.go | 2 +- go.mod | 16 +++++++------- go.sum | 28 ++++++++++++++---------- service/collector.go | 2 +- service/telemetry.go | 2 +- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/component/componenttest/nop_telemetry.go b/component/componenttest/nop_telemetry.go index 057991052cb..190ed817164 100644 --- a/component/componenttest/nop_telemetry.go +++ b/component/componenttest/nop_telemetry.go @@ -27,6 +27,6 @@ func NewNopTelemetrySettings() component.TelemetrySettings { return component.TelemetrySettings{ Logger: zap.NewNop(), TracerProvider: trace.NewNoopTracerProvider(), - MeterProvider: metric.NoopMeterProvider{}, + MeterProvider: metric.NewNoopMeterProvider(), } } diff --git a/go.mod b/go.mod index 101dfda9548..05271585a9e 100644 --- a/go.mod +++ b/go.mod @@ -22,13 +22,13 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.24.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.24.0 go.opentelemetry.io/contrib/zpages v0.24.0 - go.opentelemetry.io/otel v1.0.0 - go.opentelemetry.io/otel/exporters/prometheus v0.23.0 - go.opentelemetry.io/otel/metric v0.23.0 - go.opentelemetry.io/otel/sdk v1.0.0 - go.opentelemetry.io/otel/sdk/export/metric v0.23.0 - go.opentelemetry.io/otel/sdk/metric v0.23.0 - go.opentelemetry.io/otel/trace v1.0.0 + go.opentelemetry.io/otel v1.0.1 + go.opentelemetry.io/otel/exporters/prometheus v0.24.0 + go.opentelemetry.io/otel/metric v0.24.0 + go.opentelemetry.io/otel/sdk v1.0.1 + 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.0.1 go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.6.0 go.uber.org/zap v1.19.1 @@ -64,7 +64,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect - go.opentelemetry.io/otel/internal/metric v0.23.0 // indirect + go.opentelemetry.io/otel/internal/metric v0.24.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 3dc28a03ba6..2ea60fdf1c5 100644 --- a/go.sum +++ b/go.sum @@ -406,24 +406,28 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.24.0/go.mod h1: go.opentelemetry.io/contrib/zpages v0.24.0 h1:VL3XVUgqn23yH5dmwCfq+yWaN/nrmzz2Iz3OBm3EyCk= go.opentelemetry.io/contrib/zpages v0.24.0/go.mod h1:/dZbBvWhnvD1wWk0xaTdRpqDuPorUGZgOVZwgsdaDsM= go.opentelemetry.io/otel v1.0.0-RC3/go.mod h1:Ka5j3ua8tZs4Rkq4Ex3hwgBgOchyPVq5S6P2lz//nKQ= -go.opentelemetry.io/otel v1.0.0 h1:qTTn6x71GVBvoafHK/yaRUmFzI4LcONZD0/kXxl5PHI= go.opentelemetry.io/otel v1.0.0/go.mod h1:AjRVh9A5/5DE7S+mZtTR6t8vpKKryam+0lREnfmS4cg= -go.opentelemetry.io/otel/exporters/prometheus v0.23.0 h1:ZFx1kUjUSBF7H1mTPHHOqglEDQsxYBrDnYZ8i41v3iE= -go.opentelemetry.io/otel/exporters/prometheus v0.23.0/go.mod h1:kjCXbxQnnEm5l3HrUw4IPyuALu7Uqb/bEK7vWQnbd8s= -go.opentelemetry.io/otel/internal/metric v0.23.0 h1:mPfzm9Iqhw7G2nDBmUAjFTfPqLZPbOW2k7QI57ITbaI= +go.opentelemetry.io/otel v1.0.1 h1:4XKyXmfqJLOQ7feyV5DB6gsBFZ0ltB8vLtp6pj4JIcc= +go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= +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.23.0/go.mod h1:z+RPiDJe30YnCrOhFGivwBS+DU1JU/PiLKkk4re2DNY= -go.opentelemetry.io/otel/metric v0.23.0 h1:mYCcDxi60P4T27/0jchIDFa1WHEfQeU3zH9UEMpnj2c= +go.opentelemetry.io/otel/internal/metric v0.24.0 h1:O5lFy6kAl0LMWBjzy3k//M8VjEaTDWL9DPJuqZmWIAA= +go.opentelemetry.io/otel/internal/metric v0.24.0/go.mod h1:PSkQG+KuApZjBpC6ea6082ZrWUUy/w132tJ/LOU3TXk= go.opentelemetry.io/otel/metric v0.23.0/go.mod h1:G/Nn9InyNnIv7J6YVkQfpc0JCfKBNJaERBGw08nqmVQ= -go.opentelemetry.io/otel/sdk v1.0.0-RC3/go.mod h1:78H6hyg2fka0NYT9fqGuFLvly2yCxiBXDJAgLKo/2Us= -go.opentelemetry.io/otel/sdk v1.0.0 h1:BNPMYUONPNbLneMttKSjQhOTlFLOD9U22HNG1KrIN2Y= +go.opentelemetry.io/otel/metric v0.24.0 h1:Rg4UYHS6JKR1Sw1TxnI13z7q/0p/XAbgIqUTagvLJuU= +go.opentelemetry.io/otel/metric v0.24.0/go.mod h1:tpMFnCD9t+BEGiWY2bWF5+AwjuAdM0lSowQ4SBA3/K4= go.opentelemetry.io/otel/sdk v1.0.0/go.mod h1:PCrDHlSy5x1kjezSdL37PhbFUMjrsLRshJ2zCzeXwbM= -go.opentelemetry.io/otel/sdk/export/metric v0.23.0 h1:7NeoKPPx6NdZBVHLEp/LY5Lq85Ff1WNZnuJkuRy+azw= -go.opentelemetry.io/otel/sdk/export/metric v0.23.0/go.mod h1:SuMiREmKVRIwFKq73zvGTvwFpxb/ZAYkMfyqMoOtDqs= -go.opentelemetry.io/otel/sdk/metric v0.23.0 h1:xlZhPbiue1+jjSFEth94q9QCmX8Q24mOtue9IAmlVyI= -go.opentelemetry.io/otel/sdk/metric v0.23.0/go.mod h1:wa0sKK13eeIFW+0OFjcC3S1i7FTRRiLAXe1kjBVbhwg= +go.opentelemetry.io/otel/sdk v1.0.1 h1:wXxFEWGo7XfXupPwVJvTBOaPBC9FEg0wB8hMNrKk+cA= +go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI= +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/trace v1.0.0-RC3/go.mod h1:VUt2TUYd8S2/ZRX09ZDFZQwn2RqfMB5MzO17jBojGxo= -go.opentelemetry.io/otel/trace v1.0.0 h1:TSBr8GTEtKevYMG/2d21M989r5WJYVimhTHBKVEZuh4= go.opentelemetry.io/otel/trace v1.0.0/go.mod h1:PXTWqayeFUlJV1YDNhsJYB184+IvAH814St6o6ajzIs= +go.opentelemetry.io/otel/trace v1.0.1 h1:StTeIH6Q3G4r0Fiw34LTokUFESZgIDUr0qIJ7mKmAfw= +go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= 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/collector.go b/service/collector.go index e838a72fbad..cf7c0ab1c94 100644 --- a/service/collector.go +++ b/service/collector.go @@ -213,7 +213,7 @@ func (col *Collector) Run(ctx context.Context) error { // global TracerProvider. otel.SetTracerProvider(col.tracerProvider) - col.meterProvider = metric.NoopMeterProvider{} + col.meterProvider = metric.NewNoopMeterProvider() col.stateChannel <- Starting diff --git a/service/telemetry.go b/service/telemetry.go index baed123c9a1..b463b236b19 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -175,7 +175,7 @@ func (tel *colTelemetry) initOpenCensus(level configtelemetry.Level, instanceID func (tel *colTelemetry) initOpenTelemetry() (http.Handler, error) { config := otelprometheus.Config{} c := controller.New( - processor.New( + processor.NewFactory( selector.NewWithHistogramDistribution( histogram.WithExplicitBoundaries(config.DefaultHistogramBoundaries), ), From 273260a371a655f76f3625fb3338d10314b391c7 Mon Sep 17 00:00:00 2001 From: alrex Date: Mon, 4 Oct 2021 08:48:22 -0700 Subject: [PATCH 048/149] rename SetupRecordedMetricsTest -> SetupTelemetry (#4157) * rename SetupRecordedMetricsTest -> SetupTelemetry * rename TestTelemetrySettings -> TestTelemetry --- exporter/exporterhelper/logs_test.go | 4 +- exporter/exporterhelper/metrics_test.go | 4 +- exporter/exporterhelper/obsreport_test.go | 8 ++-- exporter/exporterhelper/queued_retry_test.go | 2 +- exporter/exporterhelper/traces_test.go | 4 +- obsreport/obsreport_test.go | 22 +++++------ obsreport/obsreporttest/obsreporttest.go | 38 +++++++++---------- obsreport/obsreporttest/obsreporttest_test.go | 12 +++--- receiver/otlpreceiver/otlp_test.go | 2 +- .../scraperhelper/scrapercontroller_test.go | 2 +- 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/exporter/exporterhelper/logs_test.go b/exporter/exporterhelper/logs_test.go index 7f0e9266c18..fcea4f252b4 100644 --- a/exporter/exporterhelper/logs_test.go +++ b/exporter/exporterhelper/logs_test.go @@ -125,7 +125,7 @@ func TestLogsExporter_WithRecordLogs_ReturnError(t *testing.T) { } func TestLogsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -205,7 +205,7 @@ func newPushLogsData(retError error) consumerhelper.ConsumeLogsFunc { } func checkRecordedMetricsForLogsExporter(t *testing.T, le component.LogsExporter, wantError error) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) diff --git a/exporter/exporterhelper/metrics_test.go b/exporter/exporterhelper/metrics_test.go index c853c630174..903cae64f1a 100644 --- a/exporter/exporterhelper/metrics_test.go +++ b/exporter/exporterhelper/metrics_test.go @@ -124,7 +124,7 @@ func TestMetricsExporter_WithRecordMetrics_ReturnError(t *testing.T) { } func TestMetricsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -206,7 +206,7 @@ func newPushMetricsData(retError error) consumerhelper.ConsumeMetricsFunc { } func checkRecordedMetricsForMetricsExporter(t *testing.T, me component.MetricsExporter, wantError error) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) diff --git a/exporter/exporterhelper/obsreport_test.go b/exporter/exporterhelper/obsreport_test.go index 7afdc7a8d18..f1c659ee004 100644 --- a/exporter/exporterhelper/obsreport_test.go +++ b/exporter/exporterhelper/obsreport_test.go @@ -31,7 +31,7 @@ import ( ) func TestExportEnqueueFailure(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -57,21 +57,21 @@ func TestExportEnqueueFailure(t *testing.T) { } // checkExporterEnqueueFailedTracesStats checks that reported number of spans failed to enqueue match given values. -// When this function is called it is required to also call SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func checkExporterEnqueueFailedTracesStats(t *testing.T, exporter config.ComponentID, spans int64) { exporterTags := tagsForExporterView(exporter) checkValueForView(t, exporterTags, spans, "exporter/enqueue_failed_spans") } // checkExporterEnqueueFailedMetricsStats checks that reported number of metric points failed to enqueue match given values. -// When this function is called it is required to also call SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func checkExporterEnqueueFailedMetricsStats(t *testing.T, exporter config.ComponentID, metricPoints int64) { exporterTags := tagsForExporterView(exporter) checkValueForView(t, exporterTags, metricPoints, "exporter/enqueue_failed_metric_points") } // checkExporterEnqueueFailedLogsStats checks that reported number of log records failed to enqueue match given values. -// When this function is called it is required to also call SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func checkExporterEnqueueFailedLogsStats(t *testing.T, exporter config.ComponentID, logRecords int64) { exporterTags := tagsForExporterView(exporter) checkValueForView(t, exporterTags, logRecords, "exporter/enqueue_failed_log_records") diff --git a/exporter/exporterhelper/queued_retry_test.go b/exporter/exporterhelper/queued_retry_test.go index ad1f8ad4e6e..0855a2ee46c 100644 --- a/exporter/exporterhelper/queued_retry_test.go +++ b/exporter/exporterhelper/queued_retry_test.go @@ -300,7 +300,7 @@ func TestQueuedRetry_DropOnFull(t *testing.T) { } func TestQueuedRetryHappyPath(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) diff --git a/exporter/exporterhelper/traces_test.go b/exporter/exporterhelper/traces_test.go index ec843820a4d..c3b218de96c 100644 --- a/exporter/exporterhelper/traces_test.go +++ b/exporter/exporterhelper/traces_test.go @@ -122,7 +122,7 @@ func TestTracesExporter_WithRecordMetrics_ReturnError(t *testing.T) { } func TestTracesExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -206,7 +206,7 @@ func newTraceDataPusher(retError error) consumerhelper.ConsumeTracesFunc { } func checkRecordedMetricsForTracesExporter(t *testing.T, te component.TracesExporter, wantError error) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) diff --git a/obsreport/obsreport_test.go b/obsreport/obsreport_test.go index 86c8be0701b..8362daae671 100644 --- a/obsreport/obsreport_test.go +++ b/obsreport/obsreport_test.go @@ -54,7 +54,7 @@ type testParams struct { } func TestReceiveTraceDataOp(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -101,7 +101,7 @@ func TestReceiveTraceDataOp(t *testing.T) { } func TestReceiveLogsOp(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -148,7 +148,7 @@ func TestReceiveLogsOp(t *testing.T) { } func TestReceiveMetricsOp(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -196,7 +196,7 @@ func TestReceiveMetricsOp(t *testing.T) { } func TestScrapeMetricsDataOp(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -253,7 +253,7 @@ func TestScrapeMetricsDataOp(t *testing.T) { } func TestExportTraceDataOp(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -303,7 +303,7 @@ func TestExportTraceDataOp(t *testing.T) { } func TestExportMetricsOp(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -354,7 +354,7 @@ func TestExportMetricsOp(t *testing.T) { } func TestExportLogsOp(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -405,7 +405,7 @@ func TestExportLogsOp(t *testing.T) { } func TestReceiveWithLongLivedCtx(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -456,7 +456,7 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { } func TestProcessorTraceData(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -477,7 +477,7 @@ func TestProcessorTraceData(t *testing.T) { } func TestProcessorMetricsData(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -520,7 +520,7 @@ func TestBuildProcessorCustomMetricName(t *testing.T) { } func TestProcessorLogRecords(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) diff --git a/obsreport/obsreporttest/obsreporttest.go b/obsreport/obsreporttest/obsreporttest.go index 1b4171dae91..6ec5a1e974e 100644 --- a/obsreport/obsreporttest/obsreporttest.go +++ b/obsreport/obsreporttest/obsreporttest.go @@ -46,46 +46,46 @@ var ( processorTag, _ = tag.NewKey("processor") ) -type TestTelemetrySettings struct { +type TestTelemetry struct { component.TelemetrySettings SpanRecorder *tracetest.SpanRecorder views []*view.View } // ToExporterCreateSettings returns ExporterCreateSettings with configured TelemetrySettings -func (tts *TestTelemetrySettings) ToExporterCreateSettings() component.ExporterCreateSettings { +func (tts *TestTelemetry) ToExporterCreateSettings() component.ExporterCreateSettings { exporterSettings := componenttest.NewNopExporterCreateSettings() exporterSettings.TelemetrySettings = tts.TelemetrySettings return exporterSettings } // ToProcessorCreateSettings returns ProcessorCreateSettings with configured TelemetrySettings -func (tts *TestTelemetrySettings) ToProcessorCreateSettings() component.ProcessorCreateSettings { +func (tts *TestTelemetry) ToProcessorCreateSettings() component.ProcessorCreateSettings { processorSettings := componenttest.NewNopProcessorCreateSettings() processorSettings.TelemetrySettings = tts.TelemetrySettings return processorSettings } // ToReceiverCreateSettings returns ReceiverCreateSettings with configured TelemetrySettings -func (tts *TestTelemetrySettings) ToReceiverCreateSettings() component.ReceiverCreateSettings { +func (tts *TestTelemetry) ToReceiverCreateSettings() component.ReceiverCreateSettings { receiverSettings := componenttest.NewNopReceiverCreateSettings() receiverSettings.TelemetrySettings = tts.TelemetrySettings return receiverSettings } // Shutdown unregisters any views and shuts down the SpanRecorder -func (tts *TestTelemetrySettings) Shutdown(ctx context.Context) error { +func (tts *TestTelemetry) Shutdown(ctx context.Context) error { view.Unregister(tts.views...) return tts.SpanRecorder.Shutdown(ctx) } -// SetupRecordedMetricsTest does setup the testing environment to check the metrics recorded by receivers, producers or exporters. -// The caller should defer a call to Shutdown the returned TestTelemetrySettings. -func SetupRecordedMetricsTest() (TestTelemetrySettings, error) { +// SetupTelemetry does setup the testing environment to check the metrics recorded by receivers, producers or exporters. +// The caller should defer a call to Shutdown the returned TestTelemetry. +func SetupTelemetry() (TestTelemetry, error) { sr := new(tracetest.SpanRecorder) tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr)) - settings := TestTelemetrySettings{ + settings := TestTelemetry{ TelemetrySettings: componenttest.NewNopTelemetrySettings(), SpanRecorder: sr, } @@ -101,7 +101,7 @@ func SetupRecordedMetricsTest() (TestTelemetrySettings, 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckExporterTraces(exporter config.ComponentID, acceptedSpans, droppedSpans int64) error { exporterTags := tagsForExporterView(exporter) if err := checkValueForView(exporterTags, acceptedSpans, "exporter/sent_spans"); err != nil { @@ -111,7 +111,7 @@ func CheckExporterTraces(exporter config.ComponentID, acceptedSpans, droppedSpan } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckExporterMetrics(exporter config.ComponentID, acceptedMetricsPoints, droppedMetricsPoints int64) error { exporterTags := tagsForExporterView(exporter) if err := checkValueForView(exporterTags, acceptedMetricsPoints, "exporter/sent_metric_points"); err != nil { @@ -121,7 +121,7 @@ func CheckExporterMetrics(exporter config.ComponentID, acceptedMetricsPoints, dr } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckExporterLogs(exporter config.ComponentID, acceptedLogRecords, droppedLogRecords int64) error { exporterTags := tagsForExporterView(exporter) if err := checkValueForView(exporterTags, acceptedLogRecords, "exporter/sent_log_records"); err != nil { @@ -131,7 +131,7 @@ func CheckExporterLogs(exporter config.ComponentID, acceptedLogRecords, droppedL } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckProcessorTraces(processor config.ComponentID, acceptedSpans, refusedSpans, droppedSpans int64) error { processorTags := tagsForProcessorView(processor) if err := checkValueForView(processorTags, acceptedSpans, "processor/accepted_spans"); err != nil { @@ -144,7 +144,7 @@ func CheckProcessorTraces(processor config.ComponentID, acceptedSpans, refusedSp } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckProcessorMetrics(processor config.ComponentID, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { processorTags := tagsForProcessorView(processor) if err := checkValueForView(processorTags, acceptedMetricPoints, "processor/accepted_metric_points"); err != nil { @@ -157,7 +157,7 @@ func CheckProcessorMetrics(processor config.ComponentID, acceptedMetricPoints, r } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckProcessorLogs(processor config.ComponentID, acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { processorTags := tagsForProcessorView(processor) if err := checkValueForView(processorTags, acceptedLogRecords, "processor/accepted_log_records"); err != nil { @@ -170,7 +170,7 @@ func CheckProcessorLogs(processor config.ComponentID, acceptedLogRecords, refuse } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckReceiverTraces(receiver config.ComponentID, protocol string, acceptedSpans, droppedSpans int64) error { receiverTags := tagsForReceiverView(receiver, protocol) if err := checkValueForView(receiverTags, acceptedSpans, "receiver/accepted_spans"); err != nil { @@ -180,7 +180,7 @@ func CheckReceiverTraces(receiver config.ComponentID, protocol string, acceptedS } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckReceiverLogs(receiver config.ComponentID, protocol string, acceptedLogRecords, droppedLogRecords int64) error { receiverTags := tagsForReceiverView(receiver, protocol) if err := checkValueForView(receiverTags, acceptedLogRecords, "receiver/accepted_log_records"); err != nil { @@ -190,7 +190,7 @@ func CheckReceiverLogs(receiver config.ComponentID, protocol string, acceptedLog } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckReceiverMetrics(receiver config.ComponentID, protocol string, acceptedMetricPoints, droppedMetricPoints int64) error { receiverTags := tagsForReceiverView(receiver, protocol) if err := checkValueForView(receiverTags, acceptedMetricPoints, "receiver/accepted_metric_points"); err != nil { @@ -200,7 +200,7 @@ func CheckReceiverMetrics(receiver config.ComponentID, protocol string, accepted } // 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 SetupRecordedMetricsTest as first thing. +// When this function is called it is required to also call SetupTelemetry as first thing. func CheckScraperMetrics(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 { diff --git a/obsreport/obsreporttest/obsreporttest_test.go b/obsreport/obsreporttest/obsreporttest_test.go index ee0c50278d0..422d690c8d1 100644 --- a/obsreport/obsreporttest/obsreporttest_test.go +++ b/obsreport/obsreporttest/obsreporttest_test.go @@ -38,7 +38,7 @@ var ( ) func TestCheckReceiverTracesViews(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -55,7 +55,7 @@ func TestCheckReceiverTracesViews(t *testing.T) { } func TestCheckReceiverMetricsViews(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -68,7 +68,7 @@ func TestCheckReceiverMetricsViews(t *testing.T) { } func TestCheckReceiverLogsViews(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -81,7 +81,7 @@ func TestCheckReceiverLogsViews(t *testing.T) { } func TestCheckExporterTracesViews(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -99,7 +99,7 @@ func TestCheckExporterTracesViews(t *testing.T) { } func TestCheckExporterMetricsViews(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -117,7 +117,7 @@ func TestCheckExporterMetricsViews(t *testing.T) { } func TestCheckExporterLogsViews(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index dc19880e938..031878ff5ef 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -506,7 +506,7 @@ func TestOTLPReceiverTrace_HandleNextConsumerResponse(t *testing.T) { for _, exporter := range exporters { for _, tt := range tests { t.Run(tt.name+"/"+exporter.receiverTag, func(t *testing.T) { - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index 606397cd2ce..0951b48006d 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -191,7 +191,7 @@ func TestScrapeController(t *testing.T) { otel.SetTracerProvider(tp) defer otel.SetTracerProvider(trace.NewNoopTracerProvider()) - set, err := obsreporttest.SetupRecordedMetricsTest() + set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) From 852ae55f9332f64f55a5428261bbb43fd41b5751 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 08:59:38 -0700 Subject: [PATCH 049/149] Bump github.com/shirou/gopsutil (#4171) Bumps [github.com/shirou/gopsutil](https://github.com/shirou/gopsutil) from 3.21.8+incompatible to 3.21.9+incompatible. - [Release notes](https://github.com/shirou/gopsutil/releases) - [Commits](https://github.com/shirou/gopsutil/compare/v3.21.8...v3.21.9) --- updated-dependencies: - dependency-name: github.com/shirou/gopsutil 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 05271585a9e..afe2fda48d6 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/mitchellh/mapstructure v1.4.2 github.com/prometheus/common v0.31.1 github.com/rs/cors v1.8.0 - github.com/shirou/gopsutil v3.21.8+incompatible + github.com/shirou/gopsutil v3.21.9+incompatible github.com/spf13/cast v1.4.1 github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum index 2ea60fdf1c5..88181aa695f 100644 --- a/go.sum +++ b/go.sum @@ -348,8 +348,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v3.21.8+incompatible h1:sh0foI8tMRlCidUJR+KzqWYWxrkuuPIGiO6Vp+KXdCU= -github.com/shirou/gopsutil v3.21.8+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v3.21.9+incompatible h1:LTLpUnfX81MkHeCtSrwNKZwuW5Id6kCa7/P43NdcNn4= +github.com/shirou/gopsutil v3.21.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= From 190f8fbb2b9afba7f6e1ab2ea8b70d5304258cdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 08:59:59 -0700 Subject: [PATCH 050/149] Bump go.uber.org/multierr from 1.6.0 to 1.7.0 (#4172) Bumps [go.uber.org/multierr](https://github.com/uber-go/multierr) from 1.6.0 to 1.7.0. - [Release notes](https://github.com/uber-go/multierr/releases) - [Changelog](https://github.com/uber-go/multierr/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/multierr/compare/v1.6.0...v1.7.0) --- updated-dependencies: - dependency-name: go.uber.org/multierr dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index afe2fda48d6..0c0bc2c9b10 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( go.opentelemetry.io/otel/sdk/metric v0.24.0 go.opentelemetry.io/otel/trace v1.0.1 go.uber.org/atomic v1.9.0 - go.uber.org/multierr v1.6.0 + go.uber.org/multierr v1.7.0 go.uber.org/zap v1.19.1 golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08 diff --git a/go.sum b/go.sum index 88181aa695f..2ed1591cb86 100644 --- a/go.sum +++ b/go.sum @@ -434,8 +434,9 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= From d77ca779e7dff9181b3c9d891e00eb9fef998069 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Wed, 6 Oct 2021 17:16:08 +0200 Subject: [PATCH 051/149] Use gopsutil/v3 (#4176) --- extension/ballastextension/README.md | 2 +- go.mod | 8 ++++---- go.sum | 17 ++++++++--------- internal/iruntime/mem_info.go | 2 +- service/internal/telemetry/process_telemetry.go | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/extension/ballastextension/README.md b/extension/ballastextension/README.md index 78018259681..e3b5bbd8b65 100644 --- a/extension/ballastextension/README.md +++ b/extension/ballastextension/README.md @@ -24,7 +24,7 @@ When `size_in_percentage` is enabled with the value(1-100), the absolute `ballas been set for the collector process or the running container in cgroup. Then the `totalMemory` will be determined in next step. 3. if there is no memory limit set in cgroup for the collector process or container where the collector is running. The total memory will be - calculated by `github.com/shirou/gopsutil/mem`[[link]](https://github.com/shirou/gopsutil/) on `mem.VirtualMemory().total` which is supported in multiple OS systems. + calculated by `github.com/shirou/gopsutil/v3/mem`[[link]](https://github.com/shirou/gopsutil/) on `mem.VirtualMemory().total` which is supported in multiple OS systems. Example: diff --git a/go.mod b/go.mod index 0c0bc2c9b10..ba2bb99526d 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/mitchellh/mapstructure v1.4.2 github.com/prometheus/common v0.31.1 github.com/rs/cors v1.8.0 - github.com/shirou/gopsutil v3.21.9+incompatible + github.com/shirou/gopsutil/v3 v3.21.9 github.com/spf13/cast v1.4.1 github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 @@ -32,7 +32,7 @@ require ( go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.7.0 go.uber.org/zap v1.19.1 - golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 + golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08 google.golang.org/grpc v1.41.0 google.golang.org/protobuf v1.27.1 @@ -62,8 +62,8 @@ require ( github.com/prometheus/procfs v0.6.0 // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/tklauser/go-sysconf v0.3.5 // indirect - github.com/tklauser/numcpus v0.2.2 // 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 golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect golang.org/x/text v0.3.6 // indirect diff --git a/go.sum b/go.sum index 2ed1591cb86..b08fb6c6a9b 100644 --- a/go.sum +++ b/go.sum @@ -348,8 +348,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v3.21.9+incompatible h1:LTLpUnfX81MkHeCtSrwNKZwuW5Id6kCa7/P43NdcNn4= -github.com/shirou/gopsutil v3.21.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil/v3 v3.21.9 h1:Vn4MUz2uXhqLSiCbGFRc0DILbMVLAY92DSkT8bsYrHg= +github.com/shirou/gopsutil/v3 v3.21.9/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -377,10 +377,10 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= +github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo= +github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= +github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ= +github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -598,7 +598,6 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -607,8 +606,8 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210611083646-a4fc73990273/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 h1:ikCpsnYR+Ew0vu99XlDp55lGgDJdIMx3f4a18jfse/s= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/internal/iruntime/mem_info.go b/internal/iruntime/mem_info.go index 53019e8dd44..ca231361113 100644 --- a/internal/iruntime/mem_info.go +++ b/internal/iruntime/mem_info.go @@ -15,7 +15,7 @@ package iruntime import ( - "github.com/shirou/gopsutil/mem" + "github.com/shirou/gopsutil/v3/mem" ) // readMemInfo returns the total memory diff --git a/service/internal/telemetry/process_telemetry.go b/service/internal/telemetry/process_telemetry.go index d93bb93a3c3..1d9c20d3c95 100644 --- a/service/internal/telemetry/process_telemetry.go +++ b/service/internal/telemetry/process_telemetry.go @@ -20,7 +20,7 @@ import ( "runtime" "time" - "github.com/shirou/gopsutil/process" + "github.com/shirou/gopsutil/v3/process" "go.opencensus.io/stats" "go.opencensus.io/stats/view" ) From 3879ce48aee5b85dad813da0773adf283adb3ef1 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 7 Oct 2021 03:24:58 -0700 Subject: [PATCH 052/149] Extract extension builder to a separate package (#4134) The goal is to have a "package" per config section for the internal builders. Signed-off-by: Bogdan Drutu --- service/collector_test.go | 5 ++-- service/internal/builder/exporters_builder.go | 19 ++++++++------- service/internal/builder/factories_test.go | 23 ------------------ service/internal/builder/pipelines_builder.go | 7 ++++-- service/internal/builder/receivers_builder.go | 9 ++++--- .../{builder => components}/constants.go | 14 +++++------ .../{builder => components}/host_wrapper.go | 4 ++-- .../host_wrapper_test.go | 4 ++-- .../extensions.go} | 24 ++++++++++--------- .../extensions_test.go} | 20 ++++++++++++++-- service/service.go | 5 ++-- 11 files changed, 70 insertions(+), 64 deletions(-) rename service/internal/{builder => components}/constants.go (74%) rename service/internal/{builder => components}/host_wrapper.go (95%) rename service/internal/{builder => components}/host_wrapper_test.go (90%) rename service/internal/{builder/extensions_builder.go => extensions/extensions.go} (89%) rename service/internal/{builder/extensions_builder_test.go => extensions/extensions_test.go} (84%) diff --git a/service/collector_test.go b/service/collector_test.go index 300196d4c34..d0730a7ec14 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -40,6 +40,7 @@ import ( "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" "go.opentelemetry.io/collector/service/parserprovider" ) @@ -296,7 +297,7 @@ func TestCollector_reloadService(t *testing.T) { builtExporters: builder.Exporters{}, builtPipelines: builder.BuiltPipelines{}, builtReceivers: builder.Receivers{}, - builtExtensions: builder.Extensions{}, + builtExtensions: extensions.Extensions{}, }, }, { @@ -307,7 +308,7 @@ func TestCollector_reloadService(t *testing.T) { builtExporters: builder.Exporters{}, builtPipelines: builder.BuiltPipelines{}, builtReceivers: builder.Receivers{}, - builtExtensions: builder.Extensions{}, + builtExtensions: extensions.Extensions{}, }, }, } diff --git a/service/internal/builder/exporters_builder.go b/service/internal/builder/exporters_builder.go index e0bd14f6290..149e6725e75 100644 --- a/service/internal/builder/exporters_builder.go +++ b/service/internal/builder/exporters_builder.go @@ -24,6 +24,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/service/internal/components" ) // builtExporter is an exporter that is built based on a config. It can have @@ -36,11 +37,16 @@ type builtExporter struct { // Start the exporter. func (bexp *builtExporter) Start(ctx context.Context, host component.Host) error { var errs error + bexp.logger.Info("Exporter is starting...") for _, exporter := range bexp.expByDataType { - errs = multierr.Append(errs, exporter.Start(ctx, host)) + errs = multierr.Append(errs, exporter.Start(ctx, components.NewHostWrapper(host, bexp.logger))) } - return errs + if errs != nil { + return errs + } + bexp.logger.Info("Exporter started.") + return nil } // Shutdown the trace component and the metrics component of an exporter. @@ -83,12 +89,9 @@ type Exporters map[config.ComponentID]*builtExporter // StartAll starts all exporters. func (exps Exporters) StartAll(ctx context.Context, host component.Host) error { for _, exp := range exps { - exp.logger.Info("Exporter is starting...") - - if err := exp.Start(ctx, newHostWrapper(host, exp.logger)); err != nil { + if err := exp.Start(ctx, host); err != nil { return err } - exp.logger.Info("Exporter started.") } return nil } @@ -138,7 +141,7 @@ func BuildExporters( cfg *config.Config, factories map[config.Type]component.ExporterFactory, ) (Exporters, error) { - logger := settings.Logger.With(zap.String(zapKindKey, zapKindLogExporter)) + logger := settings.Logger.With(zap.String(components.ZapKindKey, components.ZapKindLogExporter)) // We need to calculate required input data types for each exporter so that we know // which data type must be started for each exporter. @@ -150,7 +153,7 @@ func BuildExporters( for expID, expCfg := range cfg.Exporters { set := component.ExporterCreateSettings{ TelemetrySettings: component.TelemetrySettings{ - Logger: logger.With(zap.String(zapNameKey, expID.String())), + Logger: logger.With(zap.String(components.ZapNameKey, expID.String())), TracerProvider: settings.TracerProvider, MeterProvider: settings.MeterProvider, }, diff --git a/service/internal/builder/factories_test.go b/service/internal/builder/factories_test.go index 7961c5cb514..f293c6ad619 100644 --- a/service/internal/builder/factories_test.go +++ b/service/internal/builder/factories_test.go @@ -15,12 +15,9 @@ package builder import ( - "context" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/exporter/exporterhelper" - "go.opentelemetry.io/collector/extension/extensionhelper" "go.opentelemetry.io/collector/internal/testcomponents" "go.opentelemetry.io/collector/processor/processorhelper" "go.opentelemetry.io/collector/receiver/receiverhelper" @@ -30,15 +27,11 @@ func createTestFactories() component.Factories { exampleReceiverFactory := testcomponents.ExampleReceiverFactory exampleProcessorFactory := testcomponents.ExampleProcessorFactory exampleExporterFactory := testcomponents.ExampleExporterFactory - badExtensionFactory := newBadExtensionFactory() badReceiverFactory := newBadReceiverFactory() badProcessorFactory := newBadProcessorFactory() badExporterFactory := newBadExporterFactory() factories := component.Factories{ - Extensions: map[config.Type]component.ExtensionFactory{ - badExtensionFactory.Type(): badExtensionFactory, - }, Receivers: map[config.Type]component.ReceiverFactory{ exampleReceiverFactory.Type(): exampleReceiverFactory, badReceiverFactory.Type(): badReceiverFactory, @@ -85,19 +78,3 @@ func newBadExporterFactory() component.ExporterFactory { } }) } - -func newBadExtensionFactory() component.ExtensionFactory { - return extensionhelper.NewFactory( - "bf", - func() config.Extension { - return &struct { - config.ExtensionSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct - }{ - ExtensionSettings: config.NewExtensionSettings(config.NewComponentID("bf")), - } - }, - func(ctx context.Context, set component.ExtensionCreateSettings, extension config.Extension) (component.Extension, error) { - return nil, nil - }, - ) -} diff --git a/service/internal/builder/pipelines_builder.go b/service/internal/builder/pipelines_builder.go index 4587b069807..0ee9e1eedc5 100644 --- a/service/internal/builder/pipelines_builder.go +++ b/service/internal/builder/pipelines_builder.go @@ -24,6 +24,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/service/internal/components" "go.opentelemetry.io/collector/service/internal/fanoutconsumer" ) @@ -49,7 +50,7 @@ type BuiltPipelines map[*config.Pipeline]*builtPipeline func (bps BuiltPipelines) StartProcessors(ctx context.Context, host component.Host) error { for _, bp := range bps { bp.logger.Info("Pipeline is starting...") - hostWrapper := newHostWrapper(host, bp.logger) + hostWrapper := components.NewHostWrapper(host, bp.logger) // Start in reverse order, starting from the back of processors pipeline. // This is important so that processors that are earlier in the pipeline and // reference processors that are later in the pipeline do not start sending @@ -160,7 +161,9 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineCfg *conf var err error set := component.ProcessorCreateSettings{ TelemetrySettings: component.TelemetrySettings{ - Logger: pb.settings.Logger.With(zap.String(zapKindKey, zapKindProcessor), zap.String(zapNameKey, procID.String())), + Logger: pb.settings.Logger.With( + zap.String(components.ZapKindKey, components.ZapKindProcessor), + zap.String(components.ZapNameKey, procID.String())), TracerProvider: pb.settings.TracerProvider, MeterProvider: pb.settings.MeterProvider, }, diff --git a/service/internal/builder/receivers_builder.go b/service/internal/builder/receivers_builder.go index f3adbff993c..38dbd171cf4 100644 --- a/service/internal/builder/receivers_builder.go +++ b/service/internal/builder/receivers_builder.go @@ -26,6 +26,7 @@ import ( "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/service/internal/components" "go.opentelemetry.io/collector/service/internal/fanoutconsumer" ) @@ -40,7 +41,7 @@ type builtReceiver struct { // Start starts the receiver. func (rcv *builtReceiver) Start(ctx context.Context, host component.Host) error { - return rcv.receiver.Start(ctx, host) + return rcv.receiver.Start(ctx, components.NewHostWrapper(host, rcv.logger)) } // Shutdown stops the receiver. @@ -66,7 +67,7 @@ func (rcvs Receivers) StartAll(ctx context.Context, host component.Host) error { for _, rcv := range rcvs { rcv.logger.Info("Receiver is starting...") - if err := rcv.Start(ctx, newHostWrapper(host, rcv.logger)); err != nil { + if err := rcv.Start(ctx, host); err != nil { return err } rcv.logger.Info("Receiver started.") @@ -95,7 +96,9 @@ func BuildReceivers( for recvID, recvCfg := range cfg.Receivers { set := component.ReceiverCreateSettings{ TelemetrySettings: component.TelemetrySettings{ - Logger: settings.Logger.With(zap.String(zapKindKey, zapKindReceiver), zap.String(zapNameKey, recvID.String())), + Logger: settings.Logger.With( + zap.String(components.ZapKindKey, components.ZapKindReceiver), + zap.String(components.ZapNameKey, recvID.String())), TracerProvider: settings.TracerProvider, MeterProvider: settings.MeterProvider, }, diff --git a/service/internal/builder/constants.go b/service/internal/components/constants.go similarity index 74% rename from service/internal/builder/constants.go rename to service/internal/components/constants.go index e05a0e9189d..2cce44ed64e 100644 --- a/service/internal/builder/constants.go +++ b/service/internal/components/constants.go @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package components const ( - zapKindKey = "kind" - zapKindReceiver = "receiver" - zapKindProcessor = "processor" - zapKindLogExporter = "exporter" - zapKindExtension = "extension" - zapNameKey = "name" + ZapKindKey = "kind" + ZapKindReceiver = "receiver" + ZapKindProcessor = "processor" + ZapKindLogExporter = "exporter" + ZapKindExtension = "extension" + ZapNameKey = "name" ) diff --git a/service/internal/builder/host_wrapper.go b/service/internal/components/host_wrapper.go similarity index 95% rename from service/internal/builder/host_wrapper.go rename to service/internal/components/host_wrapper.go index cea7cdb9b7f..c0ce5bb2531 100644 --- a/service/internal/builder/host_wrapper.go +++ b/service/internal/components/host_wrapper.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package components import ( "net/http" @@ -28,7 +28,7 @@ type hostWrapper struct { *zap.Logger } -func newHostWrapper(host component.Host, logger *zap.Logger) component.Host { +func NewHostWrapper(host component.Host, logger *zap.Logger) component.Host { return &hostWrapper{ host, logger, diff --git a/service/internal/builder/host_wrapper_test.go b/service/internal/components/host_wrapper_test.go similarity index 90% rename from service/internal/builder/host_wrapper_test.go rename to service/internal/components/host_wrapper_test.go index afdbf99e0f7..720669bd847 100644 --- a/service/internal/builder/host_wrapper_test.go +++ b/service/internal/components/host_wrapper_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package components import ( "errors" @@ -24,6 +24,6 @@ import ( ) func Test_newHostWrapper(t *testing.T) { - hw := newHostWrapper(componenttest.NewNopHost(), zap.NewNop()) + hw := NewHostWrapper(componenttest.NewNopHost(), zap.NewNop()) hw.ReportFatalError(errors.New("test error")) } diff --git a/service/internal/builder/extensions_builder.go b/service/internal/extensions/extensions.go similarity index 89% rename from service/internal/builder/extensions_builder.go rename to service/internal/extensions/extensions.go index c7bed9a894f..717cccc1596 100644 --- a/service/internal/builder/extensions_builder.go +++ b/service/internal/extensions/extensions.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package extensions import ( "context" @@ -23,6 +23,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/service/internal/components" ) // builtExporter is an exporter that is built based on a config. It can have @@ -34,7 +35,12 @@ type builtExtension struct { // Start the receiver. func (ext *builtExtension) Start(ctx context.Context, host component.Host) error { - return ext.extension.Start(ctx, host) + ext.logger.Info("Extension is starting...") + if err := ext.extension.Start(ctx, components.NewHostWrapper(host, ext.logger)); err != nil { + return err + } + ext.logger.Info("Extension started.") + return nil } // Shutdown the receiver. @@ -50,13 +56,9 @@ type Extensions map[config.ComponentID]*builtExtension // StartAll starts all exporters. func (exts Extensions) StartAll(ctx context.Context, host component.Host) error { for _, ext := range exts { - ext.logger.Info("Extension is starting...") - - if err := ext.Start(ctx, newHostWrapper(host, ext.logger)); err != nil { + if err := ext.Start(ctx, host); err != nil { return err } - - ext.logger.Info("Extension started.") } return nil } @@ -107,8 +109,8 @@ func (exts Extensions) ToMap() map[config.ComponentID]component.Extension { return result } -// BuildExtensions builds Extensions from config. -func BuildExtensions( +// Build builds Extensions from config. +func Build( settings component.TelemetrySettings, buildInfo component.BuildInfo, config *config.Config, @@ -129,8 +131,8 @@ func BuildExtensions( set := component.ExtensionCreateSettings{ TelemetrySettings: component.TelemetrySettings{ Logger: settings.Logger.With( - zap.String(zapKindKey, zapKindExtension), - zap.String(zapNameKey, extID.String())), + zap.String(components.ZapKindKey, components.ZapKindExtension), + zap.String(components.ZapNameKey, extID.String())), TracerProvider: settings.TracerProvider, MeterProvider: settings.MeterProvider, }, diff --git a/service/internal/builder/extensions_builder_test.go b/service/internal/extensions/extensions_test.go similarity index 84% rename from service/internal/builder/extensions_builder_test.go rename to service/internal/extensions/extensions_test.go index f7254fe6340..3c0420efaed 100644 --- a/service/internal/builder/extensions_builder_test.go +++ b/service/internal/extensions/extensions_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package extensions import ( "context" @@ -115,7 +115,7 @@ func TestService_setupExtensions(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ext, err := BuildExtensions(componenttest.NewNopTelemetrySettings(), component.NewDefaultBuildInfo(), tt.config, tt.factories.Extensions) + ext, err := Build(componenttest.NewNopTelemetrySettings(), component.NewDefaultBuildInfo(), tt.config, tt.factories.Extensions) assert.Error(t, err) assert.EqualError(t, err, tt.wantErrMsg) @@ -123,3 +123,19 @@ func TestService_setupExtensions(t *testing.T) { }) } } + +func newBadExtensionFactory() component.ExtensionFactory { + return extensionhelper.NewFactory( + "bf", + func() config.Extension { + return &struct { + config.ExtensionSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct + }{ + ExtensionSettings: config.NewExtensionSettings(config.NewComponentID("bf")), + } + }, + func(ctx context.Context, set component.ExtensionCreateSettings, extension config.Extension) (component.Extension, error) { + return nil, nil + }, + ) +} diff --git a/service/service.go b/service/service.go index 717a3600f3b..4a84199f2fb 100644 --- a/service/service.go +++ b/service/service.go @@ -24,6 +24,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/service/internal/builder" + "go.opentelemetry.io/collector/service/internal/extensions" ) // service represents the implementation of a component.Host. @@ -38,7 +39,7 @@ type service struct { builtExporters builder.Exporters builtReceivers builder.Receivers builtPipelines builder.BuiltPipelines - builtExtensions builder.Extensions + builtExtensions extensions.Extensions } func newService(set *svcSettings) (*service, error) { @@ -56,7 +57,7 @@ func newService(set *svcSettings) (*service, error) { } var err error - if srv.builtExtensions, err = builder.BuildExtensions(srv.telemetry, srv.buildInfo, srv.config, srv.factories.Extensions); err != nil { + if srv.builtExtensions, err = extensions.Build(srv.telemetry, srv.buildInfo, srv.config, srv.factories.Extensions); err != nil { return nil, fmt.Errorf("cannot build extensions: %w", err) } From 7ed3f75ef84d9e9d11b175a0859060f765faca0b Mon Sep 17 00:00:00 2001 From: Dani Louca <59848726+dloucasfx@users.noreply.github.com> Date: Fri, 8 Oct 2021 12:15:09 -0400 Subject: [PATCH 053/149] update troubleshooting doc with the new log level setting (#4182) Signed-off-by: Dani Louca --- docs/troubleshooting.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 2f482c1c47c..a52e0e881d7 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -9,14 +9,25 @@ as well as investigate issues. Logs can be helpful in identifying issues. Always start by checking the log output and looking for potential issues. +The verbosity level defaults to `INFO` and can be adjusted. -The verbosity level, which defaults to `INFO` can also be adjusted by passing -the `--log-level` flag to the `otelcol` process. See `--help` for more details. +#### Version 0.35 and below: +Pass `--log-level` flag to the `otelcol` process. See `--help` for more details. ```bash $ otelcol --log-level DEBUG ``` +#### Version 0.36 and above: +Set the log level in the config `service::telemetry::logs` + +```yaml +service: + telemetry: + logs: + level: "debug" +``` + ### Metrics Prometheus metrics are exposed locally on port `8888` and path `/metrics`. From 0761e0498c14434b002184988a2fd6cd05889328 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Oct 2021 18:57:08 -0700 Subject: [PATCH 054/149] Bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (#4185) Bumps [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.24.0 to 0.25.0. - [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/v0.24.0...zpages/v0.25.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index ba2bb99526d..b1c21e9476a 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( go.opencensus.io v0.23.0 go.opentelemetry.io/collector/model v0.36.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.24.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.24.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 go.opentelemetry.io/contrib/zpages v0.24.0 go.opentelemetry.io/otel v1.0.1 go.opentelemetry.io/otel/exporters/prometheus v0.24.0 diff --git a/go.sum b/go.sum index b08fb6c6a9b..75c117aa65e 100644 --- a/go.sum +++ b/go.sum @@ -401,20 +401,17 @@ 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.24.0 h1:1hCzM7mwQbFQgk3Q4lAVEsGV6NB4Uj6Jt3EU+OiSBc8= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.24.0/go.mod h1:O0cG0vP6TP3c323kh70JmeG1jN69Sn9Z5HxgmeASFWY= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.24.0 h1:qW6j1kJU24yo2xIu16Py4m4AXn1dd+s2uKllGnTFAm0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.24.0/go.mod h1:7W3JSDYTtH3qKKHrS1fMiwLtK7iZFLPq1+7htfspX/E= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 h1:FIbb8m2PtTWjvXLHOEnXAoSmkaiXbg3fuvoZAjsAT3Q= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0/go.mod h1:NyB05cd+yPX6W5SiRNuJ90w7PV2+g2cgRbsPL7MvpME= go.opentelemetry.io/contrib/zpages v0.24.0 h1:VL3XVUgqn23yH5dmwCfq+yWaN/nrmzz2Iz3OBm3EyCk= go.opentelemetry.io/contrib/zpages v0.24.0/go.mod h1:/dZbBvWhnvD1wWk0xaTdRpqDuPorUGZgOVZwgsdaDsM= -go.opentelemetry.io/otel v1.0.0-RC3/go.mod h1:Ka5j3ua8tZs4Rkq4Ex3hwgBgOchyPVq5S6P2lz//nKQ= go.opentelemetry.io/otel v1.0.0/go.mod h1:AjRVh9A5/5DE7S+mZtTR6t8vpKKryam+0lREnfmS4cg= go.opentelemetry.io/otel v1.0.1 h1:4XKyXmfqJLOQ7feyV5DB6gsBFZ0ltB8vLtp6pj4JIcc= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= 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.23.0/go.mod h1:z+RPiDJe30YnCrOhFGivwBS+DU1JU/PiLKkk4re2DNY= go.opentelemetry.io/otel/internal/metric v0.24.0 h1:O5lFy6kAl0LMWBjzy3k//M8VjEaTDWL9DPJuqZmWIAA= go.opentelemetry.io/otel/internal/metric v0.24.0/go.mod h1:PSkQG+KuApZjBpC6ea6082ZrWUUy/w132tJ/LOU3TXk= -go.opentelemetry.io/otel/metric v0.23.0/go.mod h1:G/Nn9InyNnIv7J6YVkQfpc0JCfKBNJaERBGw08nqmVQ= go.opentelemetry.io/otel/metric v0.24.0 h1:Rg4UYHS6JKR1Sw1TxnI13z7q/0p/XAbgIqUTagvLJuU= go.opentelemetry.io/otel/metric v0.24.0/go.mod h1:tpMFnCD9t+BEGiWY2bWF5+AwjuAdM0lSowQ4SBA3/K4= go.opentelemetry.io/otel/sdk v1.0.0/go.mod h1:PCrDHlSy5x1kjezSdL37PhbFUMjrsLRshJ2zCzeXwbM= @@ -424,7 +421,6 @@ go.opentelemetry.io/otel/sdk/export/metric v0.24.0 h1:innKi8LQebwPI+WEuEKEWMjhWC 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/trace v1.0.0-RC3/go.mod h1:VUt2TUYd8S2/ZRX09ZDFZQwn2RqfMB5MzO17jBojGxo= go.opentelemetry.io/otel/trace v1.0.0/go.mod h1:PXTWqayeFUlJV1YDNhsJYB184+IvAH814St6o6ajzIs= go.opentelemetry.io/otel/trace v1.0.1 h1:StTeIH6Q3G4r0Fiw34LTokUFESZgIDUr0qIJ7mKmAfw= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= From 2209f2a19819c48ac2022da3176eedf64fd004dc Mon Sep 17 00:00:00 2001 From: Anthony Mirabella Date: Mon, 11 Oct 2021 11:34:57 -0400 Subject: [PATCH 055/149] obsreport: wire up ReceiverCreateSettings for receivers using obsreport (#4149) * obsreport: wire up ReceiverCreateSettings for receivers using obsreport Signed-off-by: Anthony J Mirabella * obsreport: wire up ReceiverCreateSettings for scrapers using obsreport Signed-off-by: Anthony J Mirabella * pass ReceiverCreateSettings through scraper controller Signed-off-by: Anthony J Mirabella * Fix lint issue Signed-off-by: Anthony J Mirabella * Ensure TracerProvider is available to scraper receiver for now Signed-off-by: Anthony J Mirabella * Fix test failures Signed-off-by: Anthony J Mirabella --- obsreport/obsreport_receiver.go | 7 +-- obsreport/obsreport_scraper.go | 9 ++-- obsreport/obsreport_test.go | 50 ++++++++++--------- obsreport/obsreporttest/obsreporttest_test.go | 18 +++++-- receiver/otlpreceiver/internal/logs/otlp.go | 9 +++- .../otlpreceiver/internal/logs/otlp_test.go | 3 +- .../otlpreceiver/internal/metrics/otlp.go | 9 +++- .../internal/metrics/otlp_test.go | 3 +- receiver/otlpreceiver/internal/trace/otlp.go | 9 +++- .../otlpreceiver/internal/trace/otlp_test.go | 3 +- receiver/otlpreceiver/otlp.go | 6 +-- receiver/scraperhelper/scraper.go | 18 +++++-- receiver/scraperhelper/scrapercontroller.go | 16 ++++-- .../scraperhelper/scrapercontroller_test.go | 15 ++---- 14 files changed, 108 insertions(+), 67 deletions(-) diff --git a/obsreport/obsreport_receiver.go b/obsreport/obsreport_receiver.go index f3e57b061fa..96418391f86 100644 --- a/obsreport/obsreport_receiver.go +++ b/obsreport/obsreport_receiver.go @@ -19,10 +19,10 @@ import ( "go.opencensus.io/stats" "go.opencensus.io/tag" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/internal/obsreportconfig" @@ -47,7 +47,8 @@ type ReceiverSettings struct { // Typically the long lived context is associated to a connection, // eg.: a gRPC stream, for which many batches of data are received in individual // operations without a corresponding new context per operation. - LongLivedCtx bool + LongLivedCtx bool + ReceiverCreateSettings component.ReceiverCreateSettings } // NewReceiver creates a new Receiver. @@ -60,7 +61,7 @@ func NewReceiver(cfg ReceiverSettings) *Receiver { tag.Upsert(obsmetrics.TagKeyReceiver, cfg.ReceiverID.String(), tag.WithTTL(tag.TTLNoPropagation)), tag.Upsert(obsmetrics.TagKeyTransport, cfg.Transport, tag.WithTTL(tag.TTLNoPropagation)), }, - tracer: otel.GetTracerProvider().Tracer(cfg.ReceiverID.String()), + tracer: cfg.ReceiverCreateSettings.TracerProvider.Tracer(cfg.ReceiverID.String()), } } diff --git a/obsreport/obsreport_scraper.go b/obsreport/obsreport_scraper.go index 8ead166a3dd..01775862dcf 100644 --- a/obsreport/obsreport_scraper.go +++ b/obsreport/obsreport_scraper.go @@ -19,10 +19,10 @@ import ( "go.opencensus.io/stats" "go.opencensus.io/tag" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/internal/obsreportconfig" @@ -40,8 +40,9 @@ type Scraper struct { // ScraperSettings are settings for creating a Scraper. type ScraperSettings struct { - ReceiverID config.ComponentID - Scraper config.ComponentID + ReceiverID config.ComponentID + Scraper config.ComponentID + ReceiverCreateSettings component.ReceiverCreateSettings } // NewScraper creates a new Scraper. @@ -52,7 +53,7 @@ func NewScraper(cfg ScraperSettings) *Scraper { mutators: []tag.Mutator{ tag.Upsert(obsmetrics.TagKeyReceiver, cfg.ReceiverID.String(), tag.WithTTL(tag.TTLNoPropagation)), tag.Upsert(obsmetrics.TagKeyScraper, cfg.Scraper.String(), tag.WithTTL(tag.TTLNoPropagation))}, - tracer: otel.GetTracerProvider().Tracer(cfg.Scraper.String()), + tracer: cfg.ReceiverCreateSettings.TracerProvider.Tracer(cfg.Scraper.String()), } } diff --git a/obsreport/obsreport_test.go b/obsreport/obsreport_test.go index 8362daae671..e0a588472ce 100644 --- a/obsreport/obsreport_test.go +++ b/obsreport/obsreport_test.go @@ -21,10 +21,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configtelemetry" @@ -39,7 +37,7 @@ const ( ) var ( - receiver = config.NewComponentID("fakeReicever") + receiver = config.NewComponentID("fakeReceiver") scraper = config.NewComponentID("fakeScraper") processor = config.NewComponentID("fakeProcessor") exporter = config.NewComponentID("fakeExporter") @@ -58,9 +56,6 @@ func TestReceiveTraceDataOp(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - otel.SetTracerProvider(set.TracerProvider) - defer otel.SetTracerProvider(trace.NewNoopTracerProvider()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() @@ -69,7 +64,11 @@ func TestReceiveTraceDataOp(t *testing.T) { {items: 42, err: nil}, } for i, param := range params { - rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: transport}) + rec := NewReceiver(ReceiverSettings{ + ReceiverID: receiver, + Transport: transport, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := rec.StartTracesOp(parentCtx) assert.NotNil(t, ctx) rec.EndTracesOp(ctx, format, params[i].items, param.err) @@ -105,9 +104,6 @@ func TestReceiveLogsOp(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - otel.SetTracerProvider(set.TracerProvider) - defer otel.SetTracerProvider(trace.NewNoopTracerProvider()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() @@ -116,7 +112,11 @@ func TestReceiveLogsOp(t *testing.T) { {items: 42, err: nil}, } for i, param := range params { - rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: transport}) + rec := NewReceiver(ReceiverSettings{ + ReceiverID: receiver, + Transport: transport, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := rec.StartLogsOp(parentCtx) assert.NotNil(t, ctx) rec.EndLogsOp(ctx, format, params[i].items, param.err) @@ -152,9 +152,6 @@ func TestReceiveMetricsOp(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - otel.SetTracerProvider(set.TracerProvider) - defer otel.SetTracerProvider(trace.NewNoopTracerProvider()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() @@ -163,7 +160,11 @@ func TestReceiveMetricsOp(t *testing.T) { {items: 29, err: nil}, } for i, param := range params { - rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: transport}) + rec := NewReceiver(ReceiverSettings{ + ReceiverID: receiver, + Transport: transport, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := rec.StartMetricsOp(parentCtx) assert.NotNil(t, ctx) rec.EndMetricsOp(ctx, format, params[i].items, param.err) @@ -200,9 +201,6 @@ func TestScrapeMetricsDataOp(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - otel.SetTracerProvider(set.TracerProvider) - defer otel.SetTracerProvider(trace.NewNoopTracerProvider()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() @@ -212,7 +210,11 @@ func TestScrapeMetricsDataOp(t *testing.T) { {items: 15, err: nil}, } for i := range params { - scrp := NewScraper(ScraperSettings{ReceiverID: receiver, Scraper: scraper}) + scrp := NewScraper(ScraperSettings{ + ReceiverID: receiver, + Scraper: scraper, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := scrp.StartMetricsOp(parentCtx) assert.NotNil(t, ctx) scrp.EndMetricsOp(ctx, params[i].items, params[i].err) @@ -409,9 +411,6 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - otel.SetTracerProvider(set.TracerProvider) - defer otel.SetTracerProvider(trace.NewNoopTracerProvider()) - longLivedCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() @@ -422,7 +421,12 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { for i := range params { // Use a new context on each operation to simulate distinct operations // under the same long lived context. - rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: transport, LongLivedCtx: true}) + rec := NewReceiver(ReceiverSettings{ + ReceiverID: receiver, + Transport: transport, + LongLivedCtx: true, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := rec.StartTracesOp(longLivedCtx) assert.NotNil(t, ctx) rec.EndTracesOp(ctx, format, params[i].items, params[i].err) diff --git a/obsreport/obsreporttest/obsreporttest_test.go b/obsreport/obsreporttest/obsreporttest_test.go index 422d690c8d1..1d74bb055e6 100644 --- a/obsreport/obsreporttest/obsreporttest_test.go +++ b/obsreport/obsreporttest/obsreporttest_test.go @@ -42,7 +42,11 @@ func TestCheckReceiverTracesViews(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiver, Transport: transport}) + rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: receiver, + Transport: transport, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := rec.StartTracesOp(context.Background()) assert.NotNil(t, ctx) rec.EndTracesOp( @@ -59,7 +63,11 @@ func TestCheckReceiverMetricsViews(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiver, Transport: transport}) + rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: receiver, + Transport: transport, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := rec.StartMetricsOp(context.Background()) assert.NotNil(t, ctx) rec.EndMetricsOp(ctx, format, 7, nil) @@ -72,7 +80,11 @@ func TestCheckReceiverLogsViews(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiver, Transport: transport}) + rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: receiver, + Transport: transport, + ReceiverCreateSettings: set.ToReceiverCreateSettings(), + }) ctx := rec.StartLogsOp(context.Background()) assert.NotNil(t, ctx) rec.EndLogsOp(ctx, format, 7, nil) diff --git a/receiver/otlpreceiver/internal/logs/otlp.go b/receiver/otlpreceiver/internal/logs/otlp.go index 8774e770bb2..61ff88a1841 100644 --- a/receiver/otlpreceiver/internal/logs/otlp.go +++ b/receiver/otlpreceiver/internal/logs/otlp.go @@ -18,6 +18,7 @@ import ( "context" "go.opentelemetry.io/collector/client" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/model/otlpgrpc" @@ -36,10 +37,14 @@ type Receiver struct { } // New creates a new Receiver reference. -func New(id config.ComponentID, nextConsumer consumer.Logs) *Receiver { +func New(id config.ComponentID, nextConsumer consumer.Logs, set component.ReceiverCreateSettings) *Receiver { return &Receiver{ nextConsumer: nextConsumer, - obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: id, Transport: receiverTransport}), + obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: id, + Transport: receiverTransport, + ReceiverCreateSettings: set, + }), } } diff --git a/receiver/otlpreceiver/internal/logs/otlp_test.go b/receiver/otlpreceiver/internal/logs/otlp_test.go index bb6198eb4a0..eaf65c1f3da 100644 --- a/receiver/otlpreceiver/internal/logs/otlp_test.go +++ b/receiver/otlpreceiver/internal/logs/otlp_test.go @@ -24,6 +24,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" + "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" @@ -112,7 +113,7 @@ func otlpReceiverOnGRPCServer(t *testing.T, tc consumer.Logs) (net.Addr, func()) } } - r := New(config.NewComponentIDWithName("otlp", "log"), tc) + r := New(config.NewComponentIDWithName("otlp", "log"), tc, componenttest.NewNopReceiverCreateSettings()) require.NoError(t, err) // Now run it as a gRPC server diff --git a/receiver/otlpreceiver/internal/metrics/otlp.go b/receiver/otlpreceiver/internal/metrics/otlp.go index e9fe118baca..68d3029db7f 100644 --- a/receiver/otlpreceiver/internal/metrics/otlp.go +++ b/receiver/otlpreceiver/internal/metrics/otlp.go @@ -18,6 +18,7 @@ import ( "context" "go.opentelemetry.io/collector/client" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/model/otlpgrpc" @@ -36,10 +37,14 @@ type Receiver struct { } // New creates a new Receiver reference. -func New(id config.ComponentID, nextConsumer consumer.Metrics) *Receiver { +func New(id config.ComponentID, nextConsumer consumer.Metrics, set component.ReceiverCreateSettings) *Receiver { return &Receiver{ nextConsumer: nextConsumer, - obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: id, Transport: receiverTransport}), + obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: id, + Transport: receiverTransport, + ReceiverCreateSettings: set, + }), } } diff --git a/receiver/otlpreceiver/internal/metrics/otlp_test.go b/receiver/otlpreceiver/internal/metrics/otlp_test.go index 5b7d6f59c01..99a7d0cd36c 100644 --- a/receiver/otlpreceiver/internal/metrics/otlp_test.go +++ b/receiver/otlpreceiver/internal/metrics/otlp_test.go @@ -24,6 +24,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" + "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" @@ -114,7 +115,7 @@ func otlpReceiverOnGRPCServer(t *testing.T, mc consumer.Metrics) (net.Addr, func } } - r := New(config.NewComponentIDWithName("otlp", "metrics"), mc) + r := New(config.NewComponentIDWithName("otlp", "metrics"), mc, componenttest.NewNopReceiverCreateSettings()) // Now run it as a gRPC server srv := grpc.NewServer() otlpgrpc.RegisterMetricsServer(srv, r) diff --git a/receiver/otlpreceiver/internal/trace/otlp.go b/receiver/otlpreceiver/internal/trace/otlp.go index 3740d9e9ce8..d6e5c25fdb8 100644 --- a/receiver/otlpreceiver/internal/trace/otlp.go +++ b/receiver/otlpreceiver/internal/trace/otlp.go @@ -18,6 +18,7 @@ import ( "context" "go.opentelemetry.io/collector/client" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/model/otlpgrpc" @@ -36,10 +37,14 @@ type Receiver struct { } // New creates a new Receiver reference. -func New(id config.ComponentID, nextConsumer consumer.Traces) *Receiver { +func New(id config.ComponentID, nextConsumer consumer.Traces, set component.ReceiverCreateSettings) *Receiver { return &Receiver{ nextConsumer: nextConsumer, - obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: id, Transport: receiverTransport}), + obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: id, + Transport: receiverTransport, + ReceiverCreateSettings: set, + }), } } diff --git a/receiver/otlpreceiver/internal/trace/otlp_test.go b/receiver/otlpreceiver/internal/trace/otlp_test.go index 1b188092ff0..9975deeb947 100644 --- a/receiver/otlpreceiver/internal/trace/otlp_test.go +++ b/receiver/otlpreceiver/internal/trace/otlp_test.go @@ -24,6 +24,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" + "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" @@ -111,7 +112,7 @@ func otlpReceiverOnGRPCServer(t *testing.T, tc consumer.Traces) (net.Addr, func( } } - r := New(config.NewComponentIDWithName("otlp", "trace"), tc) + r := New(config.NewComponentIDWithName("otlp", "trace"), tc, componenttest.NewNopReceiverCreateSettings()) require.NoError(t, err) // Now run it as a gRPC server diff --git a/receiver/otlpreceiver/otlp.go b/receiver/otlpreceiver/otlp.go index adc37fefa09..39e1e01fd43 100644 --- a/receiver/otlpreceiver/otlp.go +++ b/receiver/otlpreceiver/otlp.go @@ -180,7 +180,7 @@ func (r *otlpReceiver) registerTraceConsumer(tc consumer.Traces) error { if tc == nil { return componenterror.ErrNilNextConsumer } - r.traceReceiver = trace.New(r.cfg.ID(), tc) + r.traceReceiver = trace.New(r.cfg.ID(), tc, r.settings) if r.httpMux != nil { r.httpMux.HandleFunc("/v1/traces", func(resp http.ResponseWriter, req *http.Request) { handleTraces(resp, req, r.traceReceiver, pbEncoder) @@ -204,7 +204,7 @@ func (r *otlpReceiver) registerMetricsConsumer(mc consumer.Metrics) error { if mc == nil { return componenterror.ErrNilNextConsumer } - r.metricsReceiver = metrics.New(r.cfg.ID(), mc) + r.metricsReceiver = metrics.New(r.cfg.ID(), mc, r.settings) if r.httpMux != nil { r.httpMux.HandleFunc("/v1/metrics", func(resp http.ResponseWriter, req *http.Request) { handleMetrics(resp, req, r.metricsReceiver, pbEncoder) @@ -220,7 +220,7 @@ func (r *otlpReceiver) registerLogsConsumer(lc consumer.Logs) error { if lc == nil { return componenterror.ErrNilNextConsumer } - r.logReceiver = logs.New(r.cfg.ID(), lc) + r.logReceiver = logs.New(r.cfg.ID(), lc, r.settings) if r.httpMux != nil { r.httpMux.HandleFunc("/v1/logs", func(w http.ResponseWriter, req *http.Request) { handleLogs(w, req, r.logReceiver, pbEncoder) diff --git a/receiver/scraperhelper/scraper.go b/receiver/scraperhelper/scraper.go index ef52a93f4ed..c0a305954f5 100644 --- a/receiver/scraperhelper/scraper.go +++ b/receiver/scraperhelper/scraper.go @@ -44,7 +44,7 @@ type Scraper interface { // ID returns the scraper id. ID() config.ComponentID - Scrape(context.Context, config.ComponentID) (pdata.Metrics, error) + Scrape(context.Context, config.ComponentID, component.ReceiverCreateSettings) (pdata.Metrics, error) } type baseScraper struct { @@ -101,8 +101,12 @@ func NewMetricsScraper( return ms } -func (ms metricsScraper) Scrape(ctx context.Context, receiverID config.ComponentID) (pdata.Metrics, error) { - scrp := obsreport.NewScraper(obsreport.ScraperSettings{ReceiverID: receiverID, Scraper: ms.ID()}) +func (ms metricsScraper) Scrape(ctx context.Context, receiverID config.ComponentID, set component.ReceiverCreateSettings) (pdata.Metrics, error) { + scrp := obsreport.NewScraper(obsreport.ScraperSettings{ + ReceiverID: receiverID, + Scraper: ms.ID(), + ReceiverCreateSettings: set, + }) ctx = scrp.StartMetricsOp(ctx) metrics, err := ms.ScrapeMetrics(ctx) count := 0 @@ -147,8 +151,12 @@ func NewResourceMetricsScraper( return rms } -func (rms resourceMetricsScraper) Scrape(ctx context.Context, receiverID config.ComponentID) (pdata.Metrics, error) { - scrp := obsreport.NewScraper(obsreport.ScraperSettings{ReceiverID: receiverID, Scraper: rms.ID()}) +func (rms resourceMetricsScraper) Scrape(ctx context.Context, receiverID config.ComponentID, set component.ReceiverCreateSettings) (pdata.Metrics, error) { + scrp := obsreport.NewScraper(obsreport.ScraperSettings{ + ReceiverID: receiverID, + Scraper: rms.ID(), + ReceiverCreateSettings: set, + }) ctx = scrp.StartMetricsOp(ctx) resourceMetrics, err := rms.ScrapeResourceMetrics(ctx) diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index 857c2918f57..d156e435498 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -85,13 +85,14 @@ type controller struct { done chan struct{} terminated chan struct{} - obsrecv *obsreport.Receiver + obsrecv *obsreport.Receiver + recvSettings component.ReceiverCreateSettings } // NewScraperControllerReceiver creates a Receiver with the configured options, that can control multiple scrapers. func NewScraperControllerReceiver( cfg *ScraperControllerSettings, - logger *zap.Logger, + set component.ReceiverCreateSettings, nextConsumer consumer.Metrics, options ...ScraperControllerOption, ) (component.Receiver, error) { @@ -105,12 +106,17 @@ func NewScraperControllerReceiver( sc := &controller{ id: cfg.ID(), - logger: logger, + logger: set.Logger, collectionInterval: cfg.CollectionInterval, nextConsumer: nextConsumer, done: make(chan struct{}), terminated: make(chan struct{}), - obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: cfg.ID(), Transport: ""}), + obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: cfg.ID(), + Transport: "", + ReceiverCreateSettings: set, + }), + recvSettings: set, } for _, op := range options { @@ -180,7 +186,7 @@ func (sc *controller) scrapeMetricsAndReport(ctx context.Context) { metrics := pdata.NewMetrics() for _, scraper := range sc.scrapers { - md, err := scraper.Scrape(ctx, sc.id) + md, err := scraper.Scrape(ctx, sc.id, sc.recvSettings) if err != nil { sc.logger.Error("Error scraping metrics", zap.Error(err), zap.Stringer("scraper", scraper.ID())) diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index 0951b48006d..1e26a6e3439 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -22,13 +22,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/codes" sdktrace "go.opentelemetry.io/otel/sdk/trace" - "go.opentelemetry.io/otel/sdk/trace/tracetest" - "go.opentelemetry.io/otel/trace" "go.uber.org/multierr" - "go.uber.org/zap" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" @@ -186,11 +182,6 @@ func TestScrapeController(t *testing.T) { for _, test := range testCases { t.Run(test.name, func(t *testing.T) { - sr := new(tracetest.SpanRecorder) - tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr)) - otel.SetTracerProvider(tp) - defer otel.SetTracerProvider(trace.NewNoopTracerProvider()) - set, err := obsreporttest.SetupTelemetry() require.NoError(t, err) defer set.Shutdown(context.Background()) @@ -215,7 +206,7 @@ func TestScrapeController(t *testing.T) { cfg = test.scraperControllerSettings } - mr, err := NewScraperControllerReceiver(cfg, zap.NewNop(), nextConsumer, options...) + mr, err := NewScraperControllerReceiver(cfg, set.ToReceiverCreateSettings(), nextConsumer, options...) if test.expectedNewErr != "" { assert.EqualError(t, err, test.expectedNewErr) return @@ -256,7 +247,7 @@ func TestScrapeController(t *testing.T) { assert.GreaterOrEqual(t, sink.DataPointCount(), iterations) } - spans := sr.Ended() + spans := set.SpanRecorder.Ended() assertReceiverSpan(t, spans) assertReceiverViews(t, sink) assertScraperSpan(t, test.scrapeErr, spans) @@ -429,7 +420,7 @@ func TestSingleScrapePerTick(t *testing.T) { receiver, err := NewScraperControllerReceiver( cfg, - zap.NewNop(), + componenttest.NewNopReceiverCreateSettings(), new(consumertest.MetricsSink), AddScraper(NewMetricsScraper("", tsm.scrape)), AddScraper(NewResourceMetricsScraper(config.NewComponentID("scraper"), tsrm.scrape)), From 5ee979a1bb0d0343e98913cbfb8bff92d43b8378 Mon Sep 17 00:00:00 2001 From: Anthony Mirabella Date: Mon, 11 Oct 2021 12:33:13 -0400 Subject: [PATCH 056/149] Feature gate implementation and documentation (#4108) * Feature gate implementation and documentation Signed-off-by: Anthony J Mirabella * Refactor feature gate implementation Moves the implementation from `config/configgates` to `service.featuregate`. Rearranges CLI flag handling so that it is all performed by a ParserProvider and the ConfigUnmarshaler does not need to know about CLI flags. Removes `Registry` type, collapsing `frozenRegistry` to `registry` and putting `Register()` and `Apply()` functions at the package scope. Signed-off-by: Anthony J Mirabella * rename FlagValue to gateFlagValue Signed-off-by: Anthony J Mirabella * Add tests for feature gate parses provider Signed-off-by: Anthony J Mirabella * Remove feature gate flag ParserProvider Signed-off-by: Anthony J Mirabella * Refactor feature gates to use a global registry Signed-off-by: Anthony J Mirabella * Rewrite feature gate README * Avoid copylock warnings Signed-off-by: Anthony J Mirabella * Update service/featuregate/README.md Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> * Update service/featuregate/README.md Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> * Update service/featuregate/README.md Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> * Address PR feedback Signed-off-by: Anthony J Mirabella Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> --- service/featuregate/README.md | 74 ++++++++++++++++++++++ service/featuregate/gates.go | 101 ++++++++++++++++++++++++++++++ service/featuregate/gates_test.go | 66 +++++++++++++++++++ 3 files changed, 241 insertions(+) create mode 100644 service/featuregate/README.md create mode 100644 service/featuregate/gates.go create mode 100644 service/featuregate/gates_test.go diff --git a/service/featuregate/README.md b/service/featuregate/README.md new file mode 100644 index 00000000000..ea3eddaf18d --- /dev/null +++ b/service/featuregate/README.md @@ -0,0 +1,74 @@ +# Collector Feature Gates + +This package provides a mechanism that allows operators to enable and disable +experimental or transitional features at deployment time. These flags should +be able to govern the behavior of the application starting as early as possible +and should be available to every component such that decisions may be made +based on flags at the component level. + +## Usage + +Feature gates must be defined and registered with the global registry in +an `init()` function. This makes the `Gate` available to be configured and +queried with a default value of its `Enabled` property. + +```go +const myFeatureGateID = "namespaced.uniqueIdentifier" + +func init() { + featuregate.Register(featuregate.Gate{ + ID: fancyNewFeatureGate, + Description: "A brief description of what the gate controls", + Enabled: false, + }) +} +``` + +The status of the gate may later be checked by interrogating the global +feature gate registry: + +```go +if featuregate.IsEnabled(myFeatureGateID) { + setupNewFeature() +} +``` + +Note that querying the registry takes a read lock and accesses a map, so it +should be done once and the result cached for local use if repeated checks +are required. Avoid querying the registry in a loop. + +## Controlling Gates + +``` +N.B.: This feature has not yet been implemented and is subject to change. +``` + +Feature gates can be enabled or disabled via the CLI, with the +`--feature-gates` flag. When using the CLI flag, gate +identifiers must be presented as a comma-delimited list. Gate identifiers +prefixed with `-` will disable the gate and prefixing with `+` or with no +prefix will enable the gate. + +```shell +otelcol --config=config.yaml --feature-gates=gate1,-gate2,+gate3 +``` + +This will enable `gate1` and `gate3` and disable `gate2`. + +## Feature Lifecycle + +Features controlled by a `Gate` should follow a three-stage lifecycle, +modeled after the [system used by Kubernetes](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-stages): + +1. An `alpha` stage where the feature is disabled by default and must be enabled + through a `Gate`. +2. A `beta` stage where the feature has been well tested and is enabled by + default but can be disabled through a `Gate`. +3. A generally available stage where the feature is permanently enabled and + the `Gate` is no longer operative. + +Features that prove unworkable in the `alpha` stage may be discontinued +without proceeding to the `beta` stage. Features that make it to the `beta` +stage will not be dropped and will eventually reach general availability +where the `Gate` that allowed them to be disabled during the `beta` stage +will be removed. diff --git a/service/featuregate/gates.go b/service/featuregate/gates.go new file mode 100644 index 00000000000..79aaadc2296 --- /dev/null +++ b/service/featuregate/gates.go @@ -0,0 +1,101 @@ +// 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 featuregate + +import ( + "fmt" + "sync" +) + +// Gate represents an individual feature that may be enabled or disabled based +// on the lifecycle state of the feature and CLI flags specified by the user. +type Gate struct { + ID string + Description string + Enabled bool +} + +var reg = ®istry{gates: make(map[string]Gate)} + +// IsEnabled returns true if a registered feature gate is enabled and false otherwise. +func IsEnabled(id string) bool { + return reg.isEnabled(id) +} + +// List returns a slice of copies of all registered Gates. +func List() []Gate { + return reg.list() +} + +// Register a Gate. May only be called in an init() function. +// Will panic() if a Gate with the same ID is already registered. +func Register(g Gate) { + if err := reg.add(g); err != nil { + panic(err) + } +} + +// Apply a configuration in the form of a map of Gate identifiers to boolean values. +// Sets only those values provided in the map, other gate values are not changed. +func Apply(cfg map[string]bool) { + reg.apply(cfg) +} + +type registry struct { + sync.RWMutex + gates map[string]Gate +} + +func (r *registry) apply(cfg map[string]bool) { + r.Lock() + defer r.Unlock() + for id, val := range cfg { + if g, ok := r.gates[id]; ok { + g.Enabled = val + r.gates[g.ID] = g + } + } +} + +func (r *registry) add(g Gate) error { + r.Lock() + defer r.Unlock() + if _, ok := r.gates[g.ID]; ok { + return fmt.Errorf("attempted to add pre-existing gate %q", g.ID) + } + + r.gates[g.ID] = g + return nil +} + +func (r *registry) isEnabled(id string) bool { + r.RLock() + defer r.RUnlock() + g, ok := r.gates[id] + return ok && g.Enabled +} + +func (r *registry) list() []Gate { + r.RLock() + defer r.RUnlock() + ret := make([]Gate, len(r.gates)) + i := 0 + for _, gate := range r.gates { + ret[i] = gate + i++ + } + + return ret +} diff --git a/service/featuregate/gates_test.go b/service/featuregate/gates_test.go new file mode 100644 index 00000000000..777c9a00c76 --- /dev/null +++ b/service/featuregate/gates_test.go @@ -0,0 +1,66 @@ +// 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 featuregate + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestRegistry(t *testing.T) { + r := registry{gates: map[string]Gate{}} + + gate := Gate{ + ID: "foo", + Description: "Test Gate", + Enabled: true, + } + + assert.Empty(t, r.list()) + assert.False(t, r.isEnabled(gate.ID)) + + assert.NoError(t, r.add(gate)) + assert.Len(t, r.list(), 1) + assert.True(t, r.isEnabled(gate.ID)) + + r.apply(map[string]bool{gate.ID: false}) + assert.False(t, r.isEnabled(gate.ID)) + + assert.Error(t, r.add(gate)) +} + +func TestGlobalRegistry(t *testing.T) { + gate := Gate{ + ID: "feature_gate_test.foo", + Description: "Test Gate", + Enabled: true, + } + + assert.NotContains(t, List(), gate) + assert.False(t, IsEnabled(gate.ID)) + + assert.NotPanics(t, func() { Register(gate) }) + assert.Contains(t, List(), gate) + assert.True(t, IsEnabled(gate.ID)) + + Apply(map[string]bool{gate.ID: false}) + assert.False(t, IsEnabled(gate.ID)) + + assert.Panics(t, func() { Register(gate) }) + reg.Lock() + delete(reg.gates, gate.ID) + reg.Unlock() +} From a298b1047fe38793372d11c172676e2cf6bbcfd6 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 12 Oct 2021 08:07:50 -0700 Subject: [PATCH 057/149] Upgrade otel/contrib to v0.25.0 (#4187) Signed-off-by: Bogdan Drutu --- go.mod | 4 ++-- go.sum | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index b1c21e9476a..d7f3b6c59de 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 go.opentelemetry.io/collector/model v0.36.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.24.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 - go.opentelemetry.io/contrib/zpages v0.24.0 + go.opentelemetry.io/contrib/zpages v0.25.0 go.opentelemetry.io/otel v1.0.1 go.opentelemetry.io/otel/exporters/prometheus v0.24.0 go.opentelemetry.io/otel/metric v0.24.0 diff --git a/go.sum b/go.sum index 75c117aa65e..a8d2e958958 100644 --- a/go.sum +++ b/go.sum @@ -399,13 +399,12 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.24.0 h1:1hCzM7mwQbFQgk3Q4lAVEsGV6NB4Uj6Jt3EU+OiSBc8= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.24.0/go.mod h1:O0cG0vP6TP3c323kh70JmeG1jN69Sn9Z5HxgmeASFWY= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0 h1:Wx7nFnvCaissIUZxPkBqDz2963Z+Cl+PkYbDKzTxDqQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 h1:FIbb8m2PtTWjvXLHOEnXAoSmkaiXbg3fuvoZAjsAT3Q= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0/go.mod h1:NyB05cd+yPX6W5SiRNuJ90w7PV2+g2cgRbsPL7MvpME= -go.opentelemetry.io/contrib/zpages v0.24.0 h1:VL3XVUgqn23yH5dmwCfq+yWaN/nrmzz2Iz3OBm3EyCk= -go.opentelemetry.io/contrib/zpages v0.24.0/go.mod h1:/dZbBvWhnvD1wWk0xaTdRpqDuPorUGZgOVZwgsdaDsM= -go.opentelemetry.io/otel v1.0.0/go.mod h1:AjRVh9A5/5DE7S+mZtTR6t8vpKKryam+0lREnfmS4cg= +go.opentelemetry.io/contrib/zpages v0.25.0 h1:o5aRS429e3fJmxKo32badDmCYzzRoaqHW+6XJBql9OU= +go.opentelemetry.io/contrib/zpages v0.25.0/go.mod h1:cXBK0CNcIBD9Iiw1Hv3DvS+E8N2rtr+k+OoPs+sP0T4= go.opentelemetry.io/otel v1.0.1 h1:4XKyXmfqJLOQ7feyV5DB6gsBFZ0ltB8vLtp6pj4JIcc= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= go.opentelemetry.io/otel/exporters/prometheus v0.24.0 h1:lfVirQkD4jPMh7m6i9sHDHweYZyWA0NDU6NszkbtFSE= @@ -414,14 +413,12 @@ go.opentelemetry.io/otel/internal/metric v0.24.0 h1:O5lFy6kAl0LMWBjzy3k//M8VjEaT 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/metric v0.24.0/go.mod h1:tpMFnCD9t+BEGiWY2bWF5+AwjuAdM0lSowQ4SBA3/K4= -go.opentelemetry.io/otel/sdk v1.0.0/go.mod h1:PCrDHlSy5x1kjezSdL37PhbFUMjrsLRshJ2zCzeXwbM= go.opentelemetry.io/otel/sdk v1.0.1 h1:wXxFEWGo7XfXupPwVJvTBOaPBC9FEg0wB8hMNrKk+cA= go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI= 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/trace v1.0.0/go.mod h1:PXTWqayeFUlJV1YDNhsJYB184+IvAH814St6o6ajzIs= go.opentelemetry.io/otel/trace v1.0.1 h1:StTeIH6Q3G4r0Fiw34LTokUFESZgIDUr0qIJ7mKmAfw= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= From 6654804518fd50359706c19363c16c6c1552b7ee Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 12 Oct 2021 20:36:17 +0200 Subject: [PATCH 058/149] Improve logging on telemetry initialization (#4189) --- service/telemetry.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/service/telemetry.go b/service/telemetry.go index b463b236b19..32e2b8d2e82 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -47,6 +47,11 @@ var collectorTelemetry collectorTelemetryExporter = &colTelemetry{} // AddCollectorVersionTag indicates if the collector version tag should be added to all telemetry metrics const AddCollectorVersionTag = true +const ( + zapKeyTelemetryAddress = "address" + zapKeyTelemetryLevel = "level" +) + type collectorTelemetryExporter interface { init(asyncErrorChannel chan<- error, ballastSizeBytes uint64, logger *zap.Logger) error shutdown() error @@ -72,15 +77,20 @@ func (tel *colTelemetry) init(asyncErrorChannel chan<- error, ballastSizeBytes u } func (tel *colTelemetry) initOnce(asyncErrorChannel chan<- error, ballastSizeBytes uint64, logger *zap.Logger) error { - logger.Info("Setting up own telemetry...") - level := configtelemetry.GetMetricsLevelFlagValue() metricsAddr := getMetricsAddr() if level == configtelemetry.LevelNone || metricsAddr == "" { + logger.Info( + "Skipping telemetry setup.", + zap.String(zapKeyTelemetryAddress, metricsAddr), + zap.String(zapKeyTelemetryLevel, level.String()), + ) return nil } + logger.Info("Setting up own telemetry...") + var instanceID string if getAddInstanceID() { @@ -105,8 +115,8 @@ func (tel *colTelemetry) initOnce(asyncErrorChannel chan<- error, ballastSizeByt logger.Info( "Serving Prometheus metrics", - zap.String("address", metricsAddr), - zap.Int8("level", int8(level)), // TODO: make it human friendly + zap.String(zapKeyTelemetryAddress, metricsAddr), + zap.String(zapKeyTelemetryLevel, level.String()), zap.String(semconv.AttributeServiceInstanceID, instanceID), zap.String(semconv.AttributeServiceVersion, version.Version), ) From 9d3a8a4608a7dbd9f787867226a78356ace9b5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Tue, 12 Oct 2021 22:47:36 +0200 Subject: [PATCH 059/149] Adds vanity import check (#4180) * chore: adds porto and fixes vanity imports. * chore: fixes target overriding. * chore: fixes install of porto. * chore: includes porto as a tool. * chore: upgrades porto to check internals. * chore: rebase and update vanity import. * chore: removes unnecessary space. * chore: rollsback vanity import in generated files. --- .github/workflows/build-and-test.yml | 7 +++---- Makefile | 5 +++++ Makefile.Common | 4 ++++ client/client.go | 2 +- cmd/pdatagen/internal/base_fields.go | 2 +- cmd/pdatagen/internal/base_slices.go | 2 +- cmd/pdatagen/internal/base_structs.go | 2 +- cmd/pdatagen/internal/common_structs.go | 2 +- cmd/pdatagen/internal/files.go | 2 +- cmd/pdatagen/internal/log_structs.go | 2 +- cmd/pdatagen/internal/metrics_structs.go | 2 +- cmd/pdatagen/internal/resource_structs.go | 2 +- cmd/pdatagen/internal/trace_structs.go | 2 +- component/build_info.go | 2 +- component/component.go | 2 +- component/componenterror/doc.go | 2 +- component/componenterror/errors.go | 2 +- component/componenthelper/component.go | 2 +- component/componenthelper/doc.go | 2 +- component/componenttest/doc.go | 2 +- component/componenttest/nop_exporter.go | 2 +- component/componenttest/nop_extension.go | 2 +- component/componenttest/nop_factories.go | 2 +- component/componenttest/nop_host.go | 2 +- component/componenttest/nop_processor.go | 2 +- component/componenttest/nop_receiver.go | 2 +- component/componenttest/nop_telemetry.go | 2 +- component/componenttest/shutdown_verifier.go | 2 +- component/doc.go | 2 +- component/experimental/component/doc.go | 2 +- component/experimental/component/factory.go | 2 +- component/exporter.go | 2 +- component/extension.go | 2 +- component/factories.go | 2 +- component/host.go | 2 +- component/processor.go | 2 +- component/receiver.go | 2 +- component/telemetry.go | 2 +- config/config.go | 2 +- config/configauth/clientauth.go | 2 +- config/configauth/configauth.go | 2 +- config/configauth/doc.go | 2 +- config/configauth/mock_clientauth.go | 2 +- config/configauth/mock_serverauth.go | 2 +- config/configauth/serverauth.go | 2 +- config/configgrpc/configgrpc.go | 2 +- config/configgrpc/doc.go | 2 +- config/configgrpc/gzip.go | 2 +- config/confighttp/confighttp.go | 2 +- config/confighttp/doc.go | 2 +- config/configmap.go | 2 +- config/confignet/confignet.go | 2 +- config/confignet/doc.go | 2 +- config/configtelemetry/configtelemetry.go | 2 +- config/configtelemetry/doc.go | 2 +- config/configtest/configtest.go | 2 +- config/configtest/doc.go | 2 +- config/configtls/configtls.go | 2 +- config/configtls/doc.go | 2 +- config/configunmarshaler/defaultunmarshaler.go | 2 +- config/configunmarshaler/doc.go | 2 +- config/configunmarshaler/unmarshaler.go | 2 +- config/doc.go | 2 +- config/experimental/config/config.go | 2 +- config/experimental/config/doc.go | 2 +- config/experimental/configsource/component.go | 2 +- config/experimental/configsource/doc.go | 2 +- config/exporter.go | 2 +- config/extension.go | 2 +- config/identifiable.go | 2 +- config/internal/configsource/doc.go | 2 +- config/internal/configsource/manager.go | 2 +- config/processor.go | 2 +- config/receiver.go | 2 +- consumer/consumer.go | 2 +- consumer/consumererror/combine.go | 2 +- consumer/consumererror/doc.go | 2 +- consumer/consumererror/permanent.go | 2 +- consumer/consumererror/signalerrors.go | 2 +- consumer/consumerhelper/common.go | 2 +- consumer/consumerhelper/doc.go | 2 +- consumer/consumerhelper/logs.go | 2 +- consumer/consumerhelper/metrics.go | 2 +- consumer/consumerhelper/traces.go | 2 +- consumer/consumertest/base_consumer.go | 2 +- consumer/consumertest/consumer.go | 2 +- consumer/consumertest/doc.go | 2 +- consumer/consumertest/err.go | 2 +- consumer/consumertest/nop.go | 2 +- consumer/consumertest/sink.go | 2 +- consumer/doc.go | 2 +- exporter/doc.go | 2 +- exporter/exporterhelper/common.go | 2 +- exporter/exporterhelper/constants.go | 2 +- exporter/exporterhelper/doc.go | 2 +- exporter/exporterhelper/factory.go | 2 +- exporter/exporterhelper/internal/bounded_memory_queue.go | 2 +- exporter/exporterhelper/internal/persistent_queue.go | 2 +- exporter/exporterhelper/internal/persistent_request.go | 2 +- exporter/exporterhelper/internal/persistent_storage.go | 2 +- .../exporterhelper/internal/persistent_storage_batch.go | 2 +- .../exporterhelper/internal/producer_consumer_queue.go | 2 +- exporter/exporterhelper/logs.go | 2 +- exporter/exporterhelper/metrics.go | 2 +- exporter/exporterhelper/obsreport.go | 2 +- exporter/exporterhelper/queued_retry.go | 2 +- exporter/exporterhelper/queued_retry_experimental.go | 2 +- exporter/exporterhelper/queued_retry_inmemory.go | 2 +- exporter/exporterhelper/traces.go | 2 +- exporter/loggingexporter/config.go | 2 +- exporter/loggingexporter/doc.go | 2 +- exporter/loggingexporter/factory.go | 2 +- exporter/loggingexporter/known_sync_error.go | 2 +- exporter/loggingexporter/known_sync_error_windows.go | 2 +- exporter/loggingexporter/logging_exporter.go | 2 +- exporter/otlpexporter/config.go | 2 +- exporter/otlpexporter/doc.go | 2 +- exporter/otlpexporter/factory.go | 2 +- exporter/otlpexporter/otlp.go | 2 +- exporter/otlphttpexporter/config.go | 2 +- exporter/otlphttpexporter/doc.go | 2 +- exporter/otlphttpexporter/factory.go | 2 +- exporter/otlphttpexporter/otlp.go | 2 +- extension/ballastextension/config.go | 2 +- extension/ballastextension/factory.go | 2 +- extension/ballastextension/memory_ballast.go | 2 +- extension/experimental/storage/doc.go | 2 +- extension/experimental/storage/nop_client.go | 2 +- extension/experimental/storage/storage.go | 2 +- extension/extensionhelper/factory.go | 2 +- extension/zpagesextension/config.go | 2 +- extension/zpagesextension/doc.go | 2 +- extension/zpagesextension/factory.go | 2 +- extension/zpagesextension/zpagesextension.go | 2 +- internal/cgroups/cgroup.go | 2 +- internal/cgroups/cgroups.go | 2 +- internal/cgroups/doc.go | 2 +- internal/cgroups/errors.go | 2 +- internal/cgroups/mountpoint.go | 2 +- internal/cgroups/subsys.go | 2 +- internal/internalconsumertest/err_or_sink_consumer.go | 2 +- internal/iruntime/mem_info.go | 2 +- internal/iruntime/total_memory_linux.go | 2 +- internal/iruntime/total_memory_other.go | 2 +- internal/middleware/compression.go | 2 +- internal/obsreportconfig/obsmetrics/obs_exporter.go | 2 +- internal/obsreportconfig/obsmetrics/obs_processor.go | 2 +- internal/obsreportconfig/obsmetrics/obs_receiver.go | 2 +- internal/obsreportconfig/obsmetrics/obs_scraper.go | 2 +- internal/obsreportconfig/obsmetrics/obsmetrics.go | 2 +- internal/obsreportconfig/obsreportconfig.go | 2 +- internal/otlptext/databuffer.go | 2 +- internal/otlptext/logs.go | 2 +- internal/otlptext/metrics.go | 2 +- internal/otlptext/traces.go | 2 +- internal/sharedcomponent/sharedcomponent.go | 2 +- internal/testcomponents/example_exporter.go | 2 +- internal/testcomponents/example_extension.go | 2 +- internal/testcomponents/example_factories.go | 2 +- internal/testcomponents/example_processor.go | 2 +- internal/testcomponents/example_receiver.go | 2 +- internal/testutil/testutil.go | 2 +- internal/tools/empty.go | 2 +- internal/tools/go.mod | 3 ++- internal/tools/go.sum | 6 ++++++ internal/tools/tools.go | 3 ++- internal/version/version.go | 2 +- model/internal/data/bytesid.go | 2 +- model/internal/data/spanid.go | 2 +- model/internal/data/traceid.go | 2 +- model/internal/otlp_wrapper.go | 2 +- model/otlp/json_marshaler.go | 2 +- model/otlp/json_unmarshaler.go | 2 +- model/otlp/pb_marshaler.go | 2 +- model/otlp/pb_unmarshaler.go | 2 +- model/otlpgrpc/logs.go | 2 +- model/otlpgrpc/metrics.go | 2 +- model/otlpgrpc/traces.go | 2 +- model/pdata/common.go | 2 +- model/pdata/doc.go | 2 +- model/pdata/logs.go | 2 +- model/pdata/metrics.go | 2 +- model/pdata/spanid.go | 2 +- model/pdata/timestamp.go | 2 +- model/pdata/traceid.go | 2 +- model/pdata/traces.go | 2 +- model/semconv/v1.5.0/nonstandard.go | 2 +- model/semconv/v1.5.0/resource.go | 2 +- model/semconv/v1.5.0/schema.go | 2 +- model/semconv/v1.5.0/trace.go | 2 +- model/semconv/v1.6.1/nonstandard.go | 2 +- model/semconv/v1.6.1/resource.go | 2 +- model/semconv/v1.6.1/schema.go | 2 +- model/semconv/v1.6.1/trace.go | 2 +- obsreport/doc.go | 2 +- obsreport/obsreport.go | 2 +- obsreport/obsreport_exporter.go | 2 +- obsreport/obsreport_processor.go | 2 +- obsreport/obsreport_receiver.go | 2 +- obsreport/obsreport_scraper.go | 2 +- obsreport/obsreporttest/obsreporttest.go | 2 +- processor/batchprocessor/batch_processor.go | 2 +- processor/batchprocessor/config.go | 2 +- processor/batchprocessor/factory.go | 2 +- processor/batchprocessor/metrics.go | 2 +- processor/batchprocessor/splitlogs.go | 2 +- processor/batchprocessor/splitmetrics.go | 2 +- processor/batchprocessor/splittraces.go | 2 +- processor/memorylimiterprocessor/config.go | 2 +- processor/memorylimiterprocessor/factory.go | 2 +- processor/memorylimiterprocessor/memorylimiter.go | 2 +- processor/processorhelper/factory.go | 2 +- processor/processorhelper/logs.go | 2 +- processor/processorhelper/metrics.go | 2 +- processor/processorhelper/processor.go | 2 +- processor/processorhelper/traces.go | 2 +- receiver/doc.go | 2 +- receiver/otlpreceiver/config.go | 2 +- receiver/otlpreceiver/doc.go | 2 +- receiver/otlpreceiver/encoder.go | 2 +- receiver/otlpreceiver/factory.go | 2 +- receiver/otlpreceiver/internal/logs/otlp.go | 2 +- receiver/otlpreceiver/internal/metrics/otlp.go | 2 +- receiver/otlpreceiver/internal/trace/otlp.go | 2 +- receiver/otlpreceiver/otlp.go | 2 +- receiver/otlpreceiver/otlphttp.go | 2 +- receiver/receiverhelper/doc.go | 2 +- receiver/receiverhelper/factory.go | 2 +- receiver/scrapererror/doc.go | 2 +- receiver/scrapererror/partialscrapeerror.go | 2 +- receiver/scrapererror/scrapeerror.go | 2 +- receiver/scraperhelper/doc.go | 2 +- receiver/scraperhelper/scraper.go | 2 +- receiver/scraperhelper/scrapercontroller.go | 2 +- service/collector.go | 2 +- service/collector_windows.go | 2 +- service/command.go | 2 +- service/configcheck.go | 2 +- service/defaultcomponents/defaults.go | 2 +- service/featuregate/gates.go | 2 +- service/flags.go | 2 +- service/internal/builder/doc.go | 2 +- service/internal/builder/exporters_builder.go | 2 +- service/internal/builder/pipelines_builder.go | 2 +- service/internal/builder/receivers_builder.go | 2 +- service/internal/components/constants.go | 2 +- service/internal/components/host_wrapper.go | 2 +- service/internal/extensions/extensions.go | 2 +- service/internal/fanoutconsumer/logs.go | 2 +- service/internal/fanoutconsumer/metrics.go | 2 +- service/internal/fanoutconsumer/traces.go | 2 +- service/internal/otel_trace_sampler.go | 2 +- service/internal/telemetry/process_telemetry.go | 2 +- service/internal/telemetrylogs/logger.go | 2 +- service/internal/zpages/templates.go | 2 +- service/internal/zpages/tmplgen/gen.go | 2 +- service/parserprovider/default.go | 2 +- service/parserprovider/expand.go | 2 +- service/parserprovider/file.go | 2 +- service/parserprovider/inmemory.go | 2 +- service/parserprovider/merge.go | 2 +- service/parserprovider/properties.go | 2 +- service/parserprovider/provider.go | 2 +- service/service.go | 2 +- service/settings.go | 2 +- service/telemetry.go | 2 +- service/zpages.go | 2 +- 267 files changed, 283 insertions(+), 267 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7ca2c4a6822..1ddfda58d77 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,9 +1,9 @@ name: build-and-test on: push: - branches: [ main ] + branches: [main] tags: - - 'v[0-9]+.[0-9]+.[0-9]+*' + - "v[0-9]+.[0-9]+.[0-9]+*" pull_request: jobs: @@ -77,7 +77,7 @@ jobs: path: /home/runner/go/bin key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} - name: Lint - run: make -j5 checklicense misspell checkdoc goimpi golint + run: make -j5 checklicense misspell checkdoc goimpi golint goporto - name: Gen Metadata run: | make genmdata @@ -206,4 +206,3 @@ jobs: with: name: collector-binaries-unstable path: ./bin-unstable.tar - diff --git a/Makefile b/Makefile index e076774a0a2..e7d397b7359 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,10 @@ gotest-with-cover: @$(MAKE) for-all CMD="make test-with-cover" $(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt +.PHONY: goporto +goporto: + @$(MAKE) for-all CMD="make porto" + .PHONY: golint golint: @$(MAKE) for-all CMD="make lint lint-unstable" @@ -134,6 +138,7 @@ install-tools: cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/build-tools/semconvgen cd $(TOOLS_MOD_DIR) && go install golang.org/x/exp/cmd/apidiff cd $(TOOLS_MOD_DIR) && go install golang.org/x/tools/cmd/goimports + cd $(TOOLS_MOD_DIR) && go install github.com/jcchavezs/porto/cmd/porto .PHONY: otelcol otelcol: diff --git a/Makefile.Common b/Makefile.Common index f4b9b56da37..a77cc2bd0d4 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -38,6 +38,10 @@ lint: lint-unstable: $(LINT) run --allow-parallel-runners --build-tags enable_unstable +.PHONY: porto +porto: + porto -w --include-internal ./ + .PHONY: impi impi: @$(IMPI) --local go.opentelemetry.io/collector --scheme stdThirdPartyLocal ./... diff --git a/client/client.go b/client/client.go index 6b134a30abf..bdd37eca8e8 100644 --- a/client/client.go +++ b/client/client.go @@ -13,7 +13,7 @@ // limitations under the License. // Package client contains generic representations of clients connecting to different receivers -package client +package client // import "go.opentelemetry.io/collector/client" import ( "context" diff --git a/cmd/pdatagen/internal/base_fields.go b/cmd/pdatagen/internal/base_fields.go index 5dbb37b3d47..cd633506b81 100644 --- a/cmd/pdatagen/internal/base_fields.go +++ b/cmd/pdatagen/internal/base_fields.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" import ( "os" diff --git a/cmd/pdatagen/internal/base_slices.go b/cmd/pdatagen/internal/base_slices.go index 45cf6b901b4..62ab4c84925 100644 --- a/cmd/pdatagen/internal/base_slices.go +++ b/cmd/pdatagen/internal/base_slices.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" import ( "os" diff --git a/cmd/pdatagen/internal/base_structs.go b/cmd/pdatagen/internal/base_structs.go index be16e07a946..d90760efb7d 100644 --- a/cmd/pdatagen/internal/base_structs.go +++ b/cmd/pdatagen/internal/base_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" import ( "os" diff --git a/cmd/pdatagen/internal/common_structs.go b/cmd/pdatagen/internal/common_structs.go index c532a08ed65..c024f5eedf4 100644 --- a/cmd/pdatagen/internal/common_structs.go +++ b/cmd/pdatagen/internal/common_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" var commonFile = &File{ Name: "common", diff --git a/cmd/pdatagen/internal/files.go b/cmd/pdatagen/internal/files.go index 62b9b673c38..a8b1b0048eb 100644 --- a/cmd/pdatagen/internal/files.go +++ b/cmd/pdatagen/internal/files.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" import "strings" diff --git a/cmd/pdatagen/internal/log_structs.go b/cmd/pdatagen/internal/log_structs.go index e22c837a3c9..e4500d7b526 100644 --- a/cmd/pdatagen/internal/log_structs.go +++ b/cmd/pdatagen/internal/log_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" var logFile = &File{ Name: "log", diff --git a/cmd/pdatagen/internal/metrics_structs.go b/cmd/pdatagen/internal/metrics_structs.go index 0cb11b7044e..1be0b1c5a26 100644 --- a/cmd/pdatagen/internal/metrics_structs.go +++ b/cmd/pdatagen/internal/metrics_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" var metricsFile = &File{ Name: "metrics", diff --git a/cmd/pdatagen/internal/resource_structs.go b/cmd/pdatagen/internal/resource_structs.go index e14c0f3b3e4..2f42384f8af 100644 --- a/cmd/pdatagen/internal/resource_structs.go +++ b/cmd/pdatagen/internal/resource_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" var resourceFile = &File{ Name: "resource", diff --git a/cmd/pdatagen/internal/trace_structs.go b/cmd/pdatagen/internal/trace_structs.go index 0b234bea0b7..6f8d90c54c0 100644 --- a/cmd/pdatagen/internal/trace_structs.go +++ b/cmd/pdatagen/internal/trace_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" var traceFile = &File{ Name: "trace", diff --git a/component/build_info.go b/component/build_info.go index ebecf22e223..3ac0758205c 100644 --- a/component/build_info.go +++ b/component/build_info.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" // BuildInfo is the information that is logged at the application start and // passed into each component. This information can be overridden in custom builds. diff --git a/component/component.go b/component/component.go index 868d9d26c03..39d7a77c443 100644 --- a/component/component.go +++ b/component/component.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "context" diff --git a/component/componenterror/doc.go b/component/componenterror/doc.go index 1b57560cbae..90532968959 100644 --- a/component/componenterror/doc.go +++ b/component/componenterror/doc.go @@ -14,4 +14,4 @@ // Package componenterror provides helper functions to create and process // OpenTelemetry component errors. -package componenterror +package componenterror // import "go.opentelemetry.io/collector/component/componenterror" diff --git a/component/componenterror/errors.go b/component/componenterror/errors.go index e165202406f..07d0c3bc398 100644 --- a/component/componenterror/errors.go +++ b/component/componenterror/errors.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenterror +package componenterror // import "go.opentelemetry.io/collector/component/componenterror" import ( "errors" diff --git a/component/componenthelper/component.go b/component/componenthelper/component.go index ee41c880e4a..9b1a9ad184f 100644 --- a/component/componenthelper/component.go +++ b/component/componenthelper/component.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenthelper +package componenthelper // import "go.opentelemetry.io/collector/component/componenthelper" import ( "context" diff --git a/component/componenthelper/doc.go b/component/componenthelper/doc.go index bede10d8be7..bd418113eab 100644 --- a/component/componenthelper/doc.go +++ b/component/componenthelper/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package componenthelper assists with the creation of a new component.Component. -package componenthelper +package componenthelper // import "go.opentelemetry.io/collector/component/componenthelper" diff --git a/component/componenttest/doc.go b/component/componenttest/doc.go index 1762446116c..21cd2481268 100644 --- a/component/componenttest/doc.go +++ b/component/componenttest/doc.go @@ -14,4 +14,4 @@ // Package componenttest define types and functions used to help test packages // implementing the component package interfaces. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" diff --git a/component/componenttest/nop_exporter.go b/component/componenttest/nop_exporter.go index 0cd9430b11a..5641e987236 100644 --- a/component/componenttest/nop_exporter.go +++ b/component/componenttest/nop_exporter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "context" diff --git a/component/componenttest/nop_extension.go b/component/componenttest/nop_extension.go index dc1c6aababd..b3999a9ea99 100644 --- a/component/componenttest/nop_extension.go +++ b/component/componenttest/nop_extension.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "context" diff --git a/component/componenttest/nop_factories.go b/component/componenttest/nop_factories.go index ad3813f090f..03b026cc699 100644 --- a/component/componenttest/nop_factories.go +++ b/component/componenttest/nop_factories.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "go.opentelemetry.io/collector/component" diff --git a/component/componenttest/nop_host.go b/component/componenttest/nop_host.go index 0baee4726b9..8caa1979137 100644 --- a/component/componenttest/nop_host.go +++ b/component/componenttest/nop_host.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "go.opentelemetry.io/collector/component" diff --git a/component/componenttest/nop_processor.go b/component/componenttest/nop_processor.go index e60727a7efe..8a19a22c1fc 100644 --- a/component/componenttest/nop_processor.go +++ b/component/componenttest/nop_processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "context" diff --git a/component/componenttest/nop_receiver.go b/component/componenttest/nop_receiver.go index 9d7a6e097a8..f8ca0c1f585 100644 --- a/component/componenttest/nop_receiver.go +++ b/component/componenttest/nop_receiver.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "context" diff --git a/component/componenttest/nop_telemetry.go b/component/componenttest/nop_telemetry.go index 190ed817164..265b8f0a3d4 100644 --- a/component/componenttest/nop_telemetry.go +++ b/component/componenttest/nop_telemetry.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "go.opentelemetry.io/otel/metric" diff --git a/component/componenttest/shutdown_verifier.go b/component/componenttest/shutdown_verifier.go index 1c26575e114..d2ce1a6ef21 100644 --- a/component/componenttest/shutdown_verifier.go +++ b/component/componenttest/shutdown_verifier.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package componenttest +package componenttest // import "go.opentelemetry.io/collector/component/componenttest" import ( "context" diff --git a/component/doc.go b/component/doc.go index 73f438ff0ee..bc6ea3168f9 100644 --- a/component/doc.go +++ b/component/doc.go @@ -16,4 +16,4 @@ // and provides a foundation for the component’s creation and // termination process. A component can be either a receiver, exporter, // processor, or an extension. -package component +package component // import "go.opentelemetry.io/collector/component" diff --git a/component/experimental/component/doc.go b/component/experimental/component/doc.go index 1041d4bfbb6..c5082e45c60 100644 --- a/component/experimental/component/doc.go +++ b/component/experimental/component/doc.go @@ -16,4 +16,4 @@ // that typically live under the "go.opentelemetry.io/collector/component" // package but aren't stable yet to be published there. // ATTENTION: the package is still experimental and subject to changes without advanced notice. -package component +package component // import "go.opentelemetry.io/collector/component/experimental/component" diff --git a/component/experimental/component/factory.go b/component/experimental/component/factory.go index 3532b3bb3ed..420d7885ee9 100644 --- a/component/experimental/component/factory.go +++ b/component/experimental/component/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component/experimental/component" import ( "context" diff --git a/component/exporter.go b/component/exporter.go index 39481da6053..13057ccdd03 100644 --- a/component/exporter.go +++ b/component/exporter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "context" diff --git a/component/extension.go b/component/extension.go index 2fa7a8f3e1f..70215985154 100644 --- a/component/extension.go +++ b/component/extension.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "context" diff --git a/component/factories.go b/component/factories.go index 373bbdfc688..972e103538c 100644 --- a/component/factories.go +++ b/component/factories.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "fmt" diff --git a/component/host.go b/component/host.go index 56375b871ee..2d564d8cd80 100644 --- a/component/host.go +++ b/component/host.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "go.opentelemetry.io/collector/config" diff --git a/component/processor.go b/component/processor.go index dbf7c3826a3..ee8682ddd1b 100644 --- a/component/processor.go +++ b/component/processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "context" diff --git a/component/receiver.go b/component/receiver.go index fcc0cec4456..18096f16de5 100644 --- a/component/receiver.go +++ b/component/receiver.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "context" diff --git a/component/telemetry.go b/component/telemetry.go index a1000a63322..52c77e85240 100644 --- a/component/telemetry.go +++ b/component/telemetry.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package component +package component // import "go.opentelemetry.io/collector/component" import ( "go.opentelemetry.io/otel/metric" diff --git a/config/config.go b/config/config.go index 434ad34ed10..fa9aadcb678 100644 --- a/config/config.go +++ b/config/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config" import ( "errors" diff --git a/config/configauth/clientauth.go b/config/configauth/clientauth.go index 622c4954a9f..d24e6108661 100644 --- a/config/configauth/clientauth.go +++ b/config/configauth/clientauth.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configauth +package configauth // import "go.opentelemetry.io/collector/config/configauth" import ( "fmt" diff --git a/config/configauth/configauth.go b/config/configauth/configauth.go index 16c26328a82..554f905d565 100644 --- a/config/configauth/configauth.go +++ b/config/configauth/configauth.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configauth +package configauth // import "go.opentelemetry.io/collector/config/configauth" import ( "errors" diff --git a/config/configauth/doc.go b/config/configauth/doc.go index 169a504122e..b034aab6fa1 100644 --- a/config/configauth/doc.go +++ b/config/configauth/doc.go @@ -15,4 +15,4 @@ // Package configauth implements the configuration settings to // ensure authentication on incoming requests, and allows // exporters to add authentication on outgoing requests. -package configauth +package configauth // import "go.opentelemetry.io/collector/config/configauth" diff --git a/config/configauth/mock_clientauth.go b/config/configauth/mock_clientauth.go index 68097e84ca1..cd28cf999ea 100644 --- a/config/configauth/mock_clientauth.go +++ b/config/configauth/mock_clientauth.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configauth +package configauth // import "go.opentelemetry.io/collector/config/configauth" import ( "context" diff --git a/config/configauth/mock_serverauth.go b/config/configauth/mock_serverauth.go index f2522557200..e8bf209a459 100644 --- a/config/configauth/mock_serverauth.go +++ b/config/configauth/mock_serverauth.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configauth +package configauth // import "go.opentelemetry.io/collector/config/configauth" import ( "context" diff --git a/config/configauth/serverauth.go b/config/configauth/serverauth.go index 2a6da1e378b..65533d94b91 100644 --- a/config/configauth/serverauth.go +++ b/config/configauth/serverauth.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configauth +package configauth // import "go.opentelemetry.io/collector/config/configauth" import ( "context" diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index d6dc81210bf..b26faa3aede 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configgrpc +package configgrpc // import "go.opentelemetry.io/collector/config/configgrpc" import ( "crypto/tls" diff --git a/config/configgrpc/doc.go b/config/configgrpc/doc.go index 04a7330b359..baf40c8b206 100644 --- a/config/configgrpc/doc.go +++ b/config/configgrpc/doc.go @@ -14,4 +14,4 @@ // Package configgrpc defines the configuration settings to create // a gRPC client and server. -package configgrpc +package configgrpc // import "go.opentelemetry.io/collector/config/configgrpc" diff --git a/config/configgrpc/gzip.go b/config/configgrpc/gzip.go index a6f64286ddc..3b7a4de6802 100644 --- a/config/configgrpc/gzip.go +++ b/config/configgrpc/gzip.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configgrpc +package configgrpc // import "go.opentelemetry.io/collector/config/configgrpc" import ( // Import the gzip package which auto-registers the gzip gRPC compressor. diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index 6f71eb0aec3..561c39f1f49 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package confighttp +package confighttp // import "go.opentelemetry.io/collector/config/confighttp" import ( "crypto/tls" diff --git a/config/confighttp/doc.go b/config/confighttp/doc.go index 377c2fa74b1..91f727db807 100644 --- a/config/confighttp/doc.go +++ b/config/confighttp/doc.go @@ -14,4 +14,4 @@ // Package confighttp defines the configuration settings // for creating an HTTP client and server. -package confighttp +package confighttp // import "go.opentelemetry.io/collector/config/confighttp" diff --git a/config/configmap.go b/config/configmap.go index 0eca9cc6e76..2524312e8a9 100644 --- a/config/configmap.go +++ b/config/configmap.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config" import ( "fmt" diff --git a/config/confignet/confignet.go b/config/confignet/confignet.go index 067812f1301..1b32d54fb54 100644 --- a/config/confignet/confignet.go +++ b/config/confignet/confignet.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package confignet +package confignet // import "go.opentelemetry.io/collector/config/confignet" import ( "net" diff --git a/config/confignet/doc.go b/config/confignet/doc.go index 1a37c602d6d..cb6c109328f 100644 --- a/config/confignet/doc.go +++ b/config/confignet/doc.go @@ -14,4 +14,4 @@ // Package confignet implements the configuration settings for protocols to // connect and transport data information. -package confignet +package confignet // import "go.opentelemetry.io/collector/config/confignet" diff --git a/config/configtelemetry/configtelemetry.go b/config/configtelemetry/configtelemetry.go index 2a8d75ead15..c49c715ae37 100644 --- a/config/configtelemetry/configtelemetry.go +++ b/config/configtelemetry/configtelemetry.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configtelemetry +package configtelemetry // import "go.opentelemetry.io/collector/config/configtelemetry" import ( "flag" diff --git a/config/configtelemetry/doc.go b/config/configtelemetry/doc.go index 36fe369e957..8d4833f0ba1 100644 --- a/config/configtelemetry/doc.go +++ b/config/configtelemetry/doc.go @@ -15,4 +15,4 @@ // Package configtelemetry defines various telemetry level for configuration. // It enables every component to have access to telemetry level // to enable metrics only when necessary. -package configtelemetry +package configtelemetry // import "go.opentelemetry.io/collector/config/configtelemetry" diff --git a/config/configtest/configtest.go b/config/configtest/configtest.go index fe4cecf0d98..34a911c8e8e 100644 --- a/config/configtest/configtest.go +++ b/config/configtest/configtest.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configtest +package configtest // import "go.opentelemetry.io/collector/config/configtest" import ( "context" diff --git a/config/configtest/doc.go b/config/configtest/doc.go index a76c6c8e717..0a4a33211b6 100644 --- a/config/configtest/doc.go +++ b/config/configtest/doc.go @@ -14,4 +14,4 @@ // Package configtest loads the configuration to test packages // implementing the config package interfaces. -package configtest +package configtest // import "go.opentelemetry.io/collector/config/configtest" diff --git a/config/configtls/configtls.go b/config/configtls/configtls.go index 7b6c215d3b8..cc6167b7389 100644 --- a/config/configtls/configtls.go +++ b/config/configtls/configtls.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configtls +package configtls // import "go.opentelemetry.io/collector/config/configtls" import ( "crypto/tls" diff --git a/config/configtls/doc.go b/config/configtls/doc.go index 93a167500c4..38d53dc1bc3 100644 --- a/config/configtls/doc.go +++ b/config/configtls/doc.go @@ -14,4 +14,4 @@ // Package configtls implements the TLS settings to load and // configure TLS clients and servers. -package configtls +package configtls // import "go.opentelemetry.io/collector/config/configtls" diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index 188c98f302d..fb8be211440 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configunmarshaler +package configunmarshaler // import "go.opentelemetry.io/collector/config/configunmarshaler" import ( "fmt" diff --git a/config/configunmarshaler/doc.go b/config/configunmarshaler/doc.go index 93ed4cd0559..d2a55f05223 100644 --- a/config/configunmarshaler/doc.go +++ b/config/configunmarshaler/doc.go @@ -15,4 +15,4 @@ // Package configunmarshaler implements configuration unmarshalling from a config.Map. // The implementation relies on registered factories that allow creating // default configuration for each type of receiver/exporter/processor. -package configunmarshaler +package configunmarshaler // import "go.opentelemetry.io/collector/config/configunmarshaler" diff --git a/config/configunmarshaler/unmarshaler.go b/config/configunmarshaler/unmarshaler.go index bb1bf8c2dd8..7c649e70440 100644 --- a/config/configunmarshaler/unmarshaler.go +++ b/config/configunmarshaler/unmarshaler.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configunmarshaler +package configunmarshaler // import "go.opentelemetry.io/collector/config/configunmarshaler" import ( "go.opentelemetry.io/collector/component" diff --git a/config/doc.go b/config/doc.go index e5829b77e39..548e1b50a82 100644 --- a/config/doc.go +++ b/config/doc.go @@ -27,4 +27,4 @@ // Specific Receivers/Exporters/Processors are expected to at the minimum implement the // corresponding interface and if they have additional settings they must also extend // the corresponding common settings struct (the easiest approach is to embed the common struct). -package config +package config // import "go.opentelemetry.io/collector/config" diff --git a/config/experimental/config/config.go b/config/experimental/config/config.go index 3cf80c65b2e..891a2ff6d86 100644 --- a/config/experimental/config/config.go +++ b/config/experimental/config/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config/experimental/config" import ( "go.opentelemetry.io/collector/config" diff --git a/config/experimental/config/doc.go b/config/experimental/config/doc.go index 0b7985886b8..332f25cf128 100644 --- a/config/experimental/config/doc.go +++ b/config/experimental/config/doc.go @@ -16,4 +16,4 @@ // that typically live under the "go.opentelemetry.io/collector/config" package but aren't stable yet // to be published there. // ATTENTION: the package is still experimental and subject to changes without advanced notice. -package config +package config // import "go.opentelemetry.io/collector/config/experimental/config" diff --git a/config/experimental/configsource/component.go b/config/experimental/configsource/component.go index 3f62c2ce7ee..9bb7945e569 100644 --- a/config/experimental/configsource/component.go +++ b/config/experimental/configsource/component.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configsource +package configsource // import "go.opentelemetry.io/collector/config/experimental/configsource" import ( "context" diff --git a/config/experimental/configsource/doc.go b/config/experimental/configsource/doc.go index 73b0b772145..4b256422828 100644 --- a/config/experimental/configsource/doc.go +++ b/config/experimental/configsource/doc.go @@ -17,4 +17,4 @@ // sources retrieve values from their respective storages. A configuration parser/loader // can inject these values in the configuration data used by the collector. // ATTENTION: the package is still experimental and subject to changes without advanced notice. -package configsource +package configsource // import "go.opentelemetry.io/collector/config/experimental/configsource" diff --git a/config/exporter.go b/config/exporter.go index fd68703e78f..0f9ab30ace2 100644 --- a/config/exporter.go +++ b/config/exporter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config" // Exporter is the configuration of a component.Exporter. Specific extensions must implement // this interface and must embed ExporterSettings struct or a struct that extends it. diff --git a/config/extension.go b/config/extension.go index ad0a4a473f8..d9d4a6b2962 100644 --- a/config/extension.go +++ b/config/extension.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config" // Extension is the configuration of a component.Extension. Specific extensions must implement // this interface and must embed ExtensionSettings struct or a struct that extends it. diff --git a/config/identifiable.go b/config/identifiable.go index 3d65d4dcfbe..8341c946d35 100644 --- a/config/identifiable.go +++ b/config/identifiable.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config" import ( "errors" diff --git a/config/internal/configsource/doc.go b/config/internal/configsource/doc.go index f7fa73f46c4..b8b93953c03 100644 --- a/config/internal/configsource/doc.go +++ b/config/internal/configsource/doc.go @@ -15,4 +15,4 @@ // Package configsource is an internal package that implements methods // for injecting, watching, and updating data from ConfigSource into // configuration. -package configsource +package configsource // import "go.opentelemetry.io/collector/config/internal/configsource" diff --git a/config/internal/configsource/manager.go b/config/internal/configsource/manager.go index 4481cc99206..e8579a7f8e7 100644 --- a/config/internal/configsource/manager.go +++ b/config/internal/configsource/manager.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package configsource +package configsource // import "go.opentelemetry.io/collector/config/internal/configsource" import ( "bytes" diff --git a/config/processor.go b/config/processor.go index 75639d66cd5..10214c84dab 100644 --- a/config/processor.go +++ b/config/processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config" // Processor is the configuration of a component.Processor. Specific extensions must implement // this interface and must embed ProcessorSettings struct or a struct that extends it. diff --git a/config/receiver.go b/config/receiver.go index 1ca35e6105f..c4bdf0333ea 100644 --- a/config/receiver.go +++ b/config/receiver.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package config +package config // import "go.opentelemetry.io/collector/config" // Receiver is the configuration of a component.Receiver. Specific extensions must implement // this interface and must embed ReceiverSettings struct or a struct that extends it. diff --git a/consumer/consumer.go b/consumer/consumer.go index b079981c07a..9d446f65aa6 100644 --- a/consumer/consumer.go +++ b/consumer/consumer.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumer +package consumer // import "go.opentelemetry.io/collector/consumer" import ( "context" diff --git a/consumer/consumererror/combine.go b/consumer/consumererror/combine.go index be684f9cc32..cd53b9e9332 100644 --- a/consumer/consumererror/combine.go +++ b/consumer/consumererror/combine.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumererror +package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror" import ( "errors" diff --git a/consumer/consumererror/doc.go b/consumer/consumererror/doc.go index c0ec2958402..8648f3a22e9 100644 --- a/consumer/consumererror/doc.go +++ b/consumer/consumererror/doc.go @@ -15,4 +15,4 @@ // Package consumererror provides wrappers to easily classify errors. This allows // appropriate action by error handlers without the need to know each individual // error type/instance. -package consumererror +package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror" diff --git a/consumer/consumererror/permanent.go b/consumer/consumererror/permanent.go index dbf331358ab..d167da08005 100644 --- a/consumer/consumererror/permanent.go +++ b/consumer/consumererror/permanent.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumererror +package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror" import "errors" diff --git a/consumer/consumererror/signalerrors.go b/consumer/consumererror/signalerrors.go index fc9ae5f0b25..47456f0de39 100644 --- a/consumer/consumererror/signalerrors.go +++ b/consumer/consumererror/signalerrors.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumererror +package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror" import ( "errors" diff --git a/consumer/consumerhelper/common.go b/consumer/consumerhelper/common.go index bce9aba07a7..8081e4826fe 100644 --- a/consumer/consumerhelper/common.go +++ b/consumer/consumerhelper/common.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumerhelper +package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( "errors" diff --git a/consumer/consumerhelper/doc.go b/consumer/consumerhelper/doc.go index 7dd8fa6fb8f..977dc8faea5 100644 --- a/consumer/consumerhelper/doc.go +++ b/consumer/consumerhelper/doc.go @@ -14,4 +14,4 @@ // Package consumerhelper defines types and functions used to create consumer // Logs, Metrics, and Traces. -package consumerhelper +package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" diff --git a/consumer/consumerhelper/logs.go b/consumer/consumerhelper/logs.go index 3b29b3338d5..898fa7e99cf 100644 --- a/consumer/consumerhelper/logs.go +++ b/consumer/consumerhelper/logs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumerhelper +package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( "context" diff --git a/consumer/consumerhelper/metrics.go b/consumer/consumerhelper/metrics.go index 6db7931807d..4bbd35607d8 100644 --- a/consumer/consumerhelper/metrics.go +++ b/consumer/consumerhelper/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumerhelper +package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( "context" diff --git a/consumer/consumerhelper/traces.go b/consumer/consumerhelper/traces.go index 4756fdfeded..d71f5a5606d 100644 --- a/consumer/consumerhelper/traces.go +++ b/consumer/consumerhelper/traces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumerhelper +package consumerhelper // import "go.opentelemetry.io/collector/consumer/consumerhelper" import ( "context" diff --git a/consumer/consumertest/base_consumer.go b/consumer/consumertest/base_consumer.go index 420b205d919..680532fdf14 100644 --- a/consumer/consumertest/base_consumer.go +++ b/consumer/consumertest/base_consumer.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumertest +package consumertest // import "go.opentelemetry.io/collector/consumer/consumertest" import ( "go.opentelemetry.io/collector/consumer" diff --git a/consumer/consumertest/consumer.go b/consumer/consumertest/consumer.go index ee5125b4ba5..a9cee267436 100644 --- a/consumer/consumertest/consumer.go +++ b/consumer/consumertest/consumer.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumertest +package consumertest // import "go.opentelemetry.io/collector/consumer/consumertest" import ( "context" diff --git a/consumer/consumertest/doc.go b/consumer/consumertest/doc.go index 78a0f4aaf4f..b7f10dd631e 100644 --- a/consumer/consumertest/doc.go +++ b/consumer/consumertest/doc.go @@ -14,4 +14,4 @@ // Package consumertest defines types and functions used to help test packages // implementing the consumer package interfaces. -package consumertest +package consumertest // import "go.opentelemetry.io/collector/consumer/consumertest" diff --git a/consumer/consumertest/err.go b/consumer/consumertest/err.go index 21d5a2d5fb0..dc0cf989cc1 100644 --- a/consumer/consumertest/err.go +++ b/consumer/consumertest/err.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumertest +package consumertest // import "go.opentelemetry.io/collector/consumer/consumertest" import ( "context" diff --git a/consumer/consumertest/nop.go b/consumer/consumertest/nop.go index 106b1c090b3..f48123677ca 100644 --- a/consumer/consumertest/nop.go +++ b/consumer/consumertest/nop.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumertest +package consumertest // import "go.opentelemetry.io/collector/consumer/consumertest" import ( "context" diff --git a/consumer/consumertest/sink.go b/consumer/consumertest/sink.go index 172417d90f0..d9a23602222 100644 --- a/consumer/consumertest/sink.go +++ b/consumer/consumertest/sink.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package consumertest +package consumertest // import "go.opentelemetry.io/collector/consumer/consumertest" import ( "context" diff --git a/consumer/doc.go b/consumer/doc.go index 4dea0ed3b99..c38a0a2a72f 100644 --- a/consumer/doc.go +++ b/consumer/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package consumer contains interfaces that receive and process consumerdata. -package consumer +package consumer // import "go.opentelemetry.io/collector/consumer" diff --git a/exporter/doc.go b/exporter/doc.go index 15c7e94732d..87ebd298872 100644 --- a/exporter/doc.go +++ b/exporter/doc.go @@ -19,4 +19,4 @@ // // To make the custom exporter part of the Collector build the factory must be added // to defaultcomponents.Components() function. -package exporter +package exporter // import "go.opentelemetry.io/collector/exporter" diff --git a/exporter/exporterhelper/common.go b/exporter/exporterhelper/common.go index 97ab2aeb7bb..898503c5e87 100644 --- a/exporter/exporterhelper/common.go +++ b/exporter/exporterhelper/common.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/constants.go b/exporter/exporterhelper/constants.go index 2fb7511a438..66194396300 100644 --- a/exporter/exporterhelper/constants.go +++ b/exporter/exporterhelper/constants.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "errors" diff --git a/exporter/exporterhelper/doc.go b/exporter/exporterhelper/doc.go index 6cd2d2c4cfe..884d9575161 100644 --- a/exporter/exporterhelper/doc.go +++ b/exporter/exporterhelper/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package exporterhelper provides helper functions for exporters. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" diff --git a/exporter/exporterhelper/factory.go b/exporter/exporterhelper/factory.go index f267b40338b..bb85681eafe 100644 --- a/exporter/exporterhelper/factory.go +++ b/exporter/exporterhelper/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/internal/bounded_memory_queue.go b/exporter/exporterhelper/internal/bounded_memory_queue.go index 603b7b78af6..7586ffffe95 100644 --- a/exporter/exporterhelper/internal/bounded_memory_queue.go +++ b/exporter/exporterhelper/internal/bounded_memory_queue.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal" import ( "sync" diff --git a/exporter/exporterhelper/internal/persistent_queue.go b/exporter/exporterhelper/internal/persistent_queue.go index f5927ca2949..0284373d981 100644 --- a/exporter/exporterhelper/internal/persistent_queue.go +++ b/exporter/exporterhelper/internal/persistent_queue.go @@ -15,7 +15,7 @@ //go:build enable_unstable // +build enable_unstable -package internal +package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal" import ( "context" diff --git a/exporter/exporterhelper/internal/persistent_request.go b/exporter/exporterhelper/internal/persistent_request.go index 5975871bbea..88e2a9155dc 100644 --- a/exporter/exporterhelper/internal/persistent_request.go +++ b/exporter/exporterhelper/internal/persistent_request.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal" // PersistentRequest defines capabilities required for persistent storage of a request type PersistentRequest interface { diff --git a/exporter/exporterhelper/internal/persistent_storage.go b/exporter/exporterhelper/internal/persistent_storage.go index 6e99057c5a6..2ffe743b10c 100644 --- a/exporter/exporterhelper/internal/persistent_storage.go +++ b/exporter/exporterhelper/internal/persistent_storage.go @@ -15,7 +15,7 @@ //go:build enable_unstable // +build enable_unstable -package internal +package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal" import ( "context" diff --git a/exporter/exporterhelper/internal/persistent_storage_batch.go b/exporter/exporterhelper/internal/persistent_storage_batch.go index b71b18a93b3..a5803db212a 100644 --- a/exporter/exporterhelper/internal/persistent_storage_batch.go +++ b/exporter/exporterhelper/internal/persistent_storage_batch.go @@ -15,7 +15,7 @@ //go:build enable_unstable // +build enable_unstable -package internal +package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal" import ( "bytes" diff --git a/exporter/exporterhelper/internal/producer_consumer_queue.go b/exporter/exporterhelper/internal/producer_consumer_queue.go index 734f5df19f5..4307e872192 100644 --- a/exporter/exporterhelper/internal/producer_consumer_queue.go +++ b/exporter/exporterhelper/internal/producer_consumer_queue.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal" // consumer consumes data from a bounded queue type consumer interface { diff --git a/exporter/exporterhelper/logs.go b/exporter/exporterhelper/logs.go index 4e023cd3f9e..f0b8077a57b 100644 --- a/exporter/exporterhelper/logs.go +++ b/exporter/exporterhelper/logs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/metrics.go b/exporter/exporterhelper/metrics.go index 2139da9cf66..b3ffb504fc1 100644 --- a/exporter/exporterhelper/metrics.go +++ b/exporter/exporterhelper/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/obsreport.go b/exporter/exporterhelper/obsreport.go index dc799156a17..198413b7052 100644 --- a/exporter/exporterhelper/obsreport.go +++ b/exporter/exporterhelper/obsreport.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/queued_retry.go b/exporter/exporterhelper/queued_retry.go index 2074ff1acce..ef9dea5a0a0 100644 --- a/exporter/exporterhelper/queued_retry.go +++ b/exporter/exporterhelper/queued_retry.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/queued_retry_experimental.go b/exporter/exporterhelper/queued_retry_experimental.go index a122727fa2d..8e91cf34a80 100644 --- a/exporter/exporterhelper/queued_retry_experimental.go +++ b/exporter/exporterhelper/queued_retry_experimental.go @@ -15,7 +15,7 @@ //go:build enable_unstable // +build enable_unstable -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/queued_retry_inmemory.go b/exporter/exporterhelper/queued_retry_inmemory.go index c5e8b82000a..e2934095973 100644 --- a/exporter/exporterhelper/queued_retry_inmemory.go +++ b/exporter/exporterhelper/queued_retry_inmemory.go @@ -15,7 +15,7 @@ //go:build !enable_unstable // +build !enable_unstable -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/exporterhelper/traces.go b/exporter/exporterhelper/traces.go index 78ebbcd82e5..cb69719c879 100644 --- a/exporter/exporterhelper/traces.go +++ b/exporter/exporterhelper/traces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package exporterhelper +package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper" import ( "context" diff --git a/exporter/loggingexporter/config.go b/exporter/loggingexporter/config.go index b89e54a319c..e7e7c67fd4a 100644 --- a/exporter/loggingexporter/config.go +++ b/exporter/loggingexporter/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package loggingexporter +package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" import ( "go.opentelemetry.io/collector/config" diff --git a/exporter/loggingexporter/doc.go b/exporter/loggingexporter/doc.go index d6652178b27..4465a6e903a 100644 --- a/exporter/loggingexporter/doc.go +++ b/exporter/loggingexporter/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package loggingexporter exports data to console as logs. -package loggingexporter +package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" diff --git a/exporter/loggingexporter/factory.go b/exporter/loggingexporter/factory.go index d6049f7a48f..26d676ecde2 100644 --- a/exporter/loggingexporter/factory.go +++ b/exporter/loggingexporter/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package loggingexporter +package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" import ( "context" diff --git a/exporter/loggingexporter/known_sync_error.go b/exporter/loggingexporter/known_sync_error.go index cad34d12b3c..da1eb9c65fc 100644 --- a/exporter/loggingexporter/known_sync_error.go +++ b/exporter/loggingexporter/known_sync_error.go @@ -15,7 +15,7 @@ //go:build !windows // +build !windows -package loggingexporter +package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" import ( "syscall" diff --git a/exporter/loggingexporter/known_sync_error_windows.go b/exporter/loggingexporter/known_sync_error_windows.go index e2d38a098b8..97b927b681b 100644 --- a/exporter/loggingexporter/known_sync_error_windows.go +++ b/exporter/loggingexporter/known_sync_error_windows.go @@ -15,7 +15,7 @@ //go:build windows // +build windows -package loggingexporter +package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" import "golang.org/x/sys/windows" diff --git a/exporter/loggingexporter/logging_exporter.go b/exporter/loggingexporter/logging_exporter.go index daf0e49a95a..7b31a8c67c1 100644 --- a/exporter/loggingexporter/logging_exporter.go +++ b/exporter/loggingexporter/logging_exporter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package loggingexporter +package loggingexporter // import "go.opentelemetry.io/collector/exporter/loggingexporter" import ( "context" diff --git a/exporter/otlpexporter/config.go b/exporter/otlpexporter/config.go index 90982935eff..4b561e66bbc 100644 --- a/exporter/otlpexporter/config.go +++ b/exporter/otlpexporter/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpexporter +package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexporter" import ( "go.opentelemetry.io/collector/config" diff --git a/exporter/otlpexporter/doc.go b/exporter/otlpexporter/doc.go index 41d4b7662fa..23df8da1da8 100644 --- a/exporter/otlpexporter/doc.go +++ b/exporter/otlpexporter/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package otlpexporter exports data by using the OTLP format to a gPRC endpoint. -package otlpexporter +package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexporter" diff --git a/exporter/otlpexporter/factory.go b/exporter/otlpexporter/factory.go index 761213577e8..a466b23602b 100644 --- a/exporter/otlpexporter/factory.go +++ b/exporter/otlpexporter/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpexporter +package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexporter" import ( "context" diff --git a/exporter/otlpexporter/otlp.go b/exporter/otlpexporter/otlp.go index c31bd71d8d3..3b8230afd68 100644 --- a/exporter/otlpexporter/otlp.go +++ b/exporter/otlpexporter/otlp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpexporter +package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexporter" import ( "context" diff --git a/exporter/otlphttpexporter/config.go b/exporter/otlphttpexporter/config.go index ccf7f52a162..cb7b2163608 100644 --- a/exporter/otlphttpexporter/config.go +++ b/exporter/otlphttpexporter/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlphttpexporter +package otlphttpexporter // import "go.opentelemetry.io/collector/exporter/otlphttpexporter" import ( "go.opentelemetry.io/collector/config" diff --git a/exporter/otlphttpexporter/doc.go b/exporter/otlphttpexporter/doc.go index 816df31ac35..c42b7c31987 100644 --- a/exporter/otlphttpexporter/doc.go +++ b/exporter/otlphttpexporter/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package otlphttpexporter exports data by using the OTLP format to an HTTP endpoint. -package otlphttpexporter +package otlphttpexporter // import "go.opentelemetry.io/collector/exporter/otlphttpexporter" diff --git a/exporter/otlphttpexporter/factory.go b/exporter/otlphttpexporter/factory.go index ad8b2c33e01..4baf2971f3f 100644 --- a/exporter/otlphttpexporter/factory.go +++ b/exporter/otlphttpexporter/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlphttpexporter +package otlphttpexporter // import "go.opentelemetry.io/collector/exporter/otlphttpexporter" import ( "context" diff --git a/exporter/otlphttpexporter/otlp.go b/exporter/otlphttpexporter/otlp.go index 4931a2f69e9..3cd9702aef3 100644 --- a/exporter/otlphttpexporter/otlp.go +++ b/exporter/otlphttpexporter/otlp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlphttpexporter +package otlphttpexporter // import "go.opentelemetry.io/collector/exporter/otlphttpexporter" import ( "bytes" diff --git a/extension/ballastextension/config.go b/extension/ballastextension/config.go index fac10933375..f03f166ad78 100644 --- a/extension/ballastextension/config.go +++ b/extension/ballastextension/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ballastextension +package ballastextension // import "go.opentelemetry.io/collector/extension/ballastextension" import ( "fmt" diff --git a/extension/ballastextension/factory.go b/extension/ballastextension/factory.go index 6ecc61ca8ea..825a3fc3db2 100644 --- a/extension/ballastextension/factory.go +++ b/extension/ballastextension/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ballastextension +package ballastextension // import "go.opentelemetry.io/collector/extension/ballastextension" import ( "context" diff --git a/extension/ballastextension/memory_ballast.go b/extension/ballastextension/memory_ballast.go index c7a37365ede..f8f78605bde 100644 --- a/extension/ballastextension/memory_ballast.go +++ b/extension/ballastextension/memory_ballast.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ballastextension +package ballastextension // import "go.opentelemetry.io/collector/extension/ballastextension" import ( "context" diff --git a/extension/experimental/storage/doc.go b/extension/experimental/storage/doc.go index 3590d5fcc3b..1b4f9839231 100644 --- a/extension/experimental/storage/doc.go +++ b/extension/experimental/storage/doc.go @@ -14,4 +14,4 @@ // Package stanzareceiver implements a receiver that can be used by the // Opentelemetry collector to receive logs using the stanza log agent -package storage +package storage // import "go.opentelemetry.io/collector/extension/experimental/storage" diff --git a/extension/experimental/storage/nop_client.go b/extension/experimental/storage/nop_client.go index 10ee9df821c..4d9c398f930 100644 --- a/extension/experimental/storage/nop_client.go +++ b/extension/experimental/storage/nop_client.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package storage +package storage // import "go.opentelemetry.io/collector/extension/experimental/storage" import "context" diff --git a/extension/experimental/storage/storage.go b/extension/experimental/storage/storage.go index e17768023e0..9ebe3bc073e 100644 --- a/extension/experimental/storage/storage.go +++ b/extension/experimental/storage/storage.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package storage +package storage // import "go.opentelemetry.io/collector/extension/experimental/storage" import ( "context" diff --git a/extension/extensionhelper/factory.go b/extension/extensionhelper/factory.go index 271cba740a4..d184638f7da 100644 --- a/extension/extensionhelper/factory.go +++ b/extension/extensionhelper/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package extensionhelper +package extensionhelper // import "go.opentelemetry.io/collector/extension/extensionhelper" import ( "context" diff --git a/extension/zpagesextension/config.go b/extension/zpagesextension/config.go index 79335bbe870..519e27fd12c 100644 --- a/extension/zpagesextension/config.go +++ b/extension/zpagesextension/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package zpagesextension +package zpagesextension // import "go.opentelemetry.io/collector/extension/zpagesextension" import ( "errors" diff --git a/extension/zpagesextension/doc.go b/extension/zpagesextension/doc.go index 7b312a5e9d2..1a7106fb29d 100644 --- a/extension/zpagesextension/doc.go +++ b/extension/zpagesextension/doc.go @@ -14,4 +14,4 @@ // Package zpagesextension implements an extension that exposes zPages of // properly instrumented components. -package zpagesextension +package zpagesextension // import "go.opentelemetry.io/collector/extension/zpagesextension" diff --git a/extension/zpagesextension/factory.go b/extension/zpagesextension/factory.go index d3eb025aba4..666843ff65e 100644 --- a/extension/zpagesextension/factory.go +++ b/extension/zpagesextension/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package zpagesextension +package zpagesextension // import "go.opentelemetry.io/collector/extension/zpagesextension" import ( "context" diff --git a/extension/zpagesextension/zpagesextension.go b/extension/zpagesextension/zpagesextension.go index d4b741dde00..22db8ae7c19 100644 --- a/extension/zpagesextension/zpagesextension.go +++ b/extension/zpagesextension/zpagesextension.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package zpagesextension +package zpagesextension // import "go.opentelemetry.io/collector/extension/zpagesextension" import ( "context" diff --git a/internal/cgroups/cgroup.go b/internal/cgroups/cgroup.go index 2e2702a9bd0..bceb68b9e3b 100644 --- a/internal/cgroups/cgroup.go +++ b/internal/cgroups/cgroup.go @@ -37,7 +37,7 @@ //go:build linux // +build linux -package cgroups +package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" import ( "bufio" diff --git a/internal/cgroups/cgroups.go b/internal/cgroups/cgroups.go index 8eb3c18345c..5784e479e29 100644 --- a/internal/cgroups/cgroups.go +++ b/internal/cgroups/cgroups.go @@ -37,7 +37,7 @@ //go:build linux // +build linux -package cgroups +package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" const ( // _cgroupFSType is the Linux CGroup file system type used in diff --git a/internal/cgroups/doc.go b/internal/cgroups/doc.go index c47417a93db..046c996094a 100644 --- a/internal/cgroups/doc.go +++ b/internal/cgroups/doc.go @@ -37,4 +37,4 @@ // Package cgroups provides utilities to access Linux control group (CGroups) // parameters (total memory, for example) for a given process. // The original implementation is taken from https://github.com/uber-go/automaxprocs -package cgroups +package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" diff --git a/internal/cgroups/errors.go b/internal/cgroups/errors.go index c28bbab53d2..31d967674e3 100644 --- a/internal/cgroups/errors.go +++ b/internal/cgroups/errors.go @@ -37,7 +37,7 @@ //go:build linux // +build linux -package cgroups +package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" import "fmt" diff --git a/internal/cgroups/mountpoint.go b/internal/cgroups/mountpoint.go index ce952352cc9..dc1bac8c566 100644 --- a/internal/cgroups/mountpoint.go +++ b/internal/cgroups/mountpoint.go @@ -37,7 +37,7 @@ //go:build linux // +build linux -package cgroups +package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" import ( "bufio" diff --git a/internal/cgroups/subsys.go b/internal/cgroups/subsys.go index 0eb68f758a8..40d453ad377 100644 --- a/internal/cgroups/subsys.go +++ b/internal/cgroups/subsys.go @@ -37,7 +37,7 @@ //go:build linux // +build linux -package cgroups +package cgroups // import "go.opentelemetry.io/collector/internal/cgroups" import ( "bufio" diff --git a/internal/internalconsumertest/err_or_sink_consumer.go b/internal/internalconsumertest/err_or_sink_consumer.go index ddb2ca5cb72..fb5f8914bf7 100644 --- a/internal/internalconsumertest/err_or_sink_consumer.go +++ b/internal/internalconsumertest/err_or_sink_consumer.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internalconsumertest +package internalconsumertest // import "go.opentelemetry.io/collector/internal/internalconsumertest" import ( "context" diff --git a/internal/iruntime/mem_info.go b/internal/iruntime/mem_info.go index ca231361113..609bc517f38 100644 --- a/internal/iruntime/mem_info.go +++ b/internal/iruntime/mem_info.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package iruntime +package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" import ( "github.com/shirou/gopsutil/v3/mem" diff --git a/internal/iruntime/total_memory_linux.go b/internal/iruntime/total_memory_linux.go index 8048dcf8f87..28f177bd19c 100644 --- a/internal/iruntime/total_memory_linux.go +++ b/internal/iruntime/total_memory_linux.go @@ -15,7 +15,7 @@ //go:build linux // +build linux -package iruntime +package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" import "go.opentelemetry.io/collector/internal/cgroups" diff --git a/internal/iruntime/total_memory_other.go b/internal/iruntime/total_memory_other.go index 9e5c2e93c00..e30fec5557d 100644 --- a/internal/iruntime/total_memory_other.go +++ b/internal/iruntime/total_memory_other.go @@ -15,7 +15,7 @@ //go:build !linux // +build !linux -package iruntime +package iruntime // import "go.opentelemetry.io/collector/internal/iruntime" // TotalMemory returns total available memory for non-linux platforms. func TotalMemory() (uint64, error) { diff --git a/internal/middleware/compression.go b/internal/middleware/compression.go index 8b0f3cdd09e..d69a57fa638 100644 --- a/internal/middleware/compression.go +++ b/internal/middleware/compression.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package middleware +package middleware // import "go.opentelemetry.io/collector/internal/middleware" import ( "bytes" diff --git a/internal/obsreportconfig/obsmetrics/obs_exporter.go b/internal/obsreportconfig/obsmetrics/obs_exporter.go index e85f6ef119f..24fe3395ebe 100644 --- a/internal/obsreportconfig/obsmetrics/obs_exporter.go +++ b/internal/obsreportconfig/obsmetrics/obs_exporter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsmetrics +package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" import ( "go.opencensus.io/stats" diff --git a/internal/obsreportconfig/obsmetrics/obs_processor.go b/internal/obsreportconfig/obsmetrics/obs_processor.go index ea4a9a51751..2d2169c01bf 100644 --- a/internal/obsreportconfig/obsmetrics/obs_processor.go +++ b/internal/obsreportconfig/obsmetrics/obs_processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsmetrics +package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" import ( "go.opencensus.io/stats" diff --git a/internal/obsreportconfig/obsmetrics/obs_receiver.go b/internal/obsreportconfig/obsmetrics/obs_receiver.go index 8cc7bf8b296..77a568a8798 100644 --- a/internal/obsreportconfig/obsmetrics/obs_receiver.go +++ b/internal/obsreportconfig/obsmetrics/obs_receiver.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsmetrics +package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" import ( "go.opencensus.io/stats" diff --git a/internal/obsreportconfig/obsmetrics/obs_scraper.go b/internal/obsreportconfig/obsmetrics/obs_scraper.go index dedbe4953ef..39051e68586 100644 --- a/internal/obsreportconfig/obsmetrics/obs_scraper.go +++ b/internal/obsreportconfig/obsmetrics/obs_scraper.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsmetrics +package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" import ( "go.opencensus.io/stats" diff --git a/internal/obsreportconfig/obsmetrics/obsmetrics.go b/internal/obsreportconfig/obsmetrics/obsmetrics.go index fe7ea208116..8eb825565af 100644 --- a/internal/obsreportconfig/obsmetrics/obsmetrics.go +++ b/internal/obsreportconfig/obsmetrics/obsmetrics.go @@ -15,7 +15,7 @@ // Package obsmetrics defines the obsreport metrics for each components // all the metrics is in OpenCensus format which will be replaced with OTEL Metrics // in the future -package obsmetrics +package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" const ( NameSep = "/" diff --git a/internal/obsreportconfig/obsreportconfig.go b/internal/obsreportconfig/obsreportconfig.go index dbad5efca64..bc833ddac36 100644 --- a/internal/obsreportconfig/obsreportconfig.go +++ b/internal/obsreportconfig/obsreportconfig.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsreportconfig +package obsreportconfig // import "go.opentelemetry.io/collector/internal/obsreportconfig" import ( "go.opencensus.io/stats" diff --git a/internal/otlptext/databuffer.go b/internal/otlptext/databuffer.go index a88e49f149d..2bbcbb87e08 100644 --- a/internal/otlptext/databuffer.go +++ b/internal/otlptext/databuffer.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlptext +package otlptext // import "go.opentelemetry.io/collector/internal/otlptext" import ( "bytes" diff --git a/internal/otlptext/logs.go b/internal/otlptext/logs.go index c7be0c4492d..0a45dbceb22 100644 --- a/internal/otlptext/logs.go +++ b/internal/otlptext/logs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlptext +package otlptext // import "go.opentelemetry.io/collector/internal/otlptext" import ( "go.opentelemetry.io/collector/model/pdata" diff --git a/internal/otlptext/metrics.go b/internal/otlptext/metrics.go index a107de27e5f..3536797370f 100644 --- a/internal/otlptext/metrics.go +++ b/internal/otlptext/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlptext +package otlptext // import "go.opentelemetry.io/collector/internal/otlptext" import ( "go.opentelemetry.io/collector/model/pdata" diff --git a/internal/otlptext/traces.go b/internal/otlptext/traces.go index d3e3cc6548c..3a11e1e4534 100644 --- a/internal/otlptext/traces.go +++ b/internal/otlptext/traces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlptext +package otlptext // import "go.opentelemetry.io/collector/internal/otlptext" import ( "go.opentelemetry.io/collector/model/pdata" diff --git a/internal/sharedcomponent/sharedcomponent.go b/internal/sharedcomponent/sharedcomponent.go index 66e6487f7e1..02043b72996 100644 --- a/internal/sharedcomponent/sharedcomponent.go +++ b/internal/sharedcomponent/sharedcomponent.go @@ -14,7 +14,7 @@ // Package sharedcomponent exposes util functionality for receivers and exporters // that need to share state between different signal types instances such as net.Listener or os.File. -package sharedcomponent +package sharedcomponent // import "go.opentelemetry.io/collector/internal/sharedcomponent" import ( "context" diff --git a/internal/testcomponents/example_exporter.go b/internal/testcomponents/example_exporter.go index e567bed2815..70dc89cb171 100644 --- a/internal/testcomponents/example_exporter.go +++ b/internal/testcomponents/example_exporter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package testcomponents +package testcomponents // import "go.opentelemetry.io/collector/internal/testcomponents" import ( "context" diff --git a/internal/testcomponents/example_extension.go b/internal/testcomponents/example_extension.go index 1a55a86431c..9471d2c4f4a 100644 --- a/internal/testcomponents/example_extension.go +++ b/internal/testcomponents/example_extension.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package testcomponents +package testcomponents // import "go.opentelemetry.io/collector/internal/testcomponents" import ( "context" diff --git a/internal/testcomponents/example_factories.go b/internal/testcomponents/example_factories.go index 6d478223a1e..e10105a41ea 100644 --- a/internal/testcomponents/example_factories.go +++ b/internal/testcomponents/example_factories.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package testcomponents +package testcomponents // import "go.opentelemetry.io/collector/internal/testcomponents" import ( "go.opentelemetry.io/collector/component" diff --git a/internal/testcomponents/example_processor.go b/internal/testcomponents/example_processor.go index 5128ff10a6e..c0a1503e02b 100644 --- a/internal/testcomponents/example_processor.go +++ b/internal/testcomponents/example_processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package testcomponents +package testcomponents // import "go.opentelemetry.io/collector/internal/testcomponents" import ( "context" diff --git a/internal/testcomponents/example_receiver.go b/internal/testcomponents/example_receiver.go index 55246e31655..3c574a69bc2 100644 --- a/internal/testcomponents/example_receiver.go +++ b/internal/testcomponents/example_receiver.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package testcomponents +package testcomponents // import "go.opentelemetry.io/collector/internal/testcomponents" import ( "context" diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 20462754077..6b8ac9d402c 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package testutil +package testutil // import "go.opentelemetry.io/collector/internal/testutil" import ( "net" diff --git a/internal/tools/empty.go b/internal/tools/empty.go index 80b6ec8ba3b..cbb2c132d3f 100644 --- a/internal/tools/empty.go +++ b/internal/tools/empty.go @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -package tools +package tools // import "go.opentelemetry.io/collector/internal/tools" diff --git a/internal/tools/go.mod b/internal/tools/go.mod index cb711675ef1..7ae93edd0ee 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -6,6 +6,7 @@ require ( github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.42.1 github.com/google/addlicense v1.0.0 + github.com/jcchavezs/porto v0.3.0 github.com/mjibson/esc v0.2.0 github.com/ory/go-acc v0.2.6 github.com/pavius/impi v0.0.3 @@ -154,7 +155,7 @@ require ( github.com/uudashr/gocognit v1.0.5 // indirect github.com/yeya24/promlinter v0.1.0 // indirect go.opentelemetry.io/build-tools v0.0.0-20210719163622-92017e64f35b // indirect - golang.org/x/mod v0.4.2 // 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/sync v0.0.0-20210220032951-036812b2e83c // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 62a1433db7a..de75a4cdf50 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -392,6 +392,10 @@ github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jcchavezs/porto v0.2.1 h1:Ox0DkFvM3itXUVRQNV9DJnwdSzWe11NbyBqQhp4n37s= +github.com/jcchavezs/porto v0.2.1/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A= +github.com/jcchavezs/porto v0.3.0 h1:JSKeMsqexngzHUpiv4NPPADSNBF9bDyavGRDWedzNeM= +github.com/jcchavezs/porto v0.3.0/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A= 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= @@ -837,6 +841,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/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= 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= diff --git a/internal/tools/tools.go b/internal/tools/tools.go index a2fe0ca0cf4..a9b678855ec 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -15,7 +15,7 @@ //go:build tools // +build tools -package tools +package tools // import "go.opentelemetry.io/collector/internal/tools" // This file follows the recommendation at // https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module @@ -26,6 +26,7 @@ import ( _ "github.com/client9/misspell/cmd/misspell" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/google/addlicense" + _ "github.com/jcchavezs/porto/cmd/porto" _ "github.com/mjibson/esc" _ "github.com/ory/go-acc" _ "github.com/pavius/impi/cmd/impi" diff --git a/internal/version/version.go b/internal/version/version.go index a0fa98ac9ff..dd962baf55c 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package version +package version // import "go.opentelemetry.io/collector/internal/version" import ( "bytes" diff --git a/model/internal/data/bytesid.go b/model/internal/data/bytesid.go index 5b02eaa6a45..0e1ed9e23cd 100644 --- a/model/internal/data/bytesid.go +++ b/model/internal/data/bytesid.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package data +package data // import "go.opentelemetry.io/collector/model/internal/data" import ( "encoding/hex" diff --git a/model/internal/data/spanid.go b/model/internal/data/spanid.go index e5e790fb3f8..9d28664b677 100644 --- a/model/internal/data/spanid.go +++ b/model/internal/data/spanid.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package data +package data // import "go.opentelemetry.io/collector/model/internal/data" import ( "encoding/hex" diff --git a/model/internal/data/traceid.go b/model/internal/data/traceid.go index b608621b72a..4b62abdf8c4 100644 --- a/model/internal/data/traceid.go +++ b/model/internal/data/traceid.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package data +package data // import "go.opentelemetry.io/collector/model/internal/data" import ( "encoding/hex" diff --git a/model/internal/otlp_wrapper.go b/model/internal/otlp_wrapper.go index d0d2dd18a39..97aa90ca564 100644 --- a/model/internal/otlp_wrapper.go +++ b/model/internal/otlp_wrapper.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/model/internal" import ( otlpcollectorlog "go.opentelemetry.io/collector/model/internal/data/protogen/collector/logs/v1" diff --git a/model/otlp/json_marshaler.go b/model/otlp/json_marshaler.go index 6744304f4e8..b08fdcbb70c 100644 --- a/model/otlp/json_marshaler.go +++ b/model/otlp/json_marshaler.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlp +package otlp // import "go.opentelemetry.io/collector/model/otlp" import ( "bytes" diff --git a/model/otlp/json_unmarshaler.go b/model/otlp/json_unmarshaler.go index 01c3a403d5b..92aeb9a3db7 100644 --- a/model/otlp/json_unmarshaler.go +++ b/model/otlp/json_unmarshaler.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlp +package otlp // import "go.opentelemetry.io/collector/model/otlp" import ( "bytes" diff --git a/model/otlp/pb_marshaler.go b/model/otlp/pb_marshaler.go index c35e43e3a87..2697de317fe 100644 --- a/model/otlp/pb_marshaler.go +++ b/model/otlp/pb_marshaler.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlp +package otlp // import "go.opentelemetry.io/collector/model/otlp" import ( "go.opentelemetry.io/collector/model/internal" diff --git a/model/otlp/pb_unmarshaler.go b/model/otlp/pb_unmarshaler.go index 6fc8d2fa38d..1b36b1b1246 100644 --- a/model/otlp/pb_unmarshaler.go +++ b/model/otlp/pb_unmarshaler.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlp +package otlp // import "go.opentelemetry.io/collector/model/otlp" import ( "go.opentelemetry.io/collector/model/internal" diff --git a/model/otlpgrpc/logs.go b/model/otlpgrpc/logs.go index be3b0e3a0c5..f40836a7429 100644 --- a/model/otlpgrpc/logs.go +++ b/model/otlpgrpc/logs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpgrpc +package otlpgrpc // import "go.opentelemetry.io/collector/model/otlpgrpc" import ( "bytes" diff --git a/model/otlpgrpc/metrics.go b/model/otlpgrpc/metrics.go index 4a71c69c129..276968d1a2a 100644 --- a/model/otlpgrpc/metrics.go +++ b/model/otlpgrpc/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpgrpc +package otlpgrpc // import "go.opentelemetry.io/collector/model/otlpgrpc" import ( "bytes" diff --git a/model/otlpgrpc/traces.go b/model/otlpgrpc/traces.go index 41b0eb98e46..14755918abe 100644 --- a/model/otlpgrpc/traces.go +++ b/model/otlpgrpc/traces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpgrpc +package otlpgrpc // import "go.opentelemetry.io/collector/model/otlpgrpc" import ( "bytes" diff --git a/model/pdata/common.go b/model/pdata/common.go index 85a907cf2c2..5d853fbdf17 100644 --- a/model/pdata/common.go +++ b/model/pdata/common.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" // This file contains data structures that are common for all telemetry types, // such as timestamps, attributes, etc. diff --git a/model/pdata/doc.go b/model/pdata/doc.go index dbd02bd0433..feea31438a2 100644 --- a/model/pdata/doc.go +++ b/model/pdata/doc.go @@ -38,4 +38,4 @@ // * Encoding: Common interfaces for serializing/deserializing bytes from/to protocol-specific data models. // * Translation: Common interfaces for translating protocol-specific data models from/to pdata types. // * Marshaling: Common higher level APIs that do both encoding and translation of bytes and data model if going directly pdata types to bytes. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" diff --git a/model/pdata/logs.go b/model/pdata/logs.go index fe8476e7af6..565d9eabcb9 100644 --- a/model/pdata/logs.go +++ b/model/pdata/logs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal" diff --git a/model/pdata/metrics.go b/model/pdata/metrics.go index 5c23cdd22eb..1ec0f54a290 100644 --- a/model/pdata/metrics.go +++ b/model/pdata/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal" diff --git a/model/pdata/spanid.go b/model/pdata/spanid.go index e8c853ca1c9..fafb54a3011 100644 --- a/model/pdata/spanid.go +++ b/model/pdata/spanid.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal/data" diff --git a/model/pdata/timestamp.go b/model/pdata/timestamp.go index bd3f96b0121..92f2e145eb4 100644 --- a/model/pdata/timestamp.go +++ b/model/pdata/timestamp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "time" diff --git a/model/pdata/traceid.go b/model/pdata/traceid.go index 7ca0d3b22d2..c2c6c8b7393 100644 --- a/model/pdata/traceid.go +++ b/model/pdata/traceid.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal/data" diff --git a/model/pdata/traces.go b/model/pdata/traces.go index 1335978fc8b..ad68dcddec6 100644 --- a/model/pdata/traces.go +++ b/model/pdata/traces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pdata +package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal" diff --git a/model/semconv/v1.5.0/nonstandard.go b/model/semconv/v1.5.0/nonstandard.go index 503df293722..d9856098f02 100644 --- a/model/semconv/v1.5.0/nonstandard.go +++ b/model/semconv/v1.5.0/nonstandard.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.5.0" const ( InstrumentationLibraryName = "otel.library.name" diff --git a/model/semconv/v1.5.0/resource.go b/model/semconv/v1.5.0/resource.go index fc7d6a68f77..ce0a2ac26d2 100644 --- a/model/semconv/v1.5.0/resource.go +++ b/model/semconv/v1.5.0/resource.go @@ -14,7 +14,7 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.5.0" // A cloud environment (e.g. GCP, Azure, AWS) const ( diff --git a/model/semconv/v1.5.0/schema.go b/model/semconv/v1.5.0/schema.go index 0f393673567..f9d05e6104f 100644 --- a/model/semconv/v1.5.0/schema.go +++ b/model/semconv/v1.5.0/schema.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.5.0" // SchemaURL is the schema URL that matches the version of the semantic conventions // that this package defines. Conventions packages starting from v1.4.0 must declare diff --git a/model/semconv/v1.5.0/trace.go b/model/semconv/v1.5.0/trace.go index b6be0e49649..08389f9e28b 100644 --- a/model/semconv/v1.5.0/trace.go +++ b/model/semconv/v1.5.0/trace.go @@ -14,7 +14,7 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.5.0" // Span attributes used by AWS Lambda (in addition to general `faas` attributes). const ( diff --git a/model/semconv/v1.6.1/nonstandard.go b/model/semconv/v1.6.1/nonstandard.go index 2cfd5203a81..2c0b2f33cfe 100644 --- a/model/semconv/v1.6.1/nonstandard.go +++ b/model/semconv/v1.6.1/nonstandard.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.6.1" const ( OtelLibraryName = "otel.library.name" diff --git a/model/semconv/v1.6.1/resource.go b/model/semconv/v1.6.1/resource.go index 7a1b3520d38..dbb63d70503 100644 --- a/model/semconv/v1.6.1/resource.go +++ b/model/semconv/v1.6.1/resource.go @@ -14,7 +14,7 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.6.1" // A cloud environment (e.g. GCP, Azure, AWS) const ( diff --git a/model/semconv/v1.6.1/schema.go b/model/semconv/v1.6.1/schema.go index 2bb65ae612b..d46f43d7e4b 100644 --- a/model/semconv/v1.6.1/schema.go +++ b/model/semconv/v1.6.1/schema.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.6.1" // SchemaURL is the schema URL that matches the version of the semantic conventions // that this package defines. Conventions packages starting from v1.4.0 must declare diff --git a/model/semconv/v1.6.1/trace.go b/model/semconv/v1.6.1/trace.go index c1858c52b7c..8e2972d4c90 100644 --- a/model/semconv/v1.6.1/trace.go +++ b/model/semconv/v1.6.1/trace.go @@ -14,7 +14,7 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv +package semconv // import "go.opentelemetry.io/collector/model/semconv/v1.6.1" // Span attributes used by AWS Lambda (in addition to general `faas` attributes). const ( diff --git a/obsreport/doc.go b/obsreport/doc.go index cb796729ce6..a5c886d9796 100644 --- a/obsreport/doc.go +++ b/obsreport/doc.go @@ -114,4 +114,4 @@ // // `processor/batch/batch_size_trigger_send{processor="batch/dev",...}` // -package obsreport +package obsreport // import "go.opentelemetry.io/collector/obsreport" diff --git a/obsreport/obsreport.go b/obsreport/obsreport.go index 79edae4765e..eddc68c1048 100644 --- a/obsreport/obsreport.go +++ b/obsreport/obsreport.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsreport +package obsreport // import "go.opentelemetry.io/collector/obsreport" import ( "go.opentelemetry.io/otel/codes" diff --git a/obsreport/obsreport_exporter.go b/obsreport/obsreport_exporter.go index def6a90f675..6eb716adb1d 100644 --- a/obsreport/obsreport_exporter.go +++ b/obsreport/obsreport_exporter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsreport +package obsreport // import "go.opentelemetry.io/collector/obsreport" import ( "context" diff --git a/obsreport/obsreport_processor.go b/obsreport/obsreport_processor.go index 94b0149f439..f6c9100e8f6 100644 --- a/obsreport/obsreport_processor.go +++ b/obsreport/obsreport_processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsreport +package obsreport // import "go.opentelemetry.io/collector/obsreport" import ( "context" diff --git a/obsreport/obsreport_receiver.go b/obsreport/obsreport_receiver.go index 96418391f86..6c1bcf935a7 100644 --- a/obsreport/obsreport_receiver.go +++ b/obsreport/obsreport_receiver.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsreport +package obsreport // import "go.opentelemetry.io/collector/obsreport" import ( "context" diff --git a/obsreport/obsreport_scraper.go b/obsreport/obsreport_scraper.go index 01775862dcf..3d496c24d50 100644 --- a/obsreport/obsreport_scraper.go +++ b/obsreport/obsreport_scraper.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsreport +package obsreport // import "go.opentelemetry.io/collector/obsreport" import ( "context" diff --git a/obsreport/obsreporttest/obsreporttest.go b/obsreport/obsreporttest/obsreporttest.go index 6ec5a1e974e..536c3f84dae 100644 --- a/obsreport/obsreporttest/obsreporttest.go +++ b/obsreport/obsreporttest/obsreporttest.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package obsreporttest +package obsreporttest // import "go.opentelemetry.io/collector/obsreport/obsreporttest" import ( "context" diff --git a/processor/batchprocessor/batch_processor.go b/processor/batchprocessor/batch_processor.go index c7ccab58003..c7974f08bdd 100644 --- a/processor/batchprocessor/batch_processor.go +++ b/processor/batchprocessor/batch_processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package batchprocessor +package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor" import ( "context" diff --git a/processor/batchprocessor/config.go b/processor/batchprocessor/config.go index eb25d77c6e3..f26928eb509 100644 --- a/processor/batchprocessor/config.go +++ b/processor/batchprocessor/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package batchprocessor +package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor" import ( "errors" diff --git a/processor/batchprocessor/factory.go b/processor/batchprocessor/factory.go index 27f3f96de10..a3638326ad8 100644 --- a/processor/batchprocessor/factory.go +++ b/processor/batchprocessor/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package batchprocessor +package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor" import ( "context" diff --git a/processor/batchprocessor/metrics.go b/processor/batchprocessor/metrics.go index 8ae203e915d..a2a5a109c73 100644 --- a/processor/batchprocessor/metrics.go +++ b/processor/batchprocessor/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package batchprocessor +package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor" import ( "go.opencensus.io/stats" diff --git a/processor/batchprocessor/splitlogs.go b/processor/batchprocessor/splitlogs.go index 2d6637dd1dc..b95ce446e44 100644 --- a/processor/batchprocessor/splitlogs.go +++ b/processor/batchprocessor/splitlogs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package batchprocessor +package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor" import ( "go.opentelemetry.io/collector/model/pdata" diff --git a/processor/batchprocessor/splitmetrics.go b/processor/batchprocessor/splitmetrics.go index b168936d63b..b842929c113 100644 --- a/processor/batchprocessor/splitmetrics.go +++ b/processor/batchprocessor/splitmetrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package batchprocessor +package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor" import ( "go.opentelemetry.io/collector/model/pdata" diff --git a/processor/batchprocessor/splittraces.go b/processor/batchprocessor/splittraces.go index 46ff7f933ac..11465bb442b 100644 --- a/processor/batchprocessor/splittraces.go +++ b/processor/batchprocessor/splittraces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package batchprocessor +package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor" import ( "go.opentelemetry.io/collector/model/pdata" diff --git a/processor/memorylimiterprocessor/config.go b/processor/memorylimiterprocessor/config.go index 72789bc325e..bb336524811 100644 --- a/processor/memorylimiterprocessor/config.go +++ b/processor/memorylimiterprocessor/config.go @@ -15,7 +15,7 @@ // Package memorylimiterprocessor provides a processor for OpenTelemetry Service pipeline // that drops data on the pipeline according to the current state of memory // usage. -package memorylimiterprocessor +package memorylimiterprocessor // import "go.opentelemetry.io/collector/processor/memorylimiterprocessor" import ( "time" diff --git a/processor/memorylimiterprocessor/factory.go b/processor/memorylimiterprocessor/factory.go index 532e45efae4..ea26c45b415 100644 --- a/processor/memorylimiterprocessor/factory.go +++ b/processor/memorylimiterprocessor/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package memorylimiterprocessor +package memorylimiterprocessor // import "go.opentelemetry.io/collector/processor/memorylimiterprocessor" import ( "context" diff --git a/processor/memorylimiterprocessor/memorylimiter.go b/processor/memorylimiterprocessor/memorylimiter.go index 89475054af0..a8ca86f4fdf 100644 --- a/processor/memorylimiterprocessor/memorylimiter.go +++ b/processor/memorylimiterprocessor/memorylimiter.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package memorylimiterprocessor +package memorylimiterprocessor // import "go.opentelemetry.io/collector/processor/memorylimiterprocessor" import ( "context" diff --git a/processor/processorhelper/factory.go b/processor/processorhelper/factory.go index 6d7794a9fc8..5465055f4c0 100644 --- a/processor/processorhelper/factory.go +++ b/processor/processorhelper/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package processorhelper +package processorhelper // import "go.opentelemetry.io/collector/processor/processorhelper" import ( "context" diff --git a/processor/processorhelper/logs.go b/processor/processorhelper/logs.go index 7a647e32f97..3cc2769d1a9 100644 --- a/processor/processorhelper/logs.go +++ b/processor/processorhelper/logs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package processorhelper +package processorhelper // import "go.opentelemetry.io/collector/processor/processorhelper" import ( "context" diff --git a/processor/processorhelper/metrics.go b/processor/processorhelper/metrics.go index 62879c61bae..abbde83488b 100644 --- a/processor/processorhelper/metrics.go +++ b/processor/processorhelper/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package processorhelper +package processorhelper // import "go.opentelemetry.io/collector/processor/processorhelper" import ( "context" diff --git a/processor/processorhelper/processor.go b/processor/processorhelper/processor.go index 528560b206f..7db885fb896 100644 --- a/processor/processorhelper/processor.go +++ b/processor/processorhelper/processor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package processorhelper +package processorhelper // import "go.opentelemetry.io/collector/processor/processorhelper" import ( "errors" diff --git a/processor/processorhelper/traces.go b/processor/processorhelper/traces.go index 8e0bd889abc..991f7cfb265 100644 --- a/processor/processorhelper/traces.go +++ b/processor/processorhelper/traces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package processorhelper +package processorhelper // import "go.opentelemetry.io/collector/processor/processorhelper" import ( "context" diff --git a/receiver/doc.go b/receiver/doc.go index f2e788b1241..86ff181ebff 100644 --- a/receiver/doc.go +++ b/receiver/doc.go @@ -15,4 +15,4 @@ // Package receiver contains implementations of Receiver components. // // A receiver must be added as a default component to be included in the collector. -package receiver +package receiver // import "go.opentelemetry.io/collector/receiver" diff --git a/receiver/otlpreceiver/config.go b/receiver/otlpreceiver/config.go index e22e4bfc877..f40052ec342 100644 --- a/receiver/otlpreceiver/config.go +++ b/receiver/otlpreceiver/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpreceiver +package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlpreceiver" import ( "fmt" diff --git a/receiver/otlpreceiver/doc.go b/receiver/otlpreceiver/doc.go index 08660f683e6..52f926dce74 100644 --- a/receiver/otlpreceiver/doc.go +++ b/receiver/otlpreceiver/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package otlpreceiver receives data in OTLP format. -package otlpreceiver +package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlpreceiver" diff --git a/receiver/otlpreceiver/encoder.go b/receiver/otlpreceiver/encoder.go index d55151a4e1d..f1c2007d14b 100644 --- a/receiver/otlpreceiver/encoder.go +++ b/receiver/otlpreceiver/encoder.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpreceiver +package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlpreceiver" import ( "bytes" diff --git a/receiver/otlpreceiver/factory.go b/receiver/otlpreceiver/factory.go index 2a06700afdb..acc820df318 100644 --- a/receiver/otlpreceiver/factory.go +++ b/receiver/otlpreceiver/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpreceiver +package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlpreceiver" import ( "context" diff --git a/receiver/otlpreceiver/internal/logs/otlp.go b/receiver/otlpreceiver/internal/logs/otlp.go index 61ff88a1841..2ad3aab6c5a 100644 --- a/receiver/otlpreceiver/internal/logs/otlp.go +++ b/receiver/otlpreceiver/internal/logs/otlp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package logs +package logs // import "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/logs" import ( "context" diff --git a/receiver/otlpreceiver/internal/metrics/otlp.go b/receiver/otlpreceiver/internal/metrics/otlp.go index 68d3029db7f..71a37bb0e0a 100644 --- a/receiver/otlpreceiver/internal/metrics/otlp.go +++ b/receiver/otlpreceiver/internal/metrics/otlp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package metrics +package metrics // import "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metrics" import ( "context" diff --git a/receiver/otlpreceiver/internal/trace/otlp.go b/receiver/otlpreceiver/internal/trace/otlp.go index d6e5c25fdb8..1cfddf9fe3b 100644 --- a/receiver/otlpreceiver/internal/trace/otlp.go +++ b/receiver/otlpreceiver/internal/trace/otlp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package trace +package trace // import "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/trace" import ( "context" diff --git a/receiver/otlpreceiver/otlp.go b/receiver/otlpreceiver/otlp.go index 39e1e01fd43..2e1a3b8ee1c 100644 --- a/receiver/otlpreceiver/otlp.go +++ b/receiver/otlpreceiver/otlp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpreceiver +package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlpreceiver" import ( "context" diff --git a/receiver/otlpreceiver/otlphttp.go b/receiver/otlpreceiver/otlphttp.go index 11b0416583c..dc5628b1a2a 100644 --- a/receiver/otlpreceiver/otlphttp.go +++ b/receiver/otlpreceiver/otlphttp.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpreceiver +package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlpreceiver" import ( "io/ioutil" diff --git a/receiver/receiverhelper/doc.go b/receiver/receiverhelper/doc.go index 412bb53dd92..bf82d16d4d6 100644 --- a/receiver/receiverhelper/doc.go +++ b/receiver/receiverhelper/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package receiverhelper contains utilities for receivers. -package receiverhelper +package receiverhelper // import "go.opentelemetry.io/collector/receiver/receiverhelper" diff --git a/receiver/receiverhelper/factory.go b/receiver/receiverhelper/factory.go index 650afcf7d2c..94c0f26f1c1 100644 --- a/receiver/receiverhelper/factory.go +++ b/receiver/receiverhelper/factory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package receiverhelper +package receiverhelper // import "go.opentelemetry.io/collector/receiver/receiverhelper" import ( "context" diff --git a/receiver/scrapererror/doc.go b/receiver/scrapererror/doc.go index acc3c48e365..a66d4a30b81 100644 --- a/receiver/scrapererror/doc.go +++ b/receiver/scrapererror/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package scraperror provides custom error types for scrapers. -package scrapererror +package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" diff --git a/receiver/scrapererror/partialscrapeerror.go b/receiver/scrapererror/partialscrapeerror.go index 6487fd46d5e..d003b0ad2d7 100644 --- a/receiver/scrapererror/partialscrapeerror.go +++ b/receiver/scrapererror/partialscrapeerror.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scrapererror +package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" import "errors" diff --git a/receiver/scrapererror/scrapeerror.go b/receiver/scrapererror/scrapeerror.go index 22dc2f79aa9..eb3042bf530 100644 --- a/receiver/scrapererror/scrapeerror.go +++ b/receiver/scrapererror/scrapeerror.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scrapererror +package scrapererror // import "go.opentelemetry.io/collector/receiver/scrapererror" import ( "go.uber.org/multierr" diff --git a/receiver/scraperhelper/doc.go b/receiver/scraperhelper/doc.go index a8bdb3877f4..1b2ee55317c 100644 --- a/receiver/scraperhelper/doc.go +++ b/receiver/scraperhelper/doc.go @@ -13,4 +13,4 @@ // limitations under the License. // Package scraperhelper provides utilities for scrapers. -package scraperhelper +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" diff --git a/receiver/scraperhelper/scraper.go b/receiver/scraperhelper/scraper.go index c0a305954f5..152ca3edef3 100644 --- a/receiver/scraperhelper/scraper.go +++ b/receiver/scraperhelper/scraper.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scraperhelper +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" import ( "context" diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index d156e435498..3046cc2cea7 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scraperhelper +package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperhelper" import ( "context" diff --git a/service/collector.go b/service/collector.go index cf7c0ab1c94..a363f8ed7c7 100644 --- a/service/collector.go +++ b/service/collector.go @@ -14,7 +14,7 @@ // Package service handles the command-line, configuration, and runs the // OpenTelemetry Collector. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "context" diff --git a/service/collector_windows.go b/service/collector_windows.go index 57019dc200c..96149855cef 100644 --- a/service/collector_windows.go +++ b/service/collector_windows.go @@ -15,7 +15,7 @@ //go:build windows // +build windows -package service +package service // import "go.opentelemetry.io/collector/service" import ( "context" diff --git a/service/command.go b/service/command.go index ef5a491665d..9adebb16f60 100644 --- a/service/command.go +++ b/service/command.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "github.com/spf13/cobra" diff --git a/service/configcheck.go b/service/configcheck.go index a7485049fa7..9e068b6b8fe 100644 --- a/service/configcheck.go +++ b/service/configcheck.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "go.uber.org/multierr" diff --git a/service/defaultcomponents/defaults.go b/service/defaultcomponents/defaults.go index aaef3fe6f67..bb503c05e9b 100644 --- a/service/defaultcomponents/defaults.go +++ b/service/defaultcomponents/defaults.go @@ -13,7 +13,7 @@ // limitations under the License. // Package defaultcomponents composes the default set of components used by the otel service -package defaultcomponents +package defaultcomponents // import "go.opentelemetry.io/collector/service/defaultcomponents" import ( "go.uber.org/multierr" diff --git a/service/featuregate/gates.go b/service/featuregate/gates.go index 79aaadc2296..47d14f9346e 100644 --- a/service/featuregate/gates.go +++ b/service/featuregate/gates.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package featuregate +package featuregate // import "go.opentelemetry.io/collector/service/featuregate" import ( "fmt" diff --git a/service/flags.go b/service/flags.go index 76945d66800..8eb90229eab 100644 --- a/service/flags.go +++ b/service/flags.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "flag" diff --git a/service/internal/builder/doc.go b/service/internal/builder/doc.go index c5bd4259703..d5aa04b14e7 100644 --- a/service/internal/builder/doc.go +++ b/service/internal/builder/doc.go @@ -14,4 +14,4 @@ // Package builder handles the options to build the OpenTelemetry collector // pipeline. -package builder +package builder // import "go.opentelemetry.io/collector/service/internal/builder" diff --git a/service/internal/builder/exporters_builder.go b/service/internal/builder/exporters_builder.go index 149e6725e75..0ddd28684ce 100644 --- a/service/internal/builder/exporters_builder.go +++ b/service/internal/builder/exporters_builder.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package builder // import "go.opentelemetry.io/collector/service/internal/builder" import ( "context" diff --git a/service/internal/builder/pipelines_builder.go b/service/internal/builder/pipelines_builder.go index 0ee9e1eedc5..9c40a5294d9 100644 --- a/service/internal/builder/pipelines_builder.go +++ b/service/internal/builder/pipelines_builder.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package builder // import "go.opentelemetry.io/collector/service/internal/builder" import ( "context" diff --git a/service/internal/builder/receivers_builder.go b/service/internal/builder/receivers_builder.go index 38dbd171cf4..4c15e92ba8a 100644 --- a/service/internal/builder/receivers_builder.go +++ b/service/internal/builder/receivers_builder.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package builder // import "go.opentelemetry.io/collector/service/internal/builder" import ( "context" diff --git a/service/internal/components/constants.go b/service/internal/components/constants.go index 2cce44ed64e..52c730bcb14 100644 --- a/service/internal/components/constants.go +++ b/service/internal/components/constants.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package components +package components // import "go.opentelemetry.io/collector/service/internal/components" const ( ZapKindKey = "kind" diff --git a/service/internal/components/host_wrapper.go b/service/internal/components/host_wrapper.go index c0ce5bb2531..78428e4e2f0 100644 --- a/service/internal/components/host_wrapper.go +++ b/service/internal/components/host_wrapper.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package components +package components // import "go.opentelemetry.io/collector/service/internal/components" import ( "net/http" diff --git a/service/internal/extensions/extensions.go b/service/internal/extensions/extensions.go index 717cccc1596..15e67bb48ff 100644 --- a/service/internal/extensions/extensions.go +++ b/service/internal/extensions/extensions.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package extensions +package extensions // import "go.opentelemetry.io/collector/service/internal/extensions" import ( "context" diff --git a/service/internal/fanoutconsumer/logs.go b/service/internal/fanoutconsumer/logs.go index 66c124f816e..9dde97673a1 100644 --- a/service/internal/fanoutconsumer/logs.go +++ b/service/internal/fanoutconsumer/logs.go @@ -14,7 +14,7 @@ // Package fanoutconsumer contains implementations of Traces/Metrics/Logs consumers // that fan out the data to multiple other consumers. -package fanoutconsumer +package fanoutconsumer // import "go.opentelemetry.io/collector/service/internal/fanoutconsumer" import ( "context" diff --git a/service/internal/fanoutconsumer/metrics.go b/service/internal/fanoutconsumer/metrics.go index 9a9d221d151..371643252b5 100644 --- a/service/internal/fanoutconsumer/metrics.go +++ b/service/internal/fanoutconsumer/metrics.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fanoutconsumer +package fanoutconsumer // import "go.opentelemetry.io/collector/service/internal/fanoutconsumer" import ( "context" diff --git a/service/internal/fanoutconsumer/traces.go b/service/internal/fanoutconsumer/traces.go index e4cc8073fc0..04dcd9fb5e8 100644 --- a/service/internal/fanoutconsumer/traces.go +++ b/service/internal/fanoutconsumer/traces.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package fanoutconsumer +package fanoutconsumer // import "go.opentelemetry.io/collector/service/internal/fanoutconsumer" import ( "context" diff --git a/service/internal/otel_trace_sampler.go b/service/internal/otel_trace_sampler.go index 15141bee7b4..c659a1e1794 100644 --- a/service/internal/otel_trace_sampler.go +++ b/service/internal/otel_trace_sampler.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package internal // import "go.opentelemetry.io/collector/service/internal" import ( sdktrace "go.opentelemetry.io/otel/sdk/trace" diff --git a/service/internal/telemetry/process_telemetry.go b/service/internal/telemetry/process_telemetry.go index 1d9c20d3c95..1a8e5700d16 100644 --- a/service/internal/telemetry/process_telemetry.go +++ b/service/internal/telemetry/process_telemetry.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package telemetry +package telemetry // import "go.opentelemetry.io/collector/service/internal/telemetry" import ( "context" diff --git a/service/internal/telemetrylogs/logger.go b/service/internal/telemetrylogs/logger.go index a40bb582b45..913ce6e05ac 100644 --- a/service/internal/telemetrylogs/logger.go +++ b/service/internal/telemetrylogs/logger.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package telemetrylogs +package telemetrylogs // import "go.opentelemetry.io/collector/service/internal/telemetrylogs" import ( "flag" diff --git a/service/internal/zpages/templates.go b/service/internal/zpages/templates.go index 364eb5b2078..184a9a44d96 100644 --- a/service/internal/zpages/templates.go +++ b/service/internal/zpages/templates.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package zpages +package zpages // import "go.opentelemetry.io/collector/service/internal/zpages" import ( "html/template" diff --git a/service/internal/zpages/tmplgen/gen.go b/service/internal/zpages/tmplgen/gen.go index 19aaa91c531..41151765f7f 100644 --- a/service/internal/zpages/tmplgen/gen.go +++ b/service/internal/zpages/tmplgen/gen.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package tmplgen +package tmplgen // import "go.opentelemetry.io/collector/service/internal/zpages/tmplgen" //go:generate esc -pkg tmplgen -o resources.go -modtime "0" ../templates/ //go:generate addlicense -y "" -c "The OpenTelemetry Authors" resources.go diff --git a/service/parserprovider/default.go b/service/parserprovider/default.go index 20f675795a3..680cba0d126 100644 --- a/service/parserprovider/default.go +++ b/service/parserprovider/default.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" // NewDefaultMapProvider returns the default MapProvider, and it creates configuration from a file // defined by the given configFile and overwrites fields using properties. diff --git a/service/parserprovider/expand.go b/service/parserprovider/expand.go index 4cb6ce6c8fd..7a756c3c204 100644 --- a/service/parserprovider/expand.go +++ b/service/parserprovider/expand.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" import ( "context" diff --git a/service/parserprovider/file.go b/service/parserprovider/file.go index 04286923d99..e99d1836176 100644 --- a/service/parserprovider/file.go +++ b/service/parserprovider/file.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" import ( "context" diff --git a/service/parserprovider/inmemory.go b/service/parserprovider/inmemory.go index 4bee4941575..d4f101d906b 100644 --- a/service/parserprovider/inmemory.go +++ b/service/parserprovider/inmemory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" import ( "context" diff --git a/service/parserprovider/merge.go b/service/parserprovider/merge.go index af4ab50764f..499d091e625 100644 --- a/service/parserprovider/merge.go +++ b/service/parserprovider/merge.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" import ( "context" diff --git a/service/parserprovider/properties.go b/service/parserprovider/properties.go index 331001d1860..ddd58e67313 100644 --- a/service/parserprovider/properties.go +++ b/service/parserprovider/properties.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" import ( "bytes" diff --git a/service/parserprovider/provider.go b/service/parserprovider/provider.go index f5fecbca0ca..148346343c6 100644 --- a/service/parserprovider/provider.go +++ b/service/parserprovider/provider.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" import ( "context" diff --git a/service/service.go b/service/service.go index 4a84199f2fb..039563526c2 100644 --- a/service/service.go +++ b/service/service.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "context" diff --git a/service/settings.go b/service/settings.go index bd1b41a114e..cca64ed6285 100644 --- a/service/settings.go +++ b/service/settings.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "go.opentelemetry.io/contrib/zpages" diff --git a/service/telemetry.go b/service/telemetry.go index 32e2b8d2e82..a281fd5a8a0 100644 --- a/service/telemetry.go +++ b/service/telemetry.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "fmt" diff --git a/service/zpages.go b/service/zpages.go index 928e239d855..c9f8a355db3 100644 --- a/service/zpages.go +++ b/service/zpages.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package service +package service // import "go.opentelemetry.io/collector/service" import ( "net/http" From beb76e4b89e6e8dc3339e314d39ac0f00aa03416 Mon Sep 17 00:00:00 2001 From: Jeff Cheng Date: Wed, 13 Oct 2021 09:25:41 -0400 Subject: [PATCH 060/149] Release v0.37.0 (#4192) --- CHANGELOG.md | 18 +++++++++++++----- go.mod | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6459d2429e..17760799640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,30 @@ ## Unreleased +## v0.37.0 Beta + ## 🛑 Breaking changes 🛑 -- Move configcheck.ValidateConfigFromFactories as internal function in service package (#3876) +- Move `configcheck.ValidateConfigFromFactories` as internal function in service package (#3876) - Rename `configparser.Parser` as `config.Map` (#4075) - Rename `component.DefaultBuildInfo()` to `component.NewDefaultBuildInfo()` (#4129) -- Rename consumererror.Permanent to consumererror.NewPermanent (#4118) +- Rename `consumererror.Permanent` to `consumererror.NewPermanent` (#4118) - Rename `config.NewID` to `config.NewComponentID` and `config.NewIDFromString` to `config.NewComponentIDFromString` (#4137) +- Rename `config.NewIDWithName` to `config.NewComponentIDWithName` (#4151) +- Move `extension/storage` to `extension/experimental/storage` (#4082) +- Rename `obsreporttest.SetupRecordedMetricsTest()` to `obsreporttest.SetupTelemetry()` and `obsreporttest.TestTelemetrySettings` to `obsreporttest.TestTelemetry` (#4157) ## 💡 Enhancements 💡 - Add Gen dependabot into CI (#4083) - -## 💡 Enhancements 💡 - - Update OTLP to v0.10.0 (#4045). - Add Flags field to NumberDataPoint, HistogramDataPoint, SummaryDataPoint (#4081). +- Add feature gate library (#4108) +- Add version to the internal telemetry metrics (#4140) + +## 🧰 Bug fixes 🧰 + +- Fix panic when not using `service.NewCommand` (#4139) ## v0.36.0 Beta diff --git a/go.mod b/go.mod index d7f3b6c59de..068fbfbfb9f 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,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.36.0 + go.opentelemetry.io/collector/model v0.37.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 go.opentelemetry.io/contrib/zpages v0.25.0 From 55700930f9a3dc272b431cdbe2435f250cd5b5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Wed, 13 Oct 2021 17:45:02 +0200 Subject: [PATCH 061/149] Change jpkrohling's company affiliation (#4193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7a2c090437..6fa04baf750 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Approvers ([@open-telemetry/collector-approvers](https://github.com/orgs/open-te - [Alex Boten](https://github.com/codeboten), Lightstep - [Anthony Mirabella](https://github.com/Aneurysm9), AWS - [Dmitrii Anoshin](https://github.com/dmitryax), Splunk -- [Juraci Paixão Kröhling](https://github.com/jpkrohling), Red Hat +- [Juraci Paixão Kröhling](https://github.com/jpkrohling), Grafana Labs - [Owais Lone](https://github.com/owais), Splunk Maintainers ([@open-telemetry/collector-maintainers](https://github.com/orgs/open-telemetry/teams/collector-maintainers)): From 028fc46e667e2673b93d39372825aee5036eaa98 Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 13 Oct 2021 11:31:58 -0700 Subject: [PATCH 062/149] Revert "Make TLSClient config to pointer type (#4104)" (#4196) This reverts commit ebb0fbd6f23e9ecc17ddc64edd54bb2a84ea9ce1. --- config/configgrpc/configgrpc.go | 18 +++++++----------- config/configgrpc/configgrpc_test.go | 16 ++++++++-------- config/confighttp/confighttp.go | 19 +++++++------------ config/confighttp/confighttp_test.go | 12 ++++++------ exporter/otlpexporter/config_test.go | 2 +- exporter/otlpexporter/factory_test.go | 6 +++--- exporter/otlpexporter/otlp_test.go | 22 ++++++++++------------ exporter/otlphttpexporter/config_test.go | 2 +- exporter/otlphttpexporter/factory_test.go | 6 +++--- 9 files changed, 46 insertions(+), 57 deletions(-) diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index b26faa3aede..8274bf76c59 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -73,7 +73,7 @@ type GRPCClientSettings struct { Compression string `mapstructure:"compression"` // TLSSetting struct exposes TLS client configuration. - TLSSetting *configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` // The keepalive parameters for gRPC client. See grpc.WithKeepaliveParams. // (https://godoc.org/google.golang.org/grpc#WithKeepaliveParams). @@ -181,8 +181,6 @@ func (gcs *GRPCClientSettings) isSchemeHTTPS() bool { // ToDialOptions maps configgrpc.GRPCClientSettings to a slice of dial options for gRPC. func (gcs *GRPCClientSettings) ToDialOptions(host component.Host) ([]grpc.DialOption, error) { var opts []grpc.DialOption - var tlsCfg *tls.Config - var err error if gcs.Compression != "" { if compressionKey := GetGRPCCompressionKey(gcs.Compression); compressionKey != CompressionUnsupported { opts = append(opts, grpc.WithDefaultCallOptions(grpc.UseCompressor(compressionKey))) @@ -190,19 +188,17 @@ func (gcs *GRPCClientSettings) ToDialOptions(host component.Host) ([]grpc.DialOp return nil, fmt.Errorf("unsupported compression type %q", gcs.Compression) } } - tlsDialOption := grpc.WithInsecure() - if gcs.TLSSetting != nil { - tlsCfg, err = gcs.TLSSetting.LoadTLSConfig() - if err != nil { - return nil, err - } + + tlsCfg, err := gcs.TLSSetting.LoadTLSConfig() + if err != nil { + return nil, err } + tlsDialOption := grpc.WithInsecure() if tlsCfg != nil { tlsDialOption = grpc.WithTransportCredentials(credentials.NewTLS(tlsCfg)) } else if gcs.isSchemeHTTPS() { tlsDialOption = grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})) } - opts = append(opts, tlsDialOption) if gcs.ReadBufferSize > 0 { @@ -239,7 +235,7 @@ func (gcs *GRPCClientSettings) ToDialOptions(host component.Host) ([]grpc.DialOp perRPCCredentials, perr := grpcAuthenticator.PerRPCCredentials() if perr != nil { - return nil, perr + return nil, err } opts = append(opts, grpc.WithPerRPCCredentials(perRPCCredentials)) } diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index c15243dd7e0..74fa1f62106 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -38,7 +38,7 @@ import ( func TestDefaultGrpcClientSettings(t *testing.T) { gcs := &GRPCClientSettings{ - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, } @@ -54,7 +54,7 @@ func TestAllGrpcClientSettings(t *testing.T) { }, Endpoint: "localhost:1234", Compression: "gzip", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: false, }, Keepalive: &KeepaliveClientConfig{ @@ -160,7 +160,7 @@ func TestGRPCClientSettingsError(t *testing.T) { Headers: nil, Endpoint: "", Compression: "", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "/doesnt/exist", }, @@ -176,7 +176,7 @@ func TestGRPCClientSettingsError(t *testing.T) { Headers: nil, Endpoint: "", Compression: "", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "/doesnt/exist", }, @@ -194,7 +194,7 @@ func TestGRPCClientSettingsError(t *testing.T) { }, Endpoint: "localhost:1234", Compression: "gzip", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: false, }, Keepalive: &KeepaliveClientConfig{ @@ -250,7 +250,7 @@ func TestUseSecure(t *testing.T) { Headers: nil, Endpoint: "", Compression: "", - TLSSetting: &configtls.TLSClientSetting{}, + TLSSetting: configtls.TLSClientSetting{}, Keepalive: nil, } dialOpts, err := gcs.ToDialOptions(componenttest.NewNopHost()) @@ -472,7 +472,7 @@ func TestHttpReception(t *testing.T) { gcs := &GRPCClientSettings{ Endpoint: ln.Addr().String(), - TLSSetting: tt.tlsClientCreds, + TLSSetting: *tt.tlsClientCreds, } clientOpts, errClient := gcs.ToDialOptions(componenttest.NewNopHost()) assert.NoError(t, errClient) @@ -517,7 +517,7 @@ func TestReceiveOnUnixDomainSocket(t *testing.T) { gcs := &GRPCClientSettings{ Endpoint: "unix://" + ln.Addr().String(), - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, } diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index 561c39f1f49..2c09e8cb73e 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -38,7 +38,7 @@ type HTTPClientSettings struct { Endpoint string `mapstructure:"endpoint"` // TLSSetting struct exposes TLS client configuration. - TLSSetting *configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` // ReadBufferSize for HTTP client. See http.Transport.ReadBufferSize. ReadBufferSize int `mapstructure:"read_buffer_size"` @@ -62,19 +62,14 @@ type HTTPClientSettings struct { // ToClient creates an HTTP client. func (hcs *HTTPClientSettings) ToClient(ext map[config.ComponentID]component.Extension) (*http.Client, error) { - var err error + tlsCfg, err := hcs.TLSSetting.LoadTLSConfig() + if err != nil { + return nil, err + } transport := http.DefaultTransport.(*http.Transport).Clone() - - if hcs.TLSSetting != nil { - tlsCfg, terr := hcs.TLSSetting.LoadTLSConfig() - if terr != nil { - return nil, terr - } - if tlsCfg != nil { - transport.TLSClientConfig = tlsCfg - } + if tlsCfg != nil { + transport.TLSClientConfig = tlsCfg } - if hcs.ReadBufferSize > 0 { transport.ReadBufferSize = hcs.ReadBufferSize } diff --git a/config/confighttp/confighttp_test.go b/config/confighttp/confighttp_test.go index bde6ea048bc..3eb588433cf 100644 --- a/config/confighttp/confighttp_test.go +++ b/config/confighttp/confighttp_test.go @@ -57,7 +57,7 @@ func TestAllHTTPClientSettings(t *testing.T) { name: "all_valid_settings", settings: HTTPClientSettings{ Endpoint: "localhost:1234", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: false, }, ReadBufferSize: 1024, @@ -70,7 +70,7 @@ func TestAllHTTPClientSettings(t *testing.T) { name: "error_round_tripper_returned", settings: HTTPClientSettings{ Endpoint: "localhost:1234", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: false, }, ReadBufferSize: 1024, @@ -105,7 +105,7 @@ func TestHTTPClientSettingsError(t *testing.T) { err: "^failed to load TLS config: failed to load CA CertPool: failed to load CA /doesnt/exist:", settings: HTTPClientSettings{ Endpoint: "", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "/doesnt/exist", }, @@ -118,7 +118,7 @@ func TestHTTPClientSettingsError(t *testing.T) { err: "^failed to load TLS config: for auth via TLS, either both certificate and key must be supplied, or neither", settings: HTTPClientSettings{ Endpoint: "", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "/doesnt/exist", }, @@ -407,7 +407,7 @@ func TestHttpReception(t *testing.T) { hcs := &HTTPClientSettings{ Endpoint: prefix + ln.Addr().String(), - TLSSetting: tt.tlsClientCreds, + TLSSetting: *tt.tlsClientCreds, } client, errClient := hcs.ToClient(map[config.ComponentID]component.Extension{}) assert.NoError(t, errClient) @@ -582,7 +582,7 @@ func TestHttpHeaders(t *testing.T) { serverURL, _ := url.Parse(server.URL) setting := HTTPClientSettings{ Endpoint: serverURL.String(), - TLSSetting: &configtls.TLSClientSetting{}, + TLSSetting: configtls.TLSClientSetting{}, ReadBufferSize: 0, WriteBufferSize: 0, Timeout: 0, diff --git a/exporter/otlpexporter/config_test.go b/exporter/otlpexporter/config_test.go index f1f7fd1093d..3ad431d4e27 100644 --- a/exporter/otlpexporter/config_test.go +++ b/exporter/otlpexporter/config_test.go @@ -72,7 +72,7 @@ func TestLoadConfig(t *testing.T) { }, Endpoint: "1.2.3.4:1234", Compression: "on", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "/var/lib/mycert.pem", }, diff --git a/exporter/otlpexporter/factory_test.go b/exporter/otlpexporter/factory_test.go index 9220e81a947..e791114d6ad 100644 --- a/exporter/otlpexporter/factory_test.go +++ b/exporter/otlpexporter/factory_test.go @@ -78,7 +78,7 @@ func TestCreateTracesExporter(t *testing.T) { ExporterSettings: config.NewExporterSettings(config.NewComponentID(typeStr)), GRPCClientSettings: configgrpc.GRPCClientSettings{ Endpoint: endpoint, - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: false, }, }, @@ -147,7 +147,7 @@ func TestCreateTracesExporter(t *testing.T) { ExporterSettings: config.NewExporterSettings(config.NewComponentID(typeStr)), GRPCClientSettings: configgrpc.GRPCClientSettings{ Endpoint: endpoint, - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "testdata/test_cert.pem", }, @@ -161,7 +161,7 @@ func TestCreateTracesExporter(t *testing.T) { ExporterSettings: config.NewExporterSettings(config.NewComponentID(typeStr)), GRPCClientSettings: configgrpc.GRPCClientSettings{ Endpoint: endpoint, - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "nosuchfile", }, diff --git a/exporter/otlpexporter/otlp_test.go b/exporter/otlpexporter/otlp_test.go index b5ccd9d1205..64c7c8f4632 100644 --- a/exporter/otlpexporter/otlp_test.go +++ b/exporter/otlpexporter/otlp_test.go @@ -195,7 +195,7 @@ func TestSendTraces(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.GRPCClientSettings = configgrpc.GRPCClientSettings{ Endpoint: ln.Addr().String(), - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, Headers: map[string]string{ @@ -258,19 +258,17 @@ func TestSendTracesWhenEndpointHasHttpScheme(t *testing.T) { gRPCClientSettings configgrpc.GRPCClientSettings }{ { - name: "Use https scheme", - useTLS: true, - scheme: "https://", - gRPCClientSettings: configgrpc.GRPCClientSettings{ - TLSSetting: &configtls.TLSClientSetting{}, - }, + name: "Use https scheme", + useTLS: true, + scheme: "https://", + gRPCClientSettings: configgrpc.GRPCClientSettings{}, }, { name: "Use http scheme", useTLS: false, scheme: "http://", gRPCClientSettings: configgrpc.GRPCClientSettings{ - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, }, @@ -338,7 +336,7 @@ func TestSendMetrics(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.GRPCClientSettings = configgrpc.GRPCClientSettings{ Endpoint: ln.Addr().String(), - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, Headers: map[string]string{ @@ -406,7 +404,7 @@ func TestSendTraceDataServerDownAndUp(t *testing.T) { cfg.QueueSettings.Enabled = false cfg.GRPCClientSettings = configgrpc.GRPCClientSettings{ Endpoint: ln.Addr().String(), - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, // Need to wait for every request blocking until either request timeouts or succeed. @@ -466,7 +464,7 @@ func TestSendTraceDataServerStartWhileRequest(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.GRPCClientSettings = configgrpc.GRPCClientSettings{ Endpoint: ln.Addr().String(), - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, } @@ -542,7 +540,7 @@ func TestSendLogData(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.GRPCClientSettings = configgrpc.GRPCClientSettings{ Endpoint: ln.Addr().String(), - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: true, }, } diff --git a/exporter/otlphttpexporter/config_test.go b/exporter/otlphttpexporter/config_test.go index 9beb5e43fc3..e6866e9d7c7 100644 --- a/exporter/otlphttpexporter/config_test.go +++ b/exporter/otlphttpexporter/config_test.go @@ -66,7 +66,7 @@ func TestLoadConfig(t *testing.T) { "another": "somevalue", }, Endpoint: "https://1.2.3.4:1234", - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "/var/lib/mycert.pem", CertFile: "certfile", diff --git a/exporter/otlphttpexporter/factory_test.go b/exporter/otlphttpexporter/factory_test.go index 9039b8a4a0c..ecee2c9f92d 100644 --- a/exporter/otlphttpexporter/factory_test.go +++ b/exporter/otlphttpexporter/factory_test.go @@ -82,7 +82,7 @@ func TestCreateTracesExporter(t *testing.T) { ExporterSettings: config.NewExporterSettings(config.NewComponentID(typeStr)), HTTPClientSettings: confighttp.HTTPClientSettings{ Endpoint: endpoint, - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ Insecure: false, }, }, @@ -107,7 +107,7 @@ func TestCreateTracesExporter(t *testing.T) { ExporterSettings: config.NewExporterSettings(config.NewComponentID(typeStr)), HTTPClientSettings: confighttp.HTTPClientSettings{ Endpoint: endpoint, - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "testdata/test_cert.pem", }, @@ -121,7 +121,7 @@ func TestCreateTracesExporter(t *testing.T) { ExporterSettings: config.NewExporterSettings(config.NewComponentID(typeStr)), HTTPClientSettings: confighttp.HTTPClientSettings{ Endpoint: endpoint, - TLSSetting: &configtls.TLSClientSetting{ + TLSSetting: configtls.TLSClientSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "nosuchfile", }, From 9a77f1bf578f168c7a22af125100dcd3be548843 Mon Sep 17 00:00:00 2001 From: Cal Loomis <68860480+loomis-relativity@users.noreply.github.com> Date: Wed, 13 Oct 2021 16:50:31 -0500 Subject: [PATCH 063/149] Generate custom service code for Windows (#75) * update main to include windows service code * use main version from tag 0.35.0 * update main function * align with upstream v0.36.0 tag * dummy change to trigger build * Revert "dummy change to trigger build" This reverts commit 629d499461da2d2c240bf1e495b5fe0558e3547f. --- internal/builder/main.go | 8 +++ internal/scaffold/main.go | 106 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 111 insertions(+), 3 deletions(-) diff --git a/internal/builder/main.go b/internal/builder/main.go index 8a8ca6c012d..8cc9c9f784c 100644 --- a/internal/builder/main.go +++ b/internal/builder/main.go @@ -69,6 +69,14 @@ func Generate(cfg Config) error { "main.go", scaffold.Main, }, + { + "main_others.go", + scaffold.MainOthers, + }, + { + "main_windows.go", + scaffold.MainWindows, + }, // components.go { "components.go", diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index ddf60f52bbf..2002b0eca82 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -35,6 +35,7 @@ const Main = ` package main import ( + "fmt" "log" "go.opentelemetry.io/collector/component" @@ -53,14 +54,113 @@ func main() { Version: "{{ .Distribution.Version }}", } - app, err := service.New(service.CollectorSettings{BuildInfo: info, Factories: factories}) + if err := run(service.CollectorSettings{BuildInfo: info, Factories: factories}); err != nil { + log.Fatal(err) + } +} + +func runInteractive(params service.CollectorSettings) error { + app, err := service.New(params) if err != nil { - log.Fatalf("failed to construct the application: %v", err) + return fmt.Errorf("failed to construct the collector server: %w", err) } cmd := service.NewCommand(app) if err = cmd.Execute(); err != nil { - log.Fatalf("application run finished with error: %v", err) + 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 a9f80859e3724e144d341a02775364a2b3d80038 Mon Sep 17 00:00:00 2001 From: "Y.Horie" Date: Thu, 14 Oct 2021 23:43:59 +0900 Subject: [PATCH 064/149] Remove Core from Module type (#77) Fixes #15 Signed-off-by: yugo-horie --- internal/builder/config.go | 11 +++++++-- internal/builder/config_test.go | 40 ++++++++++++++++++++++++++++----- test/nocore.builder.yaml | 6 ++--- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/internal/builder/config.go b/internal/builder/config.go index fa253e8822a..b771871dd3d 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -32,6 +32,9 @@ const defaultOtelColVersion = "0.36.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") +// ErrDeprecatedCore indicates deprecated core +var ErrDeprecatedCore = errors.New("mod.Core has deprecated, you should not be used anymore and required to be set mod.GoMod instead") + // Config holds the builder's configuration type Config struct { Logger logr.Logger @@ -64,7 +67,8 @@ type Module struct { Import string `mapstructure:"import"` // if not specified, this is the path part of the go mods GoMod string `mapstructure:"gomod"` // a gomod-compatible spec for the module Path string `mapstructure:"path"` // an optional path to the local version of this module - Core bool `mapstructure:"core"` // whether this module comes from core, meaning that no further dependencies will be added + Core *bool `mapstructure:"core"` // whether this module comes from core. For this property isn't referred from anywhere, it might be removed. please see #15. + } // DefaultConfig creates a new config, with default values @@ -134,7 +138,10 @@ func (c *Config) ParseModules() error { func parseModules(mods []Module) ([]Module, error) { var parsedModules []Module for _, mod := range mods { - if mod.GoMod == "" && !mod.Core { + if mod.Core != nil { + return mods, ErrDeprecatedCore + } + if mod.GoMod == "" { return mods, fmt.Errorf("%w, module: %q", ErrInvalidGoMod, mod.GoMod) } diff --git a/internal/builder/config_test.go b/internal/builder/config_test.go index 08fab22c821..0b3cd9ba7ef 100644 --- a/internal/builder/config_test.go +++ b/internal/builder/config_test.go @@ -65,10 +65,17 @@ func TestRelativePath(t *testing.T) { func TestModuleFromCore(t *testing.T) { // prepare cfg := Config{ - Extensions: []Module{{ - Core: true, - Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - }}, + Extensions: []Module{ // see issue-12 + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + GoMod: "go.opentelemetry.io/collector v0.36.0", + }, + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + GoMod: "go.opentelemetry.io/collector v0.36.0", + Core: nil, + }, + }, } // test @@ -77,7 +84,30 @@ func TestModuleFromCore(t *testing.T) { // verify assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "jaegerreceiver")) - assert.Empty(t, cfg.Extensions[0].GoMod) +} + +func TestDeprecatedCore(t *testing.T) { + // prepare + coreTrue := true + coreFalse := false + cfg := Config{ + Extensions: []Module{ + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + Core: &coreTrue, + }, + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + Core: &coreFalse, + }, + }, + } + + // test + err := cfg.ParseModules() + + // verify + assert.True(t, errors.Is(err, ErrDeprecatedCore)) } func TestInvalidModule(t *testing.T) { diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 49dec4b2002..8cee42670dc 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -5,10 +5,10 @@ dist: receivers: - import: go.opentelemetry.io/collector/receiver/otlpreceiver - core: true + gomod: go.opentelemetry.io/collector v0.36.0 exporters: - import: go.opentelemetry.io/collector/exporter/loggingexporter - core: true + gomod: go.opentelemetry.io/collector v0.36.0 extensions: - import: go.opentelemetry.io/collector/extension/zpagesextension - core: true + gomod: go.opentelemetry.io/collector v0.36.0 From e3470e77649d60a8f935497485193e5153c2db7f Mon Sep 17 00:00:00 2001 From: alrex Date: Fri, 15 Oct 2021 08:53:07 -0700 Subject: [PATCH 065/149] release 0.37.0 (#78) * release 0.37.0 * update use of NewCommand --- README.md | 8 ++++---- internal/builder/config.go | 2 +- internal/builder/config_test.go | 4 ++-- internal/scaffold/main.go | 10 ++-------- test/nocore.builder.yaml | 8 ++++---- test/replaces.builder.yaml | 8 ++++---- 6 files changed, 17 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index c991a5abca4..c13c5b020a2 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given $ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.36.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.37.0 ``` diff --git a/internal/builder/config.go b/internal/builder/config.go index b771871dd3d..059fea92f92 100644 --- a/internal/builder/config.go +++ b/internal/builder/config.go @@ -27,7 +27,7 @@ import ( "go.uber.org/zap" ) -const defaultOtelColVersion = "0.36.0" +const defaultOtelColVersion = "0.37.0" // ErrInvalidGoMod indicates an invalid gomod var ErrInvalidGoMod = errors.New("invalid gomod specification for module") diff --git a/internal/builder/config_test.go b/internal/builder/config_test.go index 0b3cd9ba7ef..1528ae30d28 100644 --- a/internal/builder/config_test.go +++ b/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/jaegerreceiver", - GoMod: "go.opentelemetry.io/collector v0.36.0", + GoMod: "go.opentelemetry.io/collector v0.37.0", }, { Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - GoMod: "go.opentelemetry.io/collector v0.36.0", + GoMod: "go.opentelemetry.io/collector v0.37.0", Core: nil, }, }, diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index 2002b0eca82..3fbaed58963 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -35,7 +35,6 @@ const Main = ` package main import ( - "fmt" "log" "go.opentelemetry.io/collector/component" @@ -60,13 +59,8 @@ func main() { } func runInteractive(params service.CollectorSettings) error { - app, err := service.New(params) - if err != nil { - return fmt.Errorf("failed to construct the collector server: %w", err) - } - - cmd := service.NewCommand(app) - if err = cmd.Execute(); err != nil { + cmd := service.NewCommand(params) + if err := cmd.Execute(); err != nil { log.Fatalf("collector server run finished with error: %v", err) } diff --git a/test/nocore.builder.yaml b/test/nocore.builder.yaml index 8cee42670dc..abebfad3d7c 100644 --- a/test/nocore.builder.yaml +++ b/test/nocore.builder.yaml @@ -1,14 +1,14 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.36.0 + otelcol_version: 0.37.0 include_core: false receivers: - import: go.opentelemetry.io/collector/receiver/otlpreceiver - gomod: go.opentelemetry.io/collector v0.36.0 + gomod: go.opentelemetry.io/collector v0.37.0 exporters: - import: go.opentelemetry.io/collector/exporter/loggingexporter - gomod: go.opentelemetry.io/collector v0.36.0 + gomod: go.opentelemetry.io/collector v0.37.0 extensions: - import: go.opentelemetry.io/collector/extension/zpagesextension - gomod: go.opentelemetry.io/collector v0.36.0 + gomod: go.opentelemetry.io/collector v0.37.0 diff --git a/test/replaces.builder.yaml b/test/replaces.builder.yaml index 939912e2730..aead637b646 100644 --- a/test/replaces.builder.yaml +++ b/test/replaces.builder.yaml @@ -1,10 +1,10 @@ dist: module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.36.0 + otelcol_version: 0.37.0 processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.36.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.36.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.37.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.37.0 replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.36.0 + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.37.0 From bd87fb628058c78bdfbc61c0cbda41ffca410c96 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 15 Oct 2021 16:38:22 -0700 Subject: [PATCH 066/149] Change scraperhelper to follow the recommended append model for pdata (#4202) Signed-off-by: Bogdan Drutu --- receiver/scraperhelper/scraper.go | 135 ++++-------------- receiver/scraperhelper/scrapercontroller.go | 12 +- .../scraperhelper/scrapercontroller_test.go | 120 +++------------- 3 files changed, 58 insertions(+), 209 deletions(-) diff --git a/receiver/scraperhelper/scraper.go b/receiver/scraperhelper/scraper.go index 152ca3edef3..cbe793124e6 100644 --- a/receiver/scraperhelper/scraper.go +++ b/receiver/scraperhelper/scraper.go @@ -16,45 +16,38 @@ package scraperhelper // import "go.opentelemetry.io/collector/receiver/scraperh import ( "context" + "errors" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenthelper" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/model/pdata" - "go.opentelemetry.io/collector/obsreport" - "go.opentelemetry.io/collector/receiver/scrapererror" ) -// ScrapeMetrics scrapes metrics. -type ScrapeMetrics func(context.Context) (pdata.MetricSlice, error) +var errNilFunc = errors.New("nil scrape func") -// ScrapeResourceMetrics scrapes resource metrics. -type ScrapeResourceMetrics func(context.Context) (pdata.ResourceMetricsSlice, error) +// ScrapeFunc scrapes metrics. +type ScrapeFunc func(context.Context) (pdata.Metrics, error) -type baseSettings struct { - componentOptions []componenthelper.Option +func (sf ScrapeFunc) Scrape(ctx context.Context) (pdata.Metrics, error) { + return sf(ctx) } -// ScraperOption apply changes to internal options. -type ScraperOption func(*baseSettings) - // Scraper is the base interface for scrapers. type Scraper interface { component.Component // ID returns the scraper id. ID() config.ComponentID - Scrape(context.Context, config.ComponentID, component.ReceiverCreateSettings) (pdata.Metrics, error) + Scrape(context.Context) (pdata.Metrics, error) } -type baseScraper struct { - component.Component - id config.ComponentID +type baseSettings struct { + componentOptions []componenthelper.Option } -func (b baseScraper) ID() config.ComponentID { - return b.id -} +// ScraperOption apply changes to internal options. +type ScraperOption func(*baseSettings) // WithStart sets the function that will be called on startup. func WithStart(start componenthelper.StartFunc) ScraperOption { @@ -70,104 +63,34 @@ func WithShutdown(shutdown componenthelper.ShutdownFunc) ScraperOption { } } -type metricsScraper struct { - baseScraper - ScrapeMetrics -} - -var _ Scraper = (*metricsScraper)(nil) - -// NewMetricsScraper creates a Scraper that calls Scrape at the specified -// collection interval, reports observability information, and passes the -// scraped metrics to the next consumer. -func NewMetricsScraper( - name string, - scrape ScrapeMetrics, - options ...ScraperOption, -) Scraper { - set := &baseSettings{} - for _, op := range options { - op(set) - } - - ms := &metricsScraper{ - baseScraper: baseScraper{ - Component: componenthelper.New(set.componentOptions...), - id: config.NewComponentID(config.Type(name)), - }, - ScrapeMetrics: scrape, - } +var _ Scraper = (*baseScraper)(nil) - return ms -} - -func (ms metricsScraper) Scrape(ctx context.Context, receiverID config.ComponentID, set component.ReceiverCreateSettings) (pdata.Metrics, error) { - scrp := obsreport.NewScraper(obsreport.ScraperSettings{ - ReceiverID: receiverID, - Scraper: ms.ID(), - ReceiverCreateSettings: set, - }) - ctx = scrp.StartMetricsOp(ctx) - metrics, err := ms.ScrapeMetrics(ctx) - count := 0 - md := pdata.Metrics{} - if err == nil || scrapererror.IsPartialScrapeError(err) { - md = pdata.NewMetrics() - metrics.MoveAndAppendTo(md.ResourceMetrics().AppendEmpty().InstrumentationLibraryMetrics().AppendEmpty().Metrics()) - count = md.MetricCount() - } - scrp.EndMetricsOp(ctx, count, err) - return md, err +type baseScraper struct { + component.Component + ScrapeFunc + id config.ComponentID } -type resourceMetricsScraper struct { - baseScraper - ScrapeResourceMetrics +func (b *baseScraper) ID() config.ComponentID { + return b.id } -var _ Scraper = (*resourceMetricsScraper)(nil) - -// NewResourceMetricsScraper creates a Scraper that calls Scrape at the -// specified collection interval, reports observability information, and -// passes the scraped resource metrics to the next consumer. -func NewResourceMetricsScraper( - id config.ComponentID, - scrape ScrapeResourceMetrics, - options ...ScraperOption, -) Scraper { +// NewScraper creates a Scraper that calls Scrape at the specified collection interval, +// reports observability information, and passes the scraped metrics to the next consumer. +func NewScraper(name string, scrape ScrapeFunc, options ...ScraperOption) (Scraper, error) { + if scrape == nil { + return nil, errNilFunc + } set := &baseSettings{} for _, op := range options { op(set) } - rms := &resourceMetricsScraper{ - baseScraper: baseScraper{ - Component: componenthelper.New(set.componentOptions...), - id: id, - }, - ScrapeResourceMetrics: scrape, - } - - return rms -} - -func (rms resourceMetricsScraper) Scrape(ctx context.Context, receiverID config.ComponentID, set component.ReceiverCreateSettings) (pdata.Metrics, error) { - scrp := obsreport.NewScraper(obsreport.ScraperSettings{ - ReceiverID: receiverID, - Scraper: rms.ID(), - ReceiverCreateSettings: set, - }) - ctx = scrp.StartMetricsOp(ctx) - resourceMetrics, err := rms.ScrapeResourceMetrics(ctx) - - count := 0 - md := pdata.Metrics{} - if err == nil || scrapererror.IsPartialScrapeError(err) { - md = pdata.NewMetrics() - resourceMetrics.MoveAndAppendTo(md.ResourceMetrics()) - count = md.MetricCount() + ms := &baseScraper{ + Component: componenthelper.New(set.componentOptions...), + ScrapeFunc: scrape, + id: config.NewComponentID(config.Type(name)), } - scrp.EndMetricsOp(ctx, count, err) - return md, err + return ms, nil } diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index 3046cc2cea7..24454070e18 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -186,14 +186,22 @@ func (sc *controller) scrapeMetricsAndReport(ctx context.Context) { metrics := pdata.NewMetrics() for _, scraper := range sc.scrapers { - md, err := scraper.Scrape(ctx, sc.id, sc.recvSettings) + scrp := obsreport.NewScraper(obsreport.ScraperSettings{ + ReceiverID: sc.id, + Scraper: scraper.ID(), + ReceiverCreateSettings: sc.recvSettings, + }) + ctx = scrp.StartMetricsOp(ctx) + md, err := scraper.Scrape(ctx) + if err != nil { sc.logger.Error("Error scraping metrics", zap.Error(err), zap.Stringer("scraper", scraper.ID())) - if !scrapererror.IsPartialScrapeError(err) { + scrp.EndMetricsOp(ctx, 0, err) continue } } + scrp.EndMetricsOp(ctx, md.MetricCount(), err) md.ResourceMetrics().MoveAndAppendTo(metrics.ResourceMetrics()) } diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index 1e26a6e3439..ecf8dc47d34 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -62,39 +62,25 @@ type testScrapeMetrics struct { err error } -func (ts *testScrapeMetrics) scrape(_ context.Context) (pdata.MetricSlice, error) { +func (ts *testScrapeMetrics) scrape(_ context.Context) (pdata.Metrics, error) { ts.timesScrapeCalled++ ts.ch <- ts.timesScrapeCalled if ts.err != nil { - return pdata.MetricSlice{}, ts.err + return pdata.Metrics{}, ts.err } - return singleMetric(), nil -} - -type testScrapeResourceMetrics struct { - ch chan int - timesScrapeCalled int - err error -} - -func (ts *testScrapeResourceMetrics) scrape(_ context.Context) (pdata.ResourceMetricsSlice, error) { - ts.timesScrapeCalled++ - ts.ch <- ts.timesScrapeCalled - - if ts.err != nil { - return pdata.ResourceMetricsSlice{}, ts.err - } - - return singleResourceMetric(), nil + md := pdata.NewMetrics() + metric := md.ResourceMetrics().AppendEmpty().InstrumentationLibraryMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetDataType(pdata.MetricDataTypeGauge) + metric.Gauge().DataPoints().AppendEmpty() + return md, nil } type metricsTestCase struct { name string scrapers int - resourceScrapers int scraperControllerSettings *ScraperControllerSettings nilNextConsumer bool scrapeErr error @@ -148,36 +134,6 @@ func TestScrapeController(t *testing.T) { initializeErr: errors.New("err1"), closeErr: errors.New("err2"), }, - { - name: "AddResourceMetricsScrapersWithCollectionInterval", - resourceScrapers: 2, - expectScraped: true, - }, - { - name: "AddResourceMetricsScrapers_NewError", - resourceScrapers: 2, - nilNextConsumer: true, - expectedNewErr: "nil nextConsumer", - }, - { - name: "AddResourceMetricsScrapers_ScrapeError", - resourceScrapers: 2, - scrapeErr: errors.New("err1"), - }, - { - name: "AddResourceMetricsScrapersWithInitializeAndClose", - resourceScrapers: 2, - initialize: true, - close: true, - }, - { - name: "AddResourceMetricsScrapersWithInitializeAndCloseErrors", - resourceScrapers: 2, - initialize: true, - close: true, - initializeErr: errors.New("err1"), - closeErr: errors.New("err2"), - }, } for _, test := range testCases { @@ -186,11 +142,10 @@ func TestScrapeController(t *testing.T) { require.NoError(t, err) defer set.Shutdown(context.Background()) - initializeChs := make([]chan bool, test.scrapers+test.resourceScrapers) + initializeChs := make([]chan bool, test.scrapers) scrapeMetricsChs := make([]chan int, test.scrapers) - scrapeResourceMetricsChs := make([]chan int, test.resourceScrapers) - closeChs := make([]chan bool, test.scrapers+test.resourceScrapers) - options := configureMetricOptions(test, initializeChs, scrapeMetricsChs, scrapeResourceMetricsChs, closeChs) + closeChs := make([]chan bool, test.scrapers) + options := configureMetricOptions(t, test, initializeChs, scrapeMetricsChs, closeChs) tickerCh := make(chan time.Time) options = append(options, WithTickerChannel(tickerCh)) @@ -231,15 +186,12 @@ func TestScrapeController(t *testing.T) { for _, ch := range scrapeMetricsChs { <-ch } - for _, ch := range scrapeResourceMetricsChs { - <-ch - } } // wait until all calls to scrape have completed if test.scrapeErr == nil { require.Eventually(t, func() bool { - return sink.DataPointCount() == iterations*(test.scrapers+test.resourceScrapers) + return sink.DataPointCount() == iterations*(test.scrapers) }, time.Second, time.Millisecond) } @@ -265,7 +217,7 @@ func TestScrapeController(t *testing.T) { } } -func configureMetricOptions(test metricsTestCase, initializeChs []chan bool, scrapeMetricsChs, testScrapeResourceMetricsChs []chan int, closeChs []chan bool) []ScraperControllerOption { +func configureMetricOptions(t *testing.T, test metricsTestCase, initializeChs []chan bool, scrapeMetricsChs []chan int, closeChs []chan bool) []ScraperControllerOption { var metricOptions []ScraperControllerOption for i := 0; i < test.scrapers; i++ { @@ -283,25 +235,10 @@ func configureMetricOptions(test metricsTestCase, initializeChs []chan bool, scr scrapeMetricsChs[i] = make(chan int) tsm := &testScrapeMetrics{ch: scrapeMetricsChs[i], err: test.scrapeErr} - metricOptions = append(metricOptions, AddScraper(NewMetricsScraper("scraper", tsm.scrape, scraperOptions...))) - } - - for i := 0; i < test.resourceScrapers; i++ { - var scraperOptions []ScraperOption - if test.initialize { - initializeChs[test.scrapers+i] = make(chan bool, 1) - ti := &testInitialize{ch: initializeChs[test.scrapers+i], err: test.initializeErr} - scraperOptions = append(scraperOptions, WithStart(ti.start)) - } - if test.close { - closeChs[test.scrapers+i] = make(chan bool, 1) - tc := &testClose{ch: closeChs[test.scrapers+i], err: test.closeErr} - scraperOptions = append(scraperOptions, WithShutdown(tc.shutdown)) - } + scp, err := NewScraper("scraper", tsm.scrape, scraperOptions...) + assert.NoError(t, err) - testScrapeResourceMetricsChs[i] = make(chan int) - tsrm := &testScrapeResourceMetrics{ch: testScrapeResourceMetricsChs[i], err: test.scrapeErr} - metricOptions = append(metricOptions, AddScraper(NewResourceMetricsScraper(config.NewComponentID("scraper"), tsrm.scrape, scraperOptions...))) + metricOptions = append(metricOptions, AddScraper(scp)) } return metricOptions @@ -391,39 +328,23 @@ func assertScraperViews(t *testing.T, expectedErr error, sink *consumertest.Metr require.NoError(t, obsreporttest.CheckScraperMetrics(config.NewComponentID("receiver"), config.NewComponentID("scraper"), expectedScraped, expectedErrored)) } -func singleMetric() pdata.MetricSlice { - metrics := pdata.NewMetricSlice() - metric := metrics.AppendEmpty() - metric.SetDataType(pdata.MetricDataTypeGauge) - metric.Gauge().DataPoints().AppendEmpty() - return metrics -} - -func singleResourceMetric() pdata.ResourceMetricsSlice { - rms := pdata.NewResourceMetricsSlice() - ilm := rms.AppendEmpty().InstrumentationLibraryMetrics().AppendEmpty() - singleMetric().MoveAndAppendTo(ilm.Metrics()) - return rms -} - func TestSingleScrapePerTick(t *testing.T) { scrapeMetricsCh := make(chan int, 10) tsm := &testScrapeMetrics{ch: scrapeMetricsCh} - scrapeResourceMetricsCh := make(chan int, 10) - tsrm := &testScrapeResourceMetrics{ch: scrapeResourceMetricsCh} - defaultCfg := DefaultScraperControllerSettings("") cfg := &defaultCfg tickerCh := make(chan time.Time) + scp, err := NewScraper("", tsm.scrape) + assert.NoError(t, err) + receiver, err := NewScraperControllerReceiver( cfg, componenttest.NewNopReceiverCreateSettings(), new(consumertest.MetricsSink), - AddScraper(NewMetricsScraper("", tsm.scrape)), - AddScraper(NewResourceMetricsScraper(config.NewComponentID("scraper"), tsrm.scrape)), + AddScraper(scp), WithTickerChannel(tickerCh), ) require.NoError(t, err) @@ -433,13 +354,10 @@ func TestSingleScrapePerTick(t *testing.T) { tickerCh <- time.Now() assert.Equal(t, 1, <-scrapeMetricsCh) - assert.Equal(t, 1, <-scrapeResourceMetricsCh) select { case <-scrapeMetricsCh: assert.Fail(t, "Scrape was called more than once") - case <-scrapeResourceMetricsCh: - assert.Fail(t, "Scrape was called more than once") case <-time.After(100 * time.Millisecond): return } From 92eb2c567d298bae7d05aa47278f5eb400adfa80 Mon Sep 17 00:00:00 2001 From: alrex Date: Sat, 16 Oct 2021 17:25:29 -0700 Subject: [PATCH 067/149] updating release documentation (#4203) --- docs/release.md | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/docs/release.md b/docs/release.md index 6e1ce3e4995..191c359a7ea 100644 --- a/docs/release.md +++ b/docs/release.md @@ -2,13 +2,17 @@ Collector build and testing is currently fully automated. However there are still certain operations that need to be performed manually in order to make a release. -We release both core and contrib collectors with the same versions where the contrib release uses the core release as a dependency. We’ve divided this process into two sections. A release engineer must first release the Core collector and then the Contrib collector. +We release both core and contrib collectors with the same versions where the contrib release uses the core release as a dependency. We’ve divided this process into four sections. A release engineer must release: +1. The [Core](#releasing-opentelemetry-collector) collector. +1. The [Contrib](#releasing-opentelemetry-collector-contrib) collector. +1. The collector [Builder](#releasing-opentelemetry-collector-builder). +1. The [artifacts](#producing-the-artifacts) -Important: Note that you’ll need to be able to sign git commits/tags in order to be able to release a collector version. Follow [this guide](https://docs.github.com/en/github/authenticating-to-github/signing-commits) to setup it up. +**Important Note:** You’ll need to be able to sign git commits/tags in order to be able to release a collector version. Follow [this guide](https://docs.github.com/en/github/authenticating-to-github/signing-commits) to setup it up. -Note: You’ll need to be an approver for both the repos in order to be able to make the release. This is required as you’ll need to push tags and commits directly to the upstream repo. +**Important Note:** You’ll need to be an approver for both the repos in order to be able to make the release. This is required as you’ll need to push tags and commits directly to the upstream repo. -## Releasing OpenTelemetry Core +## Releasing opentelemetry-collector 1. Update Contrib to use the latest in development version of Core. Run `make update-otel` in Contrib root directory and if it results in any changes, submit a PR. Get the PR approved and merged. This is to ensure that the latest core does not break contrib in any way. We’ll update it once more to the final release number later. Make sure contrib builds and end-to-end tests pass successfully after being merged and -dev docker images are published. @@ -22,11 +26,11 @@ Note: You’ll need to be an approver for both the repos in order to be able to 1. Create a branch named release/ (e.g. release/v0.4.x) in Core from the changelog update commit and push to origin (not your fork). Wait for the release branch builds to pass successfully. -1. Tag all the modules with the new release version by running the `make add-tag` command (e.g. `make add-tag TAG=v0.4.0`). Push them to origin (not your fork) with `git push --tags origin` (assuming origin refers to upstream open-telemetry project). Wait for the new tag build to pass successfully. This build will push new docker images to https://hub.docker.com/repository/docker/otel/opentelemetry-collector, create a Github release for the tag and push all the build artifacts to the Github release. +1. Tag all the modules with the new release version by running the `make add-tag` command (e.g. `make add-tag TAG=v0.4.0`). Push them to origin (not your fork) with `git push --tags origin` (assuming origin refers to upstream open-telemetry project). Wait for the new tag build to pass successfully. -1. Edit the newly auto-created Github release and copy release notes from the CHANGELOG.md file to the release. This step should be automated. CI can pull the release notes from the change log and use it as the body when creating the new release. +1. Create a new Github release from the new version tag and copy release notes from the CHANGELOG.md file to the release. This step should be automated. CI can pull the release notes from the change log and use it as the body when creating the new release. -## Releasing OpenTelemetry Contrib +## Releasing opentelemetry-collector-contrib 1. Prepare Contrib for release. Update CHANGELOG.md file and rename the Unreleased section to the new release name. Add a new unreleased section at top. Refer to Core release notes (assuming the previous release of Core and Contrib was also performed simultaneously), and in addition to that list changes that happened in the Contrib repo. @@ -34,6 +38,26 @@ Note: You’ll need to be an approver for both the repos in order to be able to 1. Create a branch named release/ (e.g. release/v0.4.x) in Core from the changelog update commit and push to origin (not your fork). Wait for the release branch builds to pass successfully. -1. Tag all the modules with the new release version by running the `make add-tag` command (e.g. `make add-tag TAG=v0.4.0`). Push them to origin (not your fork) with `git push --tags origin` (assuming origin refers to upstream open-telemetry project). Wait for the new tag build to pass successfully. This build will push new docker images to https://hub.docker.com/repository/docker/otel/opentelemetry-collector-contrib, create a Github release for the tag and push all the build artifacts to the Github release. +1. Tag all the modules with the new release version by running the `make add-tag` command (e.g. `make add-tag TAG=v0.4.0`). Push them to origin (not your fork) with `git push --tags origin` (assuming origin refers to upstream open-telemetry project). -1. Edit the newly auto-created Github release and copy release notes from the CHANGELOG.md file to the release. This step should be automated. CI can pull the release notes from the change log and use it as the body when creating the new release. +1. Create a new Github release from the new version tag and copy release notes from the CHANGELOG.md file to the release. This step should be automated. CI can pull the release notes from the change log and use it as the body when creating the new release. + +## Releasing opentelemetry-collector-builder + +The collector release process uses the `opentelemetry-collector-builder` to produce the artifacts of the collector. This may require that the `opentelemetry-collector-builder` be updated to support new features. If so, follow these steps using the [opentelemetry-collector-builder](https://github.com/open-telemetry/opentelemetry-collector-builder) repo: + +1. Update the collector version to the new release in `./internal/builder/config.go` + +1. Create a pull request with the change and ensure the build completes successfully. + +## Producing the artifacts + +The last step of the release process creates artifacts for the new version of the collector and publishes images to Dockerhub. The steps in this portion of the release are done in the [opentelemetry-collector-releases](https://github.com/open-telemetry/opentelemetry-collector-releases) repo. + +1. Update `./distribution/otelcol/manifest.yaml` to include the new release version. + +1. If a new version of the builder has been created, update the builder version in `OTELCOL_BUILDER_VERSION` to the new release in the `Makefile`. + +1. Create a pull request with the change and ensure the build completes successfully. See [example](https://github.com/open-telemetry/opentelemetry-collector-releases/pull/17/files). + +1. Ensure the "Release" action passes, this will push new docker images to https://hub.docker.com/repository/docker/otel/opentelemetry-collector-contrib, create a Github release for the tag and push all the build artifacts to the Github release. See [example](https://github.com/open-telemetry/opentelemetry-collector-releases/actions/runs/1346637081). From d0a09e8b7a6dc66102fc97259ab1125b46f91270 Mon Sep 17 00:00:00 2001 From: alrex Date: Mon, 18 Oct 2021 09:46:21 -0700 Subject: [PATCH 068/149] update proto to 0.11.0 (#4209) --- .../data/protogen/common/v1/common.pb.go | 2 +- .../internal/data/protogen/logs/v1/logs.pb.go | 315 ++- .../data/protogen/metrics/v1/metrics.pb.go | 1756 +++++++++++++++-- .../data/protogen/trace/v1/trace.pb.go | 379 +++- model/internal/opentelemetry-proto | 2 +- 5 files changed, 2130 insertions(+), 324 deletions(-) diff --git a/model/internal/data/protogen/common/v1/common.pb.go b/model/internal/data/protogen/common/v1/common.pb.go index fa35ea506ad..ea7556accb7 100644 --- a/model/internal/data/protogen/common/v1/common.pb.go +++ b/model/internal/data/protogen/common/v1/common.pb.go @@ -30,7 +30,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // object containing arrays, key-value lists and primitives. type AnyValue struct { // The value is one of the listed fields. It is valid for all values to be unspecified - // in which case this AnyValue is considered to be "null". + // in which case this AnyValue is considered to be "empty". // // Types that are valid to be assigned to Value: // *AnyValue_StringValue diff --git a/model/internal/data/protogen/logs/v1/logs.pb.go b/model/internal/data/protogen/logs/v1/logs.pb.go index 2d234ad95ab..719a15581f1 100644 --- a/model/internal/data/protogen/logs/v1/logs.pb.go +++ b/model/internal/data/protogen/logs/v1/logs.pb.go @@ -151,6 +151,65 @@ func (LogRecordFlags) EnumDescriptor() ([]byte, []int) { return fileDescriptor_d1c030a3ec7e961e, []int{1} } +// LogsData represents the logs data that can be stored in a persistent storage, +// OR can be embedded by other protocols that transfer OTLP logs data but do not +// implement the OTLP protocol. +// +// The main difference between this message and collector protocol is that +// in this message there will not be any "control" or "metadata" specific to +// OTLP protocol. +// +// When new fields are added into this message, the OTLP request MUST be updated +// as well. +type LogsData struct { + // An array of ResourceLogs. + // For data coming from a single resource this array will typically contain + // one element. Intermediary nodes that receive data from multiple origins + // typically batch the data before forwarding further and in that case this + // array will contain multiple elements. + ResourceLogs []*ResourceLogs `protobuf:"bytes,1,rep,name=resource_logs,json=resourceLogs,proto3" json:"resource_logs,omitempty"` +} + +func (m *LogsData) Reset() { *m = LogsData{} } +func (m *LogsData) String() string { return proto.CompactTextString(m) } +func (*LogsData) ProtoMessage() {} +func (*LogsData) Descriptor() ([]byte, []int) { + return fileDescriptor_d1c030a3ec7e961e, []int{0} +} +func (m *LogsData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LogsData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LogsData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LogsData) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogsData.Merge(m, src) +} +func (m *LogsData) XXX_Size() int { + return m.Size() +} +func (m *LogsData) XXX_DiscardUnknown() { + xxx_messageInfo_LogsData.DiscardUnknown(m) +} + +var xxx_messageInfo_LogsData proto.InternalMessageInfo + +func (m *LogsData) GetResourceLogs() []*ResourceLogs { + if m != nil { + return m.ResourceLogs + } + return nil +} + // A collection of InstrumentationLibraryLogs from a Resource. type ResourceLogs struct { // The resource for the logs in this message. @@ -168,7 +227,7 @@ func (m *ResourceLogs) Reset() { *m = ResourceLogs{} } func (m *ResourceLogs) String() string { return proto.CompactTextString(m) } func (*ResourceLogs) ProtoMessage() {} func (*ResourceLogs) Descriptor() ([]byte, []int) { - return fileDescriptor_d1c030a3ec7e961e, []int{0} + return fileDescriptor_d1c030a3ec7e961e, []int{1} } func (m *ResourceLogs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -234,7 +293,7 @@ func (m *InstrumentationLibraryLogs) Reset() { *m = InstrumentationLibra func (m *InstrumentationLibraryLogs) String() string { return proto.CompactTextString(m) } func (*InstrumentationLibraryLogs) ProtoMessage() {} func (*InstrumentationLibraryLogs) Descriptor() ([]byte, []int) { - return fileDescriptor_d1c030a3ec7e961e, []int{1} + return fileDescriptor_d1c030a3ec7e961e, []int{2} } func (m *InstrumentationLibraryLogs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -330,7 +389,7 @@ func (m *LogRecord) Reset() { *m = LogRecord{} } func (m *LogRecord) String() string { return proto.CompactTextString(m) } func (*LogRecord) ProtoMessage() {} func (*LogRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_d1c030a3ec7e961e, []int{2} + return fileDescriptor_d1c030a3ec7e961e, []int{3} } func (m *LogRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -418,6 +477,7 @@ func (m *LogRecord) GetFlags() uint32 { func init() { proto.RegisterEnum("opentelemetry.proto.logs.v1.SeverityNumber", SeverityNumber_name, SeverityNumber_value) proto.RegisterEnum("opentelemetry.proto.logs.v1.LogRecordFlags", LogRecordFlags_name, LogRecordFlags_value) + proto.RegisterType((*LogsData)(nil), "opentelemetry.proto.logs.v1.LogsData") proto.RegisterType((*ResourceLogs)(nil), "opentelemetry.proto.logs.v1.ResourceLogs") proto.RegisterType((*InstrumentationLibraryLogs)(nil), "opentelemetry.proto.logs.v1.InstrumentationLibraryLogs") proto.RegisterType((*LogRecord)(nil), "opentelemetry.proto.logs.v1.LogRecord") @@ -428,62 +488,100 @@ func init() { } var fileDescriptor_d1c030a3ec7e961e = []byte{ - // 873 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0xeb, 0x36, 0x4d, 0x9a, 0x69, 0x9a, 0x1d, 0x86, 0x6e, 0xd7, 0xa4, 0x90, 0x46, 0x0b, - 0x2c, 0xa1, 0x48, 0x89, 0xea, 0x04, 0xb1, 0x70, 0xc2, 0x69, 0x9c, 0xca, 0x6a, 0x9a, 0x56, 0x93, - 0x64, 0x61, 0x11, 0x92, 0xe5, 0xc4, 0x43, 0xb0, 0x64, 0xcf, 0x44, 0xe3, 0x49, 0xd5, 0x7c, 0x04, - 0x6e, 0x7c, 0x27, 0x2e, 0x7b, 0xdc, 0x23, 0x02, 0x69, 0x85, 0xda, 0x33, 0x47, 0xce, 0x20, 0x8f, - 0x9d, 0xb0, 0x89, 0xec, 0x56, 0x7b, 0xf2, 0xf8, 0xfd, 0xde, 0xfb, 0xcf, 0x7f, 0xde, 0x8c, 0x47, - 0x06, 0xcf, 0xd8, 0x94, 0x50, 0x41, 0x3c, 0xe2, 0x13, 0xc1, 0xe7, 0xf5, 0x29, 0x67, 0x82, 0xd5, - 0x3d, 0x36, 0x09, 0xea, 0xd7, 0x27, 0xf2, 0x59, 0x93, 0x21, 0x74, 0xb8, 0x92, 0x17, 0x05, 0x6b, - 0x92, 0x5f, 0x9f, 0x94, 0xf6, 0x27, 0x6c, 0xc2, 0xa2, 0xd2, 0x70, 0x14, 0xd1, 0xd2, 0x71, 0x92, - 0xf4, 0x98, 0xf9, 0x3e, 0xa3, 0xa1, 0x78, 0x34, 0x8a, 0x73, 0x6b, 0x49, 0xb9, 0x9c, 0x04, 0x6c, - 0xc6, 0xc7, 0x24, 0xcc, 0x5e, 0x8c, 0xa3, 0xfc, 0xa7, 0xff, 0x28, 0xa0, 0x80, 0xe3, 0x50, 0x97, - 0x4d, 0x02, 0x74, 0x0e, 0x76, 0x16, 0x29, 0xaa, 0x52, 0x51, 0xaa, 0xbb, 0xda, 0xe7, 0xb5, 0x24, - 0xcb, 0x4b, 0x9d, 0xeb, 0x93, 0xda, 0x42, 0xa0, 0x95, 0x79, 0xf5, 0xe6, 0x68, 0x03, 0x2f, 0x05, - 0xd0, 0x1c, 0x7c, 0xe8, 0xd2, 0x40, 0xf0, 0x99, 0x4f, 0xa8, 0xb0, 0x85, 0xcb, 0xa8, 0xe5, 0xb9, - 0x23, 0x6e, 0xf3, 0xb9, 0x15, 0x2e, 0x59, 0xdd, 0xac, 0x6c, 0x55, 0x77, 0xb5, 0xaf, 0x6a, 0xf7, - 0xf4, 0xa4, 0x66, 0xae, 0x0a, 0x74, 0xa3, 0xfa, 0xd0, 0x2b, 0x2e, 0xb9, 0xa9, 0x0c, 0x7d, 0x04, - 0x40, 0x30, 0xfe, 0x99, 0xf8, 0xb6, 0x35, 0xe3, 0x9e, 0xba, 0x55, 0x51, 0xaa, 0x79, 0x9c, 0x8f, - 0x22, 0x43, 0xee, 0x3d, 0xfd, 0x5b, 0x01, 0xa5, 0x74, 0x65, 0x24, 0xc0, 0x93, 0x14, 0xe3, 0x71, - 0x53, 0xbe, 0x4c, 0xf4, 0x1c, 0x6f, 0x45, 0xaa, 0xeb, 0xb8, 0x41, 0x07, 0xc9, 0xbe, 0xd1, 0x37, - 0x20, 0xf3, 0x56, 0x5b, 0x9e, 0xdd, 0xdb, 0x96, 0x2e, 0x9b, 0x60, 0x32, 0x66, 0xdc, 0xc1, 0xb2, - 0xe6, 0xa1, 0xf5, 0xfe, 0x99, 0x01, 0xf9, 0x65, 0x09, 0xfa, 0x04, 0x14, 0x85, 0xeb, 0x13, 0x6b, - 0x46, 0xdd, 0x1b, 0x8b, 0xda, 0x94, 0xc9, 0x55, 0x65, 0x71, 0x21, 0x8c, 0x0e, 0xa9, 0x7b, 0xd3, - 0xb3, 0x29, 0x43, 0x03, 0xf0, 0x28, 0x20, 0xd7, 0x84, 0xbb, 0x62, 0x6e, 0xd1, 0x99, 0x3f, 0x22, - 0x5c, 0xdd, 0xac, 0x28, 0xd5, 0xa2, 0xf6, 0xc5, 0xbd, 0xce, 0xfa, 0x71, 0x4d, 0x4f, 0x96, 0xe0, - 0x62, 0xb0, 0xf2, 0x8e, 0x3e, 0x06, 0x7b, 0x4b, 0x55, 0x41, 0x6e, 0x44, 0xec, 0xb5, 0xb0, 0x08, - 0x0e, 0xc8, 0x8d, 0x40, 0x08, 0x64, 0xa8, 0xed, 0x13, 0x35, 0x23, 0x99, 0x1c, 0x23, 0x1d, 0x64, - 0x46, 0xcc, 0x99, 0xab, 0xdb, 0x72, 0x03, 0x3e, 0x7b, 0x60, 0x03, 0x74, 0x3a, 0x7f, 0x61, 0x7b, - 0xb3, 0xc5, 0x99, 0x94, 0xa5, 0xe8, 0x02, 0x00, 0x5b, 0x08, 0xee, 0x8e, 0x66, 0x82, 0x04, 0x6a, - 0x56, 0xb6, 0xf9, 0x21, 0xa1, 0x73, 0xb2, 0x22, 0xf4, 0x96, 0x00, 0x7a, 0x0e, 0x54, 0x87, 0xb3, - 0xe9, 0x94, 0x38, 0xd6, 0xff, 0x51, 0x6b, 0xcc, 0x66, 0x54, 0xa8, 0xb9, 0x8a, 0x52, 0xdd, 0xc3, - 0x07, 0x31, 0xd7, 0x97, 0xf8, 0x34, 0xa4, 0x68, 0x1f, 0x6c, 0xff, 0xe4, 0xd9, 0x93, 0x40, 0xdd, - 0xa9, 0x28, 0xd5, 0x1c, 0x8e, 0x5e, 0xd0, 0x8f, 0x60, 0x47, 0x70, 0x7b, 0x4c, 0x2c, 0xd7, 0x51, - 0xf3, 0x15, 0xa5, 0x5a, 0x68, 0xe9, 0xe1, 0x9c, 0x7f, 0xbc, 0x39, 0xfa, 0x7a, 0xc2, 0xd6, 0x6c, - 0xba, 0xe1, 0x15, 0xe0, 0x79, 0x64, 0x2c, 0x18, 0xaf, 0xfb, 0xcc, 0x21, 0x5e, 0xdd, 0xa5, 0x82, - 0x70, 0x6a, 0x7b, 0x75, 0xc7, 0x16, 0x76, 0x6d, 0x10, 0x2a, 0x99, 0x6d, 0x9c, 0x93, 0x92, 0xa6, - 0x83, 0x5e, 0x82, 0x5c, 0x30, 0xb5, 0x69, 0x28, 0x0e, 0xa4, 0xf8, 0xb7, 0xb1, 0xf8, 0xf3, 0x77, - 0x17, 0xef, 0x4f, 0x6d, 0x6a, 0xb6, 0x71, 0x36, 0x14, 0x34, 0x9d, 0xe3, 0xdf, 0xb6, 0x41, 0x71, - 0x75, 0xdb, 0xd1, 0x11, 0x38, 0xec, 0x1b, 0x2f, 0x0c, 0x6c, 0x0e, 0x5e, 0x5a, 0xbd, 0xe1, 0x45, - 0xcb, 0xc0, 0xd6, 0xb0, 0xd7, 0xbf, 0x32, 0x4e, 0xcd, 0x8e, 0x69, 0xb4, 0xe1, 0x06, 0xfa, 0x00, - 0x3c, 0x5e, 0x4f, 0x18, 0x60, 0xfd, 0xd4, 0x80, 0x0a, 0x2a, 0x81, 0x83, 0x44, 0xa4, 0xc1, 0xcd, - 0x54, 0xd6, 0x80, 0x5b, 0xa9, 0xac, 0x09, 0x33, 0x49, 0xd3, 0xb5, 0x8d, 0xd6, 0xf0, 0x0c, 0x6e, - 0x27, 0x95, 0x49, 0xa4, 0xc1, 0x6c, 0x2a, 0x6b, 0xc0, 0x5c, 0x2a, 0x6b, 0xc2, 0x1d, 0xa4, 0x82, - 0xfd, 0x75, 0x66, 0xf6, 0x3a, 0x97, 0x30, 0x9f, 0x64, 0x24, 0x24, 0x1a, 0x04, 0x69, 0xa8, 0x01, - 0x77, 0xd3, 0x50, 0x13, 0x16, 0x92, 0xa6, 0xfa, 0x4e, 0xc7, 0x3d, 0xb8, 0x97, 0x54, 0x14, 0x12, - 0x0d, 0x16, 0xd3, 0x50, 0x03, 0x3e, 0x4a, 0x43, 0x4d, 0x08, 0x93, 0x90, 0x81, 0xf1, 0x25, 0x86, - 0xef, 0x25, 0x35, 0x43, 0x22, 0x0d, 0xa2, 0x54, 0xd6, 0x80, 0xef, 0xa7, 0xb2, 0x26, 0xdc, 0x4f, - 0x9a, 0xae, 0xa3, 0x0f, 0xf4, 0x2e, 0x7c, 0x9c, 0x54, 0x26, 0x91, 0x06, 0x0f, 0x52, 0x59, 0x03, - 0x3e, 0x49, 0x65, 0x4d, 0xa8, 0x1e, 0x7f, 0x0f, 0x8a, 0xcb, 0x2b, 0xb2, 0x23, 0x3f, 0xc8, 0x23, - 0x70, 0xd8, 0xbd, 0x3c, 0xb3, 0xb0, 0x71, 0x7a, 0x89, 0xdb, 0x56, 0xa7, 0xab, 0x9f, 0xad, 0x1d, - 0xe2, 0x4f, 0x41, 0x65, 0x3d, 0x41, 0x9e, 0x38, 0x39, 0xec, 0x5b, 0x17, 0x7a, 0xff, 0x1c, 0xfe, - 0xab, 0xb4, 0x7e, 0x51, 0x5e, 0xdd, 0x96, 0x95, 0xd7, 0xb7, 0x65, 0xe5, 0xaf, 0xdb, 0xb2, 0xf2, - 0xeb, 0x5d, 0x79, 0xe3, 0xf5, 0x5d, 0x79, 0xe3, 0xf7, 0xbb, 0xf2, 0x06, 0x28, 0xbb, 0xec, 0xbe, - 0xdb, 0xb4, 0x15, 0xde, 0xda, 0xc1, 0x55, 0x18, 0xba, 0x52, 0x7e, 0x68, 0xbd, 0xf3, 0x97, 0x1a, - 0xfd, 0x01, 0x4c, 0x08, 0x5d, 0xfc, 0x8b, 0x8c, 0xb2, 0x32, 0xd2, 0xf8, 0x2f, 0x00, 0x00, 0xff, - 0xff, 0x79, 0x5f, 0xa8, 0xec, 0xb1, 0x08, 0x00, 0x00, + // 893 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0x4f, 0x6f, 0xe2, 0xc6, + 0x1b, 0xc7, 0x71, 0x42, 0xf8, 0x33, 0x4b, 0xd8, 0xf9, 0xcd, 0x2f, 0x9b, 0x75, 0x49, 0x4b, 0x50, + 0xda, 0x6e, 0x69, 0x2a, 0x81, 0x16, 0xa8, 0xba, 0xed, 0xa9, 0x26, 0x40, 0x64, 0x85, 0x90, 0x68, + 0x80, 0x6d, 0x77, 0x55, 0xc9, 0x32, 0x78, 0x4a, 0x2d, 0xd9, 0x33, 0x68, 0x3c, 0x44, 0xe1, 0x25, + 0xf4, 0xd6, 0xf7, 0xd4, 0xcb, 0x1e, 0xf7, 0x58, 0xb5, 0xd2, 0xaa, 0x4a, 0xce, 0x3d, 0xf6, 0xdc, + 0xca, 0x63, 0x43, 0x01, 0xd9, 0x44, 0x7b, 0x62, 0xe6, 0xf9, 0x3c, 0xcf, 0x77, 0xbe, 0xf3, 0xcc, + 0x30, 0x32, 0x78, 0xc6, 0xa6, 0x84, 0x0a, 0xe2, 0x10, 0x97, 0x08, 0x3e, 0xaf, 0x4e, 0x39, 0x13, + 0xac, 0xea, 0xb0, 0x89, 0x57, 0xbd, 0x79, 0x2e, 0x7f, 0x2b, 0x32, 0x84, 0x8e, 0xd6, 0xf2, 0x82, + 0x60, 0x45, 0xf2, 0x9b, 0xe7, 0x85, 0x83, 0x09, 0x9b, 0xb0, 0xa0, 0xd4, 0x1f, 0x05, 0xb4, 0x70, + 0x1a, 0x25, 0x3d, 0x66, 0xae, 0xcb, 0xa8, 0x2f, 0x1e, 0x8c, 0xc2, 0xdc, 0x4a, 0x54, 0x2e, 0x27, + 0x1e, 0x9b, 0xf1, 0x31, 0xf1, 0xb3, 0x17, 0xe3, 0x20, 0xff, 0xe4, 0x35, 0xc8, 0x74, 0xd9, 0xc4, + 0x6b, 0x99, 0xc2, 0x44, 0x3d, 0xb0, 0xbf, 0xa0, 0x86, 0xef, 0x48, 0x55, 0x4a, 0xbb, 0xe5, 0x47, + 0xb5, 0xcf, 0x2b, 0x5b, 0x2c, 0x57, 0x70, 0x58, 0xe1, 0xab, 0xe0, 0x1c, 0x5f, 0x99, 0x9d, 0xfc, + 0xad, 0x80, 0xdc, 0x2a, 0x46, 0x17, 0x20, 0xb3, 0x48, 0x50, 0x95, 0x92, 0x12, 0xab, 0xbd, 0xf4, + 0xb8, 0xa2, 0xdf, 0x4c, 0xbe, 0x79, 0x77, 0x9c, 0xc0, 0x4b, 0x01, 0x34, 0x07, 0x1f, 0xda, 0xd4, + 0x13, 0x7c, 0xe6, 0x12, 0x2a, 0x4c, 0x61, 0x33, 0x6a, 0x38, 0xf6, 0x88, 0x9b, 0x7c, 0x1e, 0x98, + 0xdf, 0x91, 0xe6, 0xbf, 0xda, 0x6a, 0x5e, 0x5f, 0x17, 0xe8, 0x06, 0xf5, 0x72, 0x2b, 0x05, 0x3b, + 0x96, 0xa1, 0x8f, 0x00, 0xf0, 0xc6, 0x3f, 0x11, 0xd7, 0x34, 0x66, 0xdc, 0x51, 0x77, 0x4b, 0x4a, + 0x39, 0x8b, 0xb3, 0x41, 0x64, 0xc8, 0x9d, 0x93, 0xbf, 0x14, 0x50, 0x88, 0x57, 0x46, 0x02, 0x3c, + 0x8d, 0x31, 0x1e, 0x36, 0xe5, 0xcb, 0x48, 0xcf, 0xe1, 0x31, 0xc7, 0xba, 0x0e, 0x1b, 0x74, 0x18, + 0xed, 0x1b, 0x7d, 0x03, 0x92, 0x2b, 0x6d, 0x79, 0xb6, 0xb5, 0x2d, 0x5d, 0x36, 0xc1, 0x64, 0xcc, + 0xb8, 0x85, 0x65, 0xcd, 0x43, 0xfb, 0xfd, 0x23, 0x09, 0xb2, 0xcb, 0x12, 0xf4, 0x09, 0xc8, 0x0b, + 0xdb, 0x25, 0xc6, 0x8c, 0xda, 0xb7, 0x06, 0x35, 0x29, 0x93, 0xbb, 0x4a, 0xe1, 0x9c, 0x1f, 0x1d, + 0x52, 0xfb, 0xb6, 0x67, 0x52, 0x86, 0x06, 0xe0, 0xb1, 0x47, 0x6e, 0x08, 0xb7, 0xc5, 0xdc, 0xa0, + 0x33, 0x77, 0x44, 0xb8, 0xba, 0x53, 0x52, 0xca, 0xf9, 0xda, 0x17, 0x5b, 0x9d, 0xf5, 0xc3, 0x9a, + 0x9e, 0x2c, 0xc1, 0x79, 0x6f, 0x6d, 0x8e, 0x3e, 0x06, 0xfb, 0x4b, 0x55, 0x41, 0x6e, 0x45, 0xe8, + 0x35, 0xb7, 0x08, 0x0e, 0xc8, 0xad, 0x40, 0x08, 0x24, 0xa9, 0xe9, 0x12, 0x35, 0x29, 0x99, 0x1c, + 0x23, 0x0d, 0x24, 0x47, 0xcc, 0x9a, 0xab, 0x7b, 0xf2, 0x00, 0x3e, 0x7b, 0xe0, 0x00, 0x34, 0x3a, + 0x7f, 0x69, 0x3a, 0xb3, 0xc5, 0x9d, 0x94, 0xa5, 0xe8, 0x12, 0x00, 0x53, 0x08, 0x6e, 0x8f, 0x66, + 0x82, 0x78, 0x6a, 0x4a, 0xb6, 0xf9, 0x21, 0xa1, 0x0b, 0xb2, 0x26, 0xb4, 0x22, 0x80, 0x5e, 0x00, + 0xd5, 0xe2, 0x6c, 0x3a, 0x25, 0x96, 0xf1, 0x5f, 0xd4, 0x18, 0xb3, 0x19, 0x15, 0x6a, 0xba, 0xa4, + 0x94, 0xf7, 0xf1, 0x61, 0xc8, 0xb5, 0x25, 0x3e, 0xf3, 0x29, 0x3a, 0x00, 0x7b, 0x3f, 0x3a, 0xe6, + 0xc4, 0x53, 0x33, 0x25, 0xa5, 0x9c, 0xc6, 0xc1, 0x04, 0xfd, 0x00, 0x32, 0x82, 0x9b, 0x63, 0x62, + 0xd8, 0x96, 0x9a, 0x2d, 0x29, 0xe5, 0x5c, 0x53, 0xf3, 0xd7, 0xfc, 0xfd, 0xdd, 0xf1, 0xd7, 0x13, + 0xb6, 0x61, 0xd3, 0xf6, 0x9f, 0x17, 0xc7, 0x21, 0x63, 0xc1, 0x78, 0xd5, 0x65, 0x16, 0x71, 0xaa, + 0x36, 0x15, 0x84, 0x53, 0xd3, 0xa9, 0x5a, 0xa6, 0x30, 0x2b, 0x03, 0x5f, 0x49, 0x6f, 0xe1, 0xb4, + 0x94, 0xd4, 0x2d, 0xf4, 0x0a, 0xa4, 0xbd, 0xa9, 0x49, 0x7d, 0x71, 0x20, 0xc5, 0xbf, 0x0d, 0xc5, + 0x5f, 0xbc, 0xbf, 0x78, 0x7f, 0x6a, 0x52, 0xbd, 0x85, 0x53, 0xbe, 0xa0, 0x6e, 0x9d, 0xfe, 0xba, + 0x07, 0xf2, 0xeb, 0xc7, 0x8e, 0x8e, 0xc1, 0x51, 0xbf, 0xfd, 0xb2, 0x8d, 0xf5, 0xc1, 0x2b, 0xa3, + 0x37, 0xbc, 0x6c, 0xb6, 0xb1, 0x31, 0xec, 0xf5, 0xaf, 0xdb, 0x67, 0x7a, 0x47, 0x6f, 0xb7, 0x60, + 0x02, 0x7d, 0x00, 0x9e, 0x6c, 0x26, 0x0c, 0xb0, 0x76, 0xd6, 0x86, 0x0a, 0x2a, 0x80, 0xc3, 0x48, + 0x54, 0x83, 0x3b, 0xb1, 0xac, 0x0e, 0x77, 0x63, 0x59, 0x03, 0x26, 0xa3, 0x96, 0x6b, 0xb5, 0x9b, + 0xc3, 0x73, 0xb8, 0x17, 0x55, 0x26, 0x51, 0x0d, 0xa6, 0x62, 0x59, 0x1d, 0xa6, 0x63, 0x59, 0x03, + 0x66, 0x90, 0x0a, 0x0e, 0x36, 0x99, 0xde, 0xeb, 0x5c, 0xc1, 0x6c, 0x94, 0x11, 0x9f, 0xd4, 0x20, + 0x88, 0x43, 0x75, 0xf8, 0x28, 0x0e, 0x35, 0x60, 0x2e, 0x6a, 0xa9, 0xef, 0x34, 0xdc, 0x83, 0xfb, + 0x51, 0x45, 0x3e, 0xa9, 0xc1, 0x7c, 0x1c, 0xaa, 0xc3, 0xc7, 0x71, 0xa8, 0x01, 0x61, 0x14, 0x6a, + 0x63, 0x7c, 0x85, 0xe1, 0xff, 0xa2, 0x9a, 0x21, 0x51, 0x0d, 0xa2, 0x58, 0x56, 0x87, 0xff, 0x8f, + 0x65, 0x0d, 0x78, 0x10, 0xb5, 0x5c, 0x47, 0x1b, 0x68, 0x5d, 0xf8, 0x24, 0xaa, 0x4c, 0xa2, 0x1a, + 0x3c, 0x8c, 0x65, 0x75, 0xf8, 0x34, 0x96, 0x35, 0xa0, 0x7a, 0xfa, 0x3d, 0xc8, 0x2f, 0x9f, 0xc8, + 0x8e, 0xfc, 0x43, 0x1e, 0x83, 0xa3, 0xee, 0xd5, 0xb9, 0x81, 0xdb, 0x67, 0x57, 0xb8, 0x65, 0x74, + 0xba, 0xda, 0xf9, 0xc6, 0x25, 0xfe, 0x14, 0x94, 0x36, 0x13, 0xe4, 0x8d, 0x93, 0xc3, 0xbe, 0x71, + 0xa9, 0xf5, 0x2f, 0xe0, 0x3f, 0x4a, 0xf3, 0x67, 0xe5, 0xcd, 0x5d, 0x51, 0x79, 0x7b, 0x57, 0x54, + 0xfe, 0xbc, 0x2b, 0x2a, 0xbf, 0xdc, 0x17, 0x13, 0x6f, 0xef, 0x8b, 0x89, 0xdf, 0xee, 0x8b, 0x09, + 0x50, 0xb4, 0xd9, 0xb6, 0xd7, 0xb4, 0xe9, 0xbf, 0xda, 0xde, 0xb5, 0x1f, 0xba, 0x56, 0x5e, 0x37, + 0xdf, 0xfb, 0x9f, 0x1a, 0x7c, 0x5d, 0x4c, 0x08, 0x5d, 0x7c, 0xe7, 0x8c, 0x52, 0x32, 0x52, 0xff, + 0x37, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xfd, 0x9f, 0xf7, 0x0d, 0x09, 0x00, 0x00, +} + +func (m *LogsData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LogsData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogsData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResourceLogs) > 0 { + for iNdEx := len(m.ResourceLogs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceLogs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ResourceLogs) Marshal() (dAtA []byte, err error) { @@ -708,6 +806,21 @@ func encodeVarintLogs(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *LogsData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ResourceLogs) > 0 { + for _, e := range m.ResourceLogs { + l = e.Size() + n += 1 + l + sovLogs(uint64(l)) + } + } + return n +} + func (m *ResourceLogs) Size() (n int) { if m == nil { return 0 @@ -797,6 +910,90 @@ func sovLogs(x uint64) (n int) { func sozLogs(x uint64) (n int) { return sovLogs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *LogsData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LogsData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogsData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceLogs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceLogs = append(m.ResourceLogs, &ResourceLogs{}) + if err := m.ResourceLogs[len(m.ResourceLogs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogs(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLogs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ResourceLogs) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/model/internal/data/protogen/metrics/v1/metrics.pb.go b/model/internal/data/protogen/metrics/v1/metrics.pb.go index d42ef3fda0a..5890a53a360 100644 --- a/model/internal/data/protogen/metrics/v1/metrics.pb.go +++ b/model/internal/data/protogen/metrics/v1/metrics.pb.go @@ -155,6 +155,65 @@ func (DataPointFlags) EnumDescriptor() ([]byte, []int) { return fileDescriptor_3c3112f9fa006917, []int{1} } +// MetricsData represents the metrics data that can be stored in a persistent +// storage, OR can be embedded by other protocols that transfer OTLP metrics +// data but do not implement the OTLP protocol. +// +// The main difference between this message and collector protocol is that +// in this message there will not be any "control" or "metadata" specific to +// OTLP protocol. +// +// When new fields are added into this message, the OTLP request MUST be updated +// as well. +type MetricsData struct { + // An array of ResourceMetrics. + // For data coming from a single resource this array will typically contain + // one element. Intermediary nodes that receive data from multiple origins + // typically batch the data before forwarding further and in that case this + // array will contain multiple elements. + ResourceMetrics []*ResourceMetrics `protobuf:"bytes,1,rep,name=resource_metrics,json=resourceMetrics,proto3" json:"resource_metrics,omitempty"` +} + +func (m *MetricsData) Reset() { *m = MetricsData{} } +func (m *MetricsData) String() string { return proto.CompactTextString(m) } +func (*MetricsData) ProtoMessage() {} +func (*MetricsData) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{0} +} +func (m *MetricsData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MetricsData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MetricsData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MetricsData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MetricsData.Merge(m, src) +} +func (m *MetricsData) XXX_Size() int { + return m.Size() +} +func (m *MetricsData) XXX_DiscardUnknown() { + xxx_messageInfo_MetricsData.DiscardUnknown(m) +} + +var xxx_messageInfo_MetricsData proto.InternalMessageInfo + +func (m *MetricsData) GetResourceMetrics() []*ResourceMetrics { + if m != nil { + return m.ResourceMetrics + } + return nil +} + // A collection of InstrumentationLibraryMetrics from a Resource. type ResourceMetrics struct { // The resource for the metrics in this message. @@ -172,7 +231,7 @@ func (m *ResourceMetrics) Reset() { *m = ResourceMetrics{} } func (m *ResourceMetrics) String() string { return proto.CompactTextString(m) } func (*ResourceMetrics) ProtoMessage() {} func (*ResourceMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{0} + return fileDescriptor_3c3112f9fa006917, []int{1} } func (m *ResourceMetrics) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -238,7 +297,7 @@ func (m *InstrumentationLibraryMetrics) Reset() { *m = InstrumentationLi func (m *InstrumentationLibraryMetrics) String() string { return proto.CompactTextString(m) } func (*InstrumentationLibraryMetrics) ProtoMessage() {} func (*InstrumentationLibraryMetrics) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{1} + return fileDescriptor_3c3112f9fa006917, []int{2} } func (m *InstrumentationLibraryMetrics) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -392,6 +451,7 @@ type Metric struct { // *Metric_Sum // *Metric_IntHistogram // *Metric_Histogram + // *Metric_ExponentialHistogram // *Metric_Summary Data isMetric_Data `protobuf_oneof:"data"` } @@ -400,7 +460,7 @@ func (m *Metric) Reset() { *m = Metric{} } func (m *Metric) String() string { return proto.CompactTextString(m) } func (*Metric) ProtoMessage() {} func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{2} + return fileDescriptor_3c3112f9fa006917, []int{3} } func (m *Metric) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -453,17 +513,21 @@ type Metric_IntHistogram struct { type Metric_Histogram struct { Histogram *Histogram `protobuf:"bytes,9,opt,name=histogram,proto3,oneof" json:"histogram,omitempty"` } +type Metric_ExponentialHistogram struct { + ExponentialHistogram *ExponentialHistogram `protobuf:"bytes,10,opt,name=exponential_histogram,json=exponentialHistogram,proto3,oneof" json:"exponential_histogram,omitempty"` +} type Metric_Summary struct { Summary *Summary `protobuf:"bytes,11,opt,name=summary,proto3,oneof" json:"summary,omitempty"` } -func (*Metric_IntGauge) isMetric_Data() {} -func (*Metric_Gauge) isMetric_Data() {} -func (*Metric_IntSum) isMetric_Data() {} -func (*Metric_Sum) isMetric_Data() {} -func (*Metric_IntHistogram) isMetric_Data() {} -func (*Metric_Histogram) isMetric_Data() {} -func (*Metric_Summary) isMetric_Data() {} +func (*Metric_IntGauge) isMetric_Data() {} +func (*Metric_Gauge) isMetric_Data() {} +func (*Metric_IntSum) isMetric_Data() {} +func (*Metric_Sum) isMetric_Data() {} +func (*Metric_IntHistogram) isMetric_Data() {} +func (*Metric_Histogram) isMetric_Data() {} +func (*Metric_ExponentialHistogram) isMetric_Data() {} +func (*Metric_Summary) isMetric_Data() {} func (m *Metric) GetData() isMetric_Data { if m != nil { @@ -538,6 +602,13 @@ func (m *Metric) GetHistogram() *Histogram { return nil } +func (m *Metric) GetExponentialHistogram() *ExponentialHistogram { + if x, ok := m.GetData().(*Metric_ExponentialHistogram); ok { + return x.ExponentialHistogram + } + return nil +} + func (m *Metric) GetSummary() *Summary { if x, ok := m.GetData().(*Metric_Summary); ok { return x.Summary @@ -554,6 +625,7 @@ func (*Metric) XXX_OneofWrappers() []interface{} { (*Metric_Sum)(nil), (*Metric_IntHistogram)(nil), (*Metric_Histogram)(nil), + (*Metric_ExponentialHistogram)(nil), (*Metric_Summary)(nil), } } @@ -575,7 +647,7 @@ func (m *Gauge) Reset() { *m = Gauge{} } func (m *Gauge) String() string { return proto.CompactTextString(m) } func (*Gauge) ProtoMessage() {} func (*Gauge) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{3} + return fileDescriptor_3c3112f9fa006917, []int{4} } func (m *Gauge) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -626,7 +698,7 @@ func (m *Sum) Reset() { *m = Sum{} } func (m *Sum) String() string { return proto.CompactTextString(m) } func (*Sum) ProtoMessage() {} func (*Sum) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{4} + return fileDescriptor_3c3112f9fa006917, []int{5} } func (m *Sum) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -689,7 +761,7 @@ func (m *Histogram) Reset() { *m = Histogram{} } func (m *Histogram) String() string { return proto.CompactTextString(m) } func (*Histogram) ProtoMessage() {} func (*Histogram) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{5} + return fileDescriptor_3c3112f9fa006917, []int{6} } func (m *Histogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -732,6 +804,62 @@ func (m *Histogram) GetAggregationTemporality() AggregationTemporality { return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED } +// ExponentialHistogram represents the type of a metric that is calculated by aggregating +// as a ExponentialHistogram of all reported double measurements over a time interval. +type ExponentialHistogram struct { + DataPoints []*ExponentialHistogramDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` +} + +func (m *ExponentialHistogram) Reset() { *m = ExponentialHistogram{} } +func (m *ExponentialHistogram) String() string { return proto.CompactTextString(m) } +func (*ExponentialHistogram) ProtoMessage() {} +func (*ExponentialHistogram) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{7} +} +func (m *ExponentialHistogram) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExponentialHistogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExponentialHistogram.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExponentialHistogram) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExponentialHistogram.Merge(m, src) +} +func (m *ExponentialHistogram) XXX_Size() int { + return m.Size() +} +func (m *ExponentialHistogram) XXX_DiscardUnknown() { + xxx_messageInfo_ExponentialHistogram.DiscardUnknown(m) +} + +var xxx_messageInfo_ExponentialHistogram proto.InternalMessageInfo + +func (m *ExponentialHistogram) GetDataPoints() []*ExponentialHistogramDataPoint { + if m != nil { + return m.DataPoints + } + return nil +} + +func (m *ExponentialHistogram) GetAggregationTemporality() AggregationTemporality { + if m != nil { + return m.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + // Summary metric data are used to convey quantile summaries, // a Prometheus (see: https://prometheus.io/docs/concepts/metric_types/#summary) // and OpenMetrics (see: https://github.com/OpenObservability/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45) @@ -746,7 +874,7 @@ func (m *Summary) Reset() { *m = Summary{} } func (m *Summary) String() string { return proto.CompactTextString(m) } func (*Summary) ProtoMessage() {} func (*Summary) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{6} + return fileDescriptor_3c3112f9fa006917, []int{8} } func (m *Summary) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -798,7 +926,7 @@ type NumberDataPoint struct { // This field will be removed in ~3 months, on July 1, 2021. Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // Deprecated: Do not use. // StartTimeUnixNano is optional but strongly encouraged, see the - // the detiled comments above Metric. + // the detailed comments above Metric. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. @@ -827,7 +955,7 @@ func (m *NumberDataPoint) Reset() { *m = NumberDataPoint{} } func (m *NumberDataPoint) String() string { return proto.CompactTextString(m) } func (*NumberDataPoint) ProtoMessage() {} func (*NumberDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{7} + return fileDescriptor_3c3112f9fa006917, []int{9} } func (m *NumberDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -968,7 +1096,7 @@ type HistogramDataPoint struct { // This field will be removed in ~3 months, on July 1, 2021. Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // Deprecated: Do not use. // StartTimeUnixNano is optional but strongly encouraged, see the - // the detiled comments above Metric. + // the detailed comments above Metric. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. @@ -983,8 +1111,7 @@ type HistogramDataPoint struct { // histogram is provided. Count uint64 `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"` // sum of the values in the population. If count is zero then this field - // must be zero. This value must be equal to the sum of the "sum" fields in - // buckets if a histogram is provided. + // must be zero. // // Note: Sum should only be filled out when measuring non-negative discrete // events, and is assumed to be monotonic over the values of these events. @@ -1026,7 +1153,7 @@ func (m *HistogramDataPoint) Reset() { *m = HistogramDataPoint{} } func (m *HistogramDataPoint) String() string { return proto.CompactTextString(m) } func (*HistogramDataPoint) ProtoMessage() {} func (*HistogramDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{8} + return fileDescriptor_3c3112f9fa006917, []int{10} } func (m *HistogramDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1126,6 +1253,252 @@ func (m *HistogramDataPoint) GetFlags() uint32 { return 0 } +// ExponentialHistogramDataPoint is a single data point in a timeseries that describes the +// time-varying values of a ExponentialHistogram of double values. A ExponentialHistogram contains +// summary statistics for a population of values, it may optionally contain the +// distribution of those values across a set of buckets. +// +type ExponentialHistogramDataPoint struct { + // The set of key/value pairs that uniquely identify the timeseries from + // where this point belongs. The list may be empty (may contain 0 elements). + Attributes []v11.KeyValue `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes"` + // StartTimeUnixNano is optional but strongly encouraged, see the + // the detailed comments above Metric. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // TimeUnixNano is required, see the detailed comments above Metric. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // count is the number of values in the population. Must be + // non-negative. This value must be equal to the sum of the "bucket_counts" + // values in the positive and negative Buckets plus the "zero_count" field. + Count uint64 `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"` + // sum of the values in the population. If count is zero then this field + // must be zero. + // + // Note: Sum should only be filled out when measuring non-negative discrete + // events, and is assumed to be monotonic over the values of these events. + // Negative events *can* be recorded, but sum should not be filled out when + // doing so. This is specifically to enforce compatibility w/ OpenMetrics, + // see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram + Sum float64 `protobuf:"fixed64,5,opt,name=sum,proto3" json:"sum,omitempty"` + // scale describes the resolution of the histogram. Boundaries are + // located at powers of the base, where: + // + // base = (2^(2^-scale)) + // + // The histogram bucket identified by `index`, a signed integer, + // contains values that are greater than or equal to (base^index) and + // less than (base^(index+1)). + // + // The positive and negative ranges of the histogram are expressed + // separately. Negative values are mapped by their absolute value + // into the negative range using the same scale as the positive range. + // + // scale is not restricted by the protocol, as the permissible + // values depend on the range of the data. + Scale int32 `protobuf:"zigzag32,6,opt,name=scale,proto3" json:"scale,omitempty"` + // zero_count is the count of values that are either exactly zero or + // within the region considered zero by the instrumentation at the + // tolerated degree of precision. This bucket stores values that + // cannot be expressed using the standard exponential formula as + // well as values that have been rounded to zero. + // + // Implementations MAY consider the zero bucket to have probability + // mass equal to (zero_count / count). + ZeroCount uint64 `protobuf:"fixed64,7,opt,name=zero_count,json=zeroCount,proto3" json:"zero_count,omitempty"` + // positive carries the positive range of exponential bucket counts. + Positive *ExponentialHistogramDataPoint_Buckets `protobuf:"bytes,8,opt,name=positive,proto3" json:"positive,omitempty"` + // negative carries the negative range of exponential bucket counts. + Negative *ExponentialHistogramDataPoint_Buckets `protobuf:"bytes,9,opt,name=negative,proto3" json:"negative,omitempty"` + // Flags that apply to this specific data point. See DataPointFlags + // for the available flags and their meaning. + Flags uint32 `protobuf:"varint,10,opt,name=flags,proto3" json:"flags,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []Exemplar `protobuf:"bytes,11,rep,name=exemplars,proto3" json:"exemplars"` +} + +func (m *ExponentialHistogramDataPoint) Reset() { *m = ExponentialHistogramDataPoint{} } +func (m *ExponentialHistogramDataPoint) String() string { return proto.CompactTextString(m) } +func (*ExponentialHistogramDataPoint) ProtoMessage() {} +func (*ExponentialHistogramDataPoint) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{11} +} +func (m *ExponentialHistogramDataPoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExponentialHistogramDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExponentialHistogramDataPoint.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExponentialHistogramDataPoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExponentialHistogramDataPoint.Merge(m, src) +} +func (m *ExponentialHistogramDataPoint) XXX_Size() int { + return m.Size() +} +func (m *ExponentialHistogramDataPoint) XXX_DiscardUnknown() { + xxx_messageInfo_ExponentialHistogramDataPoint.DiscardUnknown(m) +} + +var xxx_messageInfo_ExponentialHistogramDataPoint proto.InternalMessageInfo + +func (m *ExponentialHistogramDataPoint) GetAttributes() []v11.KeyValue { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *ExponentialHistogramDataPoint) GetStartTimeUnixNano() uint64 { + if m != nil { + return m.StartTimeUnixNano + } + return 0 +} + +func (m *ExponentialHistogramDataPoint) GetTimeUnixNano() uint64 { + if m != nil { + return m.TimeUnixNano + } + return 0 +} + +func (m *ExponentialHistogramDataPoint) GetCount() uint64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *ExponentialHistogramDataPoint) GetSum() float64 { + if m != nil { + return m.Sum + } + return 0 +} + +func (m *ExponentialHistogramDataPoint) GetScale() int32 { + if m != nil { + return m.Scale + } + return 0 +} + +func (m *ExponentialHistogramDataPoint) GetZeroCount() uint64 { + if m != nil { + return m.ZeroCount + } + return 0 +} + +func (m *ExponentialHistogramDataPoint) GetPositive() *ExponentialHistogramDataPoint_Buckets { + if m != nil { + return m.Positive + } + return nil +} + +func (m *ExponentialHistogramDataPoint) GetNegative() *ExponentialHistogramDataPoint_Buckets { + if m != nil { + return m.Negative + } + return nil +} + +func (m *ExponentialHistogramDataPoint) GetFlags() uint32 { + if m != nil { + return m.Flags + } + return 0 +} + +func (m *ExponentialHistogramDataPoint) GetExemplars() []Exemplar { + if m != nil { + return m.Exemplars + } + return nil +} + +// Buckets are a set of bucket counts, encoded in a contiguous array +// of counts. +type ExponentialHistogramDataPoint_Buckets struct { + // Offset is the bucket index of the first entry in the bucket_counts array. + // + // Note: This uses a varint encoding as a simple form of compression. + Offset int32 `protobuf:"zigzag32,1,opt,name=offset,proto3" json:"offset,omitempty"` + // Count is an array of counts, where count[i] carries the count + // of the bucket at index (offset+i). count[i] is the count of + // values greater than or equal to base^(offset+i) and less than + // base^(offset+i+1). + // + // Note: By contrast, the explicit HistogramDataPoint uses + // fixed64. This field is expected to have many buckets, + // especially zeros, so uint64 has been selected to ensure + // varint encoding. + BucketCounts []uint64 `protobuf:"varint,2,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"` +} + +func (m *ExponentialHistogramDataPoint_Buckets) Reset() { *m = ExponentialHistogramDataPoint_Buckets{} } +func (m *ExponentialHistogramDataPoint_Buckets) String() string { return proto.CompactTextString(m) } +func (*ExponentialHistogramDataPoint_Buckets) ProtoMessage() {} +func (*ExponentialHistogramDataPoint_Buckets) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{11, 0} +} +func (m *ExponentialHistogramDataPoint_Buckets) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExponentialHistogramDataPoint_Buckets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExponentialHistogramDataPoint_Buckets.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExponentialHistogramDataPoint_Buckets) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExponentialHistogramDataPoint_Buckets.Merge(m, src) +} +func (m *ExponentialHistogramDataPoint_Buckets) XXX_Size() int { + return m.Size() +} +func (m *ExponentialHistogramDataPoint_Buckets) XXX_DiscardUnknown() { + xxx_messageInfo_ExponentialHistogramDataPoint_Buckets.DiscardUnknown(m) +} + +var xxx_messageInfo_ExponentialHistogramDataPoint_Buckets proto.InternalMessageInfo + +func (m *ExponentialHistogramDataPoint_Buckets) GetOffset() int32 { + if m != nil { + return m.Offset + } + return 0 +} + +func (m *ExponentialHistogramDataPoint_Buckets) GetBucketCounts() []uint64 { + if m != nil { + return m.BucketCounts + } + return nil +} + // SummaryDataPoint is a single data point in a timeseries that describes the // time-varying values of a Summary metric. type SummaryDataPoint struct { @@ -1142,7 +1515,7 @@ type SummaryDataPoint struct { // This field will be removed in ~3 months, on July 1, 2021. Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // Deprecated: Do not use. // StartTimeUnixNano is optional but strongly encouraged, see the - // the detiled comments above Metric. + // the detailed comments above Metric. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. @@ -1175,7 +1548,7 @@ func (m *SummaryDataPoint) Reset() { *m = SummaryDataPoint{} } func (m *SummaryDataPoint) String() string { return proto.CompactTextString(m) } func (*SummaryDataPoint) ProtoMessage() {} func (*SummaryDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{9} + return fileDescriptor_3c3112f9fa006917, []int{12} } func (m *SummaryDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1283,7 +1656,7 @@ func (m *SummaryDataPoint_ValueAtQuantile) Reset() { *m = SummaryDataPoi func (m *SummaryDataPoint_ValueAtQuantile) String() string { return proto.CompactTextString(m) } func (*SummaryDataPoint_ValueAtQuantile) ProtoMessage() {} func (*SummaryDataPoint_ValueAtQuantile) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{9, 0} + return fileDescriptor_3c3112f9fa006917, []int{12, 0} } func (m *SummaryDataPoint_ValueAtQuantile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1372,7 +1745,7 @@ func (m *Exemplar) Reset() { *m = Exemplar{} } func (m *Exemplar) String() string { return proto.CompactTextString(m) } func (*Exemplar) ProtoMessage() {} func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{10} + return fileDescriptor_3c3112f9fa006917, []int{13} } func (m *Exemplar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1475,7 +1848,7 @@ type IntDataPoint struct { // The set of labels that uniquely identify this timeseries. Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // StartTimeUnixNano is optional but strongly encouraged, see the - // the detiled comments above Metric. + // the detailed comments above Metric. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. @@ -1496,7 +1869,7 @@ func (m *IntDataPoint) Reset() { *m = IntDataPoint{} } func (m *IntDataPoint) String() string { return proto.CompactTextString(m) } func (*IntDataPoint) ProtoMessage() {} func (*IntDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{11} + return fileDescriptor_3c3112f9fa006917, []int{14} } func (m *IntDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1571,7 +1944,7 @@ func (m *IntGauge) Reset() { *m = IntGauge{} } func (m *IntGauge) String() string { return proto.CompactTextString(m) } func (*IntGauge) ProtoMessage() {} func (*IntGauge) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{12} + return fileDescriptor_3c3112f9fa006917, []int{15} } func (m *IntGauge) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1623,7 +1996,7 @@ func (m *IntSum) Reset() { *m = IntSum{} } func (m *IntSum) String() string { return proto.CompactTextString(m) } func (*IntSum) ProtoMessage() {} func (*IntSum) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{13} + return fileDescriptor_3c3112f9fa006917, []int{16} } func (m *IntSum) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1680,7 +2053,7 @@ type IntHistogramDataPoint struct { // The set of labels that uniquely identify this timeseries. Labels []v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // StartTimeUnixNano is optional but strongly encouraged, see the - // the detiled comments above Metric. + // the detailed comments above Metric. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. @@ -1729,7 +2102,7 @@ func (m *IntHistogramDataPoint) Reset() { *m = IntHistogramDataPoint{} } func (m *IntHistogramDataPoint) String() string { return proto.CompactTextString(m) } func (*IntHistogramDataPoint) ProtoMessage() {} func (*IntHistogramDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{14} + return fileDescriptor_3c3112f9fa006917, []int{17} } func (m *IntHistogramDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1829,7 +2202,7 @@ func (m *IntHistogram) Reset() { *m = IntHistogram{} } func (m *IntHistogram) String() string { return proto.CompactTextString(m) } func (*IntHistogram) ProtoMessage() {} func (*IntHistogram) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{15} + return fileDescriptor_3c3112f9fa006917, []int{18} } func (m *IntHistogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1901,7 +2274,7 @@ func (m *IntExemplar) Reset() { *m = IntExemplar{} } func (m *IntExemplar) String() string { return proto.CompactTextString(m) } func (*IntExemplar) ProtoMessage() {} func (*IntExemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{16} + return fileDescriptor_3c3112f9fa006917, []int{19} } func (m *IntExemplar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1954,15 +2327,19 @@ func (m *IntExemplar) GetValue() int64 { func init() { proto.RegisterEnum("opentelemetry.proto.metrics.v1.AggregationTemporality", AggregationTemporality_name, AggregationTemporality_value) proto.RegisterEnum("opentelemetry.proto.metrics.v1.DataPointFlags", DataPointFlags_name, DataPointFlags_value) + proto.RegisterType((*MetricsData)(nil), "opentelemetry.proto.metrics.v1.MetricsData") proto.RegisterType((*ResourceMetrics)(nil), "opentelemetry.proto.metrics.v1.ResourceMetrics") proto.RegisterType((*InstrumentationLibraryMetrics)(nil), "opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics") proto.RegisterType((*Metric)(nil), "opentelemetry.proto.metrics.v1.Metric") proto.RegisterType((*Gauge)(nil), "opentelemetry.proto.metrics.v1.Gauge") proto.RegisterType((*Sum)(nil), "opentelemetry.proto.metrics.v1.Sum") proto.RegisterType((*Histogram)(nil), "opentelemetry.proto.metrics.v1.Histogram") + proto.RegisterType((*ExponentialHistogram)(nil), "opentelemetry.proto.metrics.v1.ExponentialHistogram") proto.RegisterType((*Summary)(nil), "opentelemetry.proto.metrics.v1.Summary") proto.RegisterType((*NumberDataPoint)(nil), "opentelemetry.proto.metrics.v1.NumberDataPoint") proto.RegisterType((*HistogramDataPoint)(nil), "opentelemetry.proto.metrics.v1.HistogramDataPoint") + proto.RegisterType((*ExponentialHistogramDataPoint)(nil), "opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint") + proto.RegisterType((*ExponentialHistogramDataPoint_Buckets)(nil), "opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets") proto.RegisterType((*SummaryDataPoint)(nil), "opentelemetry.proto.metrics.v1.SummaryDataPoint") proto.RegisterType((*SummaryDataPoint_ValueAtQuantile)(nil), "opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile") proto.RegisterType((*Exemplar)(nil), "opentelemetry.proto.metrics.v1.Exemplar") @@ -1979,101 +2356,150 @@ func init() { } var fileDescriptor_3c3112f9fa006917 = []byte{ - // 1458 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x5b, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0xda, 0xf1, 0xed, 0x38, 0x17, 0xff, 0xe7, 0x1f, 0x52, 0x2b, 0x52, 0xd2, 0xd4, 0x85, - 0x26, 0x94, 0x62, 0xd3, 0xa0, 0x72, 0x55, 0xa5, 0xda, 0xb1, 0x9b, 0x58, 0x71, 0x2e, 0xdd, 0x38, - 0x41, 0x45, 0xa5, 0xab, 0xb1, 0x3d, 0x75, 0x47, 0xec, 0xce, 0x9a, 0xdd, 0xd9, 0x28, 0xf9, 0x00, - 0xe5, 0x89, 0x07, 0xc4, 0x3b, 0x9f, 0x80, 0x2f, 0xd2, 0x37, 0xca, 0x1b, 0x02, 0xa9, 0x42, 0x0d, - 0x4f, 0xf0, 0xc0, 0x13, 0x3c, 0xa3, 0x99, 0xd9, 0xb5, 0x9d, 0xc4, 0x89, 0x1d, 0x9a, 0x4a, 0xad, - 0xfa, 0x36, 0x73, 0xe6, 0x9c, 0xdf, 0x9e, 0xfb, 0x99, 0x59, 0xb8, 0x66, 0xb7, 0x09, 0xe3, 0xc4, - 0x24, 0x16, 0xe1, 0xce, 0x7e, 0xbe, 0xed, 0xd8, 0xdc, 0xce, 0x8b, 0x35, 0x6d, 0xb8, 0xf9, 0xdd, - 0xeb, 0xc1, 0x32, 0x27, 0x0f, 0xd0, 0xec, 0x21, 0x6e, 0x45, 0xcc, 0x05, 0x2c, 0xbb, 0xd7, 0xa7, - 0x27, 0x5b, 0x76, 0xcb, 0x56, 0x18, 0x62, 0xa5, 0x18, 0xa6, 0xaf, 0xf6, 0xfb, 0x46, 0xc3, 0xb6, - 0x2c, 0x9b, 0x89, 0x4f, 0xa8, 0x95, 0xcf, 0x9b, 0xeb, 0xc7, 0xeb, 0x10, 0xd7, 0xf6, 0x9c, 0x06, - 0x11, 0xdc, 0xc1, 0x5a, 0xf1, 0x67, 0x1f, 0x85, 0x61, 0x42, 0xf7, 0x49, 0x6b, 0x4a, 0x11, 0xb4, - 0x0a, 0x89, 0x80, 0x2b, 0xa3, 0xcd, 0x69, 0x0b, 0xa9, 0xc5, 0xb7, 0x73, 0xfd, 0x14, 0xef, 0x40, - 0xed, 0x5e, 0xcf, 0x05, 0x18, 0xc5, 0x91, 0xc7, 0x4f, 0x2f, 0x86, 0xf4, 0x0e, 0x00, 0x7a, 0xa4, - 0xc1, 0x45, 0xca, 0x5c, 0xee, 0x78, 0x16, 0x61, 0x1c, 0x73, 0x6a, 0x33, 0xc3, 0xa4, 0x75, 0x07, - 0x3b, 0xfb, 0x86, 0x6f, 0x79, 0x26, 0x3c, 0x17, 0x59, 0x48, 0x2d, 0xde, 0xcc, 0x9d, 0xee, 0x9d, - 0x5c, 0xe5, 0x30, 0x4c, 0x55, 0xa1, 0xf8, 0x5a, 0xeb, 0x33, 0xf4, 0xb4, 0x63, 0x34, 0x03, 0xe0, - 0x36, 0x1e, 0x12, 0x0b, 0x1b, 0x9e, 0x63, 0x66, 0x22, 0x73, 0xda, 0x42, 0x52, 0x4f, 0x2a, 0xca, - 0xb6, 0x63, 0x66, 0xff, 0xd1, 0x60, 0xe6, 0x54, 0x7c, 0xc4, 0xe1, 0xc2, 0x09, 0x76, 0xf8, 0x4e, - 0xba, 0xd1, 0x57, 0x7f, 0x3f, 0x3a, 0x27, 0xaa, 0xef, 0x3b, 0x6c, 0xaa, 0xbf, 0xf6, 0xe8, 0x16, - 0xc4, 0x0f, 0x7b, 0xe9, 0xca, 0x20, 0x2f, 0x29, 0x7d, 0xf5, 0x40, 0x6c, 0x90, 0xe1, 0x3f, 0x8e, - 0x40, 0x4c, 0x89, 0x20, 0x04, 0x23, 0x0c, 0x5b, 0x2a, 0xe6, 0x49, 0x5d, 0xae, 0xd1, 0x1c, 0xa4, - 0x9a, 0xc4, 0x6d, 0x38, 0xb4, 0x2d, 0xb4, 0xca, 0x84, 0xe5, 0x51, 0x2f, 0x49, 0x48, 0x79, 0x8c, - 0x72, 0x1f, 0x59, 0xae, 0xd1, 0x2a, 0x24, 0x29, 0xe3, 0x46, 0x0b, 0x7b, 0x2d, 0x92, 0x19, 0x91, - 0xde, 0x59, 0x18, 0x1c, 0x5d, 0xbe, 0x2c, 0xf8, 0x8b, 0xe1, 0x8c, 0xb6, 0x12, 0xd2, 0x13, 0xd4, - 0xdf, 0xa3, 0x9b, 0x10, 0x55, 0x40, 0x51, 0x09, 0xf4, 0xd6, 0x20, 0x20, 0x29, 0xb5, 0x12, 0xd2, - 0x95, 0x14, 0x2a, 0x43, 0x5c, 0xe8, 0xe2, 0x7a, 0x56, 0x26, 0x26, 0x01, 0xae, 0x0c, 0xa1, 0xc9, - 0x96, 0x67, 0xf9, 0x7a, 0xc4, 0xa8, 0xdc, 0xa1, 0x0f, 0x21, 0x22, 0x20, 0xe2, 0x12, 0xe2, 0xf2, - 0x20, 0x88, 0x2d, 0xcf, 0x5a, 0x09, 0xe9, 0x42, 0x02, 0x7d, 0x06, 0x63, 0xe2, 0xfb, 0x0f, 0xa9, - 0xcb, 0xed, 0x96, 0x83, 0xad, 0x4c, 0x42, 0x42, 0x5c, 0x1b, 0x42, 0x8b, 0x95, 0x40, 0xc6, 0xd7, - 0x65, 0x94, 0xf6, 0xd0, 0x50, 0x05, 0x92, 0x5d, 0xd0, 0xe4, 0x29, 0x75, 0xda, 0x03, 0xda, 0x91, - 0x5e, 0x09, 0xe9, 0x5d, 0x69, 0xb4, 0x04, 0x71, 0xd7, 0xb3, 0x2c, 0x91, 0xcb, 0x29, 0x09, 0x34, - 0x3f, 0x84, 0x81, 0x82, 0x7d, 0x25, 0xa4, 0x07, 0x92, 0xc5, 0x18, 0x8c, 0x34, 0x31, 0xc7, 0xd9, - 0xbb, 0x10, 0x55, 0x81, 0xdb, 0x84, 0x94, 0x20, 0x18, 0x6d, 0x9b, 0x32, 0xee, 0x66, 0x34, 0x99, - 0xbf, 0xf9, 0x41, 0xc8, 0xeb, 0x9e, 0x55, 0x27, 0x4e, 0x09, 0x73, 0xbc, 0x29, 0xe4, 0x74, 0x68, - 0x06, 0x4b, 0x37, 0xfb, 0xa7, 0x06, 0x11, 0x11, 0x8c, 0x73, 0x47, 0x46, 0x36, 0x5c, 0xc0, 0xad, - 0x96, 0x43, 0x5a, 0xaa, 0xb2, 0x39, 0xb1, 0xda, 0xb6, 0x83, 0x4d, 0xca, 0xf7, 0x65, 0xce, 0x8f, - 0x2f, 0x7e, 0x30, 0x08, 0xbd, 0xd0, 0x15, 0xaf, 0x75, 0xa5, 0xf5, 0x29, 0xdc, 0x97, 0x8e, 0x2e, - 0xc1, 0x28, 0x75, 0x0d, 0xcb, 0x66, 0x36, 0xb7, 0x19, 0x6d, 0xc8, 0xf2, 0x49, 0xe8, 0x29, 0xea, - 0xae, 0x05, 0xa4, 0xec, 0x4f, 0x1a, 0x24, 0xbb, 0xe1, 0xde, 0xea, 0x67, 0xf3, 0xe2, 0xd0, 0x01, - 0x7f, 0x39, 0xcc, 0xce, 0xde, 0x83, 0xb8, 0x9f, 0x3a, 0xe8, 0x4e, 0x3f, 0x83, 0xde, 0x1b, 0x32, - 0xf1, 0xfa, 0xe7, 0xc7, 0x0f, 0x11, 0x98, 0x38, 0x12, 0x65, 0xb4, 0x06, 0x80, 0x39, 0x77, 0x68, - 0xdd, 0xe3, 0xc4, 0xcd, 0xc4, 0xe5, 0x57, 0xe6, 0x07, 0xb4, 0xea, 0x55, 0xb2, 0xbf, 0x83, 0x4d, - 0x2f, 0x98, 0x66, 0x3d, 0x00, 0x68, 0x0d, 0x62, 0x26, 0xae, 0x13, 0x33, 0x50, 0xf8, 0xdd, 0x01, - 0x50, 0x5b, 0xdc, 0xa1, 0xac, 0xd5, 0x01, 0x8c, 0x09, 0xc0, 0x8c, 0xa6, 0xfb, 0x20, 0x28, 0x0f, - 0x93, 0x2e, 0xc7, 0x0e, 0x37, 0x38, 0xb5, 0x88, 0xe1, 0x31, 0xba, 0x67, 0x30, 0xcc, 0x6c, 0xe9, - 0xfd, 0x98, 0xfe, 0x3f, 0x79, 0x56, 0xa3, 0x16, 0xd9, 0x66, 0x74, 0x6f, 0x1d, 0x33, 0x1b, 0xbd, - 0x09, 0xe3, 0x47, 0x58, 0x23, 0x92, 0x75, 0x94, 0xf7, 0x72, 0xcd, 0x40, 0x12, 0xbb, 0x46, 0xd3, - 0xf6, 0xea, 0xa6, 0x6a, 0xc0, 0xb2, 0xa5, 0x62, 0xb7, 0x24, 0x29, 0xe8, 0x02, 0xc4, 0xb0, 0x6b, - 0x50, 0xc6, 0x65, 0x4b, 0x4c, 0x8b, 0x66, 0x89, 0xdd, 0x0a, 0xe3, 0xa8, 0x0a, 0x49, 0xb2, 0x47, - 0xac, 0xb6, 0x89, 0x1d, 0x37, 0x13, 0x95, 0x06, 0x0e, 0x6c, 0xdc, 0x65, 0x5f, 0xc0, 0x77, 0x56, - 0x17, 0x00, 0x4d, 0x42, 0xf4, 0x81, 0x89, 0x5b, 0xae, 0x6c, 0x79, 0x63, 0xba, 0xda, 0x14, 0xe3, - 0x10, 0xdd, 0x15, 0xbe, 0xc8, 0x1e, 0x44, 0x00, 0x1d, 0xcf, 0xcf, 0x23, 0x01, 0x4b, 0xbe, 0x1e, - 0x01, 0x9b, 0x84, 0x68, 0xc3, 0xf6, 0x18, 0x97, 0xc1, 0x8a, 0xe9, 0x6a, 0x83, 0xd2, 0x6a, 0xe8, - 0x88, 0xc1, 0xa7, 0xa9, 0x69, 0x72, 0x19, 0xc6, 0xea, 0x5e, 0xe3, 0x4b, 0xc2, 0x0d, 0xc9, 0xe1, - 0x66, 0x62, 0x73, 0x11, 0x01, 0xa6, 0x88, 0x4b, 0x92, 0x86, 0xe6, 0x61, 0x82, 0xec, 0xb5, 0x4d, - 0xda, 0xa0, 0xdc, 0xa8, 0xdb, 0x1e, 0x6b, 0xaa, 0xbc, 0xd7, 0xf4, 0xf1, 0x80, 0x5c, 0x94, 0xd4, - 0xc3, 0xe1, 0x4e, 0x9c, 0x5b, 0xb8, 0xa1, 0x27, 0xdc, 0xd9, 0xbf, 0x23, 0x90, 0x3e, 0x5a, 0xb4, - 0xaf, 0x67, 0x51, 0x0e, 0x1b, 0x63, 0x0a, 0x13, 0x5f, 0x79, 0x98, 0x71, 0x6a, 0x12, 0x43, 0x56, - 0x8a, 0x8a, 0x72, 0x6a, 0xf1, 0xd6, 0x59, 0x9b, 0x63, 0x4e, 0xda, 0x57, 0xe0, 0x77, 0x7c, 0x38, - 0x7d, 0x3c, 0x00, 0x96, 0x07, 0x27, 0x54, 0xe8, 0xf4, 0x12, 0x4c, 0x1c, 0x11, 0x44, 0xd3, 0x90, - 0x08, 0x44, 0xe5, 0xfd, 0x50, 0xd3, 0x3b, 0x7b, 0x01, 0x22, 0xd5, 0x94, 0xfe, 0xd1, 0x74, 0xbf, - 0xba, 0xff, 0x88, 0x40, 0x22, 0xc8, 0x15, 0x74, 0x1f, 0xfe, 0xff, 0x80, 0x9a, 0x9c, 0x38, 0xa4, - 0x69, 0x3c, 0x6f, 0xe0, 0x51, 0x80, 0x54, 0xe8, 0x26, 0xc0, 0x7d, 0x98, 0xe8, 0xe0, 0x9f, 0x47, - 0x26, 0x8c, 0x07, 0x68, 0x55, 0x95, 0x11, 0xc7, 0x03, 0x1c, 0x1e, 0xd4, 0x75, 0x23, 0xc3, 0x77, - 0xdd, 0xbb, 0x10, 0x77, 0xdb, 0x98, 0x19, 0xb4, 0x29, 0x53, 0x63, 0xb4, 0x78, 0x4b, 0xa8, 0xf1, - 0xcb, 0xd3, 0x8b, 0x1f, 0xb5, 0xec, 0x23, 0xfa, 0x53, 0xf1, 0xf2, 0x33, 0x4d, 0xd2, 0xe0, 0xb6, - 0x93, 0xb7, 0xec, 0x26, 0x31, 0xf3, 0x94, 0x71, 0xe2, 0x30, 0x6c, 0xe6, 0xc5, 0x20, 0xcc, 0x6d, - 0xb5, 0x31, 0xab, 0x94, 0xf4, 0x98, 0x00, 0xac, 0x34, 0xd1, 0x3d, 0x48, 0x70, 0x07, 0x37, 0x88, - 0xc0, 0x8e, 0x4a, 0xec, 0x82, 0x8f, 0xfd, 0xf1, 0xd9, 0xb1, 0x6b, 0x02, 0xa9, 0x52, 0xd2, 0xe3, - 0x12, 0xb2, 0xd2, 0xec, 0xb6, 0xf2, 0xef, 0xc3, 0x30, 0x5a, 0x61, 0xbc, 0x5b, 0xe0, 0xab, 0xcf, - 0x57, 0x91, 0x2a, 0xd2, 0x2f, 0xbe, 0x1e, 0x55, 0xde, 0x0a, 0xa7, 0xa7, 0xfd, 0xbc, 0x45, 0x1b, - 0xc7, 0x47, 0xe0, 0x3b, 0x43, 0xdc, 0xd5, 0x4f, 0x6c, 0x8b, 0x9f, 0x84, 0x33, 0x5a, 0xf6, 0x0b, - 0x48, 0x04, 0xef, 0x1b, 0xb4, 0xd6, 0xef, 0xde, 0x33, 0xcc, 0x73, 0xa0, 0xef, 0x9d, 0x47, 0xc2, - 0xff, 0xa5, 0x41, 0x4c, 0xbd, 0x5a, 0xce, 0x19, 0xfd, 0x65, 0xbc, 0x17, 0x4b, 0x8b, 0xbf, 0x8e, - 0xc0, 0x1b, 0xbd, 0x2f, 0xa4, 0x57, 0x2e, 0xf3, 0x4e, 0x9f, 0x04, 0xe9, 0x17, 0x31, 0xed, 0x37, - 0x8e, 0x4f, 0xfb, 0xe7, 0xcf, 0xec, 0x5f, 0x35, 0x59, 0xf9, 0xdd, 0x77, 0xca, 0x4e, 0xbf, 0x04, - 0xbc, 0x71, 0x96, 0xd7, 0xee, 0xcb, 0x91, 0x89, 0xd2, 0xba, 0xdf, 0xc3, 0x90, 0xea, 0x71, 0x01, - 0xba, 0x77, 0x4e, 0x73, 0x46, 0xb9, 0xf2, 0xbf, 0x4d, 0x99, 0x4e, 0xdb, 0x8a, 0xf4, 0xb6, 0xad, - 0x57, 0x75, 0x86, 0x08, 0x37, 0x5f, 0xfd, 0x46, 0x83, 0xa9, 0xfe, 0xd1, 0x41, 0xf3, 0x70, 0xb9, - 0xb0, 0xbc, 0xac, 0x97, 0x97, 0x0b, 0xb5, 0xca, 0xc6, 0xba, 0x51, 0x2b, 0xaf, 0x6d, 0x6e, 0xe8, - 0x85, 0x6a, 0xa5, 0x76, 0xd7, 0xd8, 0x5e, 0xdf, 0xda, 0x2c, 0x2f, 0x55, 0x6e, 0x57, 0xca, 0xa5, - 0x74, 0x08, 0x5d, 0x82, 0x99, 0x93, 0x18, 0x4b, 0xe5, 0x6a, 0xad, 0x90, 0xd6, 0xd0, 0x15, 0xc8, - 0x9e, 0xc4, 0xb2, 0xb4, 0xbd, 0xb6, 0x5d, 0x2d, 0xd4, 0x2a, 0x3b, 0xe5, 0x74, 0xf8, 0xea, 0xa7, - 0x30, 0xde, 0xc9, 0xc1, 0xdb, 0xe2, 0x46, 0x84, 0xc6, 0x20, 0x79, 0xbb, 0x5a, 0x58, 0x36, 0xd6, - 0x37, 0xd6, 0xcb, 0xe9, 0x10, 0x9a, 0x86, 0x29, 0x7f, 0x6b, 0xe8, 0xe5, 0xa5, 0x0d, 0xbd, 0x54, - 0x2e, 0x19, 0x3b, 0x85, 0xea, 0x76, 0x39, 0xad, 0x15, 0xbf, 0xd3, 0x1e, 0x3f, 0x9b, 0xd5, 0x9e, - 0x3c, 0x9b, 0xd5, 0x7e, 0x7b, 0x36, 0xab, 0x7d, 0x7b, 0x30, 0x1b, 0x7a, 0x72, 0x30, 0x1b, 0xfa, - 0xf9, 0x60, 0x36, 0x04, 0x97, 0xa8, 0x3d, 0x20, 0x47, 0x8b, 0xa3, 0xfe, 0xef, 0xc6, 0x4d, 0x71, - 0xb0, 0xa9, 0x7d, 0x5e, 0x3e, 0xb3, 0x87, 0xd5, 0x3f, 0xdf, 0x16, 0x61, 0x3d, 0xbf, 0xa1, 0xeb, - 0x31, 0x49, 0x7c, 0xff, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xcf, 0x32, 0xca, 0xaf, 0x16, - 0x00, 0x00, -} - + // 1651 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x77, 0xdb, 0xf1, 0xd7, 0x73, 0x3e, 0x3c, 0x45, 0x36, 0x63, 0x45, 0x4a, 0x26, 0xe3, 0x81, + 0x49, 0x18, 0x16, 0x9b, 0x0d, 0x2c, 0x9f, 0x1a, 0x69, 0xec, 0xd8, 0x49, 0xac, 0x38, 0x1f, 0x5b, + 0x71, 0x82, 0x66, 0x35, 0x4c, 0xab, 0x6c, 0x57, 0xbc, 0xa5, 0xed, 0x0f, 0xd3, 0x5d, 0x1d, 0x25, + 0xdc, 0x97, 0x13, 0x07, 0x84, 0xb8, 0xf2, 0x17, 0xf0, 0x2f, 0xf0, 0x07, 0xec, 0x71, 0xb9, 0x21, + 0x90, 0x46, 0x68, 0x82, 0x84, 0x04, 0x07, 0x4e, 0x70, 0x46, 0x55, 0xd5, 0x6d, 0x3b, 0x4e, 0x27, + 0x76, 0x26, 0x19, 0x6d, 0x46, 0x73, 0xab, 0x7a, 0xfd, 0xde, 0xaf, 0xde, 0x67, 0xbd, 0xd7, 0xdd, + 0xf0, 0xa1, 0xdd, 0xa5, 0x16, 0xa7, 0x06, 0x35, 0x29, 0x77, 0x4e, 0x8b, 0x5d, 0xc7, 0xe6, 0x76, + 0x51, 0xac, 0x59, 0xcb, 0x2d, 0x1e, 0x7f, 0x14, 0x2c, 0x0b, 0xf2, 0x01, 0x5a, 0x3c, 0xc7, 0xad, + 0x88, 0x85, 0x80, 0xe5, 0xf8, 0xa3, 0xf9, 0xd9, 0x8e, 0xdd, 0xb1, 0x15, 0x86, 0x58, 0x29, 0x86, + 0xf9, 0x27, 0x61, 0x67, 0xb4, 0x6c, 0xd3, 0xb4, 0x2d, 0x71, 0x84, 0x5a, 0xf9, 0xbc, 0x85, 0x30, + 0x5e, 0x87, 0xba, 0xb6, 0xe7, 0xb4, 0xa8, 0xe0, 0x0e, 0xd6, 0x8a, 0x3f, 0xcf, 0x20, 0xb3, 0xad, + 0xce, 0xaf, 0x10, 0x4e, 0xd0, 0xa7, 0x90, 0x0d, 0x18, 0x74, 0x5f, 0xaf, 0x9c, 0xb6, 0x14, 0x5b, + 0xc9, 0xac, 0x16, 0x0b, 0x57, 0xeb, 0x5e, 0xc0, 0xbe, 0x9c, 0x0f, 0x87, 0x67, 0x9c, 0xf3, 0x84, + 0xfc, 0x17, 0x51, 0x98, 0x19, 0x62, 0x42, 0x5b, 0x90, 0x0a, 0xd8, 0x72, 0xda, 0x92, 0xb6, 0x92, + 0x59, 0xfd, 0x76, 0xe8, 0x39, 0x3d, 0xad, 0x07, 0x0e, 0x2a, 0x4f, 0x7c, 0xf9, 0xea, 0x41, 0x04, + 0xf7, 0x00, 0xd0, 0x17, 0x1a, 0x3c, 0x60, 0x96, 0xcb, 0x1d, 0xcf, 0xa4, 0x16, 0x27, 0x9c, 0xd9, + 0x96, 0x6e, 0xb0, 0xa6, 0x43, 0x9c, 0xd3, 0x9e, 0x31, 0x51, 0x69, 0xcc, 0xd3, 0x51, 0xc6, 0xd4, + 0xce, 0xc3, 0xd4, 0x15, 0x4a, 0x60, 0xda, 0x02, 0xbb, 0xea, 0x31, 0x5a, 0x00, 0x70, 0x5b, 0x9f, + 0x51, 0x93, 0xe8, 0x9e, 0x63, 0xe4, 0x62, 0x4b, 0xda, 0x4a, 0x1a, 0xa7, 0x15, 0xe5, 0xc0, 0x31, + 0xf2, 0xff, 0xd3, 0x60, 0xe1, 0x4a, 0x7c, 0xc4, 0xe1, 0xfe, 0x25, 0x76, 0xf8, 0x4e, 0xfa, 0x38, + 0x54, 0x7f, 0x3f, 0x11, 0x2e, 0x55, 0xdf, 0x77, 0xd8, 0x5c, 0xb8, 0xf6, 0xe8, 0x19, 0x24, 0xcf, + 0x7b, 0xe9, 0xf1, 0x28, 0x2f, 0x29, 0x7d, 0x71, 0x20, 0x36, 0xca, 0xf0, 0x3f, 0xc5, 0x21, 0xa1, + 0x44, 0x10, 0x82, 0x09, 0x8b, 0x98, 0x2a, 0xe6, 0x69, 0x2c, 0xd7, 0x68, 0x09, 0x32, 0x6d, 0xea, + 0xb6, 0x1c, 0xd6, 0x15, 0x5a, 0xe5, 0xa2, 0xf2, 0xd1, 0x20, 0x49, 0x48, 0x79, 0x16, 0xe3, 0x3e, + 0xb2, 0x5c, 0xa3, 0x2d, 0x48, 0x33, 0x8b, 0xeb, 0x1d, 0xe2, 0x75, 0x68, 0x6e, 0x42, 0x7a, 0x67, + 0x65, 0x74, 0x74, 0xf9, 0x86, 0xe0, 0x2f, 0x47, 0x73, 0xda, 0x66, 0x04, 0xa7, 0x98, 0xbf, 0x47, + 0x4f, 0x21, 0xae, 0x80, 0xe2, 0x12, 0xe8, 0x5b, 0xa3, 0x80, 0xa4, 0xd4, 0x66, 0x04, 0x2b, 0x29, + 0x54, 0x85, 0xa4, 0xd0, 0xc5, 0xf5, 0xcc, 0x5c, 0x42, 0x02, 0x3c, 0x1e, 0x43, 0x93, 0x7d, 0xcf, + 0xf4, 0xf5, 0x48, 0x30, 0xb9, 0x43, 0x3f, 0x82, 0x98, 0x80, 0x48, 0x4a, 0x88, 0x47, 0xa3, 0x20, + 0xf6, 0x3d, 0x73, 0x33, 0x82, 0x85, 0x04, 0xfa, 0x39, 0x4c, 0x89, 0xf3, 0x3f, 0x63, 0x2e, 0xb7, + 0x3b, 0x0e, 0x31, 0x73, 0x29, 0x09, 0xf1, 0xe1, 0x18, 0x5a, 0x6c, 0x06, 0x32, 0xbe, 0x2e, 0x93, + 0x6c, 0x80, 0x86, 0x6a, 0x90, 0xee, 0x83, 0xa6, 0xaf, 0xa8, 0xd3, 0x01, 0xd0, 0x9e, 0xf4, 0x66, + 0x04, 0xf7, 0xa5, 0xd1, 0xe7, 0xf0, 0x01, 0x3d, 0xe9, 0xda, 0x16, 0xb5, 0x38, 0x23, 0xc6, 0x80, + 0xae, 0x20, 0x61, 0x7f, 0x30, 0x0a, 0xb6, 0xda, 0x17, 0x1e, 0x3c, 0x61, 0x96, 0x86, 0xd0, 0xd1, + 0x1a, 0x24, 0x5d, 0xcf, 0x34, 0x45, 0xe1, 0x64, 0x24, 0xfc, 0xf2, 0x18, 0xde, 0x14, 0xec, 0x9b, + 0x11, 0x1c, 0x48, 0x96, 0x13, 0x30, 0xd1, 0x26, 0x9c, 0xe4, 0x9f, 0x43, 0x5c, 0x65, 0xc9, 0x1e, + 0x64, 0x04, 0x41, 0xef, 0xda, 0xcc, 0xe2, 0x63, 0xdf, 0x8f, 0x3b, 0x9e, 0xd9, 0xa4, 0x8e, 0xb8, + 0x65, 0xf7, 0x84, 0x1c, 0x86, 0x76, 0xb0, 0x74, 0xf3, 0xff, 0xd6, 0x20, 0x26, 0x22, 0x7f, 0xeb, + 0xc8, 0xc8, 0x86, 0xfb, 0xa4, 0xd3, 0x71, 0x68, 0x47, 0x5d, 0x23, 0x9c, 0x9a, 0x5d, 0xdb, 0x21, + 0x06, 0xe3, 0xa7, 0xb2, 0xc0, 0xa6, 0x57, 0x7f, 0x38, 0x0a, 0xbd, 0xd4, 0x17, 0x6f, 0xf4, 0xa5, + 0xf1, 0x1c, 0x09, 0xa5, 0xa3, 0x87, 0x30, 0xc9, 0x5c, 0xdd, 0xb4, 0x2d, 0x9b, 0xdb, 0x16, 0x6b, + 0xc9, 0x5a, 0x4d, 0xe1, 0x0c, 0x73, 0xb7, 0x03, 0x52, 0xfe, 0xcf, 0x1a, 0xa4, 0xfb, 0x31, 0xda, + 0x0f, 0xb3, 0x79, 0x75, 0xec, 0xec, 0xba, 0x1b, 0x66, 0xe7, 0xff, 0xa9, 0xc1, 0x6c, 0x58, 0x6a, + 0xa2, 0x97, 0x61, 0xe6, 0x3d, 0x7d, 0x93, 0x2c, 0xbf, 0x23, 0x96, 0xbe, 0x80, 0xa4, 0x5f, 0x24, + 0xe8, 0x93, 0x30, 0xdb, 0xbe, 0x37, 0x66, 0x89, 0x85, 0x57, 0xc2, 0x1f, 0x63, 0x30, 0x33, 0x94, + 0xcf, 0x68, 0x1b, 0x80, 0x70, 0xee, 0xb0, 0xa6, 0xc7, 0xa9, 0x9b, 0x4b, 0xca, 0x53, 0x96, 0x47, + 0x74, 0xc0, 0x2d, 0x7a, 0x7a, 0x48, 0x0c, 0x2f, 0x18, 0x12, 0x06, 0x00, 0xd0, 0x36, 0x24, 0x0c, + 0xd2, 0xa4, 0x46, 0xa0, 0xf0, 0x77, 0x47, 0x40, 0xed, 0x73, 0x87, 0x59, 0x9d, 0x1e, 0x60, 0x42, + 0x00, 0xe6, 0x34, 0xec, 0x83, 0xa0, 0x22, 0xcc, 0xba, 0x9c, 0x38, 0x5c, 0xe7, 0xcc, 0xa4, 0xba, + 0x67, 0xb1, 0x13, 0xdd, 0x22, 0x96, 0x2d, 0xbd, 0x9f, 0xc0, 0xf7, 0xe4, 0xb3, 0x06, 0x33, 0xe9, + 0x81, 0xc5, 0x4e, 0x76, 0x88, 0x65, 0xa3, 0x6f, 0xc2, 0xf4, 0x10, 0x6b, 0x4c, 0xb2, 0x4e, 0xf2, + 0x41, 0xae, 0x05, 0x48, 0x13, 0x57, 0x6f, 0xdb, 0x5e, 0xd3, 0x50, 0x7d, 0x4d, 0x76, 0x2a, 0xe2, + 0x56, 0x24, 0x05, 0xdd, 0x87, 0x04, 0x71, 0x75, 0x66, 0x71, 0xd9, 0x69, 0xb2, 0xa2, 0x07, 0x11, + 0xb7, 0x66, 0x71, 0x54, 0x87, 0x34, 0x3d, 0xa1, 0x66, 0xd7, 0x20, 0x8e, 0x9b, 0x8b, 0x4b, 0x03, + 0x57, 0x46, 0x67, 0x9b, 0x12, 0xf0, 0x9d, 0xd5, 0x07, 0x40, 0xb3, 0x10, 0x3f, 0x32, 0x48, 0xc7, + 0x95, 0x9d, 0x64, 0x0a, 0xab, 0x4d, 0x39, 0x09, 0xf1, 0x63, 0xe1, 0x8b, 0xfc, 0x59, 0x0c, 0xd0, + 0xc5, 0xfc, 0x1c, 0x0a, 0x58, 0xfa, 0xfd, 0x08, 0xd8, 0x2c, 0xc4, 0x5b, 0xb6, 0x67, 0x71, 0x19, + 0xac, 0x04, 0x56, 0x1b, 0x94, 0x55, 0xbd, 0x5c, 0xcc, 0x13, 0x9a, 0x6a, 0xd2, 0x8f, 0x60, 0xaa, + 0xe9, 0xb5, 0x3e, 0xa7, 0x5c, 0x97, 0x1c, 0x6e, 0x2e, 0xb1, 0x14, 0x13, 0x60, 0x8a, 0xb8, 0x26, + 0x69, 0x68, 0x19, 0x66, 0xe8, 0x49, 0xd7, 0x60, 0x2d, 0xc6, 0xf5, 0xa6, 0xed, 0x59, 0x6d, 0x95, + 0xf7, 0x1a, 0x9e, 0x0e, 0xc8, 0x65, 0x49, 0x3d, 0x1f, 0xee, 0xd4, 0xad, 0x85, 0x1b, 0x06, 0xc2, + 0x9d, 0xff, 0x7d, 0x1c, 0x16, 0xae, 0xbc, 0x90, 0x86, 0x02, 0xae, 0xdd, 0x34, 0xe0, 0x5f, 0x73, + 0x84, 0x66, 0x21, 0xee, 0xb6, 0x88, 0x41, 0x65, 0x69, 0xdd, 0xc3, 0x6a, 0x23, 0x86, 0xdb, 0x5f, + 0x51, 0xc7, 0x56, 0x51, 0x93, 0xc3, 0x59, 0x02, 0xa7, 0x05, 0x45, 0x86, 0x0c, 0x11, 0x48, 0x75, + 0x6d, 0x97, 0x71, 0x76, 0x4c, 0xfd, 0xb1, 0xab, 0x7a, 0xa3, 0x4b, 0xbe, 0x50, 0x96, 0xf9, 0xe0, + 0xe2, 0x1e, 0xac, 0x38, 0xc2, 0x92, 0x17, 0xf2, 0x31, 0xf5, 0x87, 0xb0, 0xdb, 0x3a, 0x22, 0x80, + 0x0d, 0x4f, 0x80, 0xf3, 0x49, 0x96, 0xb9, 0x61, 0x92, 0xcd, 0xaf, 0x43, 0xd2, 0x3f, 0x18, 0xcd, + 0x41, 0xc2, 0x3e, 0x3a, 0x72, 0x29, 0x97, 0x2f, 0x02, 0xf7, 0xb0, 0xbf, 0xbb, 0x58, 0x23, 0xe2, + 0x85, 0x64, 0xe2, 0x7c, 0x8d, 0xe4, 0xff, 0x1b, 0x83, 0xec, 0x70, 0x2f, 0x79, 0x3f, 0x7b, 0xc5, + 0xb8, 0x89, 0xcd, 0x60, 0xe6, 0x97, 0x1e, 0xb1, 0x38, 0x33, 0xa8, 0x2e, 0x2f, 0x70, 0x75, 0xf9, + 0x64, 0x56, 0x9f, 0x5d, 0xb7, 0x67, 0x17, 0xa4, 0x7d, 0x25, 0xfe, 0x89, 0x0f, 0x87, 0xa7, 0x03, + 0x60, 0xf9, 0xe0, 0x92, 0xc6, 0x31, 0xbf, 0x06, 0x33, 0x43, 0x82, 0x68, 0x1e, 0x52, 0x81, 0xa8, + 0x4c, 0x02, 0x0d, 0xf7, 0xf6, 0x02, 0x44, 0xaa, 0x29, 0xfd, 0xa3, 0x61, 0xbf, 0xe9, 0xfc, 0x2b, + 0x06, 0xa9, 0x20, 0xbb, 0xd0, 0x4b, 0xf8, 0xc6, 0x11, 0x33, 0x38, 0x75, 0x68, 0x5b, 0xbf, 0x69, + 0xe0, 0x51, 0x80, 0x54, 0xea, 0x27, 0xc0, 0x4b, 0x98, 0xe9, 0xe1, 0xdf, 0x46, 0x26, 0x4c, 0x07, + 0x68, 0x75, 0x95, 0x11, 0x17, 0x03, 0x1c, 0x1d, 0x35, 0x0c, 0xc4, 0xc6, 0x1f, 0x06, 0x9e, 0x43, + 0xd2, 0xed, 0x12, 0x4b, 0x67, 0x6d, 0x99, 0x1a, 0x93, 0xe5, 0x67, 0x42, 0x8d, 0xbf, 0xbe, 0x7a, + 0xf0, 0xe3, 0x8e, 0x3d, 0xa4, 0x3f, 0xb3, 0x8b, 0x2d, 0xdb, 0x30, 0x68, 0x8b, 0xdb, 0x4e, 0xd1, + 0xb4, 0xdb, 0xd4, 0x28, 0x32, 0x8b, 0x53, 0xc7, 0x22, 0x46, 0x51, 0xcc, 0x67, 0x85, 0xfd, 0x2e, + 0xb1, 0x6a, 0x15, 0x9c, 0x10, 0x80, 0xb5, 0x36, 0x7a, 0x01, 0x29, 0xee, 0x90, 0x16, 0x15, 0xd8, + 0x71, 0x89, 0x5d, 0xf2, 0xb1, 0x7f, 0x72, 0x7d, 0xec, 0x86, 0x40, 0xaa, 0x55, 0x70, 0x52, 0x42, + 0xd6, 0xda, 0xfd, 0x09, 0xe3, 0x0f, 0x51, 0x98, 0xac, 0x59, 0xbc, 0x5f, 0xe0, 0x5b, 0x37, 0xab, + 0x48, 0x15, 0xe9, 0xb7, 0x5f, 0x8f, 0x2a, 0x6f, 0x85, 0xd3, 0xb3, 0x7e, 0xde, 0xa2, 0xdd, 0x8b, + 0x93, 0xd9, 0x77, 0xc6, 0x78, 0x33, 0xbf, 0xf4, 0x22, 0xfd, 0x69, 0x34, 0xa7, 0xe5, 0x7f, 0x01, + 0xa9, 0xe0, 0x6b, 0x06, 0xda, 0x0e, 0x1b, 0xc7, 0xc7, 0x79, 0xf9, 0x0f, 0x1d, 0xc5, 0x25, 0xfc, + 0x7f, 0x34, 0x48, 0xa8, 0x6f, 0x14, 0xb7, 0x8c, 0x7e, 0x17, 0x5f, 0x4c, 0xa5, 0xc5, 0xbf, 0x8e, + 0xc1, 0x07, 0x83, 0xdf, 0x43, 0xde, 0xb9, 0xcc, 0xbb, 0xba, 0x13, 0x64, 0xdf, 0xc6, 0x10, 0xba, + 0x7b, 0x71, 0x08, 0xbd, 0x79, 0x66, 0xff, 0x4d, 0x93, 0x95, 0xdf, 0x7f, 0x93, 0x3e, 0x0c, 0x4b, + 0xc0, 0x8f, 0xaf, 0xf3, 0x6d, 0xeb, 0x6e, 0x64, 0xa2, 0xb4, 0xee, 0x1f, 0x51, 0xc8, 0x0c, 0xb8, + 0x00, 0xbd, 0xb8, 0xa5, 0x3e, 0xa3, 0x5c, 0xf9, 0x66, 0x5d, 0xa6, 0x77, 0x6d, 0xc5, 0x06, 0xaf, + 0xad, 0x77, 0xb5, 0x87, 0x08, 0x37, 0x3f, 0xf9, 0x8d, 0x06, 0x73, 0xe1, 0xd1, 0x41, 0xcb, 0xf0, + 0xa8, 0xb4, 0xb1, 0x81, 0xab, 0x1b, 0xa5, 0x46, 0x6d, 0x77, 0x47, 0x6f, 0x54, 0xb7, 0xf7, 0x76, + 0x71, 0xa9, 0x5e, 0x6b, 0x3c, 0xd7, 0x0f, 0x76, 0xf6, 0xf7, 0xaa, 0x6b, 0xb5, 0xf5, 0x5a, 0xb5, + 0x92, 0x8d, 0xa0, 0x87, 0xb0, 0x70, 0x19, 0x63, 0xa5, 0x5a, 0x6f, 0x94, 0xb2, 0x1a, 0x7a, 0x0c, + 0xf9, 0xcb, 0x58, 0xd6, 0x0e, 0xb6, 0x0f, 0xea, 0xa5, 0x46, 0xed, 0xb0, 0x9a, 0x8d, 0x3e, 0xf9, + 0x19, 0x4c, 0xf7, 0x72, 0x70, 0x5d, 0x8e, 0xd6, 0x53, 0x90, 0x5e, 0xaf, 0x97, 0x36, 0xf4, 0x9d, + 0xdd, 0x9d, 0x6a, 0x36, 0x82, 0xe6, 0x61, 0xce, 0xdf, 0xea, 0xb8, 0xba, 0xb6, 0x8b, 0x2b, 0xd5, + 0x8a, 0x7e, 0x58, 0xaa, 0x1f, 0x54, 0xb3, 0x5a, 0xf9, 0x77, 0xda, 0x97, 0xaf, 0x17, 0xb5, 0xaf, + 0x5e, 0x2f, 0x6a, 0x7f, 0x7f, 0xbd, 0xa8, 0xfd, 0xf6, 0x6c, 0x31, 0xf2, 0xd5, 0xd9, 0x62, 0xe4, + 0x2f, 0x67, 0x8b, 0x11, 0x78, 0xc8, 0xec, 0x11, 0x39, 0x5a, 0x9e, 0xf4, 0x7f, 0x2e, 0xec, 0x89, + 0x07, 0x7b, 0xda, 0xa7, 0xd5, 0x6b, 0x7b, 0x58, 0xfd, 0x4c, 0xea, 0x50, 0x6b, 0xe0, 0xff, 0x56, + 0x33, 0x21, 0x89, 0xdf, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0x16, 0x1c, 0xd1, 0x08, + 0x1b, 0x00, 0x00, +} + +func (m *MetricsData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MetricsData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MetricsData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResourceMetrics) > 0 { + for iNdEx := len(m.ResourceMetrics) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceMetrics[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *ResourceMetrics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2361,6 +2787,27 @@ func (m *Metric_Histogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } +func (m *Metric_ExponentialHistogram) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric_ExponentialHistogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ExponentialHistogram != nil { + { + size, err := m.ExponentialHistogram.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + return len(dAtA) - i, nil +} func (m *Metric_Summary) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) @@ -2513,6 +2960,48 @@ func (m *Histogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ExponentialHistogram) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExponentialHistogram) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExponentialHistogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AggregationTemporality != 0 { + i = encodeVarintMetrics(dAtA, i, uint64(m.AggregationTemporality)) + i-- + dAtA[i] = 0x10 + } + if len(m.DataPoints) > 0 { + for iNdEx := len(m.DataPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *Summary) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2722,9 +3211,9 @@ func (m *HistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { } if len(m.ExplicitBounds) > 0 { for iNdEx := len(m.ExplicitBounds) - 1; iNdEx >= 0; iNdEx-- { - f10 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) + f11 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f10)) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f11)) } i = encodeVarintMetrics(dAtA, i, uint64(len(m.ExplicitBounds)*8)) i-- @@ -2780,6 +3269,167 @@ func (m *HistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ExponentialHistogramDataPoint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExponentialHistogramDataPoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExponentialHistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Exemplars) > 0 { + for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } + if m.Flags != 0 { + i = encodeVarintMetrics(dAtA, i, uint64(m.Flags)) + i-- + dAtA[i] = 0x50 + } + if m.Negative != nil { + { + size, err := m.Negative.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Positive != nil { + { + size, err := m.Positive.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.ZeroCount != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.ZeroCount)) + i-- + dAtA[i] = 0x39 + } + if m.Scale != 0 { + i = encodeVarintMetrics(dAtA, i, uint64((uint32(m.Scale)<<1)^uint32((m.Scale>>31)))) + i-- + dAtA[i] = 0x30 + } + if m.Sum != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) + i-- + dAtA[i] = 0x29 + } + if m.Count != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Count)) + i-- + dAtA[i] = 0x21 + } + if m.TimeUnixNano != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.TimeUnixNano)) + i-- + dAtA[i] = 0x19 + } + if m.StartTimeUnixNano != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.StartTimeUnixNano)) + i-- + dAtA[i] = 0x11 + } + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ExponentialHistogramDataPoint_Buckets) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExponentialHistogramDataPoint_Buckets) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExponentialHistogramDataPoint_Buckets) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BucketCounts) > 0 { + dAtA15 := make([]byte, len(m.BucketCounts)*10) + var j14 int + for _, num := range m.BucketCounts { + for num >= 1<<7 { + dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j14++ + } + dAtA15[j14] = uint8(num) + j14++ + } + i -= j14 + copy(dAtA[i:], dAtA15[:j14]) + i = encodeVarintMetrics(dAtA, i, uint64(j14)) + i-- + dAtA[i] = 0x12 + } + if m.Offset != 0 { + i = encodeVarintMetrics(dAtA, i, uint64((uint32(m.Offset)<<1)^uint32((m.Offset>>31)))) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *SummaryDataPoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3215,9 +3865,9 @@ func (m *IntHistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { } if len(m.ExplicitBounds) > 0 { for iNdEx := len(m.ExplicitBounds) - 1; iNdEx >= 0; iNdEx-- { - f11 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) + f16 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f11)) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f16)) } i = encodeVarintMetrics(dAtA, i, uint64(len(m.ExplicitBounds)*8)) i-- @@ -3395,6 +4045,21 @@ func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MetricsData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ResourceMetrics) > 0 { + for _, e := range m.ResourceMetrics { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + return n +} + func (m *ResourceMetrics) Size() (n int) { if m == nil { return 0 @@ -3533,6 +4198,18 @@ func (m *Metric_Histogram) Size() (n int) { } return n } +func (m *Metric_ExponentialHistogram) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExponentialHistogram != nil { + l = m.ExponentialHistogram.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + return n +} func (m *Metric_Summary) Size() (n int) { if m == nil { return 0 @@ -3599,6 +4276,24 @@ func (m *Histogram) Size() (n int) { return n } +func (m *ExponentialHistogram) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataPoints) > 0 { + for _, e := range m.DataPoints { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.AggregationTemporality != 0 { + n += 1 + sovMetrics(uint64(m.AggregationTemporality)) + } + return n +} + func (m *Summary) Size() (n int) { if m == nil { return 0 @@ -3719,7 +4414,76 @@ func (m *HistogramDataPoint) Size() (n int) { return n } -func (m *SummaryDataPoint) Size() (n int) { +func (m *ExponentialHistogramDataPoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.StartTimeUnixNano != 0 { + n += 9 + } + if m.TimeUnixNano != 0 { + n += 9 + } + if m.Count != 0 { + n += 9 + } + if m.Sum != 0 { + n += 9 + } + if m.Scale != 0 { + n += 1 + sozMetrics(uint64(m.Scale)) + } + if m.ZeroCount != 0 { + n += 9 + } + if m.Positive != nil { + l = m.Positive.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + if m.Negative != nil { + l = m.Negative.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + if m.Flags != 0 { + n += 1 + sovMetrics(uint64(m.Flags)) + } + if len(m.Exemplars) > 0 { + for _, e := range m.Exemplars { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + return n +} + +func (m *ExponentialHistogramDataPoint_Buckets) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Offset != 0 { + n += 1 + sozMetrics(uint64(m.Offset)) + } + if len(m.BucketCounts) > 0 { + l = 0 + for _, e := range m.BucketCounts { + l += sovMetrics(uint64(e)) + } + n += 1 + sovMetrics(uint64(l)) + l + } + return n +} + +func (m *SummaryDataPoint) Size() (n int) { if m == nil { return 0 } @@ -3979,6 +4743,90 @@ func sovMetrics(x uint64) (n int) { func sozMetrics(x uint64) (n int) { return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MetricsData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MetricsData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MetricsData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceMetrics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceMetrics = append(m.ResourceMetrics, &ResourceMetrics{}) + if err := m.ResourceMetrics[len(m.ResourceMetrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ResourceMetrics) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4612,6 +5460,41 @@ func (m *Metric) Unmarshal(dAtA []byte) error { } m.Data = &Metric_Histogram{v} iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExponentialHistogram", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ExponentialHistogram{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Metric_ExponentialHistogram{v} + iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) @@ -4978,7 +5861,7 @@ func (m *Histogram) Unmarshal(dAtA []byte) error { } return nil } -func (m *Summary) Unmarshal(dAtA []byte) error { +func (m *ExponentialHistogram) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5001,10 +5884,10 @@ func (m *Summary) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Summary: wiretype end group for non-group") + return fmt.Errorf("proto: ExponentialHistogram: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Summary: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExponentialHistogram: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5036,11 +5919,30 @@ func (m *Summary) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DataPoints = append(m.DataPoints, &SummaryDataPoint{}) + m.DataPoints = append(m.DataPoints, &ExponentialHistogramDataPoint{}) if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregationTemporality", wireType) + } + m.AggregationTemporality = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AggregationTemporality |= AggregationTemporality(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipMetrics(dAtA[iNdEx:]) @@ -5062,7 +5964,7 @@ func (m *Summary) Unmarshal(dAtA []byte) error { } return nil } -func (m *NumberDataPoint) Unmarshal(dAtA []byte) error { +func (m *Summary) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5085,15 +5987,15 @@ func (m *NumberDataPoint) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NumberDataPoint: wiretype end group for non-group") + return fmt.Errorf("proto: Summary: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NumberDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Summary: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DataPoints", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5120,47 +6022,131 @@ func (m *NumberDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, v11.StringKeyValue{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DataPoints = append(m.DataPoints, &SummaryDataPoint{}) + if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimeUnixNano", wireType) - } - m.StartTimeUnixNano = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err } - m.StartTimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixNano", wireType) + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetrics } - m.TimeUnixNano = 0 - if (iNdEx + 8) > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field AsDouble", wireType) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NumberDataPoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics } - var v uint64 - if (iNdEx + 8) > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = &NumberDataPoint_AsDouble{float64(math.Float64frombits(v))} - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) - } - var msglen int + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NumberDataPoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NumberDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, v11.StringKeyValue{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTimeUnixNano", wireType) + } + m.StartTimeUnixNano = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.StartTimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixNano", wireType) + } + m.TimeUnixNano = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field AsDouble", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = &NumberDataPoint_AsDouble{float64(math.Float64frombits(v))} + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetrics @@ -5593,6 +6579,434 @@ func (m *HistogramDataPoint) Unmarshal(dAtA []byte) error { } return nil } +func (m *ExponentialHistogramDataPoint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExponentialHistogramDataPoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExponentialHistogramDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, v11.KeyValue{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTimeUnixNano", wireType) + } + m.StartTimeUnixNano = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.StartTimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixNano", wireType) + } + m.TimeUnixNano = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.Count = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 5: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Sum = float64(math.Float64frombits(v)) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Scale", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) + m.Scale = v + case 7: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ZeroCount", wireType) + } + m.ZeroCount = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.ZeroCount = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Positive", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Positive == nil { + m.Positive = &ExponentialHistogramDataPoint_Buckets{} + } + if err := m.Positive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Negative", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Negative == nil { + m.Negative = &ExponentialHistogramDataPoint_Buckets{} + } + if err := m.Negative.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Flags", wireType) + } + m.Flags = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Flags |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Exemplars = append(m.Exemplars, Exemplar{}) + if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExponentialHistogramDataPoint_Buckets) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Buckets: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Buckets: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) + m.Offset = v + case 2: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BucketCounts = append(m.BucketCounts, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.BucketCounts) == 0 { + m.BucketCounts = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BucketCounts = append(m.BucketCounts, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BucketCounts", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *SummaryDataPoint) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/model/internal/data/protogen/trace/v1/trace.pb.go b/model/internal/data/protogen/trace/v1/trace.pb.go index 2e8d6776404..092cb7903b4 100644 --- a/model/internal/data/protogen/trace/v1/trace.pb.go +++ b/model/internal/data/protogen/trace/v1/trace.pb.go @@ -79,7 +79,7 @@ func (x Span_SpanKind) String() string { } func (Span_SpanKind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{2, 0} + return fileDescriptor_5c407ac9c675a601, []int{3, 0} } type Status_DeprecatedStatusCode int32 @@ -149,7 +149,7 @@ func (x Status_DeprecatedStatusCode) String() string { } func (Status_DeprecatedStatusCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{3, 0} + return fileDescriptor_5c407ac9c675a601, []int{4, 0} } // For the semantics of status codes see @@ -183,7 +183,66 @@ func (x Status_StatusCode) String() string { } func (Status_StatusCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{3, 1} + return fileDescriptor_5c407ac9c675a601, []int{4, 1} +} + +// TracesData represents the traces data that can be stored in a persistent storage, +// OR can be embedded by other protocols that transfer OTLP traces data but do +// not implement the OTLP protocol. +// +// The main difference between this message and collector protocol is that +// in this message there will not be any "control" or "metadata" specific to +// OTLP protocol. +// +// When new fields are added into this message, the OTLP request MUST be updated +// as well. +type TracesData struct { + // An array of ResourceSpans. + // For data coming from a single resource this array will typically contain + // one element. Intermediary nodes that receive data from multiple origins + // typically batch the data before forwarding further and in that case this + // array will contain multiple elements. + ResourceSpans []*ResourceSpans `protobuf:"bytes,1,rep,name=resource_spans,json=resourceSpans,proto3" json:"resource_spans,omitempty"` +} + +func (m *TracesData) Reset() { *m = TracesData{} } +func (m *TracesData) String() string { return proto.CompactTextString(m) } +func (*TracesData) ProtoMessage() {} +func (*TracesData) Descriptor() ([]byte, []int) { + return fileDescriptor_5c407ac9c675a601, []int{0} +} +func (m *TracesData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TracesData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TracesData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TracesData) XXX_Merge(src proto.Message) { + xxx_messageInfo_TracesData.Merge(m, src) +} +func (m *TracesData) XXX_Size() int { + return m.Size() +} +func (m *TracesData) XXX_DiscardUnknown() { + xxx_messageInfo_TracesData.DiscardUnknown(m) +} + +var xxx_messageInfo_TracesData proto.InternalMessageInfo + +func (m *TracesData) GetResourceSpans() []*ResourceSpans { + if m != nil { + return m.ResourceSpans + } + return nil } // A collection of InstrumentationLibrarySpans from a Resource. @@ -203,7 +262,7 @@ func (m *ResourceSpans) Reset() { *m = ResourceSpans{} } func (m *ResourceSpans) String() string { return proto.CompactTextString(m) } func (*ResourceSpans) ProtoMessage() {} func (*ResourceSpans) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{0} + return fileDescriptor_5c407ac9c675a601, []int{1} } func (m *ResourceSpans) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -269,7 +328,7 @@ func (m *InstrumentationLibrarySpans) Reset() { *m = InstrumentationLibr func (m *InstrumentationLibrarySpans) String() string { return proto.CompactTextString(m) } func (*InstrumentationLibrarySpans) ProtoMessage() {} func (*InstrumentationLibrarySpans) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{1} + return fileDescriptor_5c407ac9c675a601, []int{2} } func (m *InstrumentationLibrarySpans) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -362,9 +421,7 @@ type Span struct { // This makes it easier to correlate spans in different traces. // // This field is semantically required to be set to non-empty string. - // When null or empty string received - receiver may use string "name" - // as a replacement. There might be smarted algorithms implemented by - // receiver to fix the empty span name. + // Empty value is equivalent to an unknown span name. // // This field is required. Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` @@ -421,7 +478,7 @@ func (m *Span) Reset() { *m = Span{} } func (m *Span) String() string { return proto.CompactTextString(m) } func (*Span) ProtoMessage() {} func (*Span) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{2} + return fileDescriptor_5c407ac9c675a601, []int{3} } func (m *Span) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -553,7 +610,7 @@ func (m *Span_Event) Reset() { *m = Span_Event{} } func (m *Span_Event) String() string { return proto.CompactTextString(m) } func (*Span_Event) ProtoMessage() {} func (*Span_Event) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{2, 0} + return fileDescriptor_5c407ac9c675a601, []int{3, 0} } func (m *Span_Event) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -633,7 +690,7 @@ func (m *Span_Link) Reset() { *m = Span_Link{} } func (m *Span_Link) String() string { return proto.CompactTextString(m) } func (*Span_Link) ProtoMessage() {} func (*Span_Link) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{2, 1} + return fileDescriptor_5c407ac9c675a601, []int{3, 1} } func (m *Span_Link) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -703,7 +760,7 @@ func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_5c407ac9c675a601, []int{3} + return fileDescriptor_5c407ac9c675a601, []int{4} } func (m *Status) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,6 +815,7 @@ func init() { proto.RegisterEnum("opentelemetry.proto.trace.v1.Span_SpanKind", Span_SpanKind_name, Span_SpanKind_value) proto.RegisterEnum("opentelemetry.proto.trace.v1.Status_DeprecatedStatusCode", Status_DeprecatedStatusCode_name, Status_DeprecatedStatusCode_value) proto.RegisterEnum("opentelemetry.proto.trace.v1.Status_StatusCode", Status_StatusCode_name, Status_StatusCode_value) + proto.RegisterType((*TracesData)(nil), "opentelemetry.proto.trace.v1.TracesData") proto.RegisterType((*ResourceSpans)(nil), "opentelemetry.proto.trace.v1.ResourceSpans") proto.RegisterType((*InstrumentationLibrarySpans)(nil), "opentelemetry.proto.trace.v1.InstrumentationLibrarySpans") proto.RegisterType((*Span)(nil), "opentelemetry.proto.trace.v1.Span") @@ -771,86 +829,124 @@ func init() { } var fileDescriptor_5c407ac9c675a601 = []byte{ - // 1253 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x41, 0x6f, 0xdb, 0x46, - 0x13, 0x15, 0x6d, 0x49, 0xb6, 0xc7, 0xb6, 0xcc, 0xec, 0xe7, 0xe4, 0x63, 0x9c, 0x46, 0x16, 0x54, - 0x37, 0x51, 0x92, 0x56, 0x6a, 0x52, 0x14, 0x48, 0x0e, 0x45, 0x43, 0x91, 0xeb, 0x84, 0x30, 0x4d, - 0x0a, 0x4b, 0xd2, 0x4d, 0x8a, 0x02, 0x04, 0x23, 0x6e, 0x5c, 0x22, 0x12, 0x29, 0x90, 0x94, 0x91, - 0x1c, 0x0a, 0xf4, 0x07, 0xf4, 0xd0, 0x6b, 0xff, 0x51, 0xd0, 0x53, 0x8e, 0x45, 0x0e, 0x41, 0x11, - 0x9f, 0x0a, 0xf4, 0x17, 0x14, 0x3d, 0x14, 0xbb, 0xa4, 0x6c, 0xcb, 0x30, 0xe5, 0x04, 0x68, 0x2e, - 0xbd, 0x18, 0xf4, 0xcc, 0x9b, 0xf7, 0xde, 0xce, 0x0c, 0x17, 0x22, 0xb4, 0xa2, 0x11, 0x0d, 0x53, - 0x3a, 0xa0, 0x43, 0x9a, 0xc6, 0x2f, 0x3a, 0xa3, 0x38, 0x4a, 0xa3, 0x4e, 0x1a, 0x7b, 0x7d, 0xda, - 0x39, 0xb8, 0x9d, 0x3d, 0xb4, 0x79, 0x10, 0x7d, 0x34, 0x85, 0xcc, 0x82, 0xed, 0x0c, 0x70, 0x70, - 0x7b, 0x63, 0x7d, 0x3f, 0xda, 0x8f, 0xb2, 0x6a, 0xf6, 0x94, 0xa5, 0x37, 0x6e, 0x9e, 0xc5, 0xde, - 0x8f, 0x86, 0xc3, 0x28, 0x64, 0xf4, 0xd9, 0x53, 0x8e, 0x6d, 0x9f, 0x85, 0x8d, 0x69, 0x12, 0x8d, - 0xe3, 0xcc, 0xcc, 0xe4, 0x39, 0xc3, 0x37, 0xff, 0x12, 0x60, 0x95, 0xe4, 0x21, 0x6b, 0xe4, 0x85, - 0x09, 0xda, 0x81, 0xc5, 0x09, 0x46, 0x12, 0x1a, 0x42, 0x6b, 0xf9, 0xce, 0x8d, 0xf6, 0x59, 0xa6, - 0x8f, 0x88, 0x0e, 0x6e, 0xb7, 0x27, 0x0c, 0xdd, 0xf2, 0xcb, 0x37, 0x9b, 0x25, 0x72, 0x44, 0x80, - 0x7e, 0x80, 0xab, 0x41, 0x98, 0xa4, 0xf1, 0x78, 0x48, 0xc3, 0xd4, 0x4b, 0x83, 0x28, 0x74, 0x07, - 0xc1, 0x93, 0xd8, 0x8b, 0x5f, 0xb8, 0x09, 0x53, 0x93, 0xe6, 0x1a, 0xf3, 0xad, 0xe5, 0x3b, 0xf7, - 0xda, 0xb3, 0xda, 0xd2, 0xd6, 0xa6, 0x29, 0xf4, 0x8c, 0x81, 0xdb, 0x25, 0x57, 0x82, 0xe2, 0x24, - 0xba, 0x0a, 0x90, 0xf4, 0xbf, 0xa7, 0x43, 0xcf, 0x1d, 0xc7, 0x03, 0x69, 0xbe, 0x21, 0xb4, 0x96, - 0xc8, 0x52, 0x16, 0x71, 0xe2, 0x41, 0xf3, 0x4f, 0x01, 0xae, 0xcc, 0xe0, 0x46, 0x29, 0xfc, 0xbf, - 0xc0, 0x7d, 0xde, 0x99, 0x2f, 0xcf, 0xf4, 0x9d, 0x0f, 0xa4, 0xd0, 0x78, 0xde, 0xa5, 0x4b, 0x67, - 0x3b, 0x47, 0x77, 0xa1, 0x72, 0xb2, 0x37, 0xcd, 0xd9, 0xbd, 0x61, 0x4e, 0x49, 0x56, 0x70, 0xde, - 0x71, 0x7f, 0x5c, 0x85, 0x32, 0x83, 0xa3, 0xef, 0x60, 0x91, 0xd7, 0xbb, 0x81, 0xcf, 0x0f, 0xb2, - 0xd2, 0x95, 0x99, 0xa3, 0xd7, 0x6f, 0x36, 0xef, 0xed, 0x47, 0xa7, 0xe4, 0x02, 0xb6, 0x6a, 0x83, - 0x01, 0xed, 0xa7, 0x51, 0xdc, 0x19, 0x46, 0x3e, 0x1d, 0x74, 0x82, 0x30, 0xa5, 0x71, 0xe8, 0x0d, - 0x3a, 0xbe, 0x97, 0x7a, 0x6d, 0x9b, 0x31, 0x69, 0x2a, 0x59, 0xe0, 0x94, 0x9a, 0x8f, 0x1e, 0xc3, - 0x02, 0xb3, 0xc3, 0xc8, 0xe7, 0x38, 0xf9, 0xfd, 0x9c, 0xfc, 0xee, 0xfb, 0x93, 0x33, 0xbb, 0x9a, - 0x4a, 0xaa, 0x8c, 0x50, 0xf3, 0xd1, 0x26, 0x2c, 0x67, 0xc6, 0x93, 0xd4, 0x4b, 0x69, 0x7e, 0x42, - 0xe0, 0x21, 0x8b, 0x45, 0xd0, 0x53, 0xa8, 0x8d, 0xbc, 0x98, 0x86, 0xa9, 0x3b, 0xb1, 0x50, 0xfe, - 0x97, 0x2c, 0xac, 0x64, 0xbc, 0x56, 0x66, 0x04, 0x41, 0x39, 0xf4, 0x86, 0x54, 0xaa, 0x70, 0x07, - 0xfc, 0x19, 0x7d, 0x0d, 0xe5, 0x67, 0x41, 0xe8, 0x4b, 0xd5, 0x86, 0xd0, 0xaa, 0xdd, 0xb9, 0x75, - 0xfe, 0xd8, 0xf8, 0x9f, 0x9d, 0x20, 0xf4, 0x09, 0x2f, 0x44, 0x1d, 0x58, 0x4f, 0x52, 0x2f, 0x4e, - 0xdd, 0x34, 0x18, 0x52, 0x77, 0x1c, 0x06, 0xcf, 0xdd, 0xd0, 0x0b, 0x23, 0x69, 0xa1, 0x21, 0xb4, - 0xaa, 0xe4, 0x02, 0xcf, 0xd9, 0xc1, 0x90, 0x3a, 0x61, 0xf0, 0xdc, 0xf0, 0xc2, 0x08, 0xdd, 0x02, - 0x44, 0x43, 0xff, 0x34, 0x7c, 0x91, 0xc3, 0xd7, 0x68, 0xe8, 0x4f, 0x81, 0x77, 0x01, 0xbc, 0x34, - 0x8d, 0x83, 0x27, 0xe3, 0x94, 0x26, 0xd2, 0x12, 0xdf, 0xad, 0xeb, 0xe7, 0xec, 0xef, 0x0e, 0x7d, - 0xb1, 0xe7, 0x0d, 0xc6, 0x93, 0xf7, 0xfa, 0x04, 0x01, 0xba, 0x0b, 0x92, 0x1f, 0x47, 0xa3, 0x11, - 0xf5, 0xdd, 0xe3, 0xa8, 0xdb, 0x8f, 0xc6, 0x61, 0x2a, 0x41, 0x43, 0x68, 0xad, 0x92, 0x4b, 0x79, - 0x5e, 0x3e, 0x4a, 0x2b, 0x2c, 0x8b, 0xee, 0x43, 0x95, 0x1e, 0xd0, 0x30, 0x4d, 0xa4, 0x65, 0x6e, - 0xa2, 0xf5, 0x0e, 0x9d, 0xc2, 0xac, 0x80, 0xe4, 0x75, 0xe8, 0x73, 0x58, 0x9f, 0x68, 0x67, 0x91, - 0x5c, 0x77, 0x85, 0xeb, 0xa2, 0x3c, 0xc7, 0x6b, 0x72, 0xcd, 0xaf, 0xa0, 0x32, 0x08, 0xc2, 0x67, - 0x89, 0xb4, 0x3a, 0xe3, 0xdc, 0xd3, 0x92, 0x7a, 0x10, 0x3e, 0x23, 0x59, 0x15, 0x6a, 0xc3, 0xff, - 0x26, 0x82, 0x3c, 0x90, 0xeb, 0xd5, 0xb8, 0xde, 0x85, 0x3c, 0xc5, 0x0a, 0x72, 0xb9, 0x2e, 0x54, - 0xd9, 0x86, 0x8e, 0x13, 0x69, 0x8d, 0xdf, 0x13, 0x5b, 0xe7, 0xe8, 0x71, 0x6c, 0xde, 0xe4, 0xbc, - 0x72, 0xe3, 0x57, 0x01, 0x2a, 0xfc, 0x08, 0x68, 0x0b, 0x6a, 0xa7, 0x46, 0x2c, 0xf0, 0x11, 0xaf, - 0xa4, 0x27, 0xe7, 0x3b, 0x59, 0xc9, 0xb9, 0x13, 0x2b, 0x39, 0x3d, 0xf3, 0xf9, 0x0f, 0x39, 0xf3, - 0xf2, 0xac, 0x99, 0x6f, 0xfc, 0x31, 0x07, 0x65, 0xd6, 0x9f, 0xff, 0xf0, 0xd5, 0x33, 0xdd, 0xeb, - 0xf2, 0x87, 0xec, 0x75, 0x65, 0x56, 0xaf, 0x9b, 0xbf, 0x08, 0xb0, 0x38, 0xb9, 0x59, 0xd0, 0x65, - 0xb8, 0x68, 0xf5, 0x64, 0xc3, 0xdd, 0xd1, 0x0c, 0xd5, 0x75, 0x0c, 0xab, 0x87, 0x15, 0x6d, 0x5b, - 0xc3, 0xaa, 0x58, 0x42, 0x97, 0x00, 0x1d, 0xa7, 0x34, 0xc3, 0xc6, 0xc4, 0x90, 0x75, 0x51, 0x40, - 0xeb, 0x20, 0x1e, 0xc7, 0x2d, 0x4c, 0xf6, 0x30, 0x11, 0xe7, 0xa6, 0xa3, 0x8a, 0xae, 0x61, 0xc3, - 0x16, 0xe7, 0xa7, 0x39, 0x7a, 0xc4, 0x54, 0x1d, 0x05, 0x13, 0xb1, 0x3c, 0x1d, 0x57, 0x4c, 0xc3, - 0x72, 0x76, 0x31, 0x11, 0x2b, 0xcd, 0xbf, 0x17, 0xa0, 0x9a, 0x6d, 0x3b, 0x7a, 0x0a, 0x6b, 0x3e, - 0x1d, 0xc5, 0xb4, 0xef, 0xa5, 0xd4, 0x77, 0xfb, 0x91, 0x9f, 0xfd, 0xdc, 0xa8, 0x9d, 0xf7, 0x63, - 0x20, 0x2b, 0x6f, 0xab, 0x47, 0xb5, 0x59, 0x40, 0x89, 0x7c, 0xda, 0x9d, 0x93, 0x04, 0x52, 0x3b, - 0x66, 0x65, 0x31, 0x24, 0xc1, 0xc2, 0x90, 0x26, 0x89, 0xb7, 0x3f, 0x79, 0x35, 0x26, 0xff, 0x22, - 0x05, 0xca, 0x5c, 0x76, 0x9e, 0xcb, 0x76, 0xde, 0x49, 0xf6, 0x58, 0x8c, 0xf0, 0xe2, 0xe6, 0xeb, - 0x0a, 0xac, 0x9f, 0xe5, 0x05, 0x5d, 0x85, 0xcb, 0x2a, 0xee, 0x11, 0xac, 0xc8, 0x36, 0x56, 0x5d, - 0xcb, 0x96, 0x6d, 0xc7, 0x72, 0x15, 0x53, 0xc5, 0xae, 0xb9, 0x23, 0x96, 0xd0, 0x16, 0x34, 0x0a, - 0xd2, 0x8a, 0x6c, 0x28, 0x58, 0xd7, 0xb1, 0x2a, 0x0a, 0xa8, 0x05, 0x5b, 0x05, 0x28, 0xc7, 0xd8, - 0x31, 0xcc, 0x6f, 0x0c, 0x17, 0x13, 0x62, 0xb2, 0xf9, 0xdc, 0x82, 0xeb, 0x05, 0x48, 0xcd, 0xd8, - 0x93, 0x75, 0x4d, 0x75, 0x65, 0xf2, 0xc0, 0xd9, 0xcd, 0xc6, 0xf6, 0x29, 0xb4, 0x0a, 0xc0, 0x2a, - 0x96, 0x55, 0x5d, 0x33, 0xb0, 0x8b, 0x1f, 0x29, 0x18, 0xab, 0x58, 0x15, 0xcb, 0x33, 0xac, 0x1a, - 0xa6, 0xed, 0x6e, 0x9b, 0x8e, 0xa1, 0x8a, 0x15, 0x74, 0x03, 0x3e, 0x29, 0x40, 0xc9, 0x3a, 0xc1, - 0xb2, 0xfa, 0xd8, 0xc5, 0x8f, 0x34, 0xcb, 0xb6, 0xc4, 0xea, 0x0c, 0xf9, 0x1e, 0x26, 0xbb, 0x9a, - 0x65, 0x69, 0xa6, 0xe1, 0xaa, 0xd8, 0x60, 0x7b, 0xba, 0x80, 0x3e, 0x83, 0x1b, 0x05, 0x68, 0x82, - 0x2d, 0xd3, 0x21, 0x0a, 0x33, 0xfb, 0x50, 0x76, 0x2c, 0x1b, 0xab, 0xe2, 0x22, 0x6a, 0xc3, 0xcd, - 0x02, 0xf8, 0xb6, 0xac, 0xe9, 0x98, 0xad, 0x29, 0x56, 0x4c, 0x43, 0xd5, 0x6c, 0xcd, 0x34, 0xc4, - 0x25, 0xd4, 0x84, 0x7a, 0x91, 0xef, 0xae, 0x49, 0x18, 0x27, 0xa0, 0xeb, 0xf0, 0x71, 0xd1, 0x2c, - 0x1d, 0xdb, 0x35, 0xb7, 0x5d, 0x22, 0x1b, 0x0f, 0xb0, 0xb8, 0x3c, 0x73, 0x5e, 0xda, 0x6e, 0x4f, - 0xc7, 0x6c, 0x00, 0x58, 0x15, 0x57, 0x66, 0xb4, 0x6b, 0xf2, 0x2a, 0xe6, 0xa3, 0x5d, 0x45, 0xd7, - 0xa0, 0x59, 0x48, 0x2a, 0xef, 0xc9, 0x9a, 0x2e, 0x77, 0x75, 0x2c, 0xd6, 0x66, 0xcc, 0x49, 0x95, - 0x6d, 0xd9, 0xd5, 0x4d, 0xcb, 0x12, 0xd7, 0xd0, 0x4d, 0xb8, 0x56, 0xcc, 0xe6, 0xd8, 0x0f, 0xb1, - 0x61, 0x6b, 0x3c, 0x27, 0x8a, 0x4d, 0x03, 0xe0, 0xc4, 0x46, 0x5f, 0x84, 0x0b, 0xd3, 0x70, 0x0b, - 0xdb, 0x62, 0x09, 0x21, 0xa8, 0x9d, 0xda, 0x6e, 0xe1, 0x34, 0x34, 0x5f, 0xd2, 0xee, 0x4f, 0xc2, - 0xcb, 0xb7, 0x75, 0xe1, 0xd5, 0xdb, 0xba, 0xf0, 0xfb, 0xdb, 0xba, 0xf0, 0xf3, 0x61, 0xbd, 0xf4, - 0xea, 0xb0, 0x5e, 0xfa, 0xed, 0xb0, 0x5e, 0x82, 0xcd, 0x20, 0x9a, 0xf9, 0x02, 0x76, 0x81, 0xdf, - 0xf6, 0x3d, 0x16, 0xec, 0x09, 0xdf, 0x2a, 0xef, 0x7d, 0xa1, 0x67, 0xdf, 0x42, 0xfb, 0x34, 0x3c, - 0xfa, 0x30, 0x7b, 0x52, 0xe5, 0xa1, 0x2f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x27, 0x69, - 0x6f, 0xbf, 0x0d, 0x00, 0x00, + // 1278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcd, 0x6e, 0xdb, 0xc6, + 0x16, 0x16, 0x6d, 0x49, 0xb6, 0x8f, 0x6d, 0x99, 0x99, 0xeb, 0xe4, 0x32, 0xce, 0x8d, 0x2c, 0xe8, + 0xba, 0x89, 0x92, 0xb4, 0x52, 0x93, 0xa2, 0x40, 0xb2, 0x28, 0x1a, 0x8a, 0x1c, 0x27, 0x84, 0x69, + 0x52, 0x18, 0x52, 0x6e, 0x52, 0x14, 0x60, 0x19, 0x71, 0xe2, 0x12, 0x91, 0x48, 0x81, 0xa4, 0x82, + 0x64, 0x51, 0xa0, 0x0f, 0xd0, 0x45, 0xb7, 0x7d, 0xa3, 0xa0, 0xab, 0x2c, 0x8b, 0x2c, 0x82, 0x22, + 0x59, 0x15, 0xe8, 0x13, 0x14, 0x5d, 0x14, 0x33, 0xa4, 0x6c, 0xc9, 0x30, 0xe9, 0x04, 0x68, 0x36, + 0xdd, 0x08, 0xa3, 0x73, 0xbe, 0xf3, 0x9d, 0xef, 0xfc, 0x0c, 0x41, 0x42, 0x2b, 0x1c, 0xd3, 0x20, + 0xa1, 0x43, 0x3a, 0xa2, 0x49, 0xf4, 0xbc, 0x33, 0x8e, 0xc2, 0x24, 0xec, 0x24, 0x91, 0x3b, 0xa0, + 0x9d, 0xa7, 0x37, 0xd3, 0x43, 0x9b, 0x1b, 0xd1, 0xff, 0xe6, 0x90, 0xa9, 0xb1, 0x9d, 0x02, 0x9e, + 0xde, 0xdc, 0xda, 0x3c, 0x0c, 0x0f, 0xc3, 0x34, 0x9a, 0x9d, 0x52, 0xf7, 0xd6, 0xf5, 0xd3, 0xd8, + 0x07, 0xe1, 0x68, 0x14, 0x06, 0x8c, 0x3e, 0x3d, 0x65, 0xd8, 0xf6, 0x69, 0xd8, 0x88, 0xc6, 0xe1, + 0x24, 0x4a, 0xc5, 0x4c, 0xcf, 0x29, 0xbe, 0xf9, 0x2d, 0x80, 0xcd, 0xb2, 0xc7, 0xaa, 0x9b, 0xb8, + 0x88, 0x40, 0x6d, 0xea, 0x77, 0xe2, 0xb1, 0x1b, 0xc4, 0x92, 0xd0, 0x58, 0x6c, 0xad, 0xde, 0xba, + 0xd1, 0x2e, 0x92, 0xdd, 0x26, 0x59, 0x8c, 0xc5, 0x42, 0xc8, 0x7a, 0x34, 0xfb, 0xb7, 0xf9, 0xa7, + 0x00, 0xeb, 0x73, 0x00, 0xb4, 0x07, 0xcb, 0x53, 0x88, 0x24, 0x34, 0x84, 0xd6, 0xea, 0xad, 0x6b, + 0xa7, 0xf2, 0x1f, 0x49, 0x9d, 0x49, 0xd1, 0x2d, 0xbf, 0x78, 0xbd, 0x5d, 0x22, 0x47, 0x04, 0xe8, + 0x7b, 0xb8, 0xec, 0x07, 0x71, 0x12, 0x4d, 0x46, 0x34, 0x48, 0xdc, 0xc4, 0x0f, 0x03, 0x67, 0xe8, + 0x3f, 0x8a, 0xdc, 0xe8, 0x79, 0x56, 0xc1, 0x02, 0xaf, 0xe0, 0x4e, 0x71, 0x05, 0xda, 0x3c, 0x85, + 0x9e, 0x32, 0xa4, 0xf5, 0x5c, 0xf2, 0xf3, 0x9d, 0xe8, 0x32, 0x40, 0x3c, 0xf8, 0x8e, 0x8e, 0x5c, + 0x67, 0x12, 0x0d, 0xa5, 0xc5, 0x86, 0xd0, 0x5a, 0x21, 0x2b, 0xa9, 0xa5, 0x1f, 0x0d, 0x9b, 0x7f, + 0x08, 0x70, 0xa9, 0x80, 0x1b, 0x25, 0xf0, 0xdf, 0x1c, 0xf5, 0x59, 0x67, 0x3e, 0x3f, 0x55, 0x77, + 0x36, 0xf2, 0x5c, 0xe1, 0x59, 0x97, 0x2e, 0x9c, 0xae, 0x1c, 0xdd, 0x86, 0xca, 0x6c, 0x6f, 0x9a, + 0xc5, 0xbd, 0x61, 0x4a, 0x49, 0x1a, 0x70, 0x56, 0xb9, 0x3f, 0xac, 0x43, 0x99, 0xc1, 0xd1, 0x37, + 0xb0, 0xcc, 0xe3, 0x1d, 0xdf, 0xe3, 0x85, 0xac, 0x75, 0x65, 0xa6, 0xe8, 0xd5, 0xeb, 0xed, 0x3b, + 0x87, 0xe1, 0x89, 0x74, 0x3e, 0x5b, 0xe6, 0xe1, 0x90, 0x0e, 0x92, 0x30, 0xea, 0x8c, 0x42, 0x8f, + 0x0e, 0x3b, 0x7e, 0x90, 0xd0, 0x28, 0x70, 0x87, 0x1d, 0xcf, 0x4d, 0xdc, 0x36, 0x5f, 0x50, 0x4d, + 0x25, 0x4b, 0x9c, 0x52, 0xf3, 0xd0, 0x43, 0x58, 0x62, 0x72, 0x18, 0xf9, 0x02, 0x27, 0xbf, 0x9b, + 0x91, 0xdf, 0x7e, 0x7f, 0x72, 0x26, 0x57, 0x53, 0x49, 0x95, 0x11, 0x6a, 0x1e, 0xda, 0x86, 0xd5, + 0x54, 0x78, 0x9c, 0xb8, 0x09, 0xcd, 0x2a, 0x04, 0x6e, 0xb2, 0x98, 0x05, 0x3d, 0x86, 0xda, 0xd8, + 0x8d, 0x68, 0x90, 0x38, 0x53, 0x09, 0xe5, 0x7f, 0x48, 0xc2, 0x5a, 0xca, 0x6b, 0xa5, 0x42, 0x10, + 0x94, 0x03, 0x77, 0x44, 0xa5, 0x0a, 0x57, 0xc0, 0xcf, 0xe8, 0x4b, 0x28, 0x3f, 0xf1, 0x03, 0x4f, + 0xaa, 0x36, 0x84, 0x56, 0xed, 0xac, 0x4b, 0xc9, 0x78, 0xf8, 0xcf, 0x9e, 0x1f, 0x78, 0x84, 0x07, + 0xa2, 0x0e, 0x6c, 0xc6, 0x89, 0x1b, 0x25, 0x4e, 0xe2, 0x8f, 0xa8, 0x33, 0x09, 0xfc, 0x67, 0x4e, + 0xe0, 0x06, 0xa1, 0xb4, 0xd4, 0x10, 0x5a, 0x55, 0x72, 0x8e, 0xfb, 0x6c, 0x7f, 0x44, 0xfb, 0x81, + 0xff, 0xcc, 0x70, 0x83, 0x10, 0xdd, 0x00, 0x44, 0x03, 0xef, 0x24, 0x7c, 0x99, 0xc3, 0x37, 0x68, + 0xe0, 0xcd, 0x81, 0xf7, 0x01, 0xdc, 0x24, 0x89, 0xfc, 0x47, 0x93, 0x84, 0xc6, 0xd2, 0x0a, 0xdf, + 0xad, 0xab, 0x67, 0xec, 0xef, 0x1e, 0x7d, 0x7e, 0xe0, 0x0e, 0x27, 0xd3, 0x7b, 0x3d, 0x43, 0x80, + 0x6e, 0x83, 0xe4, 0x45, 0xe1, 0x78, 0x4c, 0x3d, 0xe7, 0xd8, 0xea, 0x0c, 0xc2, 0x49, 0x90, 0x48, + 0xd0, 0x10, 0x5a, 0xeb, 0xe4, 0x42, 0xe6, 0x97, 0x8f, 0xdc, 0x0a, 0xf3, 0xa2, 0xbb, 0x50, 0xa5, + 0x4f, 0x69, 0x90, 0xc4, 0xd2, 0x2a, 0x17, 0xd1, 0x7a, 0x87, 0x4e, 0x61, 0x16, 0x40, 0xb2, 0x38, + 0xf4, 0x29, 0x6c, 0x4e, 0x73, 0xa7, 0x96, 0x2c, 0xef, 0x1a, 0xcf, 0x8b, 0x32, 0x1f, 0x8f, 0xc9, + 0x72, 0x7e, 0x01, 0x95, 0xa1, 0x1f, 0x3c, 0x89, 0xa5, 0xf5, 0x82, 0xba, 0xe7, 0x53, 0xea, 0x7e, + 0xf0, 0x84, 0xa4, 0x51, 0xa8, 0x0d, 0xff, 0x99, 0x26, 0xe4, 0x86, 0x2c, 0x5f, 0x8d, 0xe7, 0x3b, + 0x97, 0xb9, 0x58, 0x40, 0x96, 0xae, 0x0b, 0x55, 0xb6, 0xa1, 0x93, 0x58, 0xda, 0xe0, 0xcf, 0x89, + 0x9d, 0x33, 0xf2, 0x71, 0x6c, 0xd6, 0xe4, 0x2c, 0x72, 0xeb, 0x17, 0x01, 0x2a, 0xbc, 0x04, 0xb4, + 0x03, 0xb5, 0x13, 0x23, 0x16, 0xf8, 0x88, 0xd7, 0x92, 0xd9, 0xf9, 0x4e, 0x57, 0x72, 0x61, 0x66, + 0x25, 0xe7, 0x67, 0xbe, 0xf8, 0x21, 0x67, 0x5e, 0x2e, 0x9a, 0xf9, 0xd6, 0xef, 0x0b, 0x50, 0x66, + 0xfd, 0xf9, 0x17, 0x3f, 0x7a, 0xe6, 0x7b, 0x5d, 0xfe, 0x90, 0xbd, 0xae, 0x14, 0xf5, 0xba, 0xf9, + 0xb3, 0x00, 0xcb, 0xd3, 0x27, 0x0b, 0xba, 0x08, 0xe7, 0xad, 0x9e, 0x6c, 0x38, 0x7b, 0x9a, 0xa1, + 0x3a, 0x7d, 0xc3, 0xea, 0x61, 0x45, 0xdb, 0xd5, 0xb0, 0x2a, 0x96, 0xd0, 0x05, 0x40, 0xc7, 0x2e, + 0xcd, 0xb0, 0x31, 0x31, 0x64, 0x5d, 0x14, 0xd0, 0x26, 0x88, 0xc7, 0x76, 0x0b, 0x93, 0x03, 0x4c, + 0xc4, 0x85, 0x79, 0xab, 0xa2, 0x6b, 0xd8, 0xb0, 0xc5, 0xc5, 0x79, 0x8e, 0x1e, 0x31, 0xd5, 0xbe, + 0x82, 0x89, 0x58, 0x9e, 0xb7, 0x2b, 0xa6, 0x61, 0xf5, 0xf7, 0x31, 0x11, 0x2b, 0xcd, 0xbf, 0x96, + 0xa0, 0x9a, 0x6e, 0x3b, 0x7a, 0x0c, 0x1b, 0x1e, 0x1d, 0x47, 0x74, 0xe0, 0x26, 0xd4, 0x73, 0x06, + 0xa1, 0x97, 0xbe, 0x6e, 0xd4, 0xce, 0x7a, 0x19, 0x48, 0xc3, 0xdb, 0xea, 0x51, 0x6c, 0x6a, 0x50, + 0x42, 0x8f, 0x76, 0x17, 0x24, 0x81, 0xd4, 0x8e, 0x59, 0x99, 0x0d, 0x49, 0xb0, 0x34, 0xa2, 0x71, + 0xec, 0x1e, 0x4e, 0xaf, 0xc6, 0xf4, 0x2f, 0x52, 0xa0, 0xcc, 0xd3, 0x2e, 0xf2, 0xb4, 0x9d, 0x77, + 0x4a, 0x7b, 0x9c, 0x8c, 0xf0, 0xe0, 0xe6, 0xab, 0x0a, 0x6c, 0x9e, 0xa6, 0x05, 0x5d, 0x86, 0x8b, + 0x2a, 0xee, 0x11, 0xac, 0xc8, 0x36, 0x56, 0x1d, 0xcb, 0x96, 0xed, 0xbe, 0xe5, 0x28, 0xa6, 0x8a, + 0x1d, 0x73, 0x4f, 0x2c, 0xa1, 0x1d, 0x68, 0xe4, 0xb8, 0x15, 0xd9, 0x50, 0xb0, 0xae, 0x63, 0x55, + 0x14, 0x50, 0x0b, 0x76, 0x72, 0x50, 0x7d, 0x63, 0xcf, 0x30, 0xbf, 0x32, 0x1c, 0x4c, 0x88, 0xc9, + 0xe6, 0x73, 0x03, 0xae, 0xe6, 0x20, 0x35, 0xe3, 0x40, 0xd6, 0x35, 0xd5, 0x91, 0xc9, 0xbd, 0xfe, + 0x7e, 0x3a, 0xb6, 0x8f, 0xa1, 0x95, 0x03, 0x56, 0xb1, 0xac, 0xea, 0x9a, 0x81, 0x1d, 0xfc, 0x40, + 0xc1, 0x58, 0xc5, 0xaa, 0x58, 0x2e, 0x90, 0x6a, 0x98, 0xb6, 0xb3, 0x6b, 0xf6, 0x0d, 0x55, 0xac, + 0xa0, 0x6b, 0xf0, 0x51, 0x0e, 0x4a, 0xd6, 0x09, 0x96, 0xd5, 0x87, 0x0e, 0x7e, 0xa0, 0x59, 0xb6, + 0x25, 0x56, 0x0b, 0xd2, 0xf7, 0x30, 0xd9, 0xd7, 0x2c, 0x4b, 0x33, 0x0d, 0x47, 0xc5, 0x06, 0xdb, + 0xd3, 0x25, 0xf4, 0x09, 0x5c, 0xcb, 0x41, 0x13, 0x6c, 0x99, 0x7d, 0xa2, 0x30, 0xb1, 0xf7, 0xe5, + 0xbe, 0x65, 0x63, 0x55, 0x5c, 0x46, 0x6d, 0xb8, 0x9e, 0x03, 0xdf, 0x95, 0x35, 0x1d, 0xb3, 0x35, + 0xc5, 0x8a, 0x69, 0xa8, 0x9a, 0xad, 0x99, 0x86, 0xb8, 0x82, 0x9a, 0x50, 0xcf, 0xd3, 0xdd, 0x35, + 0x09, 0xe3, 0x04, 0x74, 0x15, 0xfe, 0x9f, 0x37, 0xcb, 0xbe, 0xed, 0x98, 0xbb, 0x0e, 0x91, 0x8d, + 0x7b, 0x58, 0x5c, 0x2d, 0x9c, 0x97, 0xb6, 0xdf, 0xd3, 0x31, 0x1b, 0x00, 0x56, 0xc5, 0xb5, 0x82, + 0x76, 0x4d, 0xaf, 0x62, 0x36, 0xda, 0x75, 0x74, 0x05, 0x9a, 0xb9, 0xa4, 0xf2, 0x81, 0xac, 0xe9, + 0x72, 0x57, 0xc7, 0x62, 0xad, 0x60, 0x4e, 0xaa, 0x6c, 0xcb, 0x8e, 0x6e, 0x5a, 0x96, 0xb8, 0x81, + 0xae, 0xc3, 0x95, 0x7c, 0xb6, 0xbe, 0x7d, 0x1f, 0x1b, 0xb6, 0xc6, 0x7d, 0xa2, 0xd8, 0x34, 0x00, + 0x66, 0x36, 0xfa, 0x3c, 0x9c, 0x9b, 0x87, 0x5b, 0xd8, 0x16, 0x4b, 0x08, 0x41, 0xed, 0xc4, 0x76, + 0x0b, 0x27, 0xa1, 0xd9, 0x92, 0x76, 0x7f, 0x14, 0x5e, 0xbc, 0xa9, 0x0b, 0x2f, 0xdf, 0xd4, 0x85, + 0xdf, 0xde, 0xd4, 0x85, 0x9f, 0xde, 0xd6, 0x4b, 0x2f, 0xdf, 0xd6, 0x4b, 0xbf, 0xbe, 0xad, 0x97, + 0x60, 0xdb, 0x0f, 0x0b, 0x2f, 0x60, 0x37, 0xfd, 0x12, 0xea, 0x31, 0x63, 0x4f, 0xf8, 0x5a, 0x79, + 0xef, 0x07, 0x7a, 0xfa, 0xb5, 0x75, 0x48, 0x83, 0xa3, 0x4f, 0xbf, 0x47, 0x55, 0x6e, 0xfa, 0xec, + 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xa4, 0x73, 0xb9, 0x21, 0x0e, 0x00, 0x00, +} + +func (m *TracesData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TracesData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TracesData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResourceSpans) > 0 { + for iNdEx := len(m.ResourceSpans) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceSpans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTrace(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } func (m *ResourceSpans) Marshal() (dAtA []byte, err error) { @@ -1287,6 +1383,21 @@ func encodeVarintTrace(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *TracesData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ResourceSpans) > 0 { + for _, e := range m.ResourceSpans { + l = e.Size() + n += 1 + l + sovTrace(uint64(l)) + } + } + return n +} + func (m *ResourceSpans) Size() (n int) { if m == nil { return 0 @@ -1466,6 +1577,90 @@ func sovTrace(x uint64) (n int) { func sozTrace(x uint64) (n int) { return sovTrace(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *TracesData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTrace + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TracesData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TracesData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceSpans", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTrace + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTrace + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTrace + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceSpans = append(m.ResourceSpans, &ResourceSpans{}) + if err := m.ResourceSpans[len(m.ResourceSpans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTrace(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTrace + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ResourceSpans) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/model/internal/opentelemetry-proto b/model/internal/opentelemetry-proto index 38b5b9b6e52..b43e9b18b76 160000 --- a/model/internal/opentelemetry-proto +++ b/model/internal/opentelemetry-proto @@ -1 +1 @@ -Subproject commit 38b5b9b6e5257c6500a843f7fdacf89dd95833e8 +Subproject commit b43e9b18b76abf3ee040164b55b9c355217151f3 From f85f13e27b3f80fd317a52fa366348b8405dbb97 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 19 Oct 2021 18:27:49 +0200 Subject: [PATCH 069/149] Move `MapProvider` to `config` package (#4178) * Move MapProvider and Watchable interfaces to config package * Rename `Watchable` to `WatchableMapProvider` * Add CHANGELOG entry * Update CHANGELOG.md Co-authored-by: Bogdan Drutu --- CHANGELOG.md | 5 +++++ {service/parserprovider => config}/provider.go | 12 +++++------- service/collector.go | 6 +++--- service/collector_test.go | 2 +- service/parserprovider/default.go | 6 ++++-- service/parserprovider/expand.go | 8 ++++---- service/parserprovider/file.go | 4 ++-- service/parserprovider/inmemory.go | 4 ++-- service/parserprovider/merge.go | 6 +++--- service/parserprovider/properties.go | 4 ++-- service/settings.go | 5 ++--- 11 files changed, 33 insertions(+), 29 deletions(-) rename {service/parserprovider => config}/provider.go (81%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17760799640..2c4d60b2aa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +## 🛑 Breaking changes 🛑 + +- Rename `parserprovider.MapProvider` as `config.MapProvider` (#4178) +- Rename `parserprovider.Watchable` as `config.WatchableMapProvider` (#4178) + ## v0.37.0 Beta ## 🛑 Breaking changes 🛑 diff --git a/service/parserprovider/provider.go b/config/provider.go similarity index 81% rename from service/parserprovider/provider.go rename to config/provider.go index 148346343c6..5e0d28725e9 100644 --- a/service/parserprovider/provider.go +++ b/config/provider.go @@ -12,19 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package config // import "go.opentelemetry.io/collector/config" import ( "context" - - "go.opentelemetry.io/collector/config" ) // MapProvider 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 { - // Get returns the config.Map if succeed or error otherwise. - Get(ctx context.Context) (*config.Map, error) + // Get returns the Map if succeed or error otherwise. + Get(ctx context.Context) (*Map, 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. @@ -32,9 +30,9 @@ type MapProvider interface { Close(ctx context.Context) error } -// Watchable is an extension for MapProvider that is implemented if the given provider +// WatchableMapProvider is an extension for MapProvider that is implemented if the given provider // supports monitoring of configuration updates. -type Watchable interface { +type WatchableMapProvider interface { // 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 diff --git a/service/collector.go b/service/collector.go index a363f8ed7c7..9a8af3cc68a 100644 --- a/service/collector.go +++ b/service/collector.go @@ -34,12 +34,12 @@ import ( "go.uber.org/zap" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config" "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" - "go.opentelemetry.io/collector/service/parserprovider" ) // State defines Collector's state. @@ -194,7 +194,7 @@ func (col *Collector) setupConfigurationComponents(ctx context.Context) error { } // If provider is watchable start a goroutine watching for updates. - if watchable, ok := col.set.ConfigMapProvider.(parserprovider.Watchable); ok { + if watchable, ok := col.set.ConfigMapProvider.(config.WatchableMapProvider); ok { go col.watchForConfigUpdates(watchable) } @@ -285,7 +285,7 @@ func (col *Collector) reloadService(ctx context.Context) error { return nil } -func (col *Collector) watchForConfigUpdates(watchable parserprovider.Watchable) { +func (col *Collector) watchForConfigUpdates(watchable config.WatchableMapProvider) { 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 d0730a7ec14..68934b63c61 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -282,7 +282,7 @@ func TestCollector_reloadService(t *testing.T) { tests := []struct { name string - parserProvider parserprovider.MapProvider + parserProvider config.MapProvider service *service }{ { diff --git a/service/parserprovider/default.go b/service/parserprovider/default.go index 680cba0d126..5796460ab1d 100644 --- a/service/parserprovider/default.go +++ b/service/parserprovider/default.go @@ -14,9 +14,11 @@ package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" -// NewDefaultMapProvider returns the default MapProvider, and it creates configuration from a file +import "go.opentelemetry.io/collector/config" + +// NewDefaultMapProvider returns the default config.MapProvider, and it creates configuration from a file // defined by the given configFile and overwrites fields using properties. -func NewDefaultMapProvider(configFileName string, properties []string) MapProvider { +func NewDefaultMapProvider(configFileName string, properties []string) config.MapProvider { return NewExpandMapProvider( NewMergeMapProvider( NewFileMapProvider(configFileName), diff --git a/service/parserprovider/expand.go b/service/parserprovider/expand.go index 7a756c3c204..a787b7ddfda 100644 --- a/service/parserprovider/expand.go +++ b/service/parserprovider/expand.go @@ -22,12 +22,12 @@ import ( ) type expandMapProvider struct { - base MapProvider + base config.MapProvider } -// NewExpandMapProvider returns a MapProvider, that expands all environment variables for a -// config.Map provided by the given MapProvider. -func NewExpandMapProvider(base MapProvider) MapProvider { +// 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 { return &expandMapProvider{ base: base, } diff --git a/service/parserprovider/file.go b/service/parserprovider/file.go index e99d1836176..b676eb32164 100644 --- a/service/parserprovider/file.go +++ b/service/parserprovider/file.go @@ -26,8 +26,8 @@ type fileMapProvider struct { fileName string } -// NewFileMapProvider returns a new MapProvider that reads the configuration from the given file. -func NewFileMapProvider(fileName string) MapProvider { +// NewFileMapProvider returns a new config.MapProvider that reads the configuration from the given file. +func NewFileMapProvider(fileName string) config.MapProvider { return &fileMapProvider{ fileName: fileName, } diff --git a/service/parserprovider/inmemory.go b/service/parserprovider/inmemory.go index d4f101d906b..edaec45f653 100644 --- a/service/parserprovider/inmemory.go +++ b/service/parserprovider/inmemory.go @@ -25,8 +25,8 @@ type inMemoryMapProvider struct { buf io.Reader } -// NewInMemoryMapProvider returns a new MapProvider that reads the configuration, from the provided buffer, as YAML. -func NewInMemoryMapProvider(buf io.Reader) MapProvider { +// NewInMemoryMapProvider returns a new config.MapProvider that reads the configuration, from the provided buffer, as YAML. +func NewInMemoryMapProvider(buf io.Reader) config.MapProvider { return &inMemoryMapProvider{buf: buf} } diff --git a/service/parserprovider/merge.go b/service/parserprovider/merge.go index 499d091e625..f59d643dd76 100644 --- a/service/parserprovider/merge.go +++ b/service/parserprovider/merge.go @@ -25,13 +25,13 @@ import ( // TODO: Add support to "merge" watchable interface. type mergeMapProvider struct { - providers []MapProvider + providers []config.MapProvider } -// NewMergeMapProvider returns a config.MapProvider, that merges the result from multiple MapProvider. +// NewMergeMapProvider returns a config.MapProvider, that merges the result from multiple config.MapProvider. // // The ConfigMaps are merged in the given order, by merging all of them in order into an initial empty map. -func NewMergeMapProvider(ps ...MapProvider) MapProvider { +func NewMergeMapProvider(ps ...config.MapProvider) config.MapProvider { return &mergeMapProvider{providers: ps} } diff --git a/service/parserprovider/properties.go b/service/parserprovider/properties.go index ddd58e67313..2b202da7dda 100644 --- a/service/parserprovider/properties.go +++ b/service/parserprovider/properties.go @@ -29,12 +29,12 @@ type propertiesMapProvider struct { properties []string } -// NewPropertiesMapProvider returns a MapProvider, that provides a config.Map from the given properties. +// NewPropertiesMapProvider returns a config.MapProvider, 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) MapProvider { +func NewPropertiesMapProvider(properties []string) config.MapProvider { return &propertiesMapProvider{ properties: properties, } diff --git a/service/settings.go b/service/settings.go index cca64ed6285..11f5b0d3551 100644 --- a/service/settings.go +++ b/service/settings.go @@ -21,7 +21,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configunmarshaler" - "go.opentelemetry.io/collector/service/parserprovider" ) // svcSettings holds configuration for building a new service. @@ -63,8 +62,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 parserprovider.Watchable, collector may reload the configuration upon error. - ConfigMapProvider parserprovider.MapProvider + // If the provider is config.WatchableMapProvider, collector may reload the configuration upon error. + ConfigMapProvider config.MapProvider // ConfigUnmarshaler unmarshalls the configuration's Parser into the service configuration. // If it is not provided a default unmarshaler is used. From 9f2ae4ab8187d81475bcbbaa4d175c27d9bce9cd Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 19 Oct 2021 11:36:37 -0700 Subject: [PATCH 070/149] Change pdata to use the newly added [Traces|Metrics|Logs]Data. (#4214) The OTLP marshaler/unmarshalers will use the newly added Data messages. Updates: https://github.com/open-telemetry/opentelemetry-collector/issues/4207 Signed-off-by: Bogdan Drutu --- model/internal/otlp_wrapper.go | 34 +++++++++++++-------------- model/internal/otlp_wrappers_test.go | 22 ++++++++--------- model/otlp/json_unmarshaler.go | 14 +++++------ model/otlp/pb_unmarshaler.go | 12 +++++----- model/otlpgrpc/logs.go | 3 ++- model/otlpgrpc/metrics.go | 3 ++- model/otlpgrpc/traces.go | 3 ++- model/pdata/logs.go | 5 ++-- model/pdata/logs_test.go | 11 ++++----- model/pdata/metrics.go | 5 ++-- model/pdata/metrics_test.go | 35 ++++++++++++++-------------- model/pdata/traces.go | 5 ++-- model/pdata/traces_test.go | 9 ++++--- 13 files changed, 76 insertions(+), 85 deletions(-) diff --git a/model/internal/otlp_wrapper.go b/model/internal/otlp_wrapper.go index 97aa90ca564..4062c913e9f 100644 --- a/model/internal/otlp_wrapper.go +++ b/model/internal/otlp_wrapper.go @@ -15,10 +15,8 @@ package internal // import "go.opentelemetry.io/collector/model/internal" import ( - otlpcollectorlog "go.opentelemetry.io/collector/model/internal/data/protogen/collector/logs/v1" - otlpcollectormetrics "go.opentelemetry.io/collector/model/internal/data/protogen/collector/metrics/v1" - otlpcollectortrace "go.opentelemetry.io/collector/model/internal/data/protogen/collector/trace/v1" otlpcommon "go.opentelemetry.io/collector/model/internal/data/protogen/common/v1" + otlplogs "go.opentelemetry.io/collector/model/internal/data/protogen/logs/v1" otlpmetrics "go.opentelemetry.io/collector/model/internal/data/protogen/metrics/v1" otlptrace "go.opentelemetry.io/collector/model/internal/data/protogen/trace/v1" ) @@ -27,26 +25,26 @@ import ( // as a way to prevent certain functions of pdata.Metrics data type to be callable by // any code outside of this module. type MetricsWrapper struct { - req *otlpcollectormetrics.ExportMetricsServiceRequest + req *otlpmetrics.MetricsData } // MetricsToOtlp internal helper to convert MetricsWrapper to protobuf representation. -func MetricsToOtlp(mw MetricsWrapper) *otlpcollectormetrics.ExportMetricsServiceRequest { +func MetricsToOtlp(mw MetricsWrapper) *otlpmetrics.MetricsData { return mw.req } // MetricsFromOtlp internal helper to convert protobuf representation to MetricsWrapper. -func MetricsFromOtlp(req *otlpcollectormetrics.ExportMetricsServiceRequest) MetricsWrapper { - MetricsCompatibilityChanges(req) +func MetricsFromOtlp(req *otlpmetrics.MetricsData) MetricsWrapper { + metricsCompatibilityChanges(req) return MetricsWrapper{req: req} } -// MetricsCompatibilityChanges performs backward compatibility conversion on Metrics: +// metricsCompatibilityChanges performs backward compatibility conversion on Metrics: // - Convert IntHistogram to Histogram. See https://github.com/open-telemetry/opentelemetry-proto/blob/f3b0ee0861d304f8f3126686ba9b01c106069cb0/opentelemetry/proto/metrics/v1/metrics.proto#L170 // - Convert IntGauge to Gauge. See https://github.com/open-telemetry/opentelemetry-proto/blob/f3b0ee0861d304f8f3126686ba9b01c106069cb0/opentelemetry/proto/metrics/v1/metrics.proto#L156 // - Convert IntSum to Sum. See https://github.com/open-telemetry/opentelemetry-proto/blob/f3b0ee0861d304f8f3126686ba9b01c106069cb0/opentelemetry/proto/metrics/v1/metrics.proto#L156 // - Converts Labels to Attributes. See https://github.com/open-telemetry/opentelemetry-proto/blob/8672494217bfc858e2a82a4e8c623d4a5530473a/opentelemetry/proto/metrics/v1/metrics.proto#L385 -func MetricsCompatibilityChanges(req *otlpcollectormetrics.ExportMetricsServiceRequest) { +func metricsCompatibilityChanges(req *otlpmetrics.MetricsData) { for _, rsm := range req.ResourceMetrics { for _, ilm := range rsm.InstrumentationLibraryMetrics { for _, metric := range ilm.Metrics { @@ -76,25 +74,25 @@ func MetricsCompatibilityChanges(req *otlpcollectormetrics.ExportMetricsServiceR // as a way to prevent certain functions of pdata.Traces data type to be callable by // any code outside of this module. type TracesWrapper struct { - req *otlpcollectortrace.ExportTraceServiceRequest + req *otlptrace.TracesData } // TracesToOtlp internal helper to convert TracesWrapper to protobuf representation. -func TracesToOtlp(mw TracesWrapper) *otlpcollectortrace.ExportTraceServiceRequest { +func TracesToOtlp(mw TracesWrapper) *otlptrace.TracesData { return mw.req } // TracesFromOtlp internal helper to convert protobuf representation to TracesWrapper. -func TracesFromOtlp(req *otlpcollectortrace.ExportTraceServiceRequest) TracesWrapper { - TracesCompatibilityChanges(req) +func TracesFromOtlp(req *otlptrace.TracesData) TracesWrapper { + tracesCompatibilityChanges(req) return TracesWrapper{req: req} } -// TracesCompatibilityChanges performs backward compatibility conversion of Span Status code according to +// tracesCompatibilityChanges performs backward compatibility conversion of Span Status code according to // OTLP specification as we are a new receiver and sender (we are pushing data to the pipelines): // See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L239 // See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L253 -func TracesCompatibilityChanges(req *otlpcollectortrace.ExportTraceServiceRequest) { +func tracesCompatibilityChanges(req *otlptrace.TracesData) { for _, rss := range req.ResourceSpans { for _, ils := range rss.InstrumentationLibrarySpans { for _, span := range ils.Spans { @@ -118,16 +116,16 @@ func TracesCompatibilityChanges(req *otlpcollectortrace.ExportTraceServiceReques // as a way to prevent certain functions of pdata.Logs data type to be callable by // any code outside of this module. type LogsWrapper struct { - req *otlpcollectorlog.ExportLogsServiceRequest + req *otlplogs.LogsData } // LogsToOtlp internal helper to convert LogsWrapper to protobuf representation. -func LogsToOtlp(l LogsWrapper) *otlpcollectorlog.ExportLogsServiceRequest { +func LogsToOtlp(l LogsWrapper) *otlplogs.LogsData { return l.req } // LogsFromOtlp internal helper to convert protobuf representation to LogsWrapper. -func LogsFromOtlp(req *otlpcollectorlog.ExportLogsServiceRequest) LogsWrapper { +func LogsFromOtlp(req *otlplogs.LogsData) LogsWrapper { return LogsWrapper{req: req} } diff --git a/model/internal/otlp_wrappers_test.go b/model/internal/otlp_wrappers_test.go index 52c21f51772..772c309a07e 100644 --- a/model/internal/otlp_wrappers_test.go +++ b/model/internal/otlp_wrappers_test.go @@ -19,8 +19,6 @@ import ( "github.com/stretchr/testify/assert" - otlpcollectormetrics "go.opentelemetry.io/collector/model/internal/data/protogen/collector/metrics/v1" - otlpcollectortrace "go.opentelemetry.io/collector/model/internal/data/protogen/collector/trace/v1" otlpcommon "go.opentelemetry.io/collector/model/internal/data/protogen/common/v1" otlpmetrics "go.opentelemetry.io/collector/model/internal/data/protogen/metrics/v1" otlptrace "go.opentelemetry.io/collector/model/internal/data/protogen/trace/v1" @@ -90,7 +88,7 @@ func TestDeprecatedStatusCode(t *testing.T) { for _, test := range tests { t.Run(test.sendCode.String()+"/"+test.sendDeprecatedCode.String(), func(t *testing.T) { - req := &otlpcollectortrace.ExportTraceServiceRequest{ + req := &otlptrace.TracesData{ ResourceSpans: []*otlptrace.ResourceSpans{ { InstrumentationLibrarySpans: []*otlptrace.InstrumentationLibrarySpans{ @@ -109,7 +107,7 @@ func TestDeprecatedStatusCode(t *testing.T) { }, } - TracesCompatibilityChanges(req) + tracesCompatibilityChanges(req) spanProto := req.ResourceSpans[0].InstrumentationLibrarySpans[0].Spans[0] // Check that DeprecatedCode is passed as is. assert.EqualValues(t, test.expectedRcvCode, spanProto.Status.Code) @@ -269,7 +267,7 @@ func TestDeprecatedIntHistogram(t *testing.T) { for _, test := range tests { t.Run(test.inputMetrics[0].Description, func(t *testing.T) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { InstrumentationLibraryMetrics: []*otlpmetrics.InstrumentationLibraryMetrics{ @@ -279,7 +277,7 @@ func TestDeprecatedIntHistogram(t *testing.T) { }}, }, } - MetricsCompatibilityChanges(req) + metricsCompatibilityChanges(req) assert.EqualValues(t, test.outputMetrics, req.ResourceMetrics[0].InstrumentationLibraryMetrics[0].Metrics) }) } @@ -372,7 +370,7 @@ func TestDeprecatedIntGauge(t *testing.T) { for _, test := range tests { t.Run(test.inputMetrics[0].Description, func(t *testing.T) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { InstrumentationLibraryMetrics: []*otlpmetrics.InstrumentationLibraryMetrics{ @@ -382,7 +380,7 @@ func TestDeprecatedIntGauge(t *testing.T) { }}, }, } - MetricsCompatibilityChanges(req) + metricsCompatibilityChanges(req) assert.EqualValues(t, test.outputMetrics, req.ResourceMetrics[0].InstrumentationLibraryMetrics[0].Metrics) }) } @@ -598,7 +596,7 @@ func TestDeprecatedIntSum(t *testing.T) { for _, test := range tests { t.Run(test.inputMetrics[0].Description, func(t *testing.T) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { InstrumentationLibraryMetrics: []*otlpmetrics.InstrumentationLibraryMetrics{ @@ -608,7 +606,7 @@ func TestDeprecatedIntSum(t *testing.T) { }}, }, } - MetricsCompatibilityChanges(req) + metricsCompatibilityChanges(req) assert.EqualValues(t, test.outputMetrics, req.ResourceMetrics[0].InstrumentationLibraryMetrics[0].Metrics) }) } @@ -737,7 +735,7 @@ func TestAttributesAndLabels(t *testing.T) { for _, test := range tests { t.Run(test.inputMetrics[0].Description, func(t *testing.T) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { InstrumentationLibraryMetrics: []*otlpmetrics.InstrumentationLibraryMetrics{ @@ -747,7 +745,7 @@ func TestAttributesAndLabels(t *testing.T) { }}, }, } - MetricsCompatibilityChanges(req) + metricsCompatibilityChanges(req) assert.EqualValues(t, test.outputMetrics, req.ResourceMetrics[0].InstrumentationLibraryMetrics[0].Metrics) }) } diff --git a/model/otlp/json_unmarshaler.go b/model/otlp/json_unmarshaler.go index 92aeb9a3db7..afcaa21e095 100644 --- a/model/otlp/json_unmarshaler.go +++ b/model/otlp/json_unmarshaler.go @@ -20,9 +20,9 @@ import ( "github.com/gogo/protobuf/jsonpb" "go.opentelemetry.io/collector/model/internal" - otlpcollectorlog "go.opentelemetry.io/collector/model/internal/data/protogen/collector/logs/v1" - otlpcollectormetrics "go.opentelemetry.io/collector/model/internal/data/protogen/collector/metrics/v1" - otlpcollectortrace "go.opentelemetry.io/collector/model/internal/data/protogen/collector/trace/v1" + otlplogs "go.opentelemetry.io/collector/model/internal/data/protogen/logs/v1" + otlpmetrics "go.opentelemetry.io/collector/model/internal/data/protogen/metrics/v1" + otlptrace "go.opentelemetry.io/collector/model/internal/data/protogen/trace/v1" "go.opentelemetry.io/collector/model/pdata" ) @@ -50,8 +50,7 @@ func newJSONUnmarshaler() *jsonUnmarshaler { } func (d *jsonUnmarshaler) UnmarshalLogs(buf []byte) (pdata.Logs, error) { - ld := &otlpcollectorlog.ExportLogsServiceRequest{} - + ld := &otlplogs.LogsData{} if err := d.delegate.Unmarshal(bytes.NewReader(buf), ld); err != nil { return pdata.Logs{}, err } @@ -59,8 +58,7 @@ func (d *jsonUnmarshaler) UnmarshalLogs(buf []byte) (pdata.Logs, error) { } func (d *jsonUnmarshaler) UnmarshalMetrics(buf []byte) (pdata.Metrics, error) { - md := &otlpcollectormetrics.ExportMetricsServiceRequest{} - + md := &otlpmetrics.MetricsData{} if err := d.delegate.Unmarshal(bytes.NewReader(buf), md); err != nil { return pdata.Metrics{}, err } @@ -68,7 +66,7 @@ func (d *jsonUnmarshaler) UnmarshalMetrics(buf []byte) (pdata.Metrics, error) { } func (d *jsonUnmarshaler) UnmarshalTraces(buf []byte) (pdata.Traces, error) { - td := &otlpcollectortrace.ExportTraceServiceRequest{} + td := &otlptrace.TracesData{} if err := d.delegate.Unmarshal(bytes.NewReader(buf), td); err != nil { return pdata.Traces{}, err } diff --git a/model/otlp/pb_unmarshaler.go b/model/otlp/pb_unmarshaler.go index 1b36b1b1246..bb01f665f61 100644 --- a/model/otlp/pb_unmarshaler.go +++ b/model/otlp/pb_unmarshaler.go @@ -16,9 +16,9 @@ package otlp // import "go.opentelemetry.io/collector/model/otlp" import ( "go.opentelemetry.io/collector/model/internal" - otlpcollectorlog "go.opentelemetry.io/collector/model/internal/data/protogen/collector/logs/v1" - otlpcollectormetrics "go.opentelemetry.io/collector/model/internal/data/protogen/collector/metrics/v1" - otlpcollectortrace "go.opentelemetry.io/collector/model/internal/data/protogen/collector/trace/v1" + otlplogs "go.opentelemetry.io/collector/model/internal/data/protogen/logs/v1" + otlpmetrics "go.opentelemetry.io/collector/model/internal/data/protogen/metrics/v1" + otlptrace "go.opentelemetry.io/collector/model/internal/data/protogen/trace/v1" "go.opentelemetry.io/collector/model/pdata" ) @@ -44,19 +44,19 @@ func newPbUnmarshaler() *pbUnmarshaler { } func (d *pbUnmarshaler) UnmarshalLogs(buf []byte) (pdata.Logs, error) { - ld := &otlpcollectorlog.ExportLogsServiceRequest{} + ld := &otlplogs.LogsData{} err := ld.Unmarshal(buf) return pdata.LogsFromInternalRep(internal.LogsFromOtlp(ld)), err } func (d *pbUnmarshaler) UnmarshalMetrics(buf []byte) (pdata.Metrics, error) { - md := &otlpcollectormetrics.ExportMetricsServiceRequest{} + md := &otlpmetrics.MetricsData{} err := md.Unmarshal(buf) return pdata.MetricsFromInternalRep(internal.MetricsFromOtlp(md)), err } func (d *pbUnmarshaler) UnmarshalTraces(buf []byte) (pdata.Traces, error) { - td := &otlpcollectortrace.ExportTraceServiceRequest{} + td := &otlptrace.TracesData{} err := td.Unmarshal(buf) return pdata.TracesFromInternalRep(internal.TracesFromOtlp(td)), err } diff --git a/model/otlpgrpc/logs.go b/model/otlpgrpc/logs.go index f40836a7429..a5853d3e87a 100644 --- a/model/otlpgrpc/logs.go +++ b/model/otlpgrpc/logs.go @@ -23,6 +23,7 @@ import ( "go.opentelemetry.io/collector/model/internal" otlpcollectorlog "go.opentelemetry.io/collector/model/internal/data/protogen/collector/logs/v1" + otlplogs "go.opentelemetry.io/collector/model/internal/data/protogen/logs/v1" "go.opentelemetry.io/collector/model/pdata" ) @@ -81,7 +82,7 @@ func (lr LogsRequest) SetLogs(ld pdata.Logs) { } func (lr LogsRequest) Logs() pdata.Logs { - return pdata.LogsFromInternalRep(internal.LogsFromOtlp(lr.orig)) + return pdata.LogsFromInternalRep(internal.LogsFromOtlp(&otlplogs.LogsData{ResourceLogs: lr.orig.ResourceLogs})) } // LogsClient is the client API for OTLP-GRPC Logs service. diff --git a/model/otlpgrpc/metrics.go b/model/otlpgrpc/metrics.go index 276968d1a2a..9ae65cd5033 100644 --- a/model/otlpgrpc/metrics.go +++ b/model/otlpgrpc/metrics.go @@ -22,6 +22,7 @@ import ( "go.opentelemetry.io/collector/model/internal" otlpcollectormetrics "go.opentelemetry.io/collector/model/internal/data/protogen/collector/metrics/v1" + otlpmetrics "go.opentelemetry.io/collector/model/internal/data/protogen/metrics/v1" "go.opentelemetry.io/collector/model/pdata" ) @@ -80,7 +81,7 @@ func (mr MetricsRequest) SetMetrics(ld pdata.Metrics) { } func (mr MetricsRequest) Metrics() pdata.Metrics { - return pdata.MetricsFromInternalRep(internal.MetricsFromOtlp(mr.orig)) + return pdata.MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpmetrics.MetricsData{ResourceMetrics: mr.orig.ResourceMetrics})) } // MetricsClient is the client API for OTLP-GRPC Metrics service. diff --git a/model/otlpgrpc/traces.go b/model/otlpgrpc/traces.go index 14755918abe..a9e6cd1ce42 100644 --- a/model/otlpgrpc/traces.go +++ b/model/otlpgrpc/traces.go @@ -22,6 +22,7 @@ import ( "go.opentelemetry.io/collector/model/internal" otlpcollectortrace "go.opentelemetry.io/collector/model/internal/data/protogen/collector/trace/v1" + otlptrace "go.opentelemetry.io/collector/model/internal/data/protogen/trace/v1" "go.opentelemetry.io/collector/model/pdata" ) @@ -80,7 +81,7 @@ func (tr TracesRequest) SetTraces(td pdata.Traces) { } func (tr TracesRequest) Traces() pdata.Traces { - return pdata.TracesFromInternalRep(internal.TracesFromOtlp(tr.orig)) + return pdata.TracesFromInternalRep(internal.TracesFromOtlp(&otlptrace.TracesData{ResourceSpans: tr.orig.ResourceSpans})) } // TracesClient is the client API for OTLP-GRPC Traces service. diff --git a/model/pdata/logs.go b/model/pdata/logs.go index 565d9eabcb9..a2c4f5a9efe 100644 --- a/model/pdata/logs.go +++ b/model/pdata/logs.go @@ -16,7 +16,6 @@ package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal" - otlpcollectorlog "go.opentelemetry.io/collector/model/internal/data/protogen/collector/logs/v1" otlplogs "go.opentelemetry.io/collector/model/internal/data/protogen/logs/v1" ) @@ -48,12 +47,12 @@ type LogsSizer interface { // Must use NewLogs functions to create new instances. // Important: zero-initialized instance is not valid for use. type Logs struct { - orig *otlpcollectorlog.ExportLogsServiceRequest + orig *otlplogs.LogsData } // NewLogs creates a new Logs. func NewLogs() Logs { - return Logs{orig: &otlpcollectorlog.ExportLogsServiceRequest{}} + return Logs{orig: &otlplogs.LogsData{}} } // LogsFromInternalRep creates the internal Logs representation from the ProtoBuf. Should diff --git a/model/pdata/logs_test.go b/model/pdata/logs_test.go index 40c8ccd0c33..14d999cc38c 100644 --- a/model/pdata/logs_test.go +++ b/model/pdata/logs_test.go @@ -20,7 +20,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/model/internal" - otlpcollectorlog "go.opentelemetry.io/collector/model/internal/data/protogen/collector/logs/v1" otlplogs "go.opentelemetry.io/collector/model/internal/data/protogen/logs/v1" ) @@ -50,17 +49,17 @@ func TestLogRecordCount(t *testing.T) { func TestLogRecordCountWithEmpty(t *testing.T) { assert.Zero(t, NewLogs().LogRecordCount()) - assert.Zero(t, Logs{orig: &otlpcollectorlog.ExportLogsServiceRequest{ + assert.Zero(t, Logs{orig: &otlplogs.LogsData{ ResourceLogs: []*otlplogs.ResourceLogs{{}}, }}.LogRecordCount()) - assert.Zero(t, Logs{orig: &otlpcollectorlog.ExportLogsServiceRequest{ + assert.Zero(t, Logs{orig: &otlplogs.LogsData{ ResourceLogs: []*otlplogs.ResourceLogs{ { InstrumentationLibraryLogs: []*otlplogs.InstrumentationLibraryLogs{{}}, }, }, }}.LogRecordCount()) - assert.Equal(t, 1, Logs{orig: &otlpcollectorlog.ExportLogsServiceRequest{ + assert.Equal(t, 1, Logs{orig: &otlplogs.LogsData{ ResourceLogs: []*otlplogs.ResourceLogs{ { InstrumentationLibraryLogs: []*otlplogs.InstrumentationLibraryLogs{ @@ -74,10 +73,10 @@ func TestLogRecordCountWithEmpty(t *testing.T) { } func TestToFromLogProto(t *testing.T) { - wrapper := internal.LogsFromOtlp(&otlpcollectorlog.ExportLogsServiceRequest{}) + wrapper := internal.LogsFromOtlp(&otlplogs.LogsData{}) ld := LogsFromInternalRep(wrapper) assert.EqualValues(t, NewLogs(), ld) - assert.EqualValues(t, &otlpcollectorlog.ExportLogsServiceRequest{}, ld.orig) + assert.EqualValues(t, &otlplogs.LogsData{}, ld.orig) } func TestLogsClone(t *testing.T) { diff --git a/model/pdata/metrics.go b/model/pdata/metrics.go index 1ec0f54a290..f9741294fde 100644 --- a/model/pdata/metrics.go +++ b/model/pdata/metrics.go @@ -16,7 +16,6 @@ package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal" - otlpcollectormetrics "go.opentelemetry.io/collector/model/internal/data/protogen/collector/metrics/v1" otlpmetrics "go.opentelemetry.io/collector/model/internal/data/protogen/metrics/v1" ) @@ -47,12 +46,12 @@ type MetricsSizer interface { // Outside of the core repository, the metrics pipeline cannot be converted to the new model since data.MetricData is // part of the internal package. type Metrics struct { - orig *otlpcollectormetrics.ExportMetricsServiceRequest + orig *otlpmetrics.MetricsData } // NewMetrics creates a new Metrics. func NewMetrics() Metrics { - return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{}} + return Metrics{orig: &otlpmetrics.MetricsData{}} } // MetricsFromInternalRep creates Metrics from the internal representation. diff --git a/model/pdata/metrics_test.go b/model/pdata/metrics_test.go index 05ee3f30665..f658ced841a 100644 --- a/model/pdata/metrics_test.go +++ b/model/pdata/metrics_test.go @@ -23,7 +23,6 @@ import ( "google.golang.org/protobuf/types/known/emptypb" "go.opentelemetry.io/collector/model/internal" - otlpcollectormetrics "go.opentelemetry.io/collector/model/internal/data/protogen/collector/metrics/v1" otlpcommon "go.opentelemetry.io/collector/model/internal/data/protogen/common/v1" otlpmetrics "go.opentelemetry.io/collector/model/internal/data/protogen/metrics/v1" otlpresource "go.opentelemetry.io/collector/model/internal/data/protogen/resource/v1" @@ -216,7 +215,7 @@ func TestDataPointCountWithNilDataPoints(t *testing.T) { } func TestOtlpToInternalReadOnly(t *testing.T) { - md := Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{ + md := Metrics{orig: &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -304,7 +303,7 @@ func TestOtlpToInternalReadOnly(t *testing.T) { } func TestOtlpToFromInternalReadOnly(t *testing.T) { - md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpcollectormetrics.ExportMetricsServiceRequest{ + md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -318,7 +317,7 @@ func TestOtlpToFromInternalReadOnly(t *testing.T) { }, })) // Test that nothing changed - assert.EqualValues(t, &otlpcollectormetrics.ExportMetricsServiceRequest{ + assert.EqualValues(t, &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -336,7 +335,7 @@ func TestOtlpToFromInternalReadOnly(t *testing.T) { func TestOtlpToFromInternalGaugeMutating(t *testing.T) { newAttributes := NewAttributeMapFromMap(map[string]AttributeValue{"k": NewAttributeValueString("v")}) - md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpcollectormetrics.ExportMetricsServiceRequest{ + md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -376,7 +375,7 @@ func TestOtlpToFromInternalGaugeMutating(t *testing.T) { assert.EqualValues(t, newAttributes, gaugeDataPoints.At(0).Attributes()) // Test that everything is updated. - assert.EqualValues(t, &otlpcollectormetrics.ExportMetricsServiceRequest{ + assert.EqualValues(t, &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -419,7 +418,7 @@ func TestOtlpToFromInternalGaugeMutating(t *testing.T) { func TestOtlpToFromInternalSumMutating(t *testing.T) { newAttributes := NewAttributeMapFromMap(map[string]AttributeValue{"k": NewAttributeValueString("v")}) - md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpcollectormetrics.ExportMetricsServiceRequest{ + md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -460,7 +459,7 @@ func TestOtlpToFromInternalSumMutating(t *testing.T) { assert.EqualValues(t, newAttributes, doubleDataPoints.At(0).Attributes()) // Test that everything is updated. - assert.EqualValues(t, &otlpcollectormetrics.ExportMetricsServiceRequest{ + assert.EqualValues(t, &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -504,7 +503,7 @@ func TestOtlpToFromInternalSumMutating(t *testing.T) { func TestOtlpToFromInternalHistogramMutating(t *testing.T) { newAttributes := NewAttributeMapFromMap(map[string]AttributeValue{"k": NewAttributeValueString("v")}) - md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpcollectormetrics.ExportMetricsServiceRequest{ + md := MetricsFromInternalRep(internal.MetricsFromOtlp(&otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -545,7 +544,7 @@ func TestOtlpToFromInternalHistogramMutating(t *testing.T) { assert.EqualValues(t, []float64{1}, histogramDataPoints.At(0).ExplicitBounds()) histogramDataPoints.At(0).SetBucketCounts([]uint64{21, 32}) // Test that everything is updated. - assert.EqualValues(t, &otlpcollectormetrics.ExportMetricsServiceRequest{ + assert.EqualValues(t, &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -618,7 +617,7 @@ func BenchmarkMetricsClone(b *testing.B) { } func BenchmarkOtlpToFromInternal_PassThrough(b *testing.B) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -643,7 +642,7 @@ func BenchmarkOtlpToFromInternal_PassThrough(b *testing.B) { } func BenchmarkOtlpToFromInternal_Gauge_MutateOneLabel(b *testing.B) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -669,7 +668,7 @@ func BenchmarkOtlpToFromInternal_Gauge_MutateOneLabel(b *testing.B) { } func BenchmarkOtlpToFromInternal_Sum_MutateOneLabel(b *testing.B) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -695,7 +694,7 @@ func BenchmarkOtlpToFromInternal_Sum_MutateOneLabel(b *testing.B) { } func BenchmarkOtlpToFromInternal_HistogramPoints_MutateOneLabel(b *testing.B) { - req := &otlpcollectormetrics.ExportMetricsServiceRequest{ + req := &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { Resource: generateTestProtoResource(), @@ -858,13 +857,13 @@ func generateTestProtoDoubleHistogramMetric() *otlpmetrics.Metric { } func generateMetricsEmptyResource() Metrics { - return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{ + return Metrics{orig: &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{{}}, }} } func generateMetricsEmptyInstrumentation() Metrics { - return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{ + return Metrics{orig: &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { InstrumentationLibraryMetrics: []*otlpmetrics.InstrumentationLibraryMetrics{{}}, @@ -874,7 +873,7 @@ func generateMetricsEmptyInstrumentation() Metrics { } func generateMetricsEmptyMetrics() Metrics { - return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{ + return Metrics{orig: &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { InstrumentationLibraryMetrics: []*otlpmetrics.InstrumentationLibraryMetrics{ @@ -888,7 +887,7 @@ func generateMetricsEmptyMetrics() Metrics { } func generateMetricsEmptyDataPoints() Metrics { - return Metrics{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{ + return Metrics{orig: &otlpmetrics.MetricsData{ ResourceMetrics: []*otlpmetrics.ResourceMetrics{ { InstrumentationLibraryMetrics: []*otlpmetrics.InstrumentationLibraryMetrics{ diff --git a/model/pdata/traces.go b/model/pdata/traces.go index ad68dcddec6..4fdf85a9871 100644 --- a/model/pdata/traces.go +++ b/model/pdata/traces.go @@ -16,7 +16,6 @@ package pdata // import "go.opentelemetry.io/collector/model/pdata" import ( "go.opentelemetry.io/collector/model/internal" - otlpcollectortrace "go.opentelemetry.io/collector/model/internal/data/protogen/collector/trace/v1" otlptrace "go.opentelemetry.io/collector/model/internal/data/protogen/trace/v1" ) @@ -43,12 +42,12 @@ type TracesSizer interface { // Traces is the top-level struct that is propagated through the traces pipeline. type Traces struct { - orig *otlpcollectortrace.ExportTraceServiceRequest + orig *otlptrace.TracesData } // NewTraces creates a new Traces. func NewTraces() Traces { - return Traces{orig: &otlpcollectortrace.ExportTraceServiceRequest{}} + return Traces{orig: &otlptrace.TracesData{}} } // TracesFromInternalRep creates Traces from the internal representation. diff --git a/model/pdata/traces_test.go b/model/pdata/traces_test.go index 6ae3c3c8971..033326bcc0e 100644 --- a/model/pdata/traces_test.go +++ b/model/pdata/traces_test.go @@ -23,7 +23,6 @@ import ( "google.golang.org/protobuf/types/known/emptypb" "go.opentelemetry.io/collector/model/internal" - otlpcollectortrace "go.opentelemetry.io/collector/model/internal/data/protogen/collector/trace/v1" otlptrace "go.opentelemetry.io/collector/model/internal/data/protogen/trace/v1" ) @@ -52,17 +51,17 @@ func TestSpanCount(t *testing.T) { } func TestSpanCountWithEmpty(t *testing.T) { - assert.EqualValues(t, 0, Traces{orig: &otlpcollectortrace.ExportTraceServiceRequest{ + assert.EqualValues(t, 0, Traces{orig: &otlptrace.TracesData{ ResourceSpans: []*otlptrace.ResourceSpans{{}}, }}.SpanCount()) - assert.EqualValues(t, 0, Traces{orig: &otlpcollectortrace.ExportTraceServiceRequest{ + assert.EqualValues(t, 0, Traces{orig: &otlptrace.TracesData{ ResourceSpans: []*otlptrace.ResourceSpans{ { InstrumentationLibrarySpans: []*otlptrace.InstrumentationLibrarySpans{{}}, }, }, }}.SpanCount()) - assert.EqualValues(t, 1, Traces{orig: &otlpcollectortrace.ExportTraceServiceRequest{ + assert.EqualValues(t, 1, Traces{orig: &otlptrace.TracesData{ ResourceSpans: []*otlptrace.ResourceSpans{ { InstrumentationLibrarySpans: []*otlptrace.InstrumentationLibrarySpans{ @@ -105,7 +104,7 @@ func TestSpanStatusCode(t *testing.T) { } func TestToFromOtlp(t *testing.T) { - otlp := &otlpcollectortrace.ExportTraceServiceRequest{} + otlp := &otlptrace.TracesData{} td := TracesFromInternalRep(internal.TracesFromOtlp(otlp)) assert.EqualValues(t, NewTraces(), td) assert.EqualValues(t, otlp, internal.TracesToOtlp(td.InternalRep())) From 48a2e01652fa679c89259866210473fc0d42ca95 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 19 Oct 2021 11:57:43 -0700 Subject: [PATCH 071/149] Remove deprecated no-op flags to setup Colletor's logging (#4213) * Remove deprecated no-op flags to setup Colletor's logging Signed-off-by: Bogdan Drutu * Update CHANGELOG.md Co-authored-by: Pablo Baeyens * Update CHANGELOG.md Co-authored-by: alrex Co-authored-by: Pablo Baeyens --- CHANGELOG.md | 1 + service/flags.go | 9 +---- service/internal/telemetrylogs/logger.go | 42 ------------------------ 3 files changed, 2 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c4d60b2aa5..ef1990f569b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Rename `parserprovider.MapProvider` as `config.MapProvider` (#4178) - Rename `parserprovider.Watchable` as `config.WatchableMapProvider` (#4178) +- Remove deprecated no-op flags to setup Collector's logging "--log-level", "--log-profile", "--log-format" (#4213) ## v0.37.0 Beta diff --git a/service/flags.go b/service/flags.go index 8eb90229eab..2c133d3be3a 100644 --- a/service/flags.go +++ b/service/flags.go @@ -19,7 +19,6 @@ import ( "strings" "go.opentelemetry.io/collector/config/configtelemetry" - "go.opentelemetry.io/collector/service/internal/telemetrylogs" ) var ( @@ -52,13 +51,7 @@ func (s *stringArrayValue) String() string { func flags() *flag.FlagSet { flagSet := new(flag.FlagSet) - addFlagsFns := []func(*flag.FlagSet){ - configtelemetry.Flags, - telemetrylogs.Flags, - } - for _, addFlags := range addFlagsFns { - addFlags(flagSet) - } + configtelemetry.Flags(flagSet) // At least until we can use a generic, i.e.: OpenCensus, metrics exporter // we default to Prometheus at port 8888, if not otherwise specified. diff --git a/service/internal/telemetrylogs/logger.go b/service/internal/telemetrylogs/logger.go index 913ce6e05ac..ee1c4efa82a 100644 --- a/service/internal/telemetrylogs/logger.go +++ b/service/internal/telemetrylogs/logger.go @@ -15,39 +15,12 @@ package telemetrylogs // import "go.opentelemetry.io/collector/service/internal/telemetrylogs" import ( - "flag" - "go.uber.org/zap" "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/config" ) -const ( - logLevelCfg = "log-level" - logProfileCfg = "log-profile" - logFormatCfg = "log-format" -) - -var ( - defaultLogValue = "deprecated" - // Command line pointer to logger level flag configuration. - loggerLevelPtr = &defaultLogValue - loggerProfilePtr = &defaultLogValue - loggerFormatPtr = &defaultLogValue -) - -// Flags adds flags related to service telemetry logs to the given flagset. -// Deprecated: keep this flag for preventing the breaking change. Use `service::telemetry::logs` in config instead. -func Flags(flags *flag.FlagSet) { - loggerLevelPtr = flags.String(logLevelCfg, defaultLogValue, "Deprecated. Define the logging configuration as part of the configuration file, under the 'service' section.") - - loggerProfilePtr = flags.String(logProfileCfg, defaultLogValue, "Deprecated. Define the logging configuration as part of the configuration file, under the 'service' section.") - - // Note: we use "console" by default for more human-friendly mode of logging (tab delimited, formatted timestamps). - loggerFormatPtr = flags.String(logFormatCfg, defaultLogValue, "Deprecated. Define the logging configuration as part of the configuration file, under the 'service' section.") -} - func NewLogger(cfg config.ServiceTelemetryLogs, options []zap.Option) (*zap.Logger, error) { // Copied from NewProductionConfig. zapCfg := &zap.Config{ @@ -72,20 +45,5 @@ func NewLogger(cfg config.ServiceTelemetryLogs, options []zap.Option) (*zap.Logg if err != nil { return nil, err } - logDeprecatedMessages(logger) return logger, nil } - -func logDeprecatedMessages(logger *zap.Logger) { - if *loggerLevelPtr != defaultLogValue { - logger.Warn("`log-level` command line option has been deprecated. Use `service::telemetry::logs` in config instead!") - } - - if *loggerProfilePtr != defaultLogValue { - logger.Warn("`log-profile` command line option has been deprecated. Use `service::telemetry::logs` in config instead!") - } - - if *loggerFormatPtr != defaultLogValue { - logger.Warn("`log-format` command line option has been deprecated. Use `service::telemetry::logs` in config instead!") - } -} From 8aa3a9ce79217171c9eeac53813507997146566b Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 19 Oct 2021 11:58:54 -0700 Subject: [PATCH 072/149] Add unmarshaler for otlpgrpc.[*]Request and otlpgrp.[*]Response (#4215) Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/4052 Signed-off-by: Bogdan Drutu --- model/otlpgrpc/logs.go | 37 ++++++++++++++++++ model/otlpgrpc/metrics.go | 38 +++++++++++++++++- model/otlpgrpc/traces.go | 38 +++++++++++++++++- receiver/otlpreceiver/encoder.go | 63 ++++-------------------------- receiver/otlpreceiver/otlp_test.go | 23 ++++------- 5 files changed, 125 insertions(+), 74 deletions(-) diff --git a/model/otlpgrpc/logs.go b/model/otlpgrpc/logs.go index a5853d3e87a..66c0e648410 100644 --- a/model/otlpgrpc/logs.go +++ b/model/otlpgrpc/logs.go @@ -28,6 +28,7 @@ import ( ) var jsonMarshaler = &jsonpb.Marshaler{} +var jsonUnmarshaler = &jsonpb.Unmarshaler{} // LogsResponse represents the response for gRPC client/server. type LogsResponse struct { @@ -39,6 +40,24 @@ func NewLogsResponse() LogsResponse { return LogsResponse{orig: &otlpcollectorlog.ExportLogsServiceResponse{}} } +// UnmarshalLogsResponse unmarshalls LogsResponse from proto bytes. +func UnmarshalLogsResponse(data []byte) (LogsResponse, error) { + var orig otlpcollectorlog.ExportLogsServiceResponse + if err := orig.Unmarshal(data); err != nil { + return LogsResponse{}, err + } + return LogsResponse{orig: &orig}, nil +} + +// UnmarshalJSONLogsResponse unmarshalls LogsResponse from JSON bytes. +func UnmarshalJSONLogsResponse(data []byte) (LogsResponse, error) { + var orig otlpcollectorlog.ExportLogsServiceResponse + if err := jsonUnmarshaler.Unmarshal(bytes.NewReader(data), &orig); err != nil { + return LogsResponse{}, err + } + return LogsResponse{orig: &orig}, nil +} + // Marshal marshals LogsResponse into proto bytes. func (lr LogsResponse) Marshal() ([]byte, error) { return lr.orig.Marshal() @@ -63,6 +82,24 @@ func NewLogsRequest() LogsRequest { return LogsRequest{orig: &otlpcollectorlog.ExportLogsServiceRequest{}} } +// UnmarshalLogsRequest unmarshalls LogsRequest from proto bytes. +func UnmarshalLogsRequest(data []byte) (LogsRequest, error) { + var orig otlpcollectorlog.ExportLogsServiceRequest + if err := orig.Unmarshal(data); err != nil { + return LogsRequest{}, err + } + return LogsRequest{orig: &orig}, nil +} + +// UnmarshalJSONLogsRequest unmarshalls LogsRequest from JSON bytes. +func UnmarshalJSONLogsRequest(data []byte) (LogsRequest, error) { + var orig otlpcollectorlog.ExportLogsServiceRequest + if err := jsonUnmarshaler.Unmarshal(bytes.NewReader(data), &orig); err != nil { + return LogsRequest{}, err + } + return LogsRequest{orig: &orig}, nil +} + // Marshal marshals LogsRequest into proto bytes. func (lr LogsRequest) Marshal() ([]byte, error) { return lr.orig.Marshal() diff --git a/model/otlpgrpc/metrics.go b/model/otlpgrpc/metrics.go index 9ae65cd5033..762ade8455c 100644 --- a/model/otlpgrpc/metrics.go +++ b/model/otlpgrpc/metrics.go @@ -26,8 +26,6 @@ import ( "go.opentelemetry.io/collector/model/pdata" ) -// TODO: Consider to add `MetricsRequest`. If we add non pdata properties we can add them to the request. - // MetricsResponse represents the response for gRPC client/server. type MetricsResponse struct { orig *otlpcollectormetrics.ExportMetricsServiceResponse @@ -38,6 +36,24 @@ func NewMetricsResponse() MetricsResponse { return MetricsResponse{orig: &otlpcollectormetrics.ExportMetricsServiceResponse{}} } +// UnmarshalMetricsResponse unmarshalls MetricsResponse from proto bytes. +func UnmarshalMetricsResponse(data []byte) (MetricsResponse, error) { + var orig otlpcollectormetrics.ExportMetricsServiceResponse + if err := orig.Unmarshal(data); err != nil { + return MetricsResponse{}, err + } + return MetricsResponse{orig: &orig}, nil +} + +// UnmarshalJSONMetricsResponse unmarshalls MetricsResponse from JSON bytes. +func UnmarshalJSONMetricsResponse(data []byte) (MetricsResponse, error) { + var orig otlpcollectormetrics.ExportMetricsServiceResponse + if err := jsonUnmarshaler.Unmarshal(bytes.NewReader(data), &orig); err != nil { + return MetricsResponse{}, err + } + return MetricsResponse{orig: &orig}, nil +} + // Marshal marshals MetricsResponse into proto bytes. func (mr MetricsResponse) Marshal() ([]byte, error) { return mr.orig.Marshal() @@ -62,6 +78,24 @@ func NewMetricsRequest() MetricsRequest { return MetricsRequest{orig: &otlpcollectormetrics.ExportMetricsServiceRequest{}} } +// UnmarshalMetricsRequest unmarshalls MetricsRequest from proto bytes. +func UnmarshalMetricsRequest(data []byte) (MetricsRequest, error) { + var orig otlpcollectormetrics.ExportMetricsServiceRequest + if err := orig.Unmarshal(data); err != nil { + return MetricsRequest{}, err + } + return MetricsRequest{orig: &orig}, nil +} + +// UnmarshalJSONMetricsRequest unmarshalls MetricsRequest from JSON bytes. +func UnmarshalJSONMetricsRequest(data []byte) (MetricsRequest, error) { + var orig otlpcollectormetrics.ExportMetricsServiceRequest + if err := jsonUnmarshaler.Unmarshal(bytes.NewReader(data), &orig); err != nil { + return MetricsRequest{}, err + } + return MetricsRequest{orig: &orig}, nil +} + // Marshal marshals MetricsRequest into proto bytes. func (mr MetricsRequest) Marshal() ([]byte, error) { return mr.orig.Marshal() diff --git a/model/otlpgrpc/traces.go b/model/otlpgrpc/traces.go index a9e6cd1ce42..96ca697d449 100644 --- a/model/otlpgrpc/traces.go +++ b/model/otlpgrpc/traces.go @@ -26,8 +26,6 @@ import ( "go.opentelemetry.io/collector/model/pdata" ) -// TODO: Consider to add `TracesRequest`. If we add non pdata properties we can add them to the request. - // TracesResponse represents the response for gRPC client/server. type TracesResponse struct { orig *otlpcollectortrace.ExportTraceServiceResponse @@ -38,6 +36,24 @@ func NewTracesResponse() TracesResponse { return TracesResponse{orig: &otlpcollectortrace.ExportTraceServiceResponse{}} } +// UnmarshalTracesResponse unmarshalls TracesResponse from proto bytes. +func UnmarshalTracesResponse(data []byte) (TracesResponse, error) { + var orig otlpcollectortrace.ExportTraceServiceResponse + if err := orig.Unmarshal(data); err != nil { + return TracesResponse{}, err + } + return TracesResponse{orig: &orig}, nil +} + +// UnmarshalJSONTracesResponse unmarshalls TracesResponse from JSON bytes. +func UnmarshalJSONTracesResponse(data []byte) (TracesResponse, error) { + var orig otlpcollectortrace.ExportTraceServiceResponse + if err := jsonUnmarshaler.Unmarshal(bytes.NewReader(data), &orig); err != nil { + return TracesResponse{}, err + } + return TracesResponse{orig: &orig}, nil +} + // Marshal marshals TracesResponse into proto bytes. func (tr TracesResponse) Marshal() ([]byte, error) { return tr.orig.Marshal() @@ -62,6 +78,24 @@ func NewTracesRequest() TracesRequest { return TracesRequest{orig: &otlpcollectortrace.ExportTraceServiceRequest{}} } +// UnmarshalTracesRequest unmarshalls TracesRequest from proto bytes. +func UnmarshalTracesRequest(data []byte) (TracesRequest, error) { + var orig otlpcollectortrace.ExportTraceServiceRequest + if err := orig.Unmarshal(data); err != nil { + return TracesRequest{}, err + } + return TracesRequest{orig: &orig}, nil +} + +// UnmarshalJSONTracesRequest unmarshalls TracesRequest from JSON bytes. +func UnmarshalJSONTracesRequest(data []byte) (TracesRequest, error) { + var orig otlpcollectortrace.ExportTraceServiceRequest + if err := jsonUnmarshaler.Unmarshal(bytes.NewReader(data), &orig); err != nil { + return TracesRequest{}, err + } + return TracesRequest{orig: &orig}, nil +} + // Marshal marshals TracesRequest into proto bytes. func (tr TracesRequest) Marshal() ([]byte, error) { return tr.orig.Marshal() diff --git a/receiver/otlpreceiver/encoder.go b/receiver/otlpreceiver/encoder.go index f1c2007d14b..ea9cee80d87 100644 --- a/receiver/otlpreceiver/encoder.go +++ b/receiver/otlpreceiver/encoder.go @@ -21,7 +21,6 @@ import ( "github.com/gogo/protobuf/proto" spb "google.golang.org/genproto/googleapis/rpc/status" - "go.opentelemetry.io/collector/model/otlp" "go.opentelemetry.io/collector/model/otlpgrpc" ) @@ -31,18 +30,8 @@ const ( ) var ( - pbEncoder = &protoEncoder{} - jsEncoder = &jsonEncoder{} - - tracesPbUnmarshaler = otlp.NewProtobufTracesUnmarshaler() - tracesJSONUnmarshaler = otlp.NewJSONTracesUnmarshaler() - - metricsPbUnmarshaler = otlp.NewProtobufMetricsUnmarshaler() - metricsJSONUnmarshaler = otlp.NewJSONMetricsUnmarshaler() - - logsPbUnmarshaler = otlp.NewProtobufLogsUnmarshaler() - logsJSONUnmarshaler = otlp.NewJSONLogsUnmarshaler() - + pbEncoder = &protoEncoder{} + jsEncoder = &jsonEncoder{} jsonMarshaler = &jsonpb.Marshaler{} ) @@ -63,33 +52,15 @@ type encoder interface { type protoEncoder struct{} func (protoEncoder) unmarshalTracesRequest(buf []byte) (otlpgrpc.TracesRequest, error) { - td, err := tracesPbUnmarshaler.UnmarshalTraces(buf) - if err != nil { - return otlpgrpc.TracesRequest{}, err - } - req := otlpgrpc.NewTracesRequest() - req.SetTraces(td) - return req, nil + return otlpgrpc.UnmarshalTracesRequest(buf) } func (protoEncoder) unmarshalMetricsRequest(buf []byte) (otlpgrpc.MetricsRequest, error) { - td, err := metricsPbUnmarshaler.UnmarshalMetrics(buf) - if err != nil { - return otlpgrpc.MetricsRequest{}, err - } - req := otlpgrpc.NewMetricsRequest() - req.SetMetrics(td) - return req, nil + return otlpgrpc.UnmarshalMetricsRequest(buf) } func (protoEncoder) unmarshalLogsRequest(buf []byte) (otlpgrpc.LogsRequest, error) { - ld, err := logsPbUnmarshaler.UnmarshalLogs(buf) - if err != nil { - return otlpgrpc.LogsRequest{}, err - } - req := otlpgrpc.NewLogsRequest() - req.SetLogs(ld) - return req, nil + return otlpgrpc.UnmarshalLogsRequest(buf) } func (protoEncoder) marshalTracesResponse(resp otlpgrpc.TracesResponse) ([]byte, error) { @@ -115,33 +86,15 @@ func (protoEncoder) contentType() string { type jsonEncoder struct{} func (jsonEncoder) unmarshalTracesRequest(buf []byte) (otlpgrpc.TracesRequest, error) { - td, err := tracesJSONUnmarshaler.UnmarshalTraces(buf) - if err != nil { - return otlpgrpc.TracesRequest{}, err - } - req := otlpgrpc.NewTracesRequest() - req.SetTraces(td) - return req, nil + return otlpgrpc.UnmarshalJSONTracesRequest(buf) } func (jsonEncoder) unmarshalMetricsRequest(buf []byte) (otlpgrpc.MetricsRequest, error) { - td, err := metricsJSONUnmarshaler.UnmarshalMetrics(buf) - if err != nil { - return otlpgrpc.MetricsRequest{}, err - } - req := otlpgrpc.NewMetricsRequest() - req.SetMetrics(td) - return req, nil + return otlpgrpc.UnmarshalJSONMetricsRequest(buf) } func (jsonEncoder) unmarshalLogsRequest(buf []byte) (otlpgrpc.LogsRequest, error) { - ld, err := logsJSONUnmarshaler.UnmarshalLogs(buf) - if err != nil { - return otlpgrpc.LogsRequest{}, err - } - req := otlpgrpc.NewLogsRequest() - req.SetLogs(ld) - return req, nil + return otlpgrpc.UnmarshalJSONLogsRequest(buf) } func (jsonEncoder) marshalTracesResponse(resp otlpgrpc.TracesResponse) ([]byte, error) { diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 031878ff5ef..22a2215a715 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -27,7 +27,6 @@ import ( "testing" "time" - "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" spb "google.golang.org/genproto/googleapis/rpc/status" @@ -179,13 +178,12 @@ func testHTTPJSONRequest(t *testing.T, url string, sink *internalconsumertest.Er client := &http.Client{} resp, err := client.Do(req) - require.NoError(t, err, "Error posting trace to grpc-gateway server: %v", err) + require.NoError(t, err, "Error posting trace to http server: %v", err) respBytes, err := ioutil.ReadAll(resp.Body) if err != nil { - t.Errorf("Error reading response from trace grpc-gateway, %v", err) + t.Errorf("Error reading response from trace http server, %v", err) } - respStr := string(respBytes) err = resp.Body.Close() if err != nil { t.Errorf("Error closing response body, %v", err) @@ -194,17 +192,14 @@ func testHTTPJSONRequest(t *testing.T, url string, sink *internalconsumertest.Er allTraces := sink.AllTraces() if expectedErr == nil { assert.Equal(t, 200, resp.StatusCode) - var respJSON map[string]interface{} - assert.NoError(t, json.Unmarshal([]byte(respStr), &respJSON)) - assert.Len(t, respJSON, 0, "Got unexpected response from trace grpc-gateway") + _, err = otlpgrpc.UnmarshalJSONTracesResponse(respBytes) + assert.NoError(t, err, "Unable to unmarshal response to TracesResponse") require.Len(t, allTraces, 1) - - got := allTraces[0] - assert.EqualValues(t, got, traceOtlp) + assert.EqualValues(t, allTraces[0], traceOtlp) } else { errStatus := &spb.Status{} - assert.NoError(t, json.Unmarshal([]byte(respStr), errStatus)) + assert.NoError(t, json.Unmarshal(respBytes, errStatus)) if s, ok := status.FromError(expectedErr); ok { assert.Equal(t, http.StatusInternalServerError, resp.StatusCode) assert.True(t, proto.Equal(errStatus, s.Proto())) @@ -326,10 +321,8 @@ func testHTTPProtobufRequest( if expectedErr == nil { require.Equal(t, 200, resp.StatusCode, "Unexpected return status") - // TODO: Parse otlp response here instead of empty proto when pdata allows that. - tmp := &types.Empty{} - err := tmp.Unmarshal(respBytes) - require.NoError(t, err, "Unable to unmarshal response to ExportTraceServiceResponse proto") + _, err = otlpgrpc.UnmarshalTracesResponse(respBytes) + require.NoError(t, err, "Unable to unmarshal response to TracesResponse") require.Len(t, allTraces, 1) assert.EqualValues(t, allTraces[0], wantData) From f2f9216fa273e762dbb4e05d070d1c385ceff5a1 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Wed, 20 Oct 2021 17:38:00 +0200 Subject: [PATCH 073/149] Rename `k8s_tagger` to `k8sattributes` (#4223) --- docs/roadmap.md | 2 +- processor/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index 7583ca36943..219fc005edc 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -13,7 +13,7 @@ Metrics correctness tests|In progress|[#652](https://github.com/open-telemetry/o | | **New Formats**| Complete OTLP/HTTP support| |[#882](https://github.com/open-telemetry/opentelemetry-collector/issues/882) -Add logs support for all primary core processors (attributes, batch, k8s_tagger, etc)|In progress| +Add logs support for all primary core processors (attributes, batch, k8sattributes, etc)|In progress| | | **5 Min to Value**| Distribution packages for most common targets (e.g. Docker, RPM, Windows, etc)| diff --git a/processor/README.md b/processor/README.md index fa6cbcdd85c..8345f235837 100644 --- a/processor/README.md +++ b/processor/README.md @@ -31,14 +31,14 @@ processor documentation for more information. 1. [memory_limiter](memorylimiterprocessor/README.md) 2. *any sampling processors* -3. Any processor relying on sending source from `Context` (e.g. `k8s_tagger`) +3. Any processor relying on sending source from `Context` (e.g. `k8sattributes`) 3. [batch](batchprocessor/README.md) 4. *any other processors* ### Metrics 1. [memory_limiter](memorylimiterprocessor/README.md) -2. Any processor relying on sending source from `Context` (e.g. `k8s_tagger`) +2. Any processor relying on sending source from `Context` (e.g. `k8sattributes`) 3. [batch](batchprocessor/README.md) 4. *any other processors* From d440d05b9fec288c4643e9b6189017d41dfa9db0 Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 20 Oct 2021 11:20:57 -0700 Subject: [PATCH 074/149] reduce test time for TestGRPCMaxRecvSize test (#4218) --- receiver/otlpreceiver/otlp_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 22a2215a715..1690a91bbb9 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -583,7 +583,7 @@ func TestGRPCMaxRecvSize(t *testing.T) { cc, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithBlock()) require.NoError(t, err) - td := testdata.GenerateTracesManySpansSameResource(500000) + td := testdata.GenerateTracesManySpansSameResource(50000) require.Error(t, exportTraces(cc, td)) cc.Close() require.NoError(t, ocr.Shutdown(context.Background())) @@ -599,7 +599,7 @@ func TestGRPCMaxRecvSize(t *testing.T) { require.NoError(t, err) defer cc.Close() - td = testdata.GenerateTracesManySpansSameResource(500000) + td = testdata.GenerateTracesManySpansSameResource(50000) require.NoError(t, exportTraces(cc, td)) require.Len(t, sink.AllTraces(), 1) assert.Equal(t, td, sink.AllTraces()[0]) From 4480a74ac82f95a0d090ff5276c321ed5a710e27 Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 20 Oct 2021 12:12:11 -0700 Subject: [PATCH 075/149] add multimod tool and makefile targets to repo (#4229) * add multimod tool and makefile targets to repo * cleanup go.mod --- Makefile | 10 +++++++ internal/tools/go.mod | 15 +++++++++++ internal/tools/go.sum | 58 +++++++++++++++++++++++++++++++++++++---- internal/tools/tools.go | 1 + model/go.mod | 16 ++++++------ 5 files changed, 87 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index e7d397b7359..049abf45d58 100644 --- a/Makefile +++ b/Makefile @@ -139,6 +139,7 @@ install-tools: cd $(TOOLS_MOD_DIR) && go install golang.org/x/exp/cmd/apidiff cd $(TOOLS_MOD_DIR) && go install golang.org/x/tools/cmd/goimports 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: @@ -418,3 +419,12 @@ endif .PHONY: apidiff-compare apidiff-compare: @$(foreach pkg,$(ALL_PKGS),$(call exec-command,./internal/buildscripts/compare-apidiff.sh -p $(pkg))) + +.PHONY: multimod-verify +multimod-verify: install-tools + @echo "Validating versions.yaml" + multimod verify + +.PHONY: multimod-prerelease +multimod-prerelease: install-tools + multimod prerelease -v ./versions.yaml -m collector-base diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 7ae93edd0ee..e920874bc62 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -13,6 +13,7 @@ require ( github.com/tcnksm/ghr v0.14.0 github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad go.opentelemetry.io/build-tools/checkdoc v0.0.0-20210826185254-a20c5b1e2d7c + go.opentelemetry.io/build-tools/multimod v0.0.0-20210920164323-2ceabab23375 go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210813222030-0139980e9794 golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 golang.org/x/tools v0.1.7 @@ -24,8 +25,11 @@ require ( 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 + github.com/Microsoft/go-winio v0.4.16 // indirect github.com/OpenPeeDeeP/depguard v1.0.1 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect github.com/Songmu/retry v0.1.0 // indirect + github.com/acomagu/bufpipe v1.0.3 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/ashanbrown/forbidigo v1.2.0 // indirect github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde // indirect @@ -41,6 +45,7 @@ require ( 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/ettle/strcase v0.1.1 // indirect github.com/fatih/color v1.12.0 // indirect @@ -48,6 +53,9 @@ require ( github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/fzipp/gocyclo v0.3.1 // indirect github.com/go-critic/go-critic v0.5.6 // 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 @@ -81,11 +89,14 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-version v1.3.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/imdario/mergo v0.3.12 // indirect 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/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 @@ -129,6 +140,7 @@ require ( 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/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/sonatard/noctx v0.0.1 // indirect @@ -153,8 +165,10 @@ require ( github.com/ultraware/funlen v0.0.3 // indirect github.com/ultraware/whitespace v0.0.4 // indirect github.com/uudashr/gocognit v1.0.5 // indirect + 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/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 @@ -165,6 +179,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.26.0 // indirect gopkg.in/ini.v1 v1.62.0 // 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 honnef.co/go/tools v0.2.1 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index de75a4cdf50..541b894aba5 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -58,13 +58,20 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenPeeDeeP/depguard v1.0.1 h1:VlW4R6jmBIv3/u1JNlawEvJMM4J+dPORPaZasQee8Us= github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/Songmu/retry v0.1.0 h1:hPA5xybQsksLR/ry/+t/7cFajPW+dqjmjhzZhioBILA= github.com/Songmu/retry v0.1.0/go.mod h1:7sXIW7eseB9fq0FUvigRcQMVLR9tuHI0Scok+rkpAuA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -72,6 +79,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF 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/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= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= @@ -79,6 +88,8 @@ 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-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= github.com/ashanbrown/forbidigo v1.2.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde h1:YOsoVXsZQPA9aOTy1g0lAJv5VzZUvwQuZqug8XPeqfM= @@ -151,6 +162,8 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -170,6 +183,7 @@ 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/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= @@ -177,8 +191,19 @@ github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3n 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-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= +github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -390,12 +415,15 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jcchavezs/porto v0.2.1 h1:Ox0DkFvM3itXUVRQNV9DJnwdSzWe11NbyBqQhp4n37s= -github.com/jcchavezs/porto v0.2.1/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jcchavezs/porto v0.3.0 h1:JSKeMsqexngzHUpiv4NPPADSNBF9bDyavGRDWedzNeM= github.com/jcchavezs/porto v0.3.0/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= 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= @@ -422,6 +450,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d h1:XeSMXURZPtUffuWAaq90o6kLgZdgu+QA8wk4MPC8ikI= github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -438,6 +468,8 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -467,6 +499,8 @@ 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/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= @@ -534,7 +568,6 @@ github.com/nakabonne/nestif v0.3.0 h1:+yOViDGhg8ygGrmII72nV9B/zGxY188TYpfolntsaP github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= 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 h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.2.3 h1:+ANTMqRNrqwInnP9aszg/0jDo+zbXa4x66U19Bx/oTk= github.com/nishanths/exhaustive v0.2.3/go.mod h1:bhIX678Nx8inLM9PbpvK1yv6oGtoP8BfaIeMzgBNKvc= @@ -640,6 +673,7 @@ github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dms 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/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= @@ -648,6 +682,7 @@ github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxr 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= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -743,6 +778,8 @@ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV 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= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -776,6 +813,8 @@ go.opentelemetry.io/build-tools v0.0.0-20210719163622-92017e64f35b h1:tFMjUqEDGM go.opentelemetry.io/build-tools v0.0.0-20210719163622-92017e64f35b/go.mod h1:zZRrJN8qdwDdPNkCEyww4SW54mM1Da0v9H3TyQet9T4= go.opentelemetry.io/build-tools/checkdoc v0.0.0-20210826185254-a20c5b1e2d7c h1:PGIQT75QXC/DXhcg7ztlzkxO2E+Ij0SnJBsi/cgL2KU= go.opentelemetry.io/build-tools/checkdoc v0.0.0-20210826185254-a20c5b1e2d7c/go.mod h1:LSxCgynkoVzMPV/OEMaGXWm48o0WVAXocdfpvmJX1pE= +go.opentelemetry.io/build-tools/multimod v0.0.0-20210920164323-2ceabab23375 h1:5zVDNFcOwiMee9Qm8sH08iw+9cJZk+l/Y3mVa2D/zmM= +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.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -794,6 +833,7 @@ golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -802,6 +842,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U 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/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= @@ -839,7 +882,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= @@ -889,6 +931,7 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-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-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -981,15 +1024,18 @@ golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-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-20210615035016-665e8c7367d1/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-20210809222454-d867a43fc93e/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= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1228,8 +1274,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks 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= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +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/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -1242,6 +1289,7 @@ gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/tools/tools.go b/internal/tools/tools.go index a9b678855ec..e94f7a8a0e2 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -33,6 +33,7 @@ import ( _ "github.com/tcnksm/ghr" _ "github.com/wadey/gocovmerge" _ "go.opentelemetry.io/build-tools/checkdoc" + _ "go.opentelemetry.io/build-tools/multimod" _ "go.opentelemetry.io/build-tools/semconvgen" _ "golang.org/x/exp/cmd/apidiff" _ "golang.org/x/tools/cmd/goimports" diff --git a/model/go.mod b/model/go.mod index bd487055188..97f96074950 100644 --- a/model/go.mod +++ b/model/go.mod @@ -3,22 +3,22 @@ module go.opentelemetry.io/collector/model go 1.17 require ( - github.com/davecgh/go-spew v1.1.1 // indirect github.com/gogo/protobuf v1.3.2 - github.com/google/go-cmp v0.5.6 // indirect - github.com/kr/text v0.2.0 // indirect github.com/stretchr/testify v1.7.0 - golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect - golang.org/x/sys v0.0.0-20210611083646-a4fc73990273 // indirect - google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08 // indirect google.golang.org/grpc v1.41.0 google.golang.org/protobuf v1.27.1 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) require ( + github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.6 // indirect + github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/sys v0.0.0-20210611083646-a4fc73990273 // indirect golang.org/x/text v0.3.6 // indirect + google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) From 964c85766e9290f3be08b2dbec9e228527a20b21 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 20 Oct 2021 13:18:33 -0700 Subject: [PATCH 076/149] Change queue metrics to use opencensus metrics instead of stats, close to otel-go (#4220) * Change queue metrics to use opencensus metrics instead of stats, close to otel Signed-off-by: Bogdan Drutu * Apply suggestions from code review Co-authored-by: alrex * Fix lint errors Signed-off-by: Bogdan Drutu Co-authored-by: alrex --- exporter/exporterhelper/common.go | 2 +- exporter/exporterhelper/logs.go | 2 +- exporter/exporterhelper/logs_test.go | 2 +- exporter/exporterhelper/metrics.go | 2 +- exporter/exporterhelper/metrics_test.go | 2 +- exporter/exporterhelper/obsreport.go | 81 ++++++++++++++++--- exporter/exporterhelper/obsreport_test.go | 62 ++++---------- exporter/exporterhelper/queued_retry.go | 16 ---- .../queued_retry_experimental.go | 4 +- .../exporterhelper/queued_retry_inmemory.go | 6 +- exporter/exporterhelper/queued_retry_test.go | 32 +++++--- exporter/exporterhelper/traces.go | 2 +- exporter/exporterhelper/traces_test.go | 2 +- .../obsmetrics/obs_exporter.go | 18 ----- internal/obsreportconfig/obsreportconfig.go | 3 - 15 files changed, 115 insertions(+), 121 deletions(-) diff --git a/exporter/exporterhelper/common.go b/exporter/exporterhelper/common.go index 898503c5e87..7c7f1e4a164 100644 --- a/exporter/exporterhelper/common.go +++ b/exporter/exporterhelper/common.go @@ -183,7 +183,7 @@ func newBaseExporter(cfg config.Exporter, set component.ExporterCreateSettings, Level: configtelemetry.GetMetricsLevelFlagValue(), ExporterID: cfg.ID(), ExporterCreateSettings: set, - }) + }, globalInstruments) be.qrSender = newQueuedRetrySender(cfg.ID(), signal, bs.QueueSettings, bs.RetrySettings, reqUnmarshaler, &timeoutSender{cfg: bs.TimeoutSettings}, set.Logger) be.sender = be.qrSender diff --git a/exporter/exporterhelper/logs.go b/exporter/exporterhelper/logs.go index f0b8077a57b..c89514f13bb 100644 --- a/exporter/exporterhelper/logs.go +++ b/exporter/exporterhelper/logs.go @@ -112,7 +112,7 @@ func NewLogsExporter( req := newLogsRequest(ctx, ld, pusher) err := be.sender.send(req) if errors.Is(err, errSendingQueueIsFull) { - be.obsrep.recordLogsEnqueueFailure(req.context(), req.count()) + be.obsrep.recordLogsEnqueueFailure(req.context(), int64(req.count())) } return err }, bs.consumerOptions...) diff --git a/exporter/exporterhelper/logs_test.go b/exporter/exporterhelper/logs_test.go index fcea4f252b4..a683f00667b 100644 --- a/exporter/exporterhelper/logs_test.go +++ b/exporter/exporterhelper/logs_test.go @@ -145,7 +145,7 @@ func TestLogsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { } // 2 batched must be in queue, and 5 batches (15 log records) rejected due to queue overflow - checkExporterEnqueueFailedLogsStats(t, fakeLogsExporterName, int64(15)) + checkExporterEnqueueFailedLogsStats(t, globalInstruments, fakeLogsExporterName, int64(15)) } func TestLogsExporter_WithSpan(t *testing.T) { diff --git a/exporter/exporterhelper/metrics.go b/exporter/exporterhelper/metrics.go index b3ffb504fc1..9cc46c438db 100644 --- a/exporter/exporterhelper/metrics.go +++ b/exporter/exporterhelper/metrics.go @@ -113,7 +113,7 @@ func NewMetricsExporter( req := newMetricsRequest(ctx, md, pusher) err := be.sender.send(req) if errors.Is(err, errSendingQueueIsFull) { - be.obsrep.recordMetricsEnqueueFailure(req.context(), req.count()) + be.obsrep.recordMetricsEnqueueFailure(req.context(), int64(req.count())) } return err }, bs.consumerOptions...) diff --git a/exporter/exporterhelper/metrics_test.go b/exporter/exporterhelper/metrics_test.go index 903cae64f1a..3075cc902c4 100644 --- a/exporter/exporterhelper/metrics_test.go +++ b/exporter/exporterhelper/metrics_test.go @@ -144,7 +144,7 @@ func TestMetricsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { } // 2 batched must be in queue, and 10 metric points rejected due to queue overflow - checkExporterEnqueueFailedMetricsStats(t, fakeMetricsExporterName, int64(10)) + checkExporterEnqueueFailedMetricsStats(t, globalInstruments, fakeMetricsExporterName, int64(10)) } func TestMetricsExporter_WithSpan(t *testing.T) { diff --git a/exporter/exporterhelper/obsreport.go b/exporter/exporterhelper/obsreport.go index 198413b7052..324857f6788 100644 --- a/exporter/exporterhelper/obsreport.go +++ b/exporter/exporterhelper/obsreport.go @@ -17,8 +17,9 @@ package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporte import ( "context" - "go.opencensus.io/stats" - "go.opencensus.io/tag" + "go.opencensus.io/metric" + "go.opencensus.io/metric/metricdata" + "go.opencensus.io/metric/metricproducer" "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" "go.opentelemetry.io/collector/obsreport" @@ -28,31 +29,87 @@ import ( // into existing `obsreport` package once its functionally is not exposed // as public API. For now this part is kept private. +var ( + globalInstruments = newInstruments(metric.NewRegistry()) +) + +func init() { + metricproducer.GlobalManager().AddProducer(globalInstruments.registry) +} + +type instruments struct { + registry *metric.Registry + queueSize *metric.Int64DerivedGauge + failedToEnqueueTraceSpans *metric.Int64Cumulative + failedToEnqueueMetricPoints *metric.Int64Cumulative + failedToEnqueueLogRecords *metric.Int64Cumulative +} + +func newInstruments(registry *metric.Registry) *instruments { + insts := &instruments{ + registry: registry, + } + insts.queueSize, _ = registry.AddInt64DerivedGauge( + obsmetrics.ExporterKey+"/queue_size", + metric.WithDescription("Current size of the retry queue (in batches)"), + metric.WithLabelKeys(obsmetrics.ExporterKey), + metric.WithUnit(metricdata.UnitDimensionless)) + + insts.failedToEnqueueTraceSpans, _ = registry.AddInt64Cumulative( + obsmetrics.ExporterKey+"/enqueue_failed_spans", + metric.WithDescription("Number of spans failed to be added to the sending queue."), + metric.WithLabelKeys(obsmetrics.ExporterKey), + metric.WithUnit(metricdata.UnitDimensionless)) + + insts.failedToEnqueueMetricPoints, _ = registry.AddInt64Cumulative( + obsmetrics.ExporterKey+"/enqueue_failed_metric_points", + metric.WithDescription("Number of metric points failed to be added to the sending queue."), + metric.WithLabelKeys(obsmetrics.ExporterKey), + metric.WithUnit(metricdata.UnitDimensionless)) + + insts.failedToEnqueueLogRecords, _ = registry.AddInt64Cumulative( + obsmetrics.ExporterKey+"/enqueue_failed_log_records", + metric.WithDescription("Number of log records failed to be added to the sending queue."), + metric.WithLabelKeys(obsmetrics.ExporterKey), + metric.WithUnit(metricdata.UnitDimensionless)) + + return insts +} + // obsExporter is a helper to add observability to a component.Exporter. type obsExporter struct { *obsreport.Exporter - mutators []tag.Mutator + failedToEnqueueTraceSpansEntry *metric.Int64CumulativeEntry + failedToEnqueueMetricPointsEntry *metric.Int64CumulativeEntry + failedToEnqueueLogRecordsEntry *metric.Int64CumulativeEntry } // newObsExporter creates a new observability exporter. -func newObsExporter(cfg obsreport.ExporterSettings) *obsExporter { +func newObsExporter(cfg obsreport.ExporterSettings, insts *instruments) *obsExporter { + labelValue := metricdata.NewLabelValue(cfg.ExporterID.String()) + failedToEnqueueTraceSpansEntry, _ := insts.failedToEnqueueTraceSpans.GetEntry(labelValue) + failedToEnqueueMetricPointsEntry, _ := insts.failedToEnqueueMetricPoints.GetEntry(labelValue) + failedToEnqueueLogRecordsEntry, _ := insts.failedToEnqueueLogRecords.GetEntry(labelValue) + return &obsExporter{ - obsreport.NewExporter(cfg), - []tag.Mutator{tag.Upsert(obsmetrics.TagKeyExporter, cfg.ExporterID.String(), tag.WithTTL(tag.TTLNoPropagation))}, + Exporter: obsreport.NewExporter(cfg), + failedToEnqueueTraceSpansEntry: failedToEnqueueTraceSpansEntry, + failedToEnqueueMetricPointsEntry: failedToEnqueueMetricPointsEntry, + failedToEnqueueLogRecordsEntry: failedToEnqueueLogRecordsEntry, } } // recordTracesEnqueueFailure records number of spans that failed to be added to the sending queue. -func (eor *obsExporter) recordTracesEnqueueFailure(ctx context.Context, numSpans int) { - _ = stats.RecordWithTags(ctx, eor.mutators, obsmetrics.ExporterFailedToEnqueueSpans.M(int64(numSpans))) +func (eor *obsExporter) recordTracesEnqueueFailure(_ context.Context, numSpans int64) { + eor.failedToEnqueueTraceSpansEntry.Inc(numSpans) } // recordMetricsEnqueueFailure records number of metric points that failed to be added to the sending queue. -func (eor *obsExporter) recordMetricsEnqueueFailure(ctx context.Context, numMetricPoints int) { - _ = stats.RecordWithTags(ctx, eor.mutators, obsmetrics.ExporterFailedToEnqueueMetricPoints.M(int64(numMetricPoints))) +func (eor *obsExporter) recordMetricsEnqueueFailure(_ context.Context, numMetricPoints int64) { + eor.failedToEnqueueMetricPointsEntry.Inc(numMetricPoints) } // recordLogsEnqueueFailure records number of log records that failed to be added to the sending queue. -func (eor *obsExporter) recordLogsEnqueueFailure(ctx context.Context, numLogRecords int) { - _ = stats.RecordWithTags(ctx, eor.mutators, obsmetrics.ExporterFailedToEnqueueLogRecords.M(int64(numLogRecords))) +func (eor *obsExporter) recordLogsEnqueueFailure(_ context.Context, numLogRecords int64) { + eor.failedToEnqueueLogRecordsEntry.Inc(numLogRecords) } diff --git a/exporter/exporterhelper/obsreport_test.go b/exporter/exporterhelper/obsreport_test.go index f1c659ee004..8a90ddc1862 100644 --- a/exporter/exporterhelper/obsreport_test.go +++ b/exporter/exporterhelper/obsreport_test.go @@ -16,12 +16,10 @@ package exporterhelper import ( "context" - "reflect" - "sort" "testing" "github.com/stretchr/testify/require" - "go.opencensus.io/stats/view" + "go.opencensus.io/metric" "go.opencensus.io/tag" "go.opentelemetry.io/collector/config" @@ -37,66 +35,42 @@ func TestExportEnqueueFailure(t *testing.T) { exporter := config.NewComponentID("fakeExporter") + insts := newInstruments(metric.NewRegistry()) obsrep := newObsExporter(obsreport.ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, ExporterCreateSettings: set.ToExporterCreateSettings(), - }) + }, insts) - logRecords := 7 + logRecords := int64(7) obsrep.recordLogsEnqueueFailure(context.Background(), logRecords) - checkExporterEnqueueFailedLogsStats(t, exporter, int64(logRecords)) + checkExporterEnqueueFailedLogsStats(t, insts, exporter, logRecords) - spans := 12 + spans := int64(12) obsrep.recordTracesEnqueueFailure(context.Background(), spans) - checkExporterEnqueueFailedTracesStats(t, exporter, int64(spans)) + checkExporterEnqueueFailedTracesStats(t, insts, exporter, spans) - metricPoints := 21 + metricPoints := int64(21) obsrep.recordMetricsEnqueueFailure(context.Background(), metricPoints) - checkExporterEnqueueFailedMetricsStats(t, exporter, int64(metricPoints)) + checkExporterEnqueueFailedMetricsStats(t, insts, exporter, metricPoints) } // checkExporterEnqueueFailedTracesStats checks that reported number of spans failed to enqueue match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func checkExporterEnqueueFailedTracesStats(t *testing.T, exporter config.ComponentID, spans int64) { - exporterTags := tagsForExporterView(exporter) - checkValueForView(t, exporterTags, spans, "exporter/enqueue_failed_spans") +func checkExporterEnqueueFailedTracesStats(t *testing.T, insts *instruments, exporter config.ComponentID, spans int64) { + checkValueForProducer(t, insts.registry, tagsForExporterView(exporter), spans, "exporter/enqueue_failed_spans") } // checkExporterEnqueueFailedMetricsStats checks that reported number of metric points failed to enqueue match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func checkExporterEnqueueFailedMetricsStats(t *testing.T, exporter config.ComponentID, metricPoints int64) { - exporterTags := tagsForExporterView(exporter) - checkValueForView(t, exporterTags, metricPoints, "exporter/enqueue_failed_metric_points") +func checkExporterEnqueueFailedMetricsStats(t *testing.T, insts *instruments, exporter config.ComponentID, metricPoints int64) { + checkValueForProducer(t, insts.registry, tagsForExporterView(exporter), metricPoints, "exporter/enqueue_failed_metric_points") } // checkExporterEnqueueFailedLogsStats checks that reported number of log records failed to enqueue match given values. // When this function is called it is required to also call SetupTelemetry as first thing. -func checkExporterEnqueueFailedLogsStats(t *testing.T, exporter config.ComponentID, logRecords int64) { - exporterTags := tagsForExporterView(exporter) - checkValueForView(t, exporterTags, logRecords, "exporter/enqueue_failed_log_records") -} - -// checkValueForView checks that for the current exported value in the view with the given name -// for {LegacyTagKeyReceiver: receiverName} is equal to "value". -func checkValueForView(t *testing.T, wantTags []tag.Tag, value int64, vName string) { - // Make sure the tags slice is sorted by tag keys. - sortTags(wantTags) - - rows, err := view.RetrieveData(vName) - require.NoError(t, err) - - for _, row := range rows { - // Make sure the tags slice is sorted by tag keys. - sortTags(row.Tags) - if reflect.DeepEqual(wantTags, row.Tags) { - sum := row.Data.(*view.SumData) - require.Equal(t, float64(value), sum.Value) - return - } - } - - require.Failf(t, "could not find tags", "wantTags: %s in rows %v", wantTags, rows) +func checkExporterEnqueueFailedLogsStats(t *testing.T, insts *instruments, exporter config.ComponentID, logRecords int64) { + checkValueForProducer(t, insts.registry, tagsForExporterView(exporter), logRecords, "exporter/enqueue_failed_log_records") } // tagsForExporterView returns the tags that are needed for the exporter views. @@ -105,9 +79,3 @@ func tagsForExporterView(exporter config.ComponentID) []tag.Tag { {Key: exporterTag, Value: exporter.String()}, } } - -func sortTags(tags []tag.Tag) { - sort.SliceStable(tags, func(i, j int) bool { - return tags[i].Key.Name() < tags[j].Key.Name() - }) -} diff --git a/exporter/exporterhelper/queued_retry.go b/exporter/exporterhelper/queued_retry.go index ef9dea5a0a0..7db7ef26e7c 100644 --- a/exporter/exporterhelper/queued_retry.go +++ b/exporter/exporterhelper/queued_retry.go @@ -21,34 +21,18 @@ import ( "time" "github.com/cenkalti/backoff/v4" - "go.opencensus.io/metric" - "go.opencensus.io/metric/metricdata" - "go.opencensus.io/metric/metricproducer" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "go.uber.org/zap/zapcore" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics" ) var ( - r = metric.NewRegistry() - - queueSizeGauge, _ = r.AddInt64DerivedGauge( - obsmetrics.ExporterKey+"/queue_size", - metric.WithDescription("Current size of the retry queue (in batches)"), - metric.WithLabelKeys(obsmetrics.ExporterKey), - metric.WithUnit(metricdata.UnitDimensionless)) - errSendingQueueIsFull = errors.New("sending_queue is full") ) -func init() { - metricproducer.GlobalManager().AddProducer(r) -} - // RetrySettings defines configuration for retrying batches in case of export failure. // The current supported strategy is exponential backoff. type RetrySettings struct { diff --git a/exporter/exporterhelper/queued_retry_experimental.go b/exporter/exporterhelper/queued_retry_experimental.go index 8e91cf34a80..1949f23b2b4 100644 --- a/exporter/exporterhelper/queued_retry_experimental.go +++ b/exporter/exporterhelper/queued_retry_experimental.go @@ -200,7 +200,7 @@ func (qrs *queuedRetrySender) start(ctx context.Context, host component.Host) er // Start reporting queue length metric if qrs.cfg.Enabled { - err := queueSizeGauge.UpsertEntry(func() int64 { + err := globalInstruments.queueSize.UpsertEntry(func() int64 { return int64(qrs.queue.Size()) }, metricdata.NewLabelValue(qrs.fullName())) if err != nil { @@ -215,7 +215,7 @@ func (qrs *queuedRetrySender) start(ctx context.Context, host component.Host) er func (qrs *queuedRetrySender) shutdown() { // Cleanup queue metrics reporting if qrs.cfg.Enabled { - _ = queueSizeGauge.UpsertEntry(func() int64 { + _ = globalInstruments.queueSize.UpsertEntry(func() int64 { return int64(0) }, metricdata.NewLabelValue(qrs.fullName())) } diff --git a/exporter/exporterhelper/queued_retry_inmemory.go b/exporter/exporterhelper/queued_retry_inmemory.go index e2934095973..b83c571ee6a 100644 --- a/exporter/exporterhelper/queued_retry_inmemory.go +++ b/exporter/exporterhelper/queued_retry_inmemory.go @@ -99,7 +99,7 @@ func onTemporaryFailure(logger *zap.Logger, req request, err error) error { } // start is invoked during service startup. -func (qrs *queuedRetrySender) start(ctx context.Context, host component.Host) error { +func (qrs *queuedRetrySender) start(context.Context, component.Host) error { qrs.queue.StartConsumers(qrs.cfg.NumConsumers, func(item interface{}) { req := item.(request) _ = qrs.consumerSender.send(req) @@ -108,7 +108,7 @@ func (qrs *queuedRetrySender) start(ctx context.Context, host component.Host) er // Start reporting queue length metric if qrs.cfg.Enabled { - err := queueSizeGauge.UpsertEntry(func() int64 { + err := globalInstruments.queueSize.UpsertEntry(func() int64 { return int64(qrs.queue.Size()) }, metricdata.NewLabelValue(qrs.fullName)) if err != nil { @@ -123,7 +123,7 @@ func (qrs *queuedRetrySender) start(ctx context.Context, host component.Host) er func (qrs *queuedRetrySender) shutdown() { // Cleanup queue metrics reporting if qrs.cfg.Enabled { - _ = queueSizeGauge.UpsertEntry(func() int64 { + _ = globalInstruments.queueSize.UpsertEntry(func() int64 { return int64(0) }, metricdata.NewLabelValue(qrs.fullName)) } diff --git a/exporter/exporterhelper/queued_retry_test.go b/exporter/exporterhelper/queued_retry_test.go index 0855a2ee46c..87b8969049c 100644 --- a/exporter/exporterhelper/queued_retry_test.go +++ b/exporter/exporterhelper/queued_retry_test.go @@ -346,10 +346,10 @@ func TestQueuedRetry_QueueMetricsReported(t *testing.T) { for i := 0; i < 7; i++ { require.NoError(t, be.sender.send(newErrorRequest(context.Background()))) } - checkValueForProducer(t, defaultExporterTags, int64(7), "exporter/queue_size") + checkValueForGlobalManager(t, defaultExporterTags, int64(7), "exporter/queue_size") assert.NoError(t, be.Shutdown(context.Background())) - checkValueForProducer(t, defaultExporterTags, int64(0), "exporter/queue_size") + checkValueForGlobalManager(t, defaultExporterTags, int64(0), "exporter/queue_size") } func TestNoCancellationContext(t *testing.T) { @@ -486,24 +486,30 @@ func (ocs *observabilityConsumerSender) checkDroppedItemsCount(t *testing.T, wan assert.EqualValues(t, want, atomic.LoadInt64(&ocs.droppedItemsCount)) } -// checkValueForProducer checks that the given metrics with wantTags is reported by one of the +// checkValueForGlobalManager checks that the given metrics with wantTags is reported by one of the // metric producers -func checkValueForProducer(t *testing.T, wantTags []tag.Tag, value int64, vName string) { +func checkValueForGlobalManager(t *testing.T, wantTags []tag.Tag, value int64, vName string) { producers := metricproducer.GlobalManager().GetAll() for _, producer := range producers { - for _, metric := range producer.Read() { - if metric.Descriptor.Name == vName && len(metric.TimeSeries) > 0 { - lastValue := metric.TimeSeries[len(metric.TimeSeries)-1] - if tagsMatchLabelKeys(wantTags, metric.Descriptor.LabelKeys, lastValue.LabelValues) { - require.Equal(t, value, lastValue.Points[len(lastValue.Points)-1].Value.(int64)) - return - } + if checkValueForProducer(t, producer, wantTags, value, vName) { + return + } + } + require.Fail(t, fmt.Sprintf("could not find metric %v with tags %s reported", vName, wantTags)) +} +// checkValueForProducer checks that the given metrics with wantTags is reported by the metric producer +func checkValueForProducer(t *testing.T, producer metricproducer.Producer, wantTags []tag.Tag, value int64, vName string) bool { + for _, metric := range producer.Read() { + if metric.Descriptor.Name == vName && len(metric.TimeSeries) > 0 { + lastValue := metric.TimeSeries[len(metric.TimeSeries)-1] + if tagsMatchLabelKeys(wantTags, metric.Descriptor.LabelKeys, lastValue.LabelValues) { + require.Equal(t, value, lastValue.Points[len(lastValue.Points)-1].Value.(int64)) + return true } } } - - require.Fail(t, fmt.Sprintf("could not find metric %v with tags %s reported", vName, wantTags)) + return false } // tagsMatchLabelKeys returns true if provided tags match keys and values diff --git a/exporter/exporterhelper/traces.go b/exporter/exporterhelper/traces.go index cb69719c879..5b6618496a1 100644 --- a/exporter/exporterhelper/traces.go +++ b/exporter/exporterhelper/traces.go @@ -114,7 +114,7 @@ func NewTracesExporter( req := newTracesRequest(ctx, td, pusher) err := be.sender.send(req) if errors.Is(err, errSendingQueueIsFull) { - be.obsrep.recordTracesEnqueueFailure(req.context(), req.count()) + be.obsrep.recordTracesEnqueueFailure(req.context(), int64(req.count())) } return err }, bs.consumerOptions...) diff --git a/exporter/exporterhelper/traces_test.go b/exporter/exporterhelper/traces_test.go index c3b218de96c..8d1987e5cc0 100644 --- a/exporter/exporterhelper/traces_test.go +++ b/exporter/exporterhelper/traces_test.go @@ -142,7 +142,7 @@ func TestTracesExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { } // 2 batched must be in queue, and 5 batches (10 spans) rejected due to queue overflow - checkExporterEnqueueFailedTracesStats(t, fakeTracesExporterName, int64(10)) + checkExporterEnqueueFailedTracesStats(t, globalInstruments, fakeTracesExporterName, int64(10)) } func TestTracesExporter_WithSpan(t *testing.T) { diff --git a/internal/obsreportconfig/obsmetrics/obs_exporter.go b/internal/obsreportconfig/obsmetrics/obs_exporter.go index 24fe3395ebe..ca0c20afdbe 100644 --- a/internal/obsreportconfig/obsmetrics/obs_exporter.go +++ b/internal/obsreportconfig/obsmetrics/obs_exporter.go @@ -27,22 +27,16 @@ const ( SentSpansKey = "sent_spans" // FailedToSendSpansKey used to track spans that failed to be sent by exporters. FailedToSendSpansKey = "send_failed_spans" - // FailedToEnqueueSpansKey used to track spans that failed to be added to the sending queue. - FailedToEnqueueSpansKey = "enqueue_failed_spans" // SentMetricPointsKey used to track metric points sent by exporters. SentMetricPointsKey = "sent_metric_points" // FailedToSendMetricPointsKey used to track metric points that failed to be sent by exporters. FailedToSendMetricPointsKey = "send_failed_metric_points" - // FailedToEnqueueMetricPointsKey used to track metric points that failed to be added to the sending queue. - FailedToEnqueueMetricPointsKey = "enqueue_failed_metric_points" // SentLogRecordsKey used to track logs sent by exporters. SentLogRecordsKey = "sent_log_records" // FailedToSendLogRecordsKey used to track logs that failed to be sent by exporters. FailedToSendLogRecordsKey = "send_failed_log_records" - // FailedToEnqueueLogRecordsKey used to track logs records that failed to be added to the sending queue. - FailedToEnqueueLogRecordsKey = "enqueue_failed_log_records" ) var ( @@ -66,10 +60,6 @@ var ( ExporterPrefix+FailedToSendSpansKey, "Number of spans in failed attempts to send to destination.", stats.UnitDimensionless) - ExporterFailedToEnqueueSpans = stats.Int64( - ExporterPrefix+FailedToEnqueueSpansKey, - "Number of spans failed to be added to the sending queue.", - stats.UnitDimensionless) ExporterSentMetricPoints = stats.Int64( ExporterPrefix+SentMetricPointsKey, "Number of metric points successfully sent to destination.", @@ -78,10 +68,6 @@ var ( ExporterPrefix+FailedToSendMetricPointsKey, "Number of metric points in failed attempts to send to destination.", stats.UnitDimensionless) - ExporterFailedToEnqueueMetricPoints = stats.Int64( - ExporterPrefix+FailedToEnqueueMetricPointsKey, - "Number of metric points failed to be added to the sending queue.", - stats.UnitDimensionless) ExporterSentLogRecords = stats.Int64( ExporterPrefix+SentLogRecordsKey, "Number of log record successfully sent to destination.", @@ -90,8 +76,4 @@ var ( ExporterPrefix+FailedToSendLogRecordsKey, "Number of log records in failed attempts to send to destination.", stats.UnitDimensionless) - ExporterFailedToEnqueueLogRecords = stats.Int64( - ExporterPrefix+FailedToEnqueueLogRecordsKey, - "Number of log records failed to be added to the sending queue.", - stats.UnitDimensionless) ) diff --git a/internal/obsreportconfig/obsreportconfig.go b/internal/obsreportconfig/obsreportconfig.go index bc833ddac36..94f1b5b1e53 100644 --- a/internal/obsreportconfig/obsreportconfig.go +++ b/internal/obsreportconfig/obsreportconfig.go @@ -77,13 +77,10 @@ func allViews() *ObsMetrics { measures = []*stats.Int64Measure{ obsmetrics.ExporterSentSpans, obsmetrics.ExporterFailedToSendSpans, - obsmetrics.ExporterFailedToEnqueueSpans, obsmetrics.ExporterSentMetricPoints, obsmetrics.ExporterFailedToSendMetricPoints, - obsmetrics.ExporterFailedToEnqueueMetricPoints, obsmetrics.ExporterSentLogRecords, obsmetrics.ExporterFailedToSendLogRecords, - obsmetrics.ExporterFailedToEnqueueLogRecords, } tagKeys = []tag.Key{obsmetrics.TagKeyExporter} views = append(views, genViews(measures, tagKeys, view.Sum())...) From a2fc9a31c6df1248e429f44eac790cf102ad2d90 Mon Sep 17 00:00:00 2001 From: alrex Date: Wed, 20 Oct 2021 16:03:01 -0700 Subject: [PATCH 077/149] add multimod verify task to linting (#4235) * add multimod verify task to linting * add versions.yaml file for multimod --- .github/workflows/build-and-test.yml | 2 ++ versions.yaml | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 versions.yaml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1ddfda58d77..c3a16e32b11 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -90,6 +90,8 @@ jobs: run: | make gendependabot git diff -s --exit-code || (echo 'ALL_MODULES have been changed, please run "make gendependabot" and commit the changes in this PR.' && exit 1) + - name: Multimod verify + run: make multimod-verify unittest: runs-on: ubuntu-latest needs: [setup-environment] diff --git a/versions.yaml b/versions.yaml new file mode 100644 index 00000000000..f6e64fb5e0c --- /dev/null +++ b/versions.yaml @@ -0,0 +1,22 @@ +# 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. + +module-sets: + collector-base: + version: v0.37.0 + modules: + - go.opentelemetry.io/collector + - go.opentelemetry.io/collector/model +excluded-modules: + - go.opentelemetry.io/collector/internal/tools From b92792509569729f3023d6486653b59881401c41 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 20 Oct 2021 16:51:50 -0700 Subject: [PATCH 078/149] Refactor configauth, getters use the map instead of iteration (#4234) Signed-off-by: Bogdan Drutu --- config/configauth/clientauth.go | 34 ------------------ config/configauth/configauth.go | 54 ++++++++++++++++++++++++---- config/configauth/configauth_test.go | 10 ++---- config/configgrpc/configgrpc.go | 19 +++------- config/confighttp/confighttp.go | 7 +--- 5 files changed, 54 insertions(+), 70 deletions(-) diff --git a/config/configauth/clientauth.go b/config/configauth/clientauth.go index d24e6108661..5bd384eafd2 100644 --- a/config/configauth/clientauth.go +++ b/config/configauth/clientauth.go @@ -15,13 +15,11 @@ package configauth // import "go.opentelemetry.io/collector/config/configauth" import ( - "fmt" "net/http" "google.golang.org/grpc/credentials" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" ) // ClientAuthenticator is an Extension that can be used as an authenticator for the configauth.Authentication option. @@ -44,35 +42,3 @@ type GRPCClientAuthenticator interface { ClientAuthenticator PerRPCCredentials() (credentials.PerRPCCredentials, error) } - -// GetHTTPClientAuthenticator attempts to select the appropriate HTTPClientAuthenticator from the list of extensions, -// based on the component id of the extension. If an authenticator is not found, an error is returned. -// This should be only used by HTTP clients. -func GetHTTPClientAuthenticator(extensions map[config.ComponentID]component.Extension, - componentID config.ComponentID) (HTTPClientAuthenticator, error) { - for id, ext := range extensions { - if id == componentID { - if auth, ok := ext.(HTTPClientAuthenticator); ok { - return auth, nil - } - return nil, fmt.Errorf("requested authenticator is not for HTTP clients") - } - } - return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) -} - -// GetGRPCClientAuthenticator attempts to select the appropriate GRPCClientAuthenticator from the list of extensions, -// based on the component id of the extension. If an authenticator is not found, an error is returned. -// This should only be used by gRPC clients. -func GetGRPCClientAuthenticator(extensions map[config.ComponentID]component.Extension, - componentID config.ComponentID) (GRPCClientAuthenticator, error) { - for id, ext := range extensions { - if id == componentID { - if auth, ok := ext.(GRPCClientAuthenticator); ok { - return auth, nil - } - return nil, fmt.Errorf("requested authenticator is not for gRPC clients") - } - } - return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) -} diff --git a/config/configauth/configauth.go b/config/configauth/configauth.go index 554f905d565..836dbd7e197 100644 --- a/config/configauth/configauth.go +++ b/config/configauth/configauth.go @@ -32,16 +32,56 @@ type Authentication struct { AuthenticatorName string `mapstructure:"authenticator"` } -// GetServerAuthenticator attempts to select the appropriate from the list of extensions, based on the requested extension name. -// If an authenticator is not found, an error is returned. -func GetServerAuthenticator(extensions map[config.ComponentID]component.Extension, componentID config.ComponentID) (ServerAuthenticator, error) { - for id, ext := range extensions { +// GetServerAuthenticator attempts to select the appropriate ServerAuthenticator from the list of extensions, +// based on the requested extension name. If an authenticator is not found, an error is returned. +func (a Authentication) GetServerAuthenticator(extensions map[config.ComponentID]component.Extension) (ServerAuthenticator, error) { + componentID, err := config.NewComponentIDFromString(a.AuthenticatorName) + if err != nil { + return nil, err + } + + if ext, found := extensions[componentID]; found { if auth, ok := ext.(ServerAuthenticator); ok { - if id == componentID { - return auth, nil - } + return auth, nil + } + return nil, fmt.Errorf("requested authenticator is not a server authenticator") + } + + return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) +} + +// GetHTTPClientAuthenticator attempts to select the appropriate HTTPClientAuthenticator from the list of extensions, +// based on the component id of the extension. If an authenticator is not found, an error is returned. +// This should be only used by HTTP clients. +func (a Authentication) GetHTTPClientAuthenticator(extensions map[config.ComponentID]component.Extension) (HTTPClientAuthenticator, error) { + componentID, err := config.NewComponentIDFromString(a.AuthenticatorName) + if err != nil { + return nil, err + } + + if ext, found := extensions[componentID]; found { + if auth, ok := ext.(HTTPClientAuthenticator); ok { + return auth, nil } + return nil, fmt.Errorf("requested authenticator is not a HTTPClientAuthenticator") + } + return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) +} + +// GetGRPCClientAuthenticator attempts to select the appropriate GRPCClientAuthenticator from the list of extensions, +// based on the component id of the extension. If an authenticator is not found, an error is returned. +// This should only be used by gRPC clients. +func (a Authentication) GetGRPCClientAuthenticator(extensions map[config.ComponentID]component.Extension) (GRPCClientAuthenticator, error) { + componentID, err := config.NewComponentIDFromString(a.AuthenticatorName) + if err != nil { + return nil, err } + if ext, found := extensions[componentID]; found { + if auth, ok := ext.(GRPCClientAuthenticator); ok { + return auth, nil + } + return nil, fmt.Errorf("requested authenticator is not a GRPCClientAuthenticator") + } return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) } diff --git a/config/configauth/configauth_test.go b/config/configauth/configauth_test.go index 7751d13b516..11a58531b28 100644 --- a/config/configauth/configauth_test.go +++ b/config/configauth/configauth_test.go @@ -32,11 +32,7 @@ func TestGetAuthenticator(t *testing.T) { config.NewComponentID("mock"): &MockAuthenticator{}, } - // test - componentID, err := config.NewComponentIDFromString(cfg.AuthenticatorName) - assert.NoError(t, err) - - authenticator, err := GetServerAuthenticator(ext, componentID) + authenticator, err := cfg.GetServerAuthenticator(ext) // verify assert.NoError(t, err) @@ -61,9 +57,7 @@ func TestGetAuthenticatorFails(t *testing.T) { } for _, tC := range testCases { t.Run(tC.desc, func(t *testing.T) { - componentID, err := config.NewComponentIDFromString(tC.cfg.AuthenticatorName) - assert.NoError(t, err) - authenticator, err := GetServerAuthenticator(tC.ext, componentID) + authenticator, err := tC.cfg.GetServerAuthenticator(tC.ext) assert.ErrorIs(t, err, tC.expected) assert.Nil(t, authenticator) }) diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index 8274bf76c59..3ba99ad8e35 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -30,7 +30,6 @@ import ( "google.golang.org/grpc/keepalive" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configauth" "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/config/configtls" @@ -223,12 +222,7 @@ func (gcs *GRPCClientSettings) ToDialOptions(host component.Host) ([]grpc.DialOp return nil, fmt.Errorf("no extensions configuration available") } - componentID, cperr := config.NewComponentIDFromString(gcs.Auth.AuthenticatorName) - if cperr != nil { - return nil, cperr - } - - grpcAuthenticator, cerr := configauth.GetGRPCClientAuthenticator(host.GetExtensions(), componentID) + grpcAuthenticator, cerr := gcs.Auth.GetGRPCClientAuthenticator(host.GetExtensions()) if cerr != nil { return nil, cerr } @@ -325,16 +319,11 @@ func (gss *GRPCServerSettings) ToServerOption(host component.Host, settings comp } } - uInterceptors := []grpc.UnaryServerInterceptor{} - sInterceptors := []grpc.StreamServerInterceptor{} + var uInterceptors []grpc.UnaryServerInterceptor + var sInterceptors []grpc.StreamServerInterceptor if gss.Auth != nil { - componentID, cperr := config.NewComponentIDFromString(gss.Auth.AuthenticatorName) - if cperr != nil { - return nil, cperr - } - - authenticator, err := configauth.GetServerAuthenticator(host.GetExtensions(), componentID) + authenticator, err := gss.Auth.GetServerAuthenticator(host.GetExtensions()) if err != nil { return nil, err } diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index 2c09e8cb73e..f3d6d2c237b 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -90,12 +90,7 @@ func (hcs *HTTPClientSettings) ToClient(ext map[config.ComponentID]component.Ext return nil, fmt.Errorf("extensions configuration not found") } - componentID, cperr := config.NewComponentIDFromString(hcs.Auth.AuthenticatorName) - if cperr != nil { - return nil, cperr - } - - httpCustomAuthRoundTripper, aerr := configauth.GetHTTPClientAuthenticator(ext, componentID) + httpCustomAuthRoundTripper, aerr := hcs.Auth.GetHTTPClientAuthenticator(ext) if aerr != nil { return nil, aerr } From bd13c61ee2fcfc335e81218e8c6554ba893d3532 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 21 Oct 2021 17:08:41 -0700 Subject: [PATCH 079/149] Simplify unmarshal logic by adding more supported hooks (#4237) * Simplify unmarshal logic by adding more supported hooks * Add hook that supports "String -> encoding.TextUnmarshaler", e.g. zapcore.Level no longer need special unmarshaling * Add hook that supports "String -> ComponentID" * Add a special hook for map[string]interface{} -> map[ComponentID]interface{} to determine duplicates after space trimming, not sure if this error needs this special treatment. Signed-off-by: Bogdan Drutu * Fix review comments Signed-off-by: Bogdan Drutu * Improve error messages for unmarshaling errors of the ComponentID Signed-off-by: Bogdan Drutu --- config/config.go | 14 +- config/configgrpc/configgrpc_test.go | 2 +- config/confighttp/confighttp_test.go | 2 +- config/configmap.go | 81 +++++--- .../configunmarshaler/defaultunmarshaler.go | 193 +++--------------- .../defaultunmarshaler_test.go | 34 +-- .../testdata/duplicate-exporter.yaml | 4 +- .../testdata/duplicate-extension.yaml | 2 +- .../testdata/duplicate-pipeline.yaml | 4 +- .../testdata/duplicate-processor.yaml | 4 +- .../testdata/duplicate-receiver.yaml | 4 +- config/identifiable.go | 42 ++-- 12 files changed, 150 insertions(+), 236 deletions(-) diff --git a/config/config.go b/config/config.go index fa9aadcb678..00e7b87e6fc 100644 --- a/config/config.go +++ b/config/config.go @@ -159,7 +159,7 @@ type Service struct { // ServiceTelemetry defines the configurable settings for service telemetry. type ServiceTelemetry struct { - Logs ServiceTelemetryLogs + Logs ServiceTelemetryLogs `mapstructure:"logs"` } func (srvT *ServiceTelemetry) validate() error { @@ -171,15 +171,15 @@ func (srvT *ServiceTelemetry) validate() error { // the collector uses mapstructure and not yaml tags. type ServiceTelemetryLogs struct { // Level is the minimum enabled logging level. - Level zapcore.Level + Level zapcore.Level `mapstructure:"level"` // Development puts the logger in development mode, which changes the // behavior of DPanicLevel and takes stacktraces more liberally. - Development bool + Development bool `mapstructure:"development"` // Encoding sets the logger's encoding. // Valid values are "json" and "console". - Encoding string + Encoding string `mapstructure:"encoding"` } func (srvTL *ServiceTelemetryLogs) validate() error { @@ -226,9 +226,9 @@ const ( type Pipeline struct { Name string InputType DataType - Receivers []ComponentID - Processors []ComponentID - Exporters []ComponentID + Receivers []ComponentID `mapstructure:"receivers"` + Processors []ComponentID `mapstructure:"processors"` + Exporters []ComponentID `mapstructure:"exporters"` } // Pipelines is a map of names to Pipelines. diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index 74fa1f62106..1b8378b3d67 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -209,7 +209,7 @@ func TestGRPCClientSettingsError(t *testing.T) { }, }, { - err: "idStr must have non empty type", + err: "id must not be empty", settings: GRPCClientSettings{ Endpoint: "localhost:1234", Auth: &configauth.Authentication{}, diff --git a/config/confighttp/confighttp_test.go b/config/confighttp/confighttp_test.go index 3eb588433cf..664785f8798 100644 --- a/config/confighttp/confighttp_test.go +++ b/config/confighttp/confighttp_test.go @@ -135,7 +135,7 @@ func TestHTTPClientSettingsError(t *testing.T) { }, }, { - err: "idStr must have non empty type", + err: "id must not be empty", settings: HTTPClientSettings{ Endpoint: "https://localhost:1234/v1/traces", Auth: &configauth.Authentication{AuthenticatorName: ""}, diff --git a/config/configmap.go b/config/configmap.go index 2524312e8a9..cdd49a14982 100644 --- a/config/configmap.go +++ b/config/configmap.go @@ -96,8 +96,8 @@ func (l *Map) Unmarshal(rawVal interface{}) error { } // UnmarshalExact unmarshalls the config into a struct, erroring if a field is nonexistent. -func (l *Map) UnmarshalExact(intoCfg interface{}) error { - dc := decoderConfig(intoCfg) +func (l *Map) UnmarshalExact(rawVal interface{}) error { + dc := decoderConfig(rawVal) dc.ErrorUnused = true decoder, err := mapstructure.NewDecoder(dc) if err != nil { @@ -164,13 +164,23 @@ func decoderConfig(result interface{}) *mapstructure.DecoderConfig { TagName: "mapstructure", WeaklyTypedInput: true, DecodeHook: mapstructure.ComposeDecodeHookFunc( - expandNilStructPointers(), - mapstructure.StringToTimeDurationHookFunc(), - mapstructure.StringToSliceHookFunc(","), + expandNilStructPointersFunc, + stringToSliceHookFunc, + mapStringToMapComponentIDHookFunc, + stringToTimeDurationHookFunc, + textUnmarshallerHookFunc, ), } } +var ( + stringToSliceHookFunc = mapstructure.StringToSliceHookFunc(",") + stringToTimeDurationHookFunc = mapstructure.StringToTimeDurationHookFunc() + textUnmarshallerHookFunc = mapstructure.TextUnmarshallerHookFunc() + + componentIDType = reflect.TypeOf(NewComponentID("foo")) +) + // In cases where a config has a mapping of something to a struct pointers // we want nil values to resolve to a pointer to the zero value of the // underlying struct just as we want nil values of a mapping of something @@ -185,26 +195,51 @@ func decoderConfig(result interface{}) *mapstructure.DecoderConfig { // // we want an unmarshaled Config to be equivalent to // Config{Thing: &SomeStruct{}} instead of Config{Thing: nil} -func expandNilStructPointers() mapstructure.DecodeHookFunc { - return func(from reflect.Value, to reflect.Value) (interface{}, error) { - // ensure we are dealing with map to map comparison - if from.Kind() == reflect.Map && to.Kind() == reflect.Map { - toElem := to.Type().Elem() - // ensure that map values are pointers to a struct - // (that may be nil and require manual setting w/ zero value) - if toElem.Kind() == reflect.Ptr && toElem.Elem().Kind() == reflect.Struct { - fromRange := from.MapRange() - for fromRange.Next() { - fromKey := fromRange.Key() - fromValue := fromRange.Value() - // ensure that we've run into a nil pointer instance - if fromValue.IsNil() { - newFromValue := reflect.New(toElem.Elem()) - from.SetMapIndex(fromKey, newFromValue) - } +var expandNilStructPointersFunc = func(from reflect.Value, to reflect.Value) (interface{}, error) { + // ensure we are dealing with map to map comparison + if from.Kind() == reflect.Map && to.Kind() == reflect.Map { + toElem := to.Type().Elem() + // ensure that map values are pointers to a struct + // (that may be nil and require manual setting w/ zero value) + if toElem.Kind() == reflect.Ptr && toElem.Elem().Kind() == reflect.Struct { + fromRange := from.MapRange() + for fromRange.Next() { + fromKey := fromRange.Key() + fromValue := fromRange.Value() + // ensure that we've run into a nil pointer instance + if fromValue.IsNil() { + newFromValue := reflect.New(toElem.Elem()) + from.SetMapIndex(fromKey, newFromValue) } } } - return from.Interface(), nil } + return from.Interface(), nil +} + +// mapStringToMapComponentIDHookFunc returns a DecodeHookFunc that converts a map[string]interface{} to +// map[ComponentID]interface{}. +// This is needed in combination since the ComponentID.UnmarshalText may produce equal IDs for different strings, +// and an error needs to be returned in that case, otherwise the last equivalent ID overwrites the previous one. +var mapStringToMapComponentIDHookFunc = func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { + if f.Kind() != reflect.Map || f.Key().Kind() != reflect.String { + return data, nil + } + + if t.Kind() != reflect.Map || t.Key() != componentIDType { + return data, nil + } + + m := make(map[ComponentID]interface{}) + for k, v := range data.(map[string]interface{}) { + id, err := NewComponentIDFromString(k) + if err != nil { + return nil, err + } + if _, ok := m[id]; ok { + return nil, fmt.Errorf("duplicate name %q after trimming spaces %v", k, id) + } + m[id] = v + } + return m, nil } diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index fb8be211440..e1c788a0197 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -33,10 +33,7 @@ const ( // Skip 0, start errors codes from 1. _ configErrorCode = iota - errInvalidTypeAndNameKey - errInvalidLogsLevel errUnknownType - errDuplicateName errUnmarshalTopLevelStructureError ) @@ -71,33 +68,17 @@ const ( ) type configSettings struct { - Receivers map[string]map[string]interface{} `mapstructure:"receivers"` - Processors map[string]map[string]interface{} `mapstructure:"processors"` - Exporters map[string]map[string]interface{} `mapstructure:"exporters"` - Extensions map[string]map[string]interface{} `mapstructure:"extensions"` - Service serviceSettings `mapstructure:"service"` + Receivers map[config.ComponentID]map[string]interface{} `mapstructure:"receivers"` + Processors map[config.ComponentID]map[string]interface{} `mapstructure:"processors"` + Exporters map[config.ComponentID]map[string]interface{} `mapstructure:"exporters"` + Extensions map[config.ComponentID]map[string]interface{} `mapstructure:"extensions"` + Service serviceSettings `mapstructure:"service"` } type serviceSettings struct { - Telemetry serviceTelemetrySettings `mapstructure:"telemetry"` - Extensions []string `mapstructure:"extensions"` - Pipelines map[string]pipelineSettings `mapstructure:"pipelines"` -} - -type serviceTelemetrySettings struct { - Logs serviceTelemetryLogsSettings `mapstructure:"logs"` -} - -type serviceTelemetryLogsSettings struct { - Level string `mapstructure:"level"` - Development bool `mapstructure:"development"` - Encoding string `mapstructure:"encoding"` -} - -type pipelineSettings struct { - Receivers []string `mapstructure:"receivers"` - Processors []string `mapstructure:"processors"` - Exporters []string `mapstructure:"exporters"` + Telemetry config.ServiceTelemetry `mapstructure:"telemetry"` + Extensions []config.ComponentID `mapstructure:"extensions"` + Pipelines map[config.ComponentID]*config.Pipeline `mapstructure:"pipelines"` } type defaultUnmarshaler struct{} @@ -120,9 +101,9 @@ func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factorie // Setup default telemetry values as in service/logger.go. // TODO: Add a component.ServiceFactory to allow this to be defined by the Service. Service: serviceSettings{ - Telemetry: serviceTelemetrySettings{ - Logs: serviceTelemetryLogsSettings{ - Level: "INFO", + Telemetry: config.ServiceTelemetry{ + Logs: config.ServiceTelemetryLogs{ + Level: zapcore.InfoLevel, Development: false, Encoding: "console", }, @@ -174,13 +155,6 @@ func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factorie return &cfg, nil } -func errorInvalidTypeAndNameKey(component, key string, err error) error { - return &configError{ - code: errInvalidTypeAndNameKey, - msg: fmt.Sprintf("invalid %s type and name key %q: %v", component, key, err), - } -} - func errorUnknownType(component string, id config.ComponentID) error { return &configError{ code: errUnknownType, @@ -195,27 +169,14 @@ func errorUnmarshalError(component string, id config.ComponentID, err error) err } } -func errorDuplicateName(component string, id config.ComponentID) error { - return &configError{ - code: errDuplicateName, - msg: fmt.Sprintf("duplicate %s name %v", component, id), - } -} - -func unmarshalExtensions(exts map[string]map[string]interface{}, factories map[config.Type]component.ExtensionFactory) (config.Extensions, error) { +func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExtensionFactory) (config.Extensions, error) { // Prepare resulting map. extensions := make(config.Extensions) // Iterate over extensions and create a config for each. - for key, value := range exts { + for id, value := range exts { componentConfig := config.NewMapFromStringMap(value) - // Decode the key into type and fullName components. - id, err := config.NewComponentIDFromString(key) - if err != nil { - return nil, errorInvalidTypeAndNameKey(extensionsKeyName, key, err) - } - // Find extension factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { @@ -229,14 +190,10 @@ func unmarshalExtensions(exts map[string]map[string]interface{}, factories map[c // 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. - if err = unmarshal(componentConfig, extensionCfg); err != nil { + if err := unmarshal(componentConfig, extensionCfg); err != nil { return nil, errorUnmarshalError(extensionsKeyName, id, err) } - if extensions[id] != nil { - return nil, errorDuplicateName(extensionsKeyName, id) - } - extensions[id] = extensionCfg } @@ -246,28 +203,8 @@ func unmarshalExtensions(exts map[string]map[string]interface{}, factories map[c func unmarshalService(rawService serviceSettings) (config.Service, error) { var ret config.Service - var lvl zapcore.Level - if err := lvl.UnmarshalText([]byte(rawService.Telemetry.Logs.Level)); err != nil { - return ret, &configError{ - msg: fmt.Sprintf(`service telemetry logs invalid level: %q, valid values are "DEBUG", "INFO", "WARN", "ERROR", "DPANIC", "PANIC", "FATAL"`, rawService.Telemetry.Logs.Level), - code: errInvalidLogsLevel, - } - } - - ret.Telemetry.Logs = config.ServiceTelemetryLogs{ - Level: lvl, - Development: rawService.Telemetry.Logs.Development, - Encoding: rawService.Telemetry.Logs.Encoding, - } - - ret.Extensions = make([]config.ComponentID, 0, len(rawService.Extensions)) - for _, extIDStr := range rawService.Extensions { - id, err := config.NewComponentIDFromString(extIDStr) - if err != nil { - return ret, err - } - ret.Extensions = append(ret.Extensions, id) - } + ret.Telemetry = rawService.Telemetry + ret.Extensions = rawService.Extensions // Process the pipelines first so in case of error on them it can be properly // reported. @@ -293,20 +230,14 @@ func LoadReceiver(componentConfig *config.Map, id config.ComponentID, factory co return receiverCfg, nil } -func unmarshalReceivers(recvs map[string]map[string]interface{}, factories map[config.Type]component.ReceiverFactory) (config.Receivers, error) { +func unmarshalReceivers(recvs map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ReceiverFactory) (config.Receivers, error) { // Prepare resulting map. receivers := make(config.Receivers) // Iterate over input map and create a config for each. - for key, value := range recvs { + for id, value := range recvs { componentConfig := config.NewMapFromStringMap(value) - // Decode the key into type and fullName components. - id, err := config.NewComponentIDFromString(key) - if err != nil { - return nil, errorInvalidTypeAndNameKey(receiversKeyName, key, err) - } - // Find receiver factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { @@ -320,29 +251,20 @@ func unmarshalReceivers(recvs map[string]map[string]interface{}, factories map[c return nil, err } - if receivers[id] != nil { - return nil, errorDuplicateName(receiversKeyName, id) - } receivers[id] = receiverCfg } return receivers, nil } -func unmarshalExporters(exps map[string]map[string]interface{}, factories map[config.Type]component.ExporterFactory) (config.Exporters, error) { +func unmarshalExporters(exps map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExporterFactory) (config.Exporters, error) { // Prepare resulting map. exporters := make(config.Exporters) // Iterate over Exporters and create a config for each. - for key, value := range exps { + for id, value := range exps { componentConfig := config.NewMapFromStringMap(value) - // Decode the key into type and fullName components. - id, err := config.NewComponentIDFromString(key) - if err != nil { - return nil, errorInvalidTypeAndNameKey(exportersKeyName, key, err) - } - // Find exporter factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { @@ -356,34 +278,24 @@ func unmarshalExporters(exps map[string]map[string]interface{}, factories map[co // 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. - if err = unmarshal(componentConfig, exporterCfg); err != nil { + if err := unmarshal(componentConfig, exporterCfg); err != nil { return nil, errorUnmarshalError(exportersKeyName, id, err) } - if exporters[id] != nil { - return nil, errorDuplicateName(exportersKeyName, id) - } - exporters[id] = exporterCfg } return exporters, nil } -func unmarshalProcessors(procs map[string]map[string]interface{}, factories map[config.Type]component.ProcessorFactory) (config.Processors, error) { +func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ProcessorFactory) (config.Processors, error) { // Prepare resulting map. processors := make(config.Processors) // Iterate over processors and create a config for each. - for key, value := range procs { + for id, value := range procs { componentConfig := config.NewMapFromStringMap(value) - // Decode the key into type and fullName components. - id, err := config.NewComponentIDFromString(key) - if err != nil { - return nil, errorInvalidTypeAndNameKey(processorsKeyName, key, err) - } - // Find processor factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { @@ -397,39 +309,23 @@ func unmarshalProcessors(procs map[string]map[string]interface{}, factories map[ // 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. - if err = unmarshal(componentConfig, processorCfg); err != nil { + if err := unmarshal(componentConfig, processorCfg); err != nil { return nil, errorUnmarshalError(processorsKeyName, id, err) } - if processors[id] != nil { - return nil, errorDuplicateName(processorsKeyName, id) - } - processors[id] = processorCfg } return processors, nil } -func unmarshalPipelines(pipelinesConfig map[string]pipelineSettings) (config.Pipelines, error) { - // Prepare resulting map. - pipelines := make(config.Pipelines) - +func unmarshalPipelines(rawPipelines map[config.ComponentID]*config.Pipeline) (config.Pipelines, error) { + pipelines := make(map[string]*config.Pipeline) // Iterate over input map and create a config for each. - for key, rawPipeline := range pipelinesConfig { - // Decode the key into type and name components. - id, err := config.NewComponentIDFromString(key) - if err != nil { - return nil, errorInvalidTypeAndNameKey(pipelinesKeyName, key, err) - } - fullName := id.String() - - // Create the config for this pipeline. - var pipelineCfg config.Pipeline - - // Set the type. - pipelineCfg.InputType = config.DataType(id.Type()) - switch pipelineCfg.InputType { + for id, pipeline := range rawPipelines { + pipeline.Name = id.String() + pipeline.InputType = config.DataType(id.Type()) + switch pipeline.InputType { case config.TracesDataType: case config.MetricsDataType: case config.LogsDataType: @@ -437,39 +333,12 @@ func unmarshalPipelines(pipelinesConfig map[string]pipelineSettings) (config.Pip return nil, errorUnknownType(pipelinesKeyName, id) } - pipelineCfg.Name = fullName - if pipelineCfg.Receivers, err = parseIDNames(id, receiversKeyName, rawPipeline.Receivers); err != nil { - return nil, err - } - if pipelineCfg.Processors, err = parseIDNames(id, processorsKeyName, rawPipeline.Processors); err != nil { - return nil, err - } - if pipelineCfg.Exporters, err = parseIDNames(id, exportersKeyName, rawPipeline.Exporters); err != nil { - return nil, err - } - - if pipelines[fullName] != nil { - return nil, errorDuplicateName(pipelinesKeyName, id) - } - - pipelines[fullName] = &pipelineCfg + pipelines[pipeline.Name] = pipeline } return pipelines, nil } -func parseIDNames(pipelineID config.ComponentID, componentType string, names []string) ([]config.ComponentID, error) { - var ret []config.ComponentID - for _, idProcStr := range names { - idRecv, err := config.NewComponentIDFromString(idProcStr) - if err != nil { - return nil, fmt.Errorf("pipelines: config for %v contains invalid %s name %s : %w", pipelineID, componentType, idProcStr, err) - } - ret = append(ret, idRecv) - } - return ret, 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{}) { diff --git a/config/configunmarshaler/defaultunmarshaler_test.go b/config/configunmarshaler/defaultunmarshaler_test.go index 39ed0807625..04a9ee728a0 100644 --- a/config/configunmarshaler/defaultunmarshaler_test.go +++ b/config/configunmarshaler/defaultunmarshaler_test.go @@ -126,17 +126,17 @@ func TestDecodeConfig_Invalid(t *testing.T) { expected configErrorCode // expected error (if nil any error is acceptable) expectedMessage string // string that the error must contain }{ - {name: "invalid-extension-type", expected: errInvalidTypeAndNameKey}, - {name: "invalid-receiver-type", expected: errInvalidTypeAndNameKey}, - {name: "invalid-exporter-type", expected: errInvalidTypeAndNameKey}, - {name: "invalid-processor-type", expected: errInvalidTypeAndNameKey}, - {name: "invalid-pipeline-type", expected: errInvalidTypeAndNameKey}, - - {name: "invalid-extension-name-after-slash", expected: errInvalidTypeAndNameKey}, - {name: "invalid-receiver-name-after-slash", expected: errInvalidTypeAndNameKey}, - {name: "invalid-exporter-name-after-slash", expected: errInvalidTypeAndNameKey}, - {name: "invalid-processor-name-after-slash", expected: errInvalidTypeAndNameKey}, - {name: "invalid-pipeline-name-after-slash", expected: errInvalidTypeAndNameKey}, + {name: "invalid-extension-type", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-receiver-type", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-exporter-type", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-processor-type", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-pipeline-type", expected: errUnmarshalTopLevelStructureError}, + + {name: "invalid-extension-name-after-slash", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-receiver-name-after-slash", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-exporter-name-after-slash", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-processor-name-after-slash", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-pipeline-name-after-slash", expected: errUnmarshalTopLevelStructureError}, {name: "unknown-extension-type", expected: errUnknownType, expectedMessage: "extensions"}, {name: "unknown-receiver-type", expected: errUnknownType, expectedMessage: "receivers"}, @@ -144,11 +144,11 @@ func TestDecodeConfig_Invalid(t *testing.T) { {name: "unknown-processor-type", expected: errUnknownType, expectedMessage: "processors"}, {name: "unknown-pipeline-type", expected: errUnknownType, expectedMessage: "pipelines"}, - {name: "duplicate-extension", expected: errDuplicateName, expectedMessage: "extensions"}, - {name: "duplicate-receiver", expected: errDuplicateName, expectedMessage: "receivers"}, - {name: "duplicate-exporter", expected: errDuplicateName, expectedMessage: "exporters"}, - {name: "duplicate-processor", expected: errDuplicateName, expectedMessage: "processors"}, - {name: "duplicate-pipeline", expected: errDuplicateName, expectedMessage: "pipelines"}, + {name: "duplicate-extension", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, + {name: "duplicate-receiver", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, + {name: "duplicate-exporter", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, + {name: "duplicate-processor", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, + {name: "duplicate-pipeline", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, {name: "invalid-top-level-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "top level"}, {name: "invalid-extension-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "extensions"}, @@ -166,7 +166,7 @@ func TestDecodeConfig_Invalid(t *testing.T) { {name: "invalid-receiver-sub-config", expected: errUnmarshalTopLevelStructureError}, {name: "invalid-pipeline-sub-config", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-logs-level", expected: errInvalidLogsLevel}, + {name: "invalid-logs-level", expected: errUnmarshalTopLevelStructureError}, } factories, err := testcomponents.ExampleComponents() diff --git a/config/configunmarshaler/testdata/duplicate-exporter.yaml b/config/configunmarshaler/testdata/duplicate-exporter.yaml index 399be0b7bb5..c1747ac8583 100644 --- a/config/configunmarshaler/testdata/duplicate-exporter.yaml +++ b/config/configunmarshaler/testdata/duplicate-exporter.yaml @@ -1,8 +1,8 @@ receivers: examplereceiver: exporters: - exampleexporter/exp: - exampleexporter/ exp : + exampleexporter /exp : + exampleexporter/ exp: processors: exampleprocessor: service: diff --git a/config/configunmarshaler/testdata/duplicate-extension.yaml b/config/configunmarshaler/testdata/duplicate-extension.yaml index 854d146723e..1b8706c20e1 100644 --- a/config/configunmarshaler/testdata/duplicate-extension.yaml +++ b/config/configunmarshaler/testdata/duplicate-extension.yaml @@ -1,3 +1,3 @@ extensions: - exampleextension/ext: + exampleextension /ext : exampleextension/ ext: diff --git a/config/configunmarshaler/testdata/duplicate-pipeline.yaml b/config/configunmarshaler/testdata/duplicate-pipeline.yaml index 671991a79d5..45fc037b7fa 100644 --- a/config/configunmarshaler/testdata/duplicate-pipeline.yaml +++ b/config/configunmarshaler/testdata/duplicate-pipeline.yaml @@ -6,11 +6,11 @@ processors: exampleprocessor: service: pipelines: - traces/default: + traces /pipe: receivers: [examplereceiver] exporters: [exampleexporter] processors: [exampleprocessor] - traces/ default: + traces/ pipe : receivers: [examplereceiver] exporters: [exampleexporter] processors: [exampleprocessor] diff --git a/config/configunmarshaler/testdata/duplicate-processor.yaml b/config/configunmarshaler/testdata/duplicate-processor.yaml index 5345cec5926..0871b540fd0 100644 --- a/config/configunmarshaler/testdata/duplicate-processor.yaml +++ b/config/configunmarshaler/testdata/duplicate-processor.yaml @@ -3,8 +3,8 @@ receivers: exporters: exampleexporter: processors: - exampleprocessor/ abc: - exampleprocessor/abc: + exampleprocessor/ proc: + exampleprocessor /proc : service: pipelines: traces: diff --git a/config/configunmarshaler/testdata/duplicate-receiver.yaml b/config/configunmarshaler/testdata/duplicate-receiver.yaml index 275054e6772..4e00b5fe631 100644 --- a/config/configunmarshaler/testdata/duplicate-receiver.yaml +++ b/config/configunmarshaler/testdata/duplicate-receiver.yaml @@ -1,6 +1,6 @@ receivers: - examplereceiver/ 1: - examplereceiver/1: + examplereceiver/ recv: + examplereceiver /recv : exporters: exampleexporter: processors: diff --git a/config/identifiable.go b/config/identifiable.go index 8341c946d35..b4482d7ca21 100644 --- a/config/identifiable.go +++ b/config/identifiable.go @@ -16,6 +16,7 @@ package config // import "go.opentelemetry.io/collector/config" import ( "errors" + "fmt" "strings" ) @@ -54,36 +55,45 @@ func NewComponentIDWithName(typeVal Type, nameVal string) ComponentID { // the forward slash and "name" are optional. // The returned ComponentID will be invalid if err is not-nil. func NewComponentIDFromString(idStr string) (ComponentID, error) { - items := strings.SplitN(idStr, typeAndNameSeparator, 2) - id := ComponentID{} + return id, id.UnmarshalText([]byte(idStr)) +} + +// Type returns the type of the component. +func (id ComponentID) Type() Type { + return id.typeVal +} + +// Name returns the custom name of the component. +func (id ComponentID) Name() string { + return id.nameVal +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (id *ComponentID) UnmarshalText(text []byte) error { + idStr := string(text) + items := strings.SplitN(idStr, typeAndNameSeparator, 2) if len(items) >= 1 { id.typeVal = Type(strings.TrimSpace(items[0])) } - if len(items) == 0 || id.typeVal == "" { - return id, errors.New("idStr must have non empty type") + if len(items) == 1 && id.typeVal == "" { + return errors.New("id must not be empty") + } + + if id.typeVal == "" { + return fmt.Errorf("in %q id: the part before %s should not be empty", idStr, typeAndNameSeparator) } if len(items) > 1 { // "name" part is present. id.nameVal = strings.TrimSpace(items[1]) if id.nameVal == "" { - return id, errors.New("name part must be specified after " + typeAndNameSeparator + " in type/name key") + return fmt.Errorf("in %q id: the part after %s should not be empty", idStr, typeAndNameSeparator) } } - return id, nil -} - -// Type returns the type of the component. -func (id ComponentID) Type() Type { - return id.typeVal -} - -// Name returns the custom name of the component. -func (id ComponentID) Name() string { - return id.nameVal + return nil } // String returns the ComponentID string representation as "type[/name]" format. From 108a49ec441fe973f5082bcefa9e5b6f1cc8a17d Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 22 Oct 2021 08:35:38 -0700 Subject: [PATCH 080/149] Use directly the ComponentID in configauth (#4238) Depends on https://github.com/open-telemetry/opentelemetry-collector/pull/4237 Signed-off-by: Bogdan Drutu --- config/configauth/configauth.go | 31 +++++++--------------------- config/configauth/configauth_test.go | 4 ++-- config/configgrpc/configgrpc_test.go | 18 ++++------------ config/confighttp/confighttp_test.go | 17 +++++---------- exporter/otlpexporter/config_test.go | 2 +- 5 files changed, 20 insertions(+), 52 deletions(-) diff --git a/config/configauth/configauth.go b/config/configauth/configauth.go index 836dbd7e197..1c2a96d0e56 100644 --- a/config/configauth/configauth.go +++ b/config/configauth/configauth.go @@ -28,60 +28,45 @@ var ( // Authentication defines the auth settings for the receiver. type Authentication struct { - // AuthenticatorName specifies the name of the extension to use in order to authenticate the incoming data point. - AuthenticatorName string `mapstructure:"authenticator"` + // AuthenticatorID specifies the name of the extension to use in order to authenticate the incoming data point. + AuthenticatorID config.ComponentID `mapstructure:"authenticator"` } // GetServerAuthenticator attempts to select the appropriate ServerAuthenticator from the list of extensions, // based on the requested extension name. If an authenticator is not found, an error is returned. func (a Authentication) GetServerAuthenticator(extensions map[config.ComponentID]component.Extension) (ServerAuthenticator, error) { - componentID, err := config.NewComponentIDFromString(a.AuthenticatorName) - if err != nil { - return nil, err - } - - if ext, found := extensions[componentID]; found { + if ext, found := extensions[a.AuthenticatorID]; found { if auth, ok := ext.(ServerAuthenticator); ok { return auth, nil } return nil, fmt.Errorf("requested authenticator is not a server authenticator") } - return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) + return nil, fmt.Errorf("failed to resolve authenticator %q: %w", a.AuthenticatorID, errAuthenticatorNotFound) } // GetHTTPClientAuthenticator attempts to select the appropriate HTTPClientAuthenticator from the list of extensions, // based on the component id of the extension. If an authenticator is not found, an error is returned. // This should be only used by HTTP clients. func (a Authentication) GetHTTPClientAuthenticator(extensions map[config.ComponentID]component.Extension) (HTTPClientAuthenticator, error) { - componentID, err := config.NewComponentIDFromString(a.AuthenticatorName) - if err != nil { - return nil, err - } - - if ext, found := extensions[componentID]; found { + if ext, found := extensions[a.AuthenticatorID]; found { if auth, ok := ext.(HTTPClientAuthenticator); ok { return auth, nil } return nil, fmt.Errorf("requested authenticator is not a HTTPClientAuthenticator") } - return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) + return nil, fmt.Errorf("failed to resolve authenticator %q: %w", a.AuthenticatorID, errAuthenticatorNotFound) } // GetGRPCClientAuthenticator attempts to select the appropriate GRPCClientAuthenticator from the list of extensions, // based on the component id of the extension. If an authenticator is not found, an error is returned. // This should only be used by gRPC clients. func (a Authentication) GetGRPCClientAuthenticator(extensions map[config.ComponentID]component.Extension) (GRPCClientAuthenticator, error) { - componentID, err := config.NewComponentIDFromString(a.AuthenticatorName) - if err != nil { - return nil, err - } - - if ext, found := extensions[componentID]; found { + if ext, found := extensions[a.AuthenticatorID]; found { if auth, ok := ext.(GRPCClientAuthenticator); ok { return auth, nil } return nil, fmt.Errorf("requested authenticator is not a GRPCClientAuthenticator") } - return nil, fmt.Errorf("failed to resolve authenticator %q: %w", componentID.String(), errAuthenticatorNotFound) + return nil, fmt.Errorf("failed to resolve authenticator %q: %w", a.AuthenticatorID, errAuthenticatorNotFound) } diff --git a/config/configauth/configauth_test.go b/config/configauth/configauth_test.go index 11a58531b28..059523cb58c 100644 --- a/config/configauth/configauth_test.go +++ b/config/configauth/configauth_test.go @@ -26,7 +26,7 @@ import ( func TestGetAuthenticator(t *testing.T) { // prepare cfg := &Authentication{ - AuthenticatorName: "mock", + AuthenticatorID: config.NewComponentID("mock"), } ext := map[config.ComponentID]component.Extension{ config.NewComponentID("mock"): &MockAuthenticator{}, @@ -49,7 +49,7 @@ func TestGetAuthenticatorFails(t *testing.T) { { desc: "ServerAuthenticator not found", cfg: &Authentication{ - AuthenticatorName: "does-not-exist", + AuthenticatorID: config.NewComponentID("does-not-exist"), }, ext: map[config.ComponentID]component.Extension{}, expected: errAuthenticatorNotFound, diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index 1b8378b3d67..b4fab3806e9 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -66,7 +66,7 @@ func TestAllGrpcClientSettings(t *testing.T) { WriteBufferSize: 1024, WaitForReady: true, BalancerName: "round_robin", - Auth: &configauth.Authentication{AuthenticatorName: "testauth"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("testauth")}, } host := &mockHost{ @@ -133,7 +133,7 @@ func TestGrpcServerAuthSettings(t *testing.T) { // test gss.Auth = &configauth.Authentication{ - AuthenticatorName: "mock", + AuthenticatorID: config.NewComponentID("mock"), } host := &mockHost{ ext: map[config.ComponentID]component.Extension{ @@ -208,21 +208,11 @@ func TestGRPCClientSettingsError(t *testing.T) { BalancerName: "test", }, }, - { - err: "id must not be empty", - settings: GRPCClientSettings{ - Endpoint: "localhost:1234", - Auth: &configauth.Authentication{}, - }, - host: &mockHost{ext: map[config.ComponentID]component.Extension{ - config.NewComponentID("mock"): &configauth.MockClientAuthenticator{}, - }}, - }, { err: "failed to resolve authenticator \"doesntexist\": authenticator not found", settings: GRPCClientSettings{ Endpoint: "localhost:1234", - Auth: &configauth.Authentication{AuthenticatorName: "doesntexist"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("doesntexist")}, }, host: &mockHost{ext: map[config.ComponentID]component.Extension{}}, }, @@ -230,7 +220,7 @@ func TestGRPCClientSettingsError(t *testing.T) { err: "no extensions configuration available", settings: GRPCClientSettings{ Endpoint: "localhost:1234", - Auth: &configauth.Authentication{AuthenticatorName: "doesntexist"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("doesntexist")}, }, host: &mockHost{}, }, diff --git a/config/confighttp/confighttp_test.go b/config/confighttp/confighttp_test.go index 664785f8798..6afe9d66234 100644 --- a/config/confighttp/confighttp_test.go +++ b/config/confighttp/confighttp_test.go @@ -131,14 +131,7 @@ func TestHTTPClientSettingsError(t *testing.T) { err: "failed to resolve authenticator \"dummy\": authenticator not found", settings: HTTPClientSettings{ Endpoint: "https://localhost:1234/v1/traces", - Auth: &configauth.Authentication{AuthenticatorName: "dummy"}, - }, - }, - { - err: "id must not be empty", - settings: HTTPClientSettings{ - Endpoint: "https://localhost:1234/v1/traces", - Auth: &configauth.Authentication{AuthenticatorName: ""}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("dummy")}, }, }, } @@ -174,7 +167,7 @@ func TestHTTPClientSettingWithAuthConfig(t *testing.T) { name: "with_auth_configuration_and_no_extension", settings: HTTPClientSettings{ Endpoint: "localhost:1234", - Auth: &configauth.Authentication{AuthenticatorName: "dummy"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("dummy")}, }, shouldErr: true, extensionMap: map[config.ComponentID]component.Extension{ @@ -185,7 +178,7 @@ func TestHTTPClientSettingWithAuthConfig(t *testing.T) { name: "with_auth_configuration_and_no_extension_map", settings: HTTPClientSettings{ Endpoint: "localhost:1234", - Auth: &configauth.Authentication{AuthenticatorName: "dummy"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("dummy")}, }, shouldErr: true, }, @@ -193,7 +186,7 @@ func TestHTTPClientSettingWithAuthConfig(t *testing.T) { name: "with_auth_configuration_has_extension", settings: HTTPClientSettings{ Endpoint: "localhost:1234", - Auth: &configauth.Authentication{AuthenticatorName: "mock"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("mock")}, }, shouldErr: false, extensionMap: map[config.ComponentID]component.Extension{ @@ -204,7 +197,7 @@ func TestHTTPClientSettingWithAuthConfig(t *testing.T) { name: "with_auth_configuration_has_err_extension", settings: HTTPClientSettings{ Endpoint: "localhost:1234", - Auth: &configauth.Authentication{AuthenticatorName: "mock"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("mock")}, }, shouldErr: true, extensionMap: map[config.ComponentID]component.Extension{ diff --git a/exporter/otlpexporter/config_test.go b/exporter/otlpexporter/config_test.go index 3ad431d4e27..2426250881c 100644 --- a/exporter/otlpexporter/config_test.go +++ b/exporter/otlpexporter/config_test.go @@ -85,7 +85,7 @@ func TestLoadConfig(t *testing.T) { }, WriteBufferSize: 512 * 1024, BalancerName: "round_robin", - Auth: &configauth.Authentication{AuthenticatorName: "nop"}, + Auth: &configauth.Authentication{AuthenticatorID: config.NewComponentID("nop")}, }, }) } From c3aa7829aaac0d372d1722d2ee7ce83ed2daa871 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Fri, 22 Oct 2021 15:59:35 -0700 Subject: [PATCH 081/149] move cmd/pdatagen -> model/internal/cmd/pdatagen (#4243) * move cmd/pdatagen -> model/internal/pdatagen * move to model/internal/cmd * update changelog --- CHANGELOG.md | 1 + Makefile | 2 +- .../internal/cmd}/pdatagen/internal/base_fields.go | 2 +- .../internal/cmd}/pdatagen/internal/base_slices.go | 2 +- .../internal/cmd}/pdatagen/internal/base_structs.go | 2 +- .../internal/cmd}/pdatagen/internal/common_structs.go | 2 +- {cmd => model/internal/cmd}/pdatagen/internal/files.go | 6 +++--- .../internal/cmd}/pdatagen/internal/log_structs.go | 2 +- .../internal/cmd}/pdatagen/internal/metrics_structs.go | 2 +- .../internal/cmd}/pdatagen/internal/resource_structs.go | 2 +- .../internal/cmd}/pdatagen/internal/trace_structs.go | 2 +- {cmd => model/internal/cmd}/pdatagen/main.go | 2 +- model/pdata/generated_common.go | 4 ++-- model/pdata/generated_common_test.go | 4 ++-- model/pdata/generated_log.go | 4 ++-- model/pdata/generated_log_test.go | 4 ++-- model/pdata/generated_metrics.go | 4 ++-- model/pdata/generated_metrics_test.go | 4 ++-- model/pdata/generated_resource.go | 4 ++-- model/pdata/generated_resource_test.go | 4 ++-- model/pdata/generated_trace.go | 4 ++-- model/pdata/generated_trace_test.go | 4 ++-- 22 files changed, 34 insertions(+), 33 deletions(-) rename {cmd => model/internal/cmd}/pdatagen/internal/base_fields.go (99%) rename {cmd => model/internal/cmd}/pdatagen/internal/base_slices.go (99%) rename {cmd => model/internal/cmd}/pdatagen/internal/base_structs.go (97%) rename {cmd => model/internal/cmd}/pdatagen/internal/common_structs.go (97%) rename {cmd => model/internal/cmd}/pdatagen/internal/files.go (92%) rename {cmd => model/internal/cmd}/pdatagen/internal/log_structs.go (97%) rename {cmd => model/internal/cmd}/pdatagen/internal/metrics_structs.go (99%) rename {cmd => model/internal/cmd}/pdatagen/internal/resource_structs.go (92%) rename {cmd => model/internal/cmd}/pdatagen/internal/trace_structs.go (98%) rename {cmd => model/internal/cmd}/pdatagen/main.go (93%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef1990f569b..c02b9c860db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Rename `parserprovider.MapProvider` as `config.MapProvider` (#4178) - Rename `parserprovider.Watchable` as `config.WatchableMapProvider` (#4178) - Remove deprecated no-op flags to setup Collector's logging "--log-level", "--log-profile", "--log-format" (#4213) +- Move `cmd/pdatagen` as internal package `model/internal/cmd/pdatagen` (#4243) ## v0.37.0 Beta diff --git a/Makefile b/Makefile index 049abf45d58..ebd8d457386 100644 --- a/Makefile +++ b/Makefile @@ -360,7 +360,7 @@ genproto_sub: # Generate structs, functions and tests for pdata package. Must be used after any changes # to proto and after running `make genproto` genpdata: - go run cmd/pdatagen/main.go + go run model/internal/cmd/pdatagen/main.go $(MAKE) fmt # Generate semantic convention constants. Requires a clone of the opentelemetry-specification repo diff --git a/cmd/pdatagen/internal/base_fields.go b/model/internal/cmd/pdatagen/internal/base_fields.go similarity index 99% rename from cmd/pdatagen/internal/base_fields.go rename to model/internal/cmd/pdatagen/internal/base_fields.go index cd633506b81..524ca2ed4f7 100644 --- a/cmd/pdatagen/internal/base_fields.go +++ b/model/internal/cmd/pdatagen/internal/base_fields.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" import ( "os" diff --git a/cmd/pdatagen/internal/base_slices.go b/model/internal/cmd/pdatagen/internal/base_slices.go similarity index 99% rename from cmd/pdatagen/internal/base_slices.go rename to model/internal/cmd/pdatagen/internal/base_slices.go index 62ab4c84925..c1cead16595 100644 --- a/cmd/pdatagen/internal/base_slices.go +++ b/model/internal/cmd/pdatagen/internal/base_slices.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" import ( "os" diff --git a/cmd/pdatagen/internal/base_structs.go b/model/internal/cmd/pdatagen/internal/base_structs.go similarity index 97% rename from cmd/pdatagen/internal/base_structs.go rename to model/internal/cmd/pdatagen/internal/base_structs.go index d90760efb7d..4bf219d89ff 100644 --- a/cmd/pdatagen/internal/base_structs.go +++ b/model/internal/cmd/pdatagen/internal/base_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" import ( "os" diff --git a/cmd/pdatagen/internal/common_structs.go b/model/internal/cmd/pdatagen/internal/common_structs.go similarity index 97% rename from cmd/pdatagen/internal/common_structs.go rename to model/internal/cmd/pdatagen/internal/common_structs.go index c024f5eedf4..e4b3488a5de 100644 --- a/cmd/pdatagen/internal/common_structs.go +++ b/model/internal/cmd/pdatagen/internal/common_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var commonFile = &File{ Name: "common", diff --git a/cmd/pdatagen/internal/files.go b/model/internal/cmd/pdatagen/internal/files.go similarity index 92% rename from cmd/pdatagen/internal/files.go rename to model/internal/cmd/pdatagen/internal/files.go index a8b1b0048eb..e341a3cb7e7 100644 --- a/cmd/pdatagen/internal/files.go +++ b/model/internal/cmd/pdatagen/internal/files.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" import "strings" @@ -30,8 +30,8 @@ const header = `// Copyright The OpenTelemetry Authors // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata` diff --git a/cmd/pdatagen/internal/log_structs.go b/model/internal/cmd/pdatagen/internal/log_structs.go similarity index 97% rename from cmd/pdatagen/internal/log_structs.go rename to model/internal/cmd/pdatagen/internal/log_structs.go index e4500d7b526..4b7c27d33d1 100644 --- a/cmd/pdatagen/internal/log_structs.go +++ b/model/internal/cmd/pdatagen/internal/log_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var logFile = &File{ Name: "log", diff --git a/cmd/pdatagen/internal/metrics_structs.go b/model/internal/cmd/pdatagen/internal/metrics_structs.go similarity index 99% rename from cmd/pdatagen/internal/metrics_structs.go rename to model/internal/cmd/pdatagen/internal/metrics_structs.go index 1be0b1c5a26..54817908fb7 100644 --- a/cmd/pdatagen/internal/metrics_structs.go +++ b/model/internal/cmd/pdatagen/internal/metrics_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var metricsFile = &File{ Name: "metrics", diff --git a/cmd/pdatagen/internal/resource_structs.go b/model/internal/cmd/pdatagen/internal/resource_structs.go similarity index 92% rename from cmd/pdatagen/internal/resource_structs.go rename to model/internal/cmd/pdatagen/internal/resource_structs.go index 2f42384f8af..fcf922c0861 100644 --- a/cmd/pdatagen/internal/resource_structs.go +++ b/model/internal/cmd/pdatagen/internal/resource_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var resourceFile = &File{ Name: "resource", diff --git a/cmd/pdatagen/internal/trace_structs.go b/model/internal/cmd/pdatagen/internal/trace_structs.go similarity index 98% rename from cmd/pdatagen/internal/trace_structs.go rename to model/internal/cmd/pdatagen/internal/trace_structs.go index 6f8d90c54c0..08fd554cc9c 100644 --- a/cmd/pdatagen/internal/trace_structs.go +++ b/model/internal/cmd/pdatagen/internal/trace_structs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal // import "go.opentelemetry.io/collector/cmd/pdatagen/internal" +package internal // import "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" var traceFile = &File{ Name: "trace", diff --git a/cmd/pdatagen/main.go b/model/internal/cmd/pdatagen/main.go similarity index 93% rename from cmd/pdatagen/main.go rename to model/internal/cmd/pdatagen/main.go index 3b4101a7426..afb96b4e716 100644 --- a/cmd/pdatagen/main.go +++ b/model/internal/cmd/pdatagen/main.go @@ -17,7 +17,7 @@ package main import ( "os" - "go.opentelemetry.io/collector/cmd/pdatagen/internal" + "go.opentelemetry.io/collector/model/internal/cmd/pdatagen/internal" ) func check(e error) { diff --git a/model/pdata/generated_common.go b/model/pdata/generated_common.go index 1c411d2d6e4..0f970e6c6ae 100644 --- a/model/pdata/generated_common.go +++ b/model/pdata/generated_common.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_common_test.go b/model/pdata/generated_common_test.go index 3ef9f668ada..1a61fe3a24d 100644 --- a/model/pdata/generated_common_test.go +++ b/model/pdata/generated_common_test.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_log.go b/model/pdata/generated_log.go index a07ccdedaaf..110c9f88df5 100644 --- a/model/pdata/generated_log.go +++ b/model/pdata/generated_log.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_log_test.go b/model/pdata/generated_log_test.go index 7b09fec026a..001c7b7fc40 100644 --- a/model/pdata/generated_log_test.go +++ b/model/pdata/generated_log_test.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_metrics.go b/model/pdata/generated_metrics.go index 047d1614f00..3e0f2555c97 100644 --- a/model/pdata/generated_metrics.go +++ b/model/pdata/generated_metrics.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_metrics_test.go b/model/pdata/generated_metrics_test.go index 9306166c5a8..941a3c23f25 100644 --- a/model/pdata/generated_metrics_test.go +++ b/model/pdata/generated_metrics_test.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_resource.go b/model/pdata/generated_resource.go index 9b98bb84172..6e44dd276a4 100644 --- a/model/pdata/generated_resource.go +++ b/model/pdata/generated_resource.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_resource_test.go b/model/pdata/generated_resource_test.go index cff3992e35f..bc8295cd0db 100644 --- a/model/pdata/generated_resource_test.go +++ b/model/pdata/generated_resource_test.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_trace.go b/model/pdata/generated_trace.go index 3a2f17e5dd9..e72a55b6329 100644 --- a/model/pdata/generated_trace.go +++ b/model/pdata/generated_trace.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata diff --git a/model/pdata/generated_trace_test.go b/model/pdata/generated_trace_test.go index 81af159405a..3eb4b35ccc3 100644 --- a/model/pdata/generated_trace_test.go +++ b/model/pdata/generated_trace_test.go @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Code generated by "cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "go run cmd/pdatagen/main.go". +// Code generated by "model/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "go run model/internal/cmd/pdatagen/main.go". package pdata From b7e2e335dbaccc1866c8dfdfb55366234d70e74a Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Sun, 24 Oct 2021 09:50:13 -0700 Subject: [PATCH 082/149] Fix small typo (#4250) Signed-off-by: Bogdan Drutu --- receiver/otlpreceiver/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/otlpreceiver/config.go b/receiver/otlpreceiver/config.go index f40052ec342..b6b694298f7 100644 --- a/receiver/otlpreceiver/config.go +++ b/receiver/otlpreceiver/config.go @@ -65,7 +65,7 @@ func (cfg *Config) Unmarshal(componentParser *config.Map) error { return err } - // next manually search for protocols in the config.Map, if a protocol is not present it means it is disable. + // next manually search for protocols in the config.Map, if a protocol is not present it means it is disabled. protocols, err := componentParser.Sub(protocolsFieldName) if err != nil { return err From ae86261f8e8470c6f18534d69fa2b013bdd592d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 09:20:57 -0700 Subject: [PATCH 083/149] Bump github.com/knadh/koanf from 1.2.4 to 1.3.0 (#4251) Bumps [github.com/knadh/koanf](https://github.com/knadh/koanf) from 1.2.4 to 1.3.0. - [Release notes](https://github.com/knadh/koanf/releases) - [Commits](https://github.com/knadh/koanf/compare/v1.2.4...v1.3.0) --- updated-dependencies: - dependency-name: github.com/knadh/koanf dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 068fbfbfb9f..34efe1ce539 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 - github.com/knadh/koanf v1.2.4 + github.com/knadh/koanf v1.3.0 github.com/magiconair/properties v1.8.5 github.com/mitchellh/mapstructure v1.4.2 github.com/prometheus/common v0.31.1 diff --git a/go.sum b/go.sum index a8d2e958958..869c7a52afa 100644 --- a/go.sum +++ b/go.sum @@ -54,6 +54,16 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 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/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= +github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= +github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= +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/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -236,6 +246,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -250,8 +262,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/knadh/koanf v1.2.4 h1:AQYoGbNwphHd63E//SkDkqEGcogARxGspHWqoJw6O8k= -github.com/knadh/koanf v1.2.4/go.mod h1:xpPTwMhsA/aaQLAilyCCqfpEiY1gpa160AiCuWHJUjY= +github.com/knadh/koanf v1.3.0 h1:nNmG4HGbpJUv7eUV1skDvHzzFS+35Q3b+OsYvoXyt2E= +github.com/knadh/koanf v1.3.0/go.mod h1:HZ7HMLIGbrWJUfgtEzfHvzR/rX+eIqQlBNPRr4Vt42s= 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.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= From c0e8f31ecc0a727b9392a3dd34fe7ad7d3b7e087 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 09:21:17 -0700 Subject: [PATCH 084/149] Bump github.com/prometheus/common from 0.31.1 to 0.32.1 (#4252) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.31.1 to 0.32.1. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](https://github.com/prometheus/common/compare/v0.31.1...v0.32.1) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 34efe1ce539..599f1647c22 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/knadh/koanf v1.3.0 github.com/magiconair/properties v1.8.5 github.com/mitchellh/mapstructure v1.4.2 - github.com/prometheus/common v0.31.1 + github.com/prometheus/common v0.32.1 github.com/rs/cors v1.8.0 github.com/shirou/gopsutil/v3 v3.21.9 github.com/spf13/cast v1.4.1 diff --git a/go.sum b/go.sum index 869c7a52afa..2117f03c13d 100644 --- a/go.sum +++ b/go.sum @@ -339,8 +339,8 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.31.1 h1:d18hG4PkHnNAKNMOmFuXFaiY8Us0nird/2m60uS1AMs= -github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= From ecd534710dd5f4f3b7ed0a216019f435409a82a9 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Mon, 25 Oct 2021 16:18:51 -0700 Subject: [PATCH 085/149] add ExponentialHistogram field to pdata (#4219) Adds OTLP v0.11.0 data type ExponentialHistogram to pdata. **Link to tracking Issue:** Fixes #4210 --- .../cmd/pdatagen/internal/metrics_structs.go | 85 ++++ .../data/protogen/metrics/v1/metrics.pb.go | 276 +++++++------ model/pdata/generated_metrics.go | 362 ++++++++++++++++++ model/pdata/generated_metrics_test.go | 300 +++++++++++++++ proto_patch.sed | 3 + 5 files changed, 881 insertions(+), 145 deletions(-) diff --git a/model/internal/cmd/pdatagen/internal/metrics_structs.go b/model/internal/cmd/pdatagen/internal/metrics_structs.go index 54817908fb7..c7d0e43dd9e 100644 --- a/model/internal/cmd/pdatagen/internal/metrics_structs.go +++ b/model/internal/cmd/pdatagen/internal/metrics_structs.go @@ -38,11 +38,15 @@ var metricsFile = &File{ doubleGauge, doubleSum, histogram, + exponentialHistogram, summary, numberDataPointSlice, numberDataPoint, histogramDataPointSlice, histogramDataPoint, + exponentialHistogramDataPointSlice, + exponentialHistogramDataPoint, + bucketsValues, summaryDataPointSlice, summaryDataPoint, quantileValuesSlice, @@ -164,6 +168,21 @@ var histogram = &messageValueStruct{ }, } +var exponentialHistogram = &messageValueStruct{ + structName: "ExponentialHistogram", + description: `// ExponentialHistogram represents the type of a metric that is calculated by aggregating + // as a ExponentialHistogram of all reported double measurements over a time interval.`, + originFullName: "otlpmetrics.ExponentialHistogram", + fields: []baseField{ + aggregationTemporalityField, + &sliceField{ + fieldName: "DataPoints", + originFieldName: "DataPoints", + returnSlice: exponentialHistogramDataPointSlice, + }, + }, +} + var summary = &messageValueStruct{ structName: "Summary", description: "// Summary represents the type of a metric that is calculated by aggregating as a Summary of all reported double measurements over a time interval.", @@ -239,6 +258,72 @@ var histogramDataPoint = &messageValueStruct{ }, } +var exponentialHistogramDataPointSlice = &sliceOfPtrs{ + structName: "ExponentialHistogramDataPointSlice", + element: exponentialHistogramDataPoint, +} + +var exponentialHistogramDataPoint = &messageValueStruct{ + structName: "ExponentialHistogramDataPoint", + description: `// ExponentialHistogramDataPoint is a single data point in a timeseries that describes the + // time-varying values of a ExponentialHistogram of double values. A ExponentialHistogram contains + // summary statistics for a population of values, it may optionally contain the + // distribution of those values across a set of buckets.`, + originFullName: "otlpmetrics.ExponentialHistogramDataPoint", + fields: []baseField{ + attributes, + startTimeField, + timeField, + countField, + doubleSumField, + &primitiveTypedField{ + fieldName: "Scale", + originFieldName: "Scale", + returnType: "int32", + rawType: "int32", + defaultVal: "int32(0)", + testVal: "int32(4)", + }, + &primitiveTypedField{ + fieldName: "ZeroCount", + originFieldName: "ZeroCount", + returnType: "uint64", + rawType: "uint64", + defaultVal: "uint64(0)", + testVal: "uint64(201)", + }, + &messageValueField{ + fieldName: "Positive", + originFieldName: "Positive", + returnMessage: bucketsValues, + }, + &messageValueField{ + fieldName: "Negative", + originFieldName: "Negative", + returnMessage: bucketsValues, + }, + exemplarsField, + dataPointFlagsField, + }, +} + +var bucketsValues = &messageValueStruct{ + structName: "Buckets", + description: "// Buckets are a set of bucket counts, encoded in a contiguous array of counts.", + originFullName: "otlpmetrics.ExponentialHistogramDataPoint_Buckets", + fields: []baseField{ + &primitiveTypedField{ + fieldName: "Offset", + originFieldName: "Offset", + returnType: "int32", + rawType: "int32", + defaultVal: "int32(0)", + testVal: "int32(909)", + }, + bucketCountsField, + }, +} + var summaryDataPointSlice = &sliceOfPtrs{ structName: "SummaryDataPointSlice", element: summaryDataPoint, diff --git a/model/internal/data/protogen/metrics/v1/metrics.pb.go b/model/internal/data/protogen/metrics/v1/metrics.pb.go index 5890a53a360..23b8faee1f8 100644 --- a/model/internal/data/protogen/metrics/v1/metrics.pb.go +++ b/model/internal/data/protogen/metrics/v1/metrics.pb.go @@ -1312,9 +1312,9 @@ type ExponentialHistogramDataPoint struct { // mass equal to (zero_count / count). ZeroCount uint64 `protobuf:"fixed64,7,opt,name=zero_count,json=zeroCount,proto3" json:"zero_count,omitempty"` // positive carries the positive range of exponential bucket counts. - Positive *ExponentialHistogramDataPoint_Buckets `protobuf:"bytes,8,opt,name=positive,proto3" json:"positive,omitempty"` + Positive ExponentialHistogramDataPoint_Buckets `protobuf:"bytes,8,opt,name=positive,proto3" json:"positive"` // negative carries the negative range of exponential bucket counts. - Negative *ExponentialHistogramDataPoint_Buckets `protobuf:"bytes,9,opt,name=negative,proto3" json:"negative,omitempty"` + Negative ExponentialHistogramDataPoint_Buckets `protobuf:"bytes,9,opt,name=negative,proto3" json:"negative"` // Flags that apply to this specific data point. See DataPointFlags // for the available flags and their meaning. Flags uint32 `protobuf:"varint,10,opt,name=flags,proto3" json:"flags,omitempty"` @@ -1405,18 +1405,18 @@ func (m *ExponentialHistogramDataPoint) GetZeroCount() uint64 { return 0 } -func (m *ExponentialHistogramDataPoint) GetPositive() *ExponentialHistogramDataPoint_Buckets { +func (m *ExponentialHistogramDataPoint) GetPositive() ExponentialHistogramDataPoint_Buckets { if m != nil { return m.Positive } - return nil + return ExponentialHistogramDataPoint_Buckets{} } -func (m *ExponentialHistogramDataPoint) GetNegative() *ExponentialHistogramDataPoint_Buckets { +func (m *ExponentialHistogramDataPoint) GetNegative() ExponentialHistogramDataPoint_Buckets { if m != nil { return m.Negative } - return nil + return ExponentialHistogramDataPoint_Buckets{} } func (m *ExponentialHistogramDataPoint) GetFlags() uint32 { @@ -2356,111 +2356,111 @@ func init() { } var fileDescriptor_3c3112f9fa006917 = []byte{ - // 1651 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0x77, 0xdb, 0xf1, 0xd7, 0x73, 0x3e, 0x3c, 0x45, 0x36, 0x63, 0x45, 0x4a, 0x26, 0xe3, 0x81, - 0x49, 0x18, 0x16, 0x9b, 0x0d, 0x2c, 0x9f, 0x1a, 0x69, 0xec, 0xd8, 0x49, 0xac, 0x38, 0x1f, 0x5b, - 0x71, 0x82, 0x66, 0x35, 0x4c, 0xab, 0x6c, 0x57, 0xbc, 0xa5, 0xed, 0x0f, 0xd3, 0x5d, 0x1d, 0x25, - 0xdc, 0x97, 0x13, 0x07, 0x84, 0xb8, 0xf2, 0x17, 0xf0, 0x2f, 0xf0, 0x07, 0xec, 0x71, 0xb9, 0x21, - 0x90, 0x46, 0x68, 0x82, 0x84, 0x04, 0x07, 0x4e, 0x70, 0x46, 0x55, 0xd5, 0x6d, 0x3b, 0x4e, 0x27, - 0x76, 0x26, 0x19, 0x6d, 0x46, 0x73, 0xab, 0x7a, 0xfd, 0xde, 0xaf, 0xde, 0x67, 0xbd, 0xd7, 0xdd, - 0xf0, 0xa1, 0xdd, 0xa5, 0x16, 0xa7, 0x06, 0x35, 0x29, 0x77, 0x4e, 0x8b, 0x5d, 0xc7, 0xe6, 0x76, - 0x51, 0xac, 0x59, 0xcb, 0x2d, 0x1e, 0x7f, 0x14, 0x2c, 0x0b, 0xf2, 0x01, 0x5a, 0x3c, 0xc7, 0xad, - 0x88, 0x85, 0x80, 0xe5, 0xf8, 0xa3, 0xf9, 0xd9, 0x8e, 0xdd, 0xb1, 0x15, 0x86, 0x58, 0x29, 0x86, - 0xf9, 0x27, 0x61, 0x67, 0xb4, 0x6c, 0xd3, 0xb4, 0x2d, 0x71, 0x84, 0x5a, 0xf9, 0xbc, 0x85, 0x30, - 0x5e, 0x87, 0xba, 0xb6, 0xe7, 0xb4, 0xa8, 0xe0, 0x0e, 0xd6, 0x8a, 0x3f, 0xcf, 0x20, 0xb3, 0xad, - 0xce, 0xaf, 0x10, 0x4e, 0xd0, 0xa7, 0x90, 0x0d, 0x18, 0x74, 0x5f, 0xaf, 0x9c, 0xb6, 0x14, 0x5b, - 0xc9, 0xac, 0x16, 0x0b, 0x57, 0xeb, 0x5e, 0xc0, 0xbe, 0x9c, 0x0f, 0x87, 0x67, 0x9c, 0xf3, 0x84, - 0xfc, 0x17, 0x51, 0x98, 0x19, 0x62, 0x42, 0x5b, 0x90, 0x0a, 0xd8, 0x72, 0xda, 0x92, 0xb6, 0x92, - 0x59, 0xfd, 0x76, 0xe8, 0x39, 0x3d, 0xad, 0x07, 0x0e, 0x2a, 0x4f, 0x7c, 0xf9, 0xea, 0x41, 0x04, - 0xf7, 0x00, 0xd0, 0x17, 0x1a, 0x3c, 0x60, 0x96, 0xcb, 0x1d, 0xcf, 0xa4, 0x16, 0x27, 0x9c, 0xd9, - 0x96, 0x6e, 0xb0, 0xa6, 0x43, 0x9c, 0xd3, 0x9e, 0x31, 0x51, 0x69, 0xcc, 0xd3, 0x51, 0xc6, 0xd4, - 0xce, 0xc3, 0xd4, 0x15, 0x4a, 0x60, 0xda, 0x02, 0xbb, 0xea, 0x31, 0x5a, 0x00, 0x70, 0x5b, 0x9f, - 0x51, 0x93, 0xe8, 0x9e, 0x63, 0xe4, 0x62, 0x4b, 0xda, 0x4a, 0x1a, 0xa7, 0x15, 0xe5, 0xc0, 0x31, - 0xf2, 0xff, 0xd3, 0x60, 0xe1, 0x4a, 0x7c, 0xc4, 0xe1, 0xfe, 0x25, 0x76, 0xf8, 0x4e, 0xfa, 0x38, - 0x54, 0x7f, 0x3f, 0x11, 0x2e, 0x55, 0xdf, 0x77, 0xd8, 0x5c, 0xb8, 0xf6, 0xe8, 0x19, 0x24, 0xcf, - 0x7b, 0xe9, 0xf1, 0x28, 0x2f, 0x29, 0x7d, 0x71, 0x20, 0x36, 0xca, 0xf0, 0x3f, 0xc5, 0x21, 0xa1, - 0x44, 0x10, 0x82, 0x09, 0x8b, 0x98, 0x2a, 0xe6, 0x69, 0x2c, 0xd7, 0x68, 0x09, 0x32, 0x6d, 0xea, - 0xb6, 0x1c, 0xd6, 0x15, 0x5a, 0xe5, 0xa2, 0xf2, 0xd1, 0x20, 0x49, 0x48, 0x79, 0x16, 0xe3, 0x3e, - 0xb2, 0x5c, 0xa3, 0x2d, 0x48, 0x33, 0x8b, 0xeb, 0x1d, 0xe2, 0x75, 0x68, 0x6e, 0x42, 0x7a, 0x67, - 0x65, 0x74, 0x74, 0xf9, 0x86, 0xe0, 0x2f, 0x47, 0x73, 0xda, 0x66, 0x04, 0xa7, 0x98, 0xbf, 0x47, - 0x4f, 0x21, 0xae, 0x80, 0xe2, 0x12, 0xe8, 0x5b, 0xa3, 0x80, 0xa4, 0xd4, 0x66, 0x04, 0x2b, 0x29, - 0x54, 0x85, 0xa4, 0xd0, 0xc5, 0xf5, 0xcc, 0x5c, 0x42, 0x02, 0x3c, 0x1e, 0x43, 0x93, 0x7d, 0xcf, - 0xf4, 0xf5, 0x48, 0x30, 0xb9, 0x43, 0x3f, 0x82, 0x98, 0x80, 0x48, 0x4a, 0x88, 0x47, 0xa3, 0x20, - 0xf6, 0x3d, 0x73, 0x33, 0x82, 0x85, 0x04, 0xfa, 0x39, 0x4c, 0x89, 0xf3, 0x3f, 0x63, 0x2e, 0xb7, - 0x3b, 0x0e, 0x31, 0x73, 0x29, 0x09, 0xf1, 0xe1, 0x18, 0x5a, 0x6c, 0x06, 0x32, 0xbe, 0x2e, 0x93, - 0x6c, 0x80, 0x86, 0x6a, 0x90, 0xee, 0x83, 0xa6, 0xaf, 0xa8, 0xd3, 0x01, 0xd0, 0x9e, 0xf4, 0x66, - 0x04, 0xf7, 0xa5, 0xd1, 0xe7, 0xf0, 0x01, 0x3d, 0xe9, 0xda, 0x16, 0xb5, 0x38, 0x23, 0xc6, 0x80, - 0xae, 0x20, 0x61, 0x7f, 0x30, 0x0a, 0xb6, 0xda, 0x17, 0x1e, 0x3c, 0x61, 0x96, 0x86, 0xd0, 0xd1, - 0x1a, 0x24, 0x5d, 0xcf, 0x34, 0x45, 0xe1, 0x64, 0x24, 0xfc, 0xf2, 0x18, 0xde, 0x14, 0xec, 0x9b, - 0x11, 0x1c, 0x48, 0x96, 0x13, 0x30, 0xd1, 0x26, 0x9c, 0xe4, 0x9f, 0x43, 0x5c, 0x65, 0xc9, 0x1e, - 0x64, 0x04, 0x41, 0xef, 0xda, 0xcc, 0xe2, 0x63, 0xdf, 0x8f, 0x3b, 0x9e, 0xd9, 0xa4, 0x8e, 0xb8, - 0x65, 0xf7, 0x84, 0x1c, 0x86, 0x76, 0xb0, 0x74, 0xf3, 0xff, 0xd6, 0x20, 0x26, 0x22, 0x7f, 0xeb, - 0xc8, 0xc8, 0x86, 0xfb, 0xa4, 0xd3, 0x71, 0x68, 0x47, 0x5d, 0x23, 0x9c, 0x9a, 0x5d, 0xdb, 0x21, - 0x06, 0xe3, 0xa7, 0xb2, 0xc0, 0xa6, 0x57, 0x7f, 0x38, 0x0a, 0xbd, 0xd4, 0x17, 0x6f, 0xf4, 0xa5, - 0xf1, 0x1c, 0x09, 0xa5, 0xa3, 0x87, 0x30, 0xc9, 0x5c, 0xdd, 0xb4, 0x2d, 0x9b, 0xdb, 0x16, 0x6b, - 0xc9, 0x5a, 0x4d, 0xe1, 0x0c, 0x73, 0xb7, 0x03, 0x52, 0xfe, 0xcf, 0x1a, 0xa4, 0xfb, 0x31, 0xda, - 0x0f, 0xb3, 0x79, 0x75, 0xec, 0xec, 0xba, 0x1b, 0x66, 0xe7, 0xff, 0xa9, 0xc1, 0x6c, 0x58, 0x6a, - 0xa2, 0x97, 0x61, 0xe6, 0x3d, 0x7d, 0x93, 0x2c, 0xbf, 0x23, 0x96, 0xbe, 0x80, 0xa4, 0x5f, 0x24, - 0xe8, 0x93, 0x30, 0xdb, 0xbe, 0x37, 0x66, 0x89, 0x85, 0x57, 0xc2, 0x1f, 0x63, 0x30, 0x33, 0x94, - 0xcf, 0x68, 0x1b, 0x80, 0x70, 0xee, 0xb0, 0xa6, 0xc7, 0xa9, 0x9b, 0x4b, 0xca, 0x53, 0x96, 0x47, - 0x74, 0xc0, 0x2d, 0x7a, 0x7a, 0x48, 0x0c, 0x2f, 0x18, 0x12, 0x06, 0x00, 0xd0, 0x36, 0x24, 0x0c, - 0xd2, 0xa4, 0x46, 0xa0, 0xf0, 0x77, 0x47, 0x40, 0xed, 0x73, 0x87, 0x59, 0x9d, 0x1e, 0x60, 0x42, - 0x00, 0xe6, 0x34, 0xec, 0x83, 0xa0, 0x22, 0xcc, 0xba, 0x9c, 0x38, 0x5c, 0xe7, 0xcc, 0xa4, 0xba, - 0x67, 0xb1, 0x13, 0xdd, 0x22, 0x96, 0x2d, 0xbd, 0x9f, 0xc0, 0xf7, 0xe4, 0xb3, 0x06, 0x33, 0xe9, - 0x81, 0xc5, 0x4e, 0x76, 0x88, 0x65, 0xa3, 0x6f, 0xc2, 0xf4, 0x10, 0x6b, 0x4c, 0xb2, 0x4e, 0xf2, - 0x41, 0xae, 0x05, 0x48, 0x13, 0x57, 0x6f, 0xdb, 0x5e, 0xd3, 0x50, 0x7d, 0x4d, 0x76, 0x2a, 0xe2, - 0x56, 0x24, 0x05, 0xdd, 0x87, 0x04, 0x71, 0x75, 0x66, 0x71, 0xd9, 0x69, 0xb2, 0xa2, 0x07, 0x11, - 0xb7, 0x66, 0x71, 0x54, 0x87, 0x34, 0x3d, 0xa1, 0x66, 0xd7, 0x20, 0x8e, 0x9b, 0x8b, 0x4b, 0x03, - 0x57, 0x46, 0x67, 0x9b, 0x12, 0xf0, 0x9d, 0xd5, 0x07, 0x40, 0xb3, 0x10, 0x3f, 0x32, 0x48, 0xc7, - 0x95, 0x9d, 0x64, 0x0a, 0xab, 0x4d, 0x39, 0x09, 0xf1, 0x63, 0xe1, 0x8b, 0xfc, 0x59, 0x0c, 0xd0, - 0xc5, 0xfc, 0x1c, 0x0a, 0x58, 0xfa, 0xfd, 0x08, 0xd8, 0x2c, 0xc4, 0x5b, 0xb6, 0x67, 0x71, 0x19, - 0xac, 0x04, 0x56, 0x1b, 0x94, 0x55, 0xbd, 0x5c, 0xcc, 0x13, 0x9a, 0x6a, 0xd2, 0x8f, 0x60, 0xaa, - 0xe9, 0xb5, 0x3e, 0xa7, 0x5c, 0x97, 0x1c, 0x6e, 0x2e, 0xb1, 0x14, 0x13, 0x60, 0x8a, 0xb8, 0x26, - 0x69, 0x68, 0x19, 0x66, 0xe8, 0x49, 0xd7, 0x60, 0x2d, 0xc6, 0xf5, 0xa6, 0xed, 0x59, 0x6d, 0x95, - 0xf7, 0x1a, 0x9e, 0x0e, 0xc8, 0x65, 0x49, 0x3d, 0x1f, 0xee, 0xd4, 0xad, 0x85, 0x1b, 0x06, 0xc2, - 0x9d, 0xff, 0x7d, 0x1c, 0x16, 0xae, 0xbc, 0x90, 0x86, 0x02, 0xae, 0xdd, 0x34, 0xe0, 0x5f, 0x73, - 0x84, 0x66, 0x21, 0xee, 0xb6, 0x88, 0x41, 0x65, 0x69, 0xdd, 0xc3, 0x6a, 0x23, 0x86, 0xdb, 0x5f, - 0x51, 0xc7, 0x56, 0x51, 0x93, 0xc3, 0x59, 0x02, 0xa7, 0x05, 0x45, 0x86, 0x0c, 0x11, 0x48, 0x75, - 0x6d, 0x97, 0x71, 0x76, 0x4c, 0xfd, 0xb1, 0xab, 0x7a, 0xa3, 0x4b, 0xbe, 0x50, 0x96, 0xf9, 0xe0, - 0xe2, 0x1e, 0xac, 0x38, 0xc2, 0x92, 0x17, 0xf2, 0x31, 0xf5, 0x87, 0xb0, 0xdb, 0x3a, 0x22, 0x80, - 0x0d, 0x4f, 0x80, 0xf3, 0x49, 0x96, 0xb9, 0x61, 0x92, 0xcd, 0xaf, 0x43, 0xd2, 0x3f, 0x18, 0xcd, - 0x41, 0xc2, 0x3e, 0x3a, 0x72, 0x29, 0x97, 0x2f, 0x02, 0xf7, 0xb0, 0xbf, 0xbb, 0x58, 0x23, 0xe2, - 0x85, 0x64, 0xe2, 0x7c, 0x8d, 0xe4, 0xff, 0x1b, 0x83, 0xec, 0x70, 0x2f, 0x79, 0x3f, 0x7b, 0xc5, - 0xb8, 0x89, 0xcd, 0x60, 0xe6, 0x97, 0x1e, 0xb1, 0x38, 0x33, 0xa8, 0x2e, 0x2f, 0x70, 0x75, 0xf9, - 0x64, 0x56, 0x9f, 0x5d, 0xb7, 0x67, 0x17, 0xa4, 0x7d, 0x25, 0xfe, 0x89, 0x0f, 0x87, 0xa7, 0x03, - 0x60, 0xf9, 0xe0, 0x92, 0xc6, 0x31, 0xbf, 0x06, 0x33, 0x43, 0x82, 0x68, 0x1e, 0x52, 0x81, 0xa8, - 0x4c, 0x02, 0x0d, 0xf7, 0xf6, 0x02, 0x44, 0xaa, 0x29, 0xfd, 0xa3, 0x61, 0xbf, 0xe9, 0xfc, 0x2b, - 0x06, 0xa9, 0x20, 0xbb, 0xd0, 0x4b, 0xf8, 0xc6, 0x11, 0x33, 0x38, 0x75, 0x68, 0x5b, 0xbf, 0x69, - 0xe0, 0x51, 0x80, 0x54, 0xea, 0x27, 0xc0, 0x4b, 0x98, 0xe9, 0xe1, 0xdf, 0x46, 0x26, 0x4c, 0x07, - 0x68, 0x75, 0x95, 0x11, 0x17, 0x03, 0x1c, 0x1d, 0x35, 0x0c, 0xc4, 0xc6, 0x1f, 0x06, 0x9e, 0x43, - 0xd2, 0xed, 0x12, 0x4b, 0x67, 0x6d, 0x99, 0x1a, 0x93, 0xe5, 0x67, 0x42, 0x8d, 0xbf, 0xbe, 0x7a, - 0xf0, 0xe3, 0x8e, 0x3d, 0xa4, 0x3f, 0xb3, 0x8b, 0x2d, 0xdb, 0x30, 0x68, 0x8b, 0xdb, 0x4e, 0xd1, - 0xb4, 0xdb, 0xd4, 0x28, 0x32, 0x8b, 0x53, 0xc7, 0x22, 0x46, 0x51, 0xcc, 0x67, 0x85, 0xfd, 0x2e, - 0xb1, 0x6a, 0x15, 0x9c, 0x10, 0x80, 0xb5, 0x36, 0x7a, 0x01, 0x29, 0xee, 0x90, 0x16, 0x15, 0xd8, - 0x71, 0x89, 0x5d, 0xf2, 0xb1, 0x7f, 0x72, 0x7d, 0xec, 0x86, 0x40, 0xaa, 0x55, 0x70, 0x52, 0x42, - 0xd6, 0xda, 0xfd, 0x09, 0xe3, 0x0f, 0x51, 0x98, 0xac, 0x59, 0xbc, 0x5f, 0xe0, 0x5b, 0x37, 0xab, - 0x48, 0x15, 0xe9, 0xb7, 0x5f, 0x8f, 0x2a, 0x6f, 0x85, 0xd3, 0xb3, 0x7e, 0xde, 0xa2, 0xdd, 0x8b, - 0x93, 0xd9, 0x77, 0xc6, 0x78, 0x33, 0xbf, 0xf4, 0x22, 0xfd, 0x69, 0x34, 0xa7, 0xe5, 0x7f, 0x01, - 0xa9, 0xe0, 0x6b, 0x06, 0xda, 0x0e, 0x1b, 0xc7, 0xc7, 0x79, 0xf9, 0x0f, 0x1d, 0xc5, 0x25, 0xfc, - 0x7f, 0x34, 0x48, 0xa8, 0x6f, 0x14, 0xb7, 0x8c, 0x7e, 0x17, 0x5f, 0x4c, 0xa5, 0xc5, 0xbf, 0x8e, - 0xc1, 0x07, 0x83, 0xdf, 0x43, 0xde, 0xb9, 0xcc, 0xbb, 0xba, 0x13, 0x64, 0xdf, 0xc6, 0x10, 0xba, - 0x7b, 0x71, 0x08, 0xbd, 0x79, 0x66, 0xff, 0x4d, 0x93, 0x95, 0xdf, 0x7f, 0x93, 0x3e, 0x0c, 0x4b, - 0xc0, 0x8f, 0xaf, 0xf3, 0x6d, 0xeb, 0x6e, 0x64, 0xa2, 0xb4, 0xee, 0x1f, 0x51, 0xc8, 0x0c, 0xb8, - 0x00, 0xbd, 0xb8, 0xa5, 0x3e, 0xa3, 0x5c, 0xf9, 0x66, 0x5d, 0xa6, 0x77, 0x6d, 0xc5, 0x06, 0xaf, - 0xad, 0x77, 0xb5, 0x87, 0x08, 0x37, 0x3f, 0xf9, 0x8d, 0x06, 0x73, 0xe1, 0xd1, 0x41, 0xcb, 0xf0, - 0xa8, 0xb4, 0xb1, 0x81, 0xab, 0x1b, 0xa5, 0x46, 0x6d, 0x77, 0x47, 0x6f, 0x54, 0xb7, 0xf7, 0x76, - 0x71, 0xa9, 0x5e, 0x6b, 0x3c, 0xd7, 0x0f, 0x76, 0xf6, 0xf7, 0xaa, 0x6b, 0xb5, 0xf5, 0x5a, 0xb5, - 0x92, 0x8d, 0xa0, 0x87, 0xb0, 0x70, 0x19, 0x63, 0xa5, 0x5a, 0x6f, 0x94, 0xb2, 0x1a, 0x7a, 0x0c, - 0xf9, 0xcb, 0x58, 0xd6, 0x0e, 0xb6, 0x0f, 0xea, 0xa5, 0x46, 0xed, 0xb0, 0x9a, 0x8d, 0x3e, 0xf9, - 0x19, 0x4c, 0xf7, 0x72, 0x70, 0x5d, 0x8e, 0xd6, 0x53, 0x90, 0x5e, 0xaf, 0x97, 0x36, 0xf4, 0x9d, - 0xdd, 0x9d, 0x6a, 0x36, 0x82, 0xe6, 0x61, 0xce, 0xdf, 0xea, 0xb8, 0xba, 0xb6, 0x8b, 0x2b, 0xd5, - 0x8a, 0x7e, 0x58, 0xaa, 0x1f, 0x54, 0xb3, 0x5a, 0xf9, 0x77, 0xda, 0x97, 0xaf, 0x17, 0xb5, 0xaf, - 0x5e, 0x2f, 0x6a, 0x7f, 0x7f, 0xbd, 0xa8, 0xfd, 0xf6, 0x6c, 0x31, 0xf2, 0xd5, 0xd9, 0x62, 0xe4, - 0x2f, 0x67, 0x8b, 0x11, 0x78, 0xc8, 0xec, 0x11, 0x39, 0x5a, 0x9e, 0xf4, 0x7f, 0x2e, 0xec, 0x89, - 0x07, 0x7b, 0xda, 0xa7, 0xd5, 0x6b, 0x7b, 0x58, 0xfd, 0x4c, 0xea, 0x50, 0x6b, 0xe0, 0xff, 0x56, - 0x33, 0x21, 0x89, 0xdf, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0x16, 0x1c, 0xd1, 0x08, - 0x1b, 0x00, 0x00, + // 1652 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4b, 0x6f, 0x1b, 0xc9, + 0x11, 0xe6, 0x90, 0xe2, 0xab, 0xa8, 0x07, 0xdd, 0x91, 0x65, 0x42, 0x80, 0x64, 0x99, 0x4e, 0x2c, + 0xc5, 0x71, 0xc8, 0x58, 0x89, 0xf3, 0x84, 0x01, 0x93, 0x22, 0x25, 0x11, 0xa2, 0x1e, 0x1e, 0x51, + 0x0a, 0x6c, 0x38, 0x1e, 0x34, 0xc9, 0x16, 0xdd, 0xf0, 0x3c, 0x98, 0x99, 0x1e, 0x41, 0xca, 0xdd, + 0x39, 0xe5, 0x10, 0xe4, 0x1e, 0x20, 0xf7, 0xfc, 0x85, 0xfc, 0x00, 0x1f, 0x9d, 0x5b, 0x90, 0x05, + 0x8c, 0x85, 0xb5, 0xc0, 0x02, 0xbb, 0x87, 0x3d, 0xed, 0x9e, 0x17, 0xdd, 0x3d, 0x43, 0x52, 0xd4, + 0x48, 0xa4, 0x2c, 0x19, 0x2b, 0xc3, 0xb7, 0xee, 0x9a, 0xaa, 0xaf, 0xeb, 0xd9, 0x55, 0x33, 0x03, + 0xf7, 0xac, 0x36, 0x31, 0x19, 0xd1, 0x89, 0x41, 0x98, 0x7d, 0x98, 0x6f, 0xdb, 0x16, 0xb3, 0xf2, + 0x7c, 0x4d, 0x1b, 0x4e, 0x7e, 0xff, 0xbe, 0xbf, 0xcc, 0x89, 0x07, 0x68, 0xf6, 0x18, 0xb7, 0x24, + 0xe6, 0x7c, 0x96, 0xfd, 0xfb, 0xd3, 0x93, 0x2d, 0xab, 0x65, 0x49, 0x0c, 0xbe, 0x92, 0x0c, 0xd3, + 0x77, 0x83, 0xce, 0x68, 0x58, 0x86, 0x61, 0x99, 0xfc, 0x08, 0xb9, 0xf2, 0x78, 0x73, 0x41, 0xbc, + 0x36, 0x71, 0x2c, 0xd7, 0x6e, 0x10, 0xce, 0xed, 0xaf, 0x25, 0x7f, 0x96, 0x42, 0x6a, 0x5d, 0x9e, + 0x5f, 0xc2, 0x0c, 0xa3, 0xa7, 0x90, 0xf6, 0x19, 0x34, 0x4f, 0xaf, 0x8c, 0x32, 0x17, 0x59, 0x48, + 0x2d, 0xe6, 0x73, 0x67, 0xeb, 0x9e, 0x53, 0x3d, 0x39, 0x0f, 0x4e, 0x9d, 0xb0, 0x8f, 0x13, 0xb2, + 0xaf, 0xc2, 0x30, 0xd1, 0xc7, 0x84, 0xd6, 0x20, 0xe1, 0xb3, 0x65, 0x94, 0x39, 0x65, 0x21, 0xb5, + 0xf8, 0xd3, 0xc0, 0x73, 0x3a, 0x5a, 0xf7, 0x1c, 0x54, 0x1c, 0x79, 0xfd, 0xf6, 0x66, 0x48, 0xed, + 0x00, 0xa0, 0x57, 0x0a, 0xdc, 0xa4, 0xa6, 0xc3, 0x6c, 0xd7, 0x20, 0x26, 0xc3, 0x8c, 0x5a, 0xa6, + 0xa6, 0xd3, 0xba, 0x8d, 0xed, 0xc3, 0x8e, 0x31, 0x61, 0x61, 0xcc, 0xc3, 0x41, 0xc6, 0x54, 0x8e, + 0xc3, 0x54, 0x25, 0x8a, 0x6f, 0xda, 0x0c, 0x3d, 0xeb, 0x31, 0x9a, 0x01, 0x70, 0x1a, 0x2f, 0x88, + 0x81, 0x35, 0xd7, 0xd6, 0x33, 0x91, 0x39, 0x65, 0x21, 0xa9, 0x26, 0x25, 0x65, 0xc7, 0xd6, 0xb3, + 0xdf, 0x29, 0x30, 0x73, 0x26, 0x3e, 0x62, 0x70, 0xe3, 0x14, 0x3b, 0x3c, 0x27, 0x3d, 0x08, 0xd4, + 0xdf, 0x4b, 0x84, 0x53, 0xd5, 0xf7, 0x1c, 0x36, 0x15, 0xac, 0x3d, 0x7a, 0x04, 0xf1, 0xe3, 0x5e, + 0xba, 0x33, 0xc8, 0x4b, 0x52, 0x5f, 0xd5, 0x17, 0x1b, 0x64, 0xf8, 0x7f, 0xa2, 0x10, 0x93, 0x22, + 0x08, 0xc1, 0x88, 0x89, 0x0d, 0x19, 0xf3, 0xa4, 0x2a, 0xd6, 0x68, 0x0e, 0x52, 0x4d, 0xe2, 0x34, + 0x6c, 0xda, 0xe6, 0x5a, 0x65, 0xc2, 0xe2, 0x51, 0x2f, 0x89, 0x4b, 0xb9, 0x26, 0x65, 0x1e, 0xb2, + 0x58, 0xa3, 0x35, 0x48, 0x52, 0x93, 0x69, 0x2d, 0xec, 0xb6, 0x48, 0x66, 0x44, 0x78, 0x67, 0x61, + 0x70, 0x74, 0xd9, 0x0a, 0xe7, 0x2f, 0x86, 0x33, 0xca, 0x6a, 0x48, 0x4d, 0x50, 0x6f, 0x8f, 0x1e, + 0x42, 0x54, 0x02, 0x45, 0x05, 0xd0, 0x4f, 0x06, 0x01, 0x09, 0xa9, 0xd5, 0x90, 0x2a, 0xa5, 0x50, + 0x19, 0xe2, 0x5c, 0x17, 0xc7, 0x35, 0x32, 0x31, 0x01, 0x70, 0x67, 0x08, 0x4d, 0xb6, 0x5d, 0xc3, + 0xd3, 0x23, 0x46, 0xc5, 0x0e, 0xfd, 0x06, 0x22, 0x1c, 0x22, 0x2e, 0x20, 0x6e, 0x0f, 0x82, 0xd8, + 0x76, 0x8d, 0xd5, 0x90, 0xca, 0x25, 0xd0, 0x1f, 0x61, 0x8c, 0x9f, 0xff, 0x82, 0x3a, 0xcc, 0x6a, + 0xd9, 0xd8, 0xc8, 0x24, 0x04, 0xc4, 0xbd, 0x21, 0xb4, 0x58, 0xf5, 0x65, 0x3c, 0x5d, 0x46, 0x69, + 0x0f, 0x0d, 0x55, 0x20, 0xd9, 0x05, 0x4d, 0x9e, 0x51, 0xa7, 0x3d, 0xa0, 0x1d, 0xe9, 0xd5, 0x90, + 0xda, 0x95, 0x46, 0x2f, 0xe1, 0x3a, 0x39, 0x68, 0x5b, 0x26, 0x31, 0x19, 0xc5, 0x7a, 0x8f, 0xae, + 0x20, 0x60, 0x7f, 0x35, 0x08, 0xb6, 0xdc, 0x15, 0xee, 0x3d, 0x61, 0x92, 0x04, 0xd0, 0xd1, 0x12, + 0xc4, 0x1d, 0xd7, 0x30, 0x78, 0xe1, 0xa4, 0x04, 0xfc, 0xfc, 0x10, 0xde, 0xe4, 0xec, 0xab, 0x21, + 0xd5, 0x97, 0x2c, 0xc6, 0x60, 0xa4, 0x89, 0x19, 0xce, 0x3e, 0x81, 0xa8, 0xcc, 0x92, 0x2d, 0x48, + 0x71, 0x82, 0xd6, 0xb6, 0xa8, 0xc9, 0x86, 0xbe, 0x1f, 0x37, 0x5c, 0xa3, 0x4e, 0x6c, 0x7e, 0xcb, + 0x6e, 0x71, 0x39, 0x15, 0x9a, 0xfe, 0xd2, 0xc9, 0x7e, 0xad, 0x40, 0x84, 0x47, 0xfe, 0xd2, 0x91, + 0x91, 0x05, 0x37, 0x70, 0xab, 0x65, 0x93, 0x96, 0xbc, 0x46, 0x18, 0x31, 0xda, 0x96, 0x8d, 0x75, + 0xca, 0x0e, 0x45, 0x81, 0x8d, 0x2f, 0xfe, 0x7a, 0x10, 0x7a, 0xa1, 0x2b, 0x5e, 0xeb, 0x4a, 0xab, + 0x53, 0x38, 0x90, 0x8e, 0x6e, 0xc1, 0x28, 0x75, 0x34, 0xc3, 0x32, 0x2d, 0x66, 0x99, 0xb4, 0x21, + 0x6a, 0x35, 0xa1, 0xa6, 0xa8, 0xb3, 0xee, 0x93, 0xb2, 0xff, 0x55, 0x20, 0xd9, 0x8d, 0xd1, 0x76, + 0x90, 0xcd, 0x8b, 0x43, 0x67, 0xd7, 0xd5, 0x30, 0x3b, 0xfb, 0xa5, 0x02, 0x93, 0x41, 0xa9, 0x89, + 0x9e, 0x07, 0x99, 0xf7, 0xf0, 0x7d, 0xb2, 0xfc, 0x8a, 0x58, 0xfa, 0x0c, 0xe2, 0x5e, 0x91, 0xa0, + 0xc7, 0x41, 0xb6, 0xfd, 0x62, 0xc8, 0x12, 0x0b, 0xae, 0x84, 0x7f, 0x47, 0x60, 0xa2, 0x2f, 0x9f, + 0xd1, 0x3a, 0x00, 0x66, 0xcc, 0xa6, 0x75, 0x97, 0x11, 0x27, 0x13, 0x17, 0xa7, 0xcc, 0x0f, 0xe8, + 0x80, 0x6b, 0xe4, 0x70, 0x17, 0xeb, 0xae, 0x3f, 0x24, 0xf4, 0x00, 0xa0, 0x75, 0x88, 0xe9, 0xb8, + 0x4e, 0x74, 0x5f, 0xe1, 0x9f, 0x0f, 0x80, 0xda, 0x66, 0x36, 0x35, 0x5b, 0x1d, 0xc0, 0x18, 0x07, + 0xcc, 0x28, 0xaa, 0x07, 0x82, 0xf2, 0x30, 0xe9, 0x30, 0x6c, 0x33, 0x8d, 0x51, 0x83, 0x68, 0xae, + 0x49, 0x0f, 0x34, 0x13, 0x9b, 0x96, 0xf0, 0x7e, 0x4c, 0xbd, 0x26, 0x9e, 0xd5, 0xa8, 0x41, 0x76, + 0x4c, 0x7a, 0xb0, 0x81, 0x4d, 0x0b, 0xfd, 0x18, 0xc6, 0xfb, 0x58, 0x23, 0x82, 0x75, 0x94, 0xf5, + 0x72, 0xcd, 0x40, 0x12, 0x3b, 0x5a, 0xd3, 0x72, 0xeb, 0xba, 0xec, 0x6b, 0xa2, 0x53, 0x61, 0xa7, + 0x24, 0x28, 0xe8, 0x06, 0xc4, 0xb0, 0xa3, 0x51, 0x93, 0x89, 0x4e, 0x93, 0xe6, 0x3d, 0x08, 0x3b, + 0x15, 0x93, 0xa1, 0x2a, 0x24, 0xc9, 0x01, 0x31, 0xda, 0x3a, 0xb6, 0x9d, 0x4c, 0x54, 0x18, 0xb8, + 0x30, 0x38, 0xdb, 0xa4, 0x80, 0xe7, 0xac, 0x2e, 0x00, 0x9a, 0x84, 0xe8, 0x9e, 0x8e, 0x5b, 0x8e, + 0xe8, 0x24, 0x63, 0xaa, 0xdc, 0x14, 0xe3, 0x10, 0xdd, 0xe7, 0xbe, 0xc8, 0x1e, 0x45, 0x00, 0x9d, + 0xcc, 0xcf, 0xbe, 0x80, 0x25, 0x3f, 0x8d, 0x80, 0x4d, 0x42, 0xb4, 0x61, 0xb9, 0x26, 0x13, 0xc1, + 0x8a, 0xa9, 0x72, 0x83, 0xd2, 0xb2, 0x97, 0xf3, 0x79, 0x42, 0x91, 0x4d, 0xfa, 0x36, 0x8c, 0xd5, + 0xdd, 0xc6, 0x4b, 0xc2, 0x34, 0xc1, 0xe1, 0x64, 0x62, 0x73, 0x11, 0x0e, 0x26, 0x89, 0x4b, 0x82, + 0x86, 0xe6, 0x61, 0x82, 0x1c, 0xb4, 0x75, 0xda, 0xa0, 0x4c, 0xab, 0x5b, 0xae, 0xd9, 0x94, 0x79, + 0xaf, 0xa8, 0xe3, 0x3e, 0xb9, 0x28, 0xa8, 0xc7, 0xc3, 0x9d, 0xb8, 0xb4, 0x70, 0x43, 0x4f, 0xb8, + 0xb3, 0xff, 0x8a, 0xc2, 0xcc, 0x99, 0x17, 0x52, 0x5f, 0xc0, 0x95, 0x8b, 0x06, 0xfc, 0x07, 0x8e, + 0xd0, 0x24, 0x44, 0x9d, 0x06, 0xd6, 0x89, 0x28, 0xad, 0x6b, 0xaa, 0xdc, 0xf0, 0xe1, 0xf6, 0x2f, + 0xc4, 0xb6, 0x64, 0xd4, 0xc4, 0x70, 0x16, 0x53, 0x93, 0x9c, 0x22, 0x42, 0x86, 0x5a, 0x90, 0x68, + 0x5b, 0x0e, 0x65, 0x74, 0x9f, 0x78, 0x63, 0x57, 0xf9, 0x42, 0x97, 0x7c, 0xae, 0x28, 0xf2, 0xc1, + 0xf1, 0xdf, 0x72, 0x7c, 0x70, 0x7e, 0x90, 0x29, 0xae, 0xe5, 0x7d, 0xe2, 0x8d, 0x62, 0x97, 0x7b, + 0x90, 0x0f, 0x1e, 0x9c, 0x0c, 0xc7, 0x13, 0x2e, 0x75, 0xc1, 0x84, 0x9b, 0x5e, 0x86, 0xb8, 0x77, + 0x3c, 0x9a, 0x82, 0x98, 0xb5, 0xb7, 0xe7, 0x10, 0x26, 0x5e, 0x0a, 0xae, 0xa9, 0xde, 0xee, 0x64, + 0xbd, 0xf0, 0x97, 0x93, 0x91, 0xe3, 0xf5, 0x92, 0xfd, 0x36, 0x02, 0xe9, 0xfe, 0xbe, 0xf2, 0x69, + 0xf6, 0x8d, 0x61, 0x93, 0x9c, 0xc2, 0xc4, 0x9f, 0x5d, 0x6c, 0x32, 0xaa, 0x13, 0x4d, 0x5c, 0xe6, + 0xf2, 0x22, 0x4a, 0x2d, 0x3e, 0x3a, 0x6f, 0xff, 0xce, 0x09, 0xfb, 0x0a, 0xec, 0xb1, 0x07, 0xa7, + 0x8e, 0xfb, 0xc0, 0xe2, 0xc1, 0x29, 0x4d, 0x64, 0x7a, 0x09, 0x26, 0xfa, 0x04, 0xd1, 0x34, 0x24, + 0x7c, 0x51, 0x91, 0x04, 0x8a, 0xda, 0xd9, 0x73, 0x10, 0xa1, 0xa6, 0xf0, 0x8f, 0xa2, 0x7a, 0x0d, + 0xe8, 0xab, 0x08, 0x24, 0xfc, 0xec, 0x42, 0xcf, 0xe1, 0x47, 0x7b, 0x54, 0x67, 0xc4, 0x26, 0x4d, + 0xed, 0xa2, 0x81, 0x47, 0x3e, 0x52, 0xa1, 0x9b, 0x00, 0xcf, 0x61, 0xa2, 0x83, 0x7f, 0x19, 0x99, + 0x30, 0xee, 0xa3, 0x55, 0x65, 0x46, 0x9c, 0x0c, 0x70, 0x78, 0xd0, 0x60, 0x10, 0x19, 0x7e, 0x30, + 0x78, 0x02, 0x71, 0xa7, 0x8d, 0x4d, 0x8d, 0x36, 0x45, 0x6a, 0x8c, 0x16, 0x1f, 0x71, 0x35, 0xfe, + 0xff, 0xf6, 0xe6, 0x6f, 0x5b, 0x56, 0x9f, 0xfe, 0xd4, 0xca, 0x37, 0x2c, 0x5d, 0x27, 0x0d, 0x66, + 0xd9, 0x79, 0xc3, 0x6a, 0x12, 0x3d, 0x4f, 0x4d, 0x46, 0x6c, 0x13, 0xeb, 0x79, 0x3e, 0xab, 0xe5, + 0xb6, 0xdb, 0xd8, 0xac, 0x94, 0xd4, 0x18, 0x07, 0xac, 0x34, 0xd1, 0x33, 0x48, 0x30, 0x1b, 0x37, + 0x08, 0xc7, 0x8e, 0x0a, 0xec, 0x82, 0x87, 0xfd, 0xbb, 0xf3, 0x63, 0xd7, 0x38, 0x52, 0xa5, 0xa4, + 0xc6, 0x05, 0x64, 0xa5, 0xd9, 0x9d, 0x36, 0xfe, 0x19, 0x86, 0xd1, 0x8a, 0xc9, 0xba, 0x05, 0xbe, + 0x76, 0xb1, 0x8a, 0x94, 0x91, 0xfe, 0xf0, 0xf5, 0x28, 0xf3, 0x96, 0x3b, 0x3d, 0xed, 0xe5, 0x2d, + 0xda, 0x3c, 0x39, 0xa5, 0xfd, 0x6c, 0x88, 0xb7, 0xf4, 0x53, 0x2f, 0xd2, 0xdf, 0x87, 0x33, 0x4a, + 0xf6, 0x4f, 0x90, 0xf0, 0xbf, 0x6c, 0xa0, 0xf5, 0xa0, 0xd1, 0x7c, 0x98, 0x0f, 0x01, 0x81, 0x63, + 0xb9, 0x80, 0xff, 0x46, 0x81, 0x98, 0xfc, 0x5e, 0x71, 0xc9, 0xe8, 0x57, 0xf1, 0x25, 0x55, 0x58, + 0xfc, 0xd7, 0x08, 0x5c, 0xef, 0xfd, 0x36, 0xf2, 0xd1, 0x65, 0xde, 0xd9, 0x9d, 0x20, 0xfd, 0x21, + 0x06, 0xd2, 0xcd, 0x93, 0x03, 0xe9, 0xc5, 0x33, 0xfb, 0x33, 0x45, 0x54, 0x7e, 0xf7, 0xad, 0x7a, + 0x37, 0x28, 0x01, 0x1f, 0x9c, 0xe7, 0x3b, 0xd7, 0xd5, 0xc8, 0x44, 0x61, 0xdd, 0x17, 0x61, 0x48, + 0xf5, 0xb8, 0x00, 0x3d, 0xbb, 0xa4, 0x3e, 0x23, 0x5d, 0xf9, 0x7e, 0x5d, 0xa6, 0x73, 0x6d, 0x45, + 0x7a, 0xaf, 0xad, 0x8f, 0xb5, 0x87, 0x70, 0x37, 0xdf, 0xfd, 0x9b, 0x02, 0x53, 0xc1, 0xd1, 0x41, + 0xf3, 0x70, 0xbb, 0xb0, 0xb2, 0xa2, 0x96, 0x57, 0x0a, 0xb5, 0xca, 0xe6, 0x86, 0x56, 0x2b, 0xaf, + 0x6f, 0x6d, 0xaa, 0x85, 0x6a, 0xa5, 0xf6, 0x44, 0xdb, 0xd9, 0xd8, 0xde, 0x2a, 0x2f, 0x55, 0x96, + 0x2b, 0xe5, 0x52, 0x3a, 0x84, 0x6e, 0xc1, 0xcc, 0x69, 0x8c, 0xa5, 0x72, 0xb5, 0x56, 0x48, 0x2b, + 0xe8, 0x0e, 0x64, 0x4f, 0x63, 0x59, 0xda, 0x59, 0xdf, 0xa9, 0x16, 0x6a, 0x95, 0xdd, 0x72, 0x3a, + 0x7c, 0xf7, 0x0f, 0x30, 0xde, 0xc9, 0xc1, 0x65, 0x31, 0x5a, 0x8f, 0x41, 0x72, 0xb9, 0x5a, 0x58, + 0xd1, 0x36, 0x36, 0x37, 0xca, 0xe9, 0x10, 0x9a, 0x86, 0x29, 0x6f, 0xab, 0xa9, 0xe5, 0xa5, 0x4d, + 0xb5, 0x54, 0x2e, 0x69, 0xbb, 0x85, 0xea, 0x4e, 0x39, 0xad, 0x14, 0xff, 0xa1, 0xbc, 0x7e, 0x37, + 0xab, 0xbc, 0x79, 0x37, 0xab, 0x7c, 0xfe, 0x6e, 0x56, 0xf9, 0xfb, 0xd1, 0x6c, 0xe8, 0xcd, 0xd1, + 0x6c, 0xe8, 0x7f, 0x47, 0xb3, 0x21, 0xb8, 0x45, 0xad, 0x01, 0x39, 0x5a, 0x1c, 0xf5, 0x7e, 0x34, + 0x6c, 0xf1, 0x07, 0x5b, 0xca, 0xd3, 0xf2, 0xb9, 0x3d, 0x2c, 0x7f, 0x2c, 0xb5, 0x88, 0xd9, 0xf3, + 0xaf, 0xab, 0x1e, 0x13, 0xc4, 0x5f, 0x7e, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x3b, 0xe0, 0x1c, 0x00, + 0x14, 0x1b, 0x00, 0x00, } func (m *MetricsData) Marshal() (dAtA []byte, err error) { @@ -3308,30 +3308,26 @@ func (m *ExponentialHistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x50 } - if m.Negative != nil { - { - size, err := m.Negative.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) + { + size, err := m.Negative.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x4a + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) } - if m.Positive != nil { - { - size, err := m.Positive.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + { + size, err := m.Positive.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x42 + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x42 if m.ZeroCount != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.ZeroCount)) @@ -4444,14 +4440,10 @@ func (m *ExponentialHistogramDataPoint) Size() (n int) { if m.ZeroCount != 0 { n += 9 } - if m.Positive != nil { - l = m.Positive.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - if m.Negative != nil { - l = m.Negative.Size() - n += 1 + l + sovMetrics(uint64(l)) - } + l = m.Positive.Size() + n += 1 + l + sovMetrics(uint64(l)) + l = m.Negative.Size() + n += 1 + l + sovMetrics(uint64(l)) if m.Flags != 0 { n += 1 + sovMetrics(uint64(m.Flags)) } @@ -6743,9 +6735,6 @@ func (m *ExponentialHistogramDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Positive == nil { - m.Positive = &ExponentialHistogramDataPoint_Buckets{} - } if err := m.Positive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -6779,9 +6768,6 @@ func (m *ExponentialHistogramDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Negative == nil { - m.Negative = &ExponentialHistogramDataPoint_Buckets{} - } if err := m.Negative.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/model/pdata/generated_metrics.go b/model/pdata/generated_metrics.go index 3e0f2555c97..01e3449ab45 100644 --- a/model/pdata/generated_metrics.go +++ b/model/pdata/generated_metrics.go @@ -728,6 +728,51 @@ func (ms Histogram) CopyTo(dest Histogram) { ms.DataPoints().CopyTo(dest.DataPoints()) } +// ExponentialHistogram represents the type of a metric that is calculated by aggregating +// as a ExponentialHistogram of all reported double measurements over a time interval. +// +// This is a reference type, if passed by value and callee modifies it the +// caller will see the modification. +// +// Must use NewExponentialHistogram function to create new instances. +// Important: zero-initialized instance is not valid for use. +// +type ExponentialHistogram struct { + orig *otlpmetrics.ExponentialHistogram +} + +func newExponentialHistogram(orig *otlpmetrics.ExponentialHistogram) ExponentialHistogram { + return ExponentialHistogram{orig: orig} +} + +// NewExponentialHistogram creates a new empty ExponentialHistogram. +// +// This must be used only in testing code since no "Set" method available. +func NewExponentialHistogram() ExponentialHistogram { + return newExponentialHistogram(&otlpmetrics.ExponentialHistogram{}) +} + +// AggregationTemporality returns the aggregationtemporality associated with this ExponentialHistogram. +func (ms ExponentialHistogram) AggregationTemporality() MetricAggregationTemporality { + return MetricAggregationTemporality((*ms.orig).AggregationTemporality) +} + +// SetAggregationTemporality replaces the aggregationtemporality associated with this ExponentialHistogram. +func (ms ExponentialHistogram) SetAggregationTemporality(v MetricAggregationTemporality) { + (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) +} + +// DataPoints returns the DataPoints associated with this ExponentialHistogram. +func (ms ExponentialHistogram) DataPoints() ExponentialHistogramDataPointSlice { + return newExponentialHistogramDataPointSlice(&(*ms.orig).DataPoints) +} + +// CopyTo copies all properties from the current struct to the dest. +func (ms ExponentialHistogram) CopyTo(dest ExponentialHistogram) { + dest.SetAggregationTemporality(ms.AggregationTemporality()) + ms.DataPoints().CopyTo(dest.DataPoints()) +} + // Summary represents the type of a metric that is calculated by aggregating as a Summary of all reported double measurements over a time interval. // // This is a reference type, if passed by value and callee modifies it the @@ -1254,6 +1299,323 @@ func (ms HistogramDataPoint) CopyTo(dest HistogramDataPoint) { dest.SetFlags(ms.Flags()) } +// ExponentialHistogramDataPointSlice logically represents a slice of ExponentialHistogramDataPoint. +// +// This is a reference type. If passed by value and callee modifies it, the +// caller will see the modification. +// +// Must use NewExponentialHistogramDataPointSlice function to create new instances. +// Important: zero-initialized instance is not valid for use. +type ExponentialHistogramDataPointSlice struct { + // orig points to the slice otlpmetrics.ExponentialHistogramDataPoint field contained somewhere else. + // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. + orig *[]*otlpmetrics.ExponentialHistogramDataPoint +} + +func newExponentialHistogramDataPointSlice(orig *[]*otlpmetrics.ExponentialHistogramDataPoint) ExponentialHistogramDataPointSlice { + return ExponentialHistogramDataPointSlice{orig} +} + +// NewExponentialHistogramDataPointSlice creates a ExponentialHistogramDataPointSlice with 0 elements. +// Can use "EnsureCapacity" to initialize with a given capacity. +func NewExponentialHistogramDataPointSlice() ExponentialHistogramDataPointSlice { + orig := []*otlpmetrics.ExponentialHistogramDataPoint(nil) + return ExponentialHistogramDataPointSlice{&orig} +} + +// Len returns the number of elements in the slice. +// +// Returns "0" for a newly instance created with "NewExponentialHistogramDataPointSlice()". +func (es ExponentialHistogramDataPointSlice) Len() int { + return len(*es.orig) +} + +// At returns the element at the given index. +// +// This function is used mostly for iterating over all the values in the slice: +// for i := 0; i < es.Len(); i++ { +// e := es.At(i) +// ... // Do something with the element +// } +func (es ExponentialHistogramDataPointSlice) At(ix int) ExponentialHistogramDataPoint { + return newExponentialHistogramDataPoint((*es.orig)[ix]) +} + +// CopyTo copies all elements from the current slice to the dest. +func (es ExponentialHistogramDataPointSlice) CopyTo(dest ExponentialHistogramDataPointSlice) { + srcLen := es.Len() + destCap := cap(*dest.orig) + if srcLen <= destCap { + (*dest.orig) = (*dest.orig)[:srcLen:destCap] + for i := range *es.orig { + newExponentialHistogramDataPoint((*es.orig)[i]).CopyTo(newExponentialHistogramDataPoint((*dest.orig)[i])) + } + return + } + origs := make([]otlpmetrics.ExponentialHistogramDataPoint, srcLen) + wrappers := make([]*otlpmetrics.ExponentialHistogramDataPoint, srcLen) + for i := range *es.orig { + wrappers[i] = &origs[i] + newExponentialHistogramDataPoint((*es.orig)[i]).CopyTo(newExponentialHistogramDataPoint(wrappers[i])) + } + *dest.orig = wrappers +} + +// EnsureCapacity is an operation that ensures the slice has at least the specified capacity. +// 1. If the newCap <= cap then no change in capacity. +// 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. +// +// Here is how a new ExponentialHistogramDataPointSlice can be initialized: +// es := NewExponentialHistogramDataPointSlice() +// es.EnsureCapacity(4) +// for i := 0; i < 4; i++ { +// e := es.AppendEmpty() +// // Here should set all the values for e. +// } +func (es ExponentialHistogramDataPointSlice) EnsureCapacity(newCap int) { + oldCap := cap(*es.orig) + if newCap <= oldCap { + return + } + + newOrig := make([]*otlpmetrics.ExponentialHistogramDataPoint, len(*es.orig), newCap) + copy(newOrig, *es.orig) + *es.orig = newOrig +} + +// AppendEmpty will append to the end of the slice an empty ExponentialHistogramDataPoint. +// It returns the newly added ExponentialHistogramDataPoint. +func (es ExponentialHistogramDataPointSlice) AppendEmpty() ExponentialHistogramDataPoint { + *es.orig = append(*es.orig, &otlpmetrics.ExponentialHistogramDataPoint{}) + return es.At(es.Len() - 1) +} + +// Sort sorts the ExponentialHistogramDataPoint elements within ExponentialHistogramDataPointSlice given the +// provided less function so that two instances of ExponentialHistogramDataPointSlice +// can be compared. +// +// Returns the same instance to allow nicer code like: +// lessFunc := func(a, b ExponentialHistogramDataPoint) bool { +// return a.Name() < b.Name() // choose any comparison here +// } +// assert.EqualValues(t, expected.Sort(lessFunc), actual.Sort(lessFunc)) +func (es ExponentialHistogramDataPointSlice) Sort(less func(a, b ExponentialHistogramDataPoint) bool) ExponentialHistogramDataPointSlice { + sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) + return es +} + +// MoveAndAppendTo moves all elements from the current slice and appends them to the dest. +// The current slice will be cleared. +func (es ExponentialHistogramDataPointSlice) MoveAndAppendTo(dest ExponentialHistogramDataPointSlice) { + if *dest.orig == nil { + // We can simply move the entire vector and avoid any allocations. + *dest.orig = *es.orig + } else { + *dest.orig = append(*dest.orig, *es.orig...) + } + *es.orig = nil +} + +// RemoveIf calls f sequentially for each element present in the slice. +// If f returns true, the element is removed from the slice. +func (es ExponentialHistogramDataPointSlice) RemoveIf(f func(ExponentialHistogramDataPoint) bool) { + newLen := 0 + for i := 0; i < len(*es.orig); i++ { + if f(es.At(i)) { + continue + } + if newLen == i { + // Nothing to move, element is at the right place. + newLen++ + continue + } + (*es.orig)[newLen] = (*es.orig)[i] + newLen++ + } + // TODO: Prevent memory leak by erasing truncated values. + *es.orig = (*es.orig)[:newLen] +} + +// ExponentialHistogramDataPoint is a single data point in a timeseries that describes the +// time-varying values of a ExponentialHistogram of double values. A ExponentialHistogram contains +// summary statistics for a population of values, it may optionally contain the +// distribution of those values across a set of buckets. +// +// This is a reference type, if passed by value and callee modifies it the +// caller will see the modification. +// +// Must use NewExponentialHistogramDataPoint function to create new instances. +// Important: zero-initialized instance is not valid for use. +// +type ExponentialHistogramDataPoint struct { + orig *otlpmetrics.ExponentialHistogramDataPoint +} + +func newExponentialHistogramDataPoint(orig *otlpmetrics.ExponentialHistogramDataPoint) ExponentialHistogramDataPoint { + return ExponentialHistogramDataPoint{orig: orig} +} + +// NewExponentialHistogramDataPoint creates a new empty ExponentialHistogramDataPoint. +// +// This must be used only in testing code since no "Set" method available. +func NewExponentialHistogramDataPoint() ExponentialHistogramDataPoint { + return newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}) +} + +// Attributes returns the Attributes associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Attributes() AttributeMap { + return newAttributeMap(&(*ms.orig).Attributes) +} + +// StartTimestamp returns the starttimestamp associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) StartTimestamp() Timestamp { + return Timestamp((*ms.orig).StartTimeUnixNano) +} + +// SetStartTimestamp replaces the starttimestamp associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetStartTimestamp(v Timestamp) { + (*ms.orig).StartTimeUnixNano = uint64(v) +} + +// Timestamp returns the timestamp associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Timestamp() Timestamp { + return Timestamp((*ms.orig).TimeUnixNano) +} + +// SetTimestamp replaces the timestamp associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetTimestamp(v Timestamp) { + (*ms.orig).TimeUnixNano = uint64(v) +} + +// Count returns the count associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Count() uint64 { + return (*ms.orig).Count +} + +// SetCount replaces the count associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetCount(v uint64) { + (*ms.orig).Count = v +} + +// Sum returns the sum associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Sum() float64 { + return (*ms.orig).Sum +} + +// SetSum replaces the sum associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetSum(v float64) { + (*ms.orig).Sum = v +} + +// Scale returns the scale associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Scale() int32 { + return int32((*ms.orig).Scale) +} + +// SetScale replaces the scale associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetScale(v int32) { + (*ms.orig).Scale = int32(v) +} + +// ZeroCount returns the zerocount associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) ZeroCount() uint64 { + return uint64((*ms.orig).ZeroCount) +} + +// SetZeroCount replaces the zerocount associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetZeroCount(v uint64) { + (*ms.orig).ZeroCount = uint64(v) +} + +// Positive returns the positive associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Positive() Buckets { + return newBuckets(&(*ms.orig).Positive) +} + +// Negative returns the negative associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Negative() Buckets { + return newBuckets(&(*ms.orig).Negative) +} + +// Exemplars returns the Exemplars associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Exemplars() ExemplarSlice { + return newExemplarSlice(&(*ms.orig).Exemplars) +} + +// Flags returns the flags associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) Flags() MetricDataPointFlags { + return MetricDataPointFlags((*ms.orig).Flags) +} + +// SetFlags replaces the flags associated with this ExponentialHistogramDataPoint. +func (ms ExponentialHistogramDataPoint) SetFlags(v MetricDataPointFlags) { + (*ms.orig).Flags = uint32(v) +} + +// CopyTo copies all properties from the current struct to the dest. +func (ms ExponentialHistogramDataPoint) CopyTo(dest ExponentialHistogramDataPoint) { + ms.Attributes().CopyTo(dest.Attributes()) + dest.SetStartTimestamp(ms.StartTimestamp()) + dest.SetTimestamp(ms.Timestamp()) + dest.SetCount(ms.Count()) + dest.SetSum(ms.Sum()) + dest.SetScale(ms.Scale()) + dest.SetZeroCount(ms.ZeroCount()) + ms.Positive().CopyTo(dest.Positive()) + ms.Negative().CopyTo(dest.Negative()) + ms.Exemplars().CopyTo(dest.Exemplars()) + dest.SetFlags(ms.Flags()) +} + +// Buckets are a set of bucket counts, encoded in a contiguous array of counts. +// +// This is a reference type, if passed by value and callee modifies it the +// caller will see the modification. +// +// Must use NewBuckets function to create new instances. +// Important: zero-initialized instance is not valid for use. +// +type Buckets struct { + orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets +} + +func newBuckets(orig *otlpmetrics.ExponentialHistogramDataPoint_Buckets) Buckets { + return Buckets{orig: orig} +} + +// NewBuckets creates a new empty Buckets. +// +// This must be used only in testing code since no "Set" method available. +func NewBuckets() Buckets { + return newBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}) +} + +// Offset returns the offset associated with this Buckets. +func (ms Buckets) Offset() int32 { + return int32((*ms.orig).Offset) +} + +// SetOffset replaces the offset associated with this Buckets. +func (ms Buckets) SetOffset(v int32) { + (*ms.orig).Offset = int32(v) +} + +// BucketCounts returns the bucketcounts associated with this Buckets. +func (ms Buckets) BucketCounts() []uint64 { + return (*ms.orig).BucketCounts +} + +// SetBucketCounts replaces the bucketcounts associated with this Buckets. +func (ms Buckets) SetBucketCounts(v []uint64) { + (*ms.orig).BucketCounts = v +} + +// CopyTo copies all properties from the current struct to the dest. +func (ms Buckets) CopyTo(dest Buckets) { + dest.SetOffset(ms.Offset()) + dest.SetBucketCounts(ms.BucketCounts()) +} + // SummaryDataPointSlice logically represents a slice of SummaryDataPoint. // // This is a reference type. If passed by value and callee modifies it, the diff --git a/model/pdata/generated_metrics_test.go b/model/pdata/generated_metrics_test.go index 941a3c23f25..71b03c4cb04 100644 --- a/model/pdata/generated_metrics_test.go +++ b/model/pdata/generated_metrics_test.go @@ -507,6 +507,28 @@ func TestHistogram_DataPoints(t *testing.T) { assert.EqualValues(t, testValDataPoints, ms.DataPoints()) } +func TestExponentialHistogram_CopyTo(t *testing.T) { + ms := NewExponentialHistogram() + generateTestExponentialHistogram().CopyTo(ms) + assert.EqualValues(t, generateTestExponentialHistogram(), ms) +} + +func TestExponentialHistogram_AggregationTemporality(t *testing.T) { + ms := NewExponentialHistogram() + assert.EqualValues(t, MetricAggregationTemporalityUnspecified, ms.AggregationTemporality()) + testValAggregationTemporality := MetricAggregationTemporalityCumulative + ms.SetAggregationTemporality(testValAggregationTemporality) + assert.EqualValues(t, testValAggregationTemporality, ms.AggregationTemporality()) +} + +func TestExponentialHistogram_DataPoints(t *testing.T) { + ms := NewExponentialHistogram() + assert.EqualValues(t, NewExponentialHistogramDataPointSlice(), ms.DataPoints()) + fillTestExponentialHistogramDataPointSlice(ms.DataPoints()) + testValDataPoints := generateTestExponentialHistogramDataPointSlice() + assert.EqualValues(t, testValDataPoints, ms.DataPoints()) +} + func TestSummary_CopyTo(t *testing.T) { ms := NewSummary() generateTestSummary().CopyTo(ms) @@ -880,6 +902,228 @@ func TestHistogramDataPoint_Flags(t *testing.T) { assert.EqualValues(t, testValFlags, ms.Flags()) } +func TestExponentialHistogramDataPointSlice(t *testing.T) { + es := NewExponentialHistogramDataPointSlice() + assert.EqualValues(t, 0, es.Len()) + es = newExponentialHistogramDataPointSlice(&[]*otlpmetrics.ExponentialHistogramDataPoint{}) + assert.EqualValues(t, 0, es.Len()) + + es.EnsureCapacity(7) + emptyVal := newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}) + testVal := generateTestExponentialHistogramDataPoint() + assert.EqualValues(t, 7, cap(*es.orig)) + for i := 0; i < es.Len(); i++ { + el := es.AppendEmpty() + assert.EqualValues(t, emptyVal, el) + fillTestExponentialHistogramDataPoint(el) + assert.EqualValues(t, testVal, el) + } +} + +func TestExponentialHistogramDataPointSlice_CopyTo(t *testing.T) { + dest := NewExponentialHistogramDataPointSlice() + // Test CopyTo to empty + NewExponentialHistogramDataPointSlice().CopyTo(dest) + assert.EqualValues(t, NewExponentialHistogramDataPointSlice(), dest) + + // Test CopyTo larger slice + generateTestExponentialHistogramDataPointSlice().CopyTo(dest) + assert.EqualValues(t, generateTestExponentialHistogramDataPointSlice(), dest) + + // Test CopyTo same size slice + generateTestExponentialHistogramDataPointSlice().CopyTo(dest) + assert.EqualValues(t, generateTestExponentialHistogramDataPointSlice(), dest) +} + +func TestExponentialHistogramDataPointSlice_EnsureCapacity(t *testing.T) { + es := generateTestExponentialHistogramDataPointSlice() + // Test ensure smaller capacity. + const ensureSmallLen = 4 + expectedEs := make(map[*otlpmetrics.ExponentialHistogramDataPoint]bool) + for i := 0; i < es.Len(); i++ { + expectedEs[es.At(i).orig] = true + } + assert.Equal(t, es.Len(), len(expectedEs)) + es.EnsureCapacity(ensureSmallLen) + assert.Less(t, ensureSmallLen, es.Len()) + foundEs := make(map[*otlpmetrics.ExponentialHistogramDataPoint]bool, es.Len()) + for i := 0; i < es.Len(); i++ { + foundEs[es.At(i).orig] = true + } + assert.EqualValues(t, expectedEs, foundEs) + + // Test ensure larger capacity + const ensureLargeLen = 9 + oldLen := es.Len() + expectedEs = make(map[*otlpmetrics.ExponentialHistogramDataPoint]bool, oldLen) + for i := 0; i < oldLen; i++ { + expectedEs[es.At(i).orig] = true + } + assert.Equal(t, oldLen, len(expectedEs)) + es.EnsureCapacity(ensureLargeLen) + assert.Equal(t, ensureLargeLen, cap(*es.orig)) + foundEs = make(map[*otlpmetrics.ExponentialHistogramDataPoint]bool, oldLen) + for i := 0; i < oldLen; i++ { + foundEs[es.At(i).orig] = true + } + assert.EqualValues(t, expectedEs, foundEs) +} + +func TestExponentialHistogramDataPointSlice_MoveAndAppendTo(t *testing.T) { + // Test MoveAndAppendTo to empty + expectedSlice := generateTestExponentialHistogramDataPointSlice() + dest := NewExponentialHistogramDataPointSlice() + src := generateTestExponentialHistogramDataPointSlice() + src.MoveAndAppendTo(dest) + assert.EqualValues(t, generateTestExponentialHistogramDataPointSlice(), dest) + assert.EqualValues(t, 0, src.Len()) + assert.EqualValues(t, expectedSlice.Len(), dest.Len()) + + // Test MoveAndAppendTo empty slice + src.MoveAndAppendTo(dest) + assert.EqualValues(t, generateTestExponentialHistogramDataPointSlice(), dest) + assert.EqualValues(t, 0, src.Len()) + assert.EqualValues(t, expectedSlice.Len(), dest.Len()) + + // Test MoveAndAppendTo not empty slice + generateTestExponentialHistogramDataPointSlice().MoveAndAppendTo(dest) + assert.EqualValues(t, 2*expectedSlice.Len(), dest.Len()) + for i := 0; i < expectedSlice.Len(); i++ { + assert.EqualValues(t, expectedSlice.At(i), dest.At(i)) + assert.EqualValues(t, expectedSlice.At(i), dest.At(i+expectedSlice.Len())) + } +} + +func TestExponentialHistogramDataPointSlice_RemoveIf(t *testing.T) { + // Test RemoveIf on empty slice + emptySlice := NewExponentialHistogramDataPointSlice() + emptySlice.RemoveIf(func(el ExponentialHistogramDataPoint) bool { + t.Fail() + return false + }) + + // Test RemoveIf + filtered := generateTestExponentialHistogramDataPointSlice() + pos := 0 + filtered.RemoveIf(func(el ExponentialHistogramDataPoint) bool { + pos++ + return pos%3 == 0 + }) + assert.Equal(t, 5, filtered.Len()) +} + +func TestExponentialHistogramDataPoint_CopyTo(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + generateTestExponentialHistogramDataPoint().CopyTo(ms) + assert.EqualValues(t, generateTestExponentialHistogramDataPoint(), ms) +} + +func TestExponentialHistogramDataPoint_Attributes(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, NewAttributeMap(), ms.Attributes()) + fillTestAttributeMap(ms.Attributes()) + testValAttributes := generateTestAttributeMap() + assert.EqualValues(t, testValAttributes, ms.Attributes()) +} + +func TestExponentialHistogramDataPoint_StartTimestamp(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, Timestamp(0), ms.StartTimestamp()) + testValStartTimestamp := Timestamp(1234567890) + ms.SetStartTimestamp(testValStartTimestamp) + assert.EqualValues(t, testValStartTimestamp, ms.StartTimestamp()) +} + +func TestExponentialHistogramDataPoint_Timestamp(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, Timestamp(0), ms.Timestamp()) + testValTimestamp := Timestamp(1234567890) + ms.SetTimestamp(testValTimestamp) + assert.EqualValues(t, testValTimestamp, ms.Timestamp()) +} + +func TestExponentialHistogramDataPoint_Count(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, uint64(0), ms.Count()) + testValCount := uint64(17) + ms.SetCount(testValCount) + assert.EqualValues(t, testValCount, ms.Count()) +} + +func TestExponentialHistogramDataPoint_Sum(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, float64(0.0), ms.Sum()) + testValSum := float64(17.13) + ms.SetSum(testValSum) + assert.EqualValues(t, testValSum, ms.Sum()) +} + +func TestExponentialHistogramDataPoint_Scale(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, int32(0), ms.Scale()) + testValScale := int32(4) + ms.SetScale(testValScale) + assert.EqualValues(t, testValScale, ms.Scale()) +} + +func TestExponentialHistogramDataPoint_ZeroCount(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, uint64(0), ms.ZeroCount()) + testValZeroCount := uint64(201) + ms.SetZeroCount(testValZeroCount) + assert.EqualValues(t, testValZeroCount, ms.ZeroCount()) +} + +func TestExponentialHistogramDataPoint_Positive(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + fillTestBuckets(ms.Positive()) + assert.EqualValues(t, generateTestBuckets(), ms.Positive()) +} + +func TestExponentialHistogramDataPoint_Negative(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + fillTestBuckets(ms.Negative()) + assert.EqualValues(t, generateTestBuckets(), ms.Negative()) +} + +func TestExponentialHistogramDataPoint_Exemplars(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, NewExemplarSlice(), ms.Exemplars()) + fillTestExemplarSlice(ms.Exemplars()) + testValExemplars := generateTestExemplarSlice() + assert.EqualValues(t, testValExemplars, ms.Exemplars()) +} + +func TestExponentialHistogramDataPoint_Flags(t *testing.T) { + ms := NewExponentialHistogramDataPoint() + assert.EqualValues(t, MetricDataPointFlagsNone, ms.Flags()) + testValFlags := MetricDataPointFlagsNone + ms.SetFlags(testValFlags) + assert.EqualValues(t, testValFlags, ms.Flags()) +} + +func TestBuckets_CopyTo(t *testing.T) { + ms := NewBuckets() + generateTestBuckets().CopyTo(ms) + assert.EqualValues(t, generateTestBuckets(), ms) +} + +func TestBuckets_Offset(t *testing.T) { + ms := NewBuckets() + assert.EqualValues(t, int32(0), ms.Offset()) + testValOffset := int32(909) + ms.SetOffset(testValOffset) + assert.EqualValues(t, testValOffset, ms.Offset()) +} + +func TestBuckets_BucketCounts(t *testing.T) { + ms := NewBuckets() + assert.EqualValues(t, []uint64(nil), ms.BucketCounts()) + testValBucketCounts := []uint64{1, 2, 3} + ms.SetBucketCounts(testValBucketCounts) + assert.EqualValues(t, testValBucketCounts, ms.BucketCounts()) +} + func TestSummaryDataPointSlice(t *testing.T) { es := NewSummaryDataPointSlice() assert.EqualValues(t, 0, es.Len()) @@ -1451,6 +1695,17 @@ func fillTestHistogram(tv Histogram) { fillTestHistogramDataPointSlice(tv.DataPoints()) } +func generateTestExponentialHistogram() ExponentialHistogram { + tv := NewExponentialHistogram() + fillTestExponentialHistogram(tv) + return tv +} + +func fillTestExponentialHistogram(tv ExponentialHistogram) { + tv.SetAggregationTemporality(MetricAggregationTemporalityCumulative) + fillTestExponentialHistogramDataPointSlice(tv.DataPoints()) +} + func generateTestSummary() Summary { tv := NewSummary() fillTestSummary(tv) @@ -1523,6 +1778,51 @@ func fillTestHistogramDataPoint(tv HistogramDataPoint) { tv.SetFlags(MetricDataPointFlagsNone) } +func generateTestExponentialHistogramDataPointSlice() ExponentialHistogramDataPointSlice { + tv := NewExponentialHistogramDataPointSlice() + fillTestExponentialHistogramDataPointSlice(tv) + return tv +} + +func fillTestExponentialHistogramDataPointSlice(tv ExponentialHistogramDataPointSlice) { + l := 7 + tv.EnsureCapacity(l) + for i := 0; i < l; i++ { + fillTestExponentialHistogramDataPoint(tv.AppendEmpty()) + } +} + +func generateTestExponentialHistogramDataPoint() ExponentialHistogramDataPoint { + tv := NewExponentialHistogramDataPoint() + fillTestExponentialHistogramDataPoint(tv) + return tv +} + +func fillTestExponentialHistogramDataPoint(tv ExponentialHistogramDataPoint) { + fillTestAttributeMap(tv.Attributes()) + tv.SetStartTimestamp(Timestamp(1234567890)) + tv.SetTimestamp(Timestamp(1234567890)) + tv.SetCount(uint64(17)) + tv.SetSum(float64(17.13)) + tv.SetScale(int32(4)) + tv.SetZeroCount(uint64(201)) + fillTestBuckets(tv.Positive()) + fillTestBuckets(tv.Negative()) + fillTestExemplarSlice(tv.Exemplars()) + tv.SetFlags(MetricDataPointFlagsNone) +} + +func generateTestBuckets() Buckets { + tv := NewBuckets() + fillTestBuckets(tv) + return tv +} + +func fillTestBuckets(tv Buckets) { + tv.SetOffset(int32(909)) + tv.SetBucketCounts([]uint64{1, 2, 3}) +} + func generateTestSummaryDataPointSlice() SummaryDataPointSlice { tv := NewSummaryDataPointSlice() fillTestSummaryDataPointSlice(tv) diff --git a/proto_patch.sed b/proto_patch.sed index e4771945252..9758580f9c8 100644 --- a/proto_patch.sed +++ b/proto_patch.sed @@ -48,3 +48,6 @@ s+repeated IntExemplar exemplars = \(.*\);+repeated IntExemplar exemplars = \1\ s+repeated Exemplar exemplars = \(.*\);+repeated Exemplar exemplars = \1\ [ (gogoproto.nullable) = false ];+g + +s+Buckets \(.*\)tive = \(.*\);+Buckets \1tive = \2\ + [ (gogoproto.nullable) = false ];+g \ No newline at end of file From 398994224765c53b9856cdd2b5fb4ad692236752 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Date: Mon, 25 Oct 2021 20:31:33 -0400 Subject: [PATCH 086/149] Make receiver data delivery guarantees explicit (#4262) Resolves https://github.com/open-telemetry/opentelemetry-collector/issues/4261 We want to make this explicit and ensure all receivers follow this pattern. It is important for applications of the Collector where it is delivery guarantees are critical. The OTLP receiver correctly follows the guarantees. Other receivers may need to be audited to ensure compliance. --- component/receiver.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/component/receiver.go b/component/receiver.go index 18096f16de5..6e0b1cfcbd6 100644 --- a/component/receiver.go +++ b/component/receiver.go @@ -22,6 +22,15 @@ import ( ) // Receiver allows the collector to receive metrics, traces and logs. +// +// The receivers that receive data via a protocol that support acknowledgements +// MUST follow this order of operations: +// - Receive data from some sender (typically from a network). +// - Push received data to the pipeline by calling nextConsumer.Consume*() function. +// - Acknowledge successful data receipt to the sender if Consume*() succeeded or +// return a failure to the sender if Consume*() returned an error. +// This ensures there are strong delivery guarantees once the data is acknowledged +// by the Collector. type Receiver interface { Component } From c64e6aeb5131f8ec955ca8038c10e82992298f41 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 26 Oct 2021 02:33:52 +0200 Subject: [PATCH 087/149] Update links (#4246) --- docs/metric-metadata.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/metric-metadata.md b/docs/metric-metadata.md index 03b5d6dee20..4487df0c40b 100644 --- a/docs/metric-metadata.md +++ b/docs/metric-metadata.md @@ -4,7 +4,7 @@ Receivers can contain a `metadata.yaml` file that documents the metrics that may Current examples: -* [hostmetricsreceiver](../receiver/hostmetricsreceiver/metadata.yaml) +* hostmetricsreceiver scrapers like the [cpuscraper](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/metadata.yaml) See [metric-metadata.yaml](metric-metadata.yaml) for file format documentation. @@ -16,4 +16,4 @@ When `go generate` is run (it is run automatically in the make build targets) th `make install-tools` results in `cmd/mdatagen` being installed to `GOBIN` -[/receiver/hostmetricsreceiver/codegen.go](../receiver/hostmetricsreceiver/codegen.go) Runs `mdatagen` for the `hostmetricsreceiver` metadata.yaml which generates [/receiver/hostmetricsreceiver/internal/metadata](../receiver/hostmetricsreceiver/internal/metadata) package which has Go files containing metric and label metadata. +[/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/codegen.go](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/codegen.go) runs `mdatagen` for the `hostmetricsreceiver` metadata.yaml which generates the [/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver/internal/scraper/cpuscraper/internal/metadata) package which has Go files containing metric and label metadata. From 2cf0fbd916bf892f32f60e3ed02c47c97fb047a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Tue, 26 Oct 2021 18:29:12 +0200 Subject: [PATCH 088/149] Remove protocol-specific authenticator interfaces (#4255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove protocol-specific authenticator interfaces This PR removes the gRPC and HTTP-specific interfaces from the client authenticators. Implementations should now comply with the main top-level interface, which defines the functions previously defined at the individual interfaces. Fixes #4239 Signed-off-by: Juraci Paixão Kröhling * Changed test case description Signed-off-by: Juraci Paixão Kröhling --- CHANGELOG.md | 3 + config/configauth/clientauth.go | 12 +-- config/configauth/configauth.go | 27 ++---- config/configauth/configauth_test.go | 108 +++++++++++++++++----- config/configauth/mock_clientauth.go | 5 +- config/configauth/mock_serverauth.go | 18 ++-- config/configauth/mock_serverauth_test.go | 4 +- config/configgrpc/configgrpc.go | 2 +- config/configgrpc/configgrpc_test.go | 2 +- config/confighttp/confighttp.go | 2 +- 10 files changed, 113 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c02b9c860db..e3d193abaa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +## 🛑 Breaking changes 🛑 +- Removed `configauth.HTTPClientAuthenticator` and `configauth.GRPCClientAuthenticator` in favor of `configauth.ClientAuthenticator` (#4255) + ## 🛑 Breaking changes 🛑 - Rename `parserprovider.MapProvider` as `config.MapProvider` (#4178) diff --git a/config/configauth/clientauth.go b/config/configauth/clientauth.go index 5bd384eafd2..c8944737fe1 100644 --- a/config/configauth/clientauth.go +++ b/config/configauth/clientauth.go @@ -27,18 +27,10 @@ import ( // names from the Authentication configuration. type ClientAuthenticator interface { component.Extension -} -// HTTPClientAuthenticator is a ClientAuthenticator that can be used as an authenticator -// for the configauth.Authentication option for HTTP clients. -type HTTPClientAuthenticator interface { - ClientAuthenticator + // RoundTripper returns a RoundTripper that can be used to authenticate HTTP requests. RoundTripper(base http.RoundTripper) (http.RoundTripper, error) -} -// GRPCClientAuthenticator is a ClientAuthenticator that can be used as an authenticator for -// the configauth.Authentication option for gRPC clients. -type GRPCClientAuthenticator interface { - ClientAuthenticator + // PerRPCCredentials returns a PerRPCCredentials that can be used to authenticate gRPC requests. PerRPCCredentials() (credentials.PerRPCCredentials, error) } diff --git a/config/configauth/configauth.go b/config/configauth/configauth.go index 1c2a96d0e56..92f53e2e85b 100644 --- a/config/configauth/configauth.go +++ b/config/configauth/configauth.go @@ -23,7 +23,9 @@ import ( ) var ( - errAuthenticatorNotFound = errors.New("authenticator not found") + errAuthenticatorNotFound = errors.New("authenticator not found") + errNotClientAuthenticator = errors.New("requested authenticator is not a client authenticator") + errNotServerAuthenticator = errors.New("requested authenticator is not a server authenticator") ) // Authentication defines the auth settings for the receiver. @@ -39,34 +41,21 @@ func (a Authentication) GetServerAuthenticator(extensions map[config.ComponentID if auth, ok := ext.(ServerAuthenticator); ok { return auth, nil } - return nil, fmt.Errorf("requested authenticator is not a server authenticator") + return nil, errNotServerAuthenticator } return nil, fmt.Errorf("failed to resolve authenticator %q: %w", a.AuthenticatorID, errAuthenticatorNotFound) } -// GetHTTPClientAuthenticator attempts to select the appropriate HTTPClientAuthenticator from the list of extensions, +// GetClientAuthenticator attempts to select the appropriate ClientAuthenticator from the list of extensions, // based on the component id of the extension. If an authenticator is not found, an error is returned. // This should be only used by HTTP clients. -func (a Authentication) GetHTTPClientAuthenticator(extensions map[config.ComponentID]component.Extension) (HTTPClientAuthenticator, error) { +func (a Authentication) GetClientAuthenticator(extensions map[config.ComponentID]component.Extension) (ClientAuthenticator, error) { if ext, found := extensions[a.AuthenticatorID]; found { - if auth, ok := ext.(HTTPClientAuthenticator); ok { + if auth, ok := ext.(ClientAuthenticator); ok { return auth, nil } - return nil, fmt.Errorf("requested authenticator is not a HTTPClientAuthenticator") - } - return nil, fmt.Errorf("failed to resolve authenticator %q: %w", a.AuthenticatorID, errAuthenticatorNotFound) -} - -// GetGRPCClientAuthenticator attempts to select the appropriate GRPCClientAuthenticator from the list of extensions, -// based on the component id of the extension. If an authenticator is not found, an error is returned. -// This should only be used by gRPC clients. -func (a Authentication) GetGRPCClientAuthenticator(extensions map[config.ComponentID]component.Extension) (GRPCClientAuthenticator, error) { - if ext, found := extensions[a.AuthenticatorID]; found { - if auth, ok := ext.(GRPCClientAuthenticator); ok { - return auth, nil - } - return nil, fmt.Errorf("requested authenticator is not a GRPCClientAuthenticator") + return nil, errNotClientAuthenticator } return nil, fmt.Errorf("failed to resolve authenticator %q: %w", a.AuthenticatorID, errAuthenticatorNotFound) } diff --git a/config/configauth/configauth_test.go b/config/configauth/configauth_test.go index 059523cb58c..9c91326c4b1 100644 --- a/config/configauth/configauth_test.go +++ b/config/configauth/configauth_test.go @@ -23,43 +23,103 @@ import ( "go.opentelemetry.io/collector/config" ) -func TestGetAuthenticator(t *testing.T) { - // prepare - cfg := &Authentication{ - AuthenticatorID: config.NewComponentID("mock"), +func TestGetServerAuthenticator(t *testing.T) { + testCases := []struct { + desc string + authenticator component.Extension + expected error + }{ + { + desc: "obtain server authenticator", + authenticator: &MockServerAuthenticator{}, + expected: nil, + }, + { + desc: "not a server authenticator", + authenticator: &MockClientAuthenticator{}, + expected: errNotServerAuthenticator, + }, } - ext := map[config.ComponentID]component.Extension{ - config.NewComponentID("mock"): &MockAuthenticator{}, + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + // prepare + cfg := &Authentication{ + AuthenticatorID: config.NewComponentID("mock"), + } + ext := map[config.ComponentID]component.Extension{ + config.NewComponentID("mock"): tC.authenticator, + } + + authenticator, err := cfg.GetServerAuthenticator(ext) + + // verify + if tC.expected != nil { + assert.ErrorIs(t, err, tC.expected) + assert.Nil(t, authenticator) + } else { + assert.NoError(t, err) + assert.NotNil(t, authenticator) + } + }) } +} - authenticator, err := cfg.GetServerAuthenticator(ext) +func TestGetServerAuthenticatorFails(t *testing.T) { + cfg := &Authentication{ + AuthenticatorID: config.NewComponentID("does-not-exist"), + } - // verify - assert.NoError(t, err) - assert.NotNil(t, authenticator) + authenticator, err := cfg.GetServerAuthenticator(map[config.ComponentID]component.Extension{}) + assert.ErrorIs(t, err, errAuthenticatorNotFound) + assert.Nil(t, authenticator) } -func TestGetAuthenticatorFails(t *testing.T) { +func TestGetClientAuthenticator(t *testing.T) { testCases := []struct { - desc string - cfg *Authentication - ext map[config.ComponentID]component.Extension - expected error + desc string + authenticator component.Extension + expected error }{ { - desc: "ServerAuthenticator not found", - cfg: &Authentication{ - AuthenticatorID: config.NewComponentID("does-not-exist"), - }, - ext: map[config.ComponentID]component.Extension{}, - expected: errAuthenticatorNotFound, + desc: "obtain client authenticator", + authenticator: &MockClientAuthenticator{}, + expected: nil, + }, + { + desc: "not a client authenticator", + authenticator: &MockServerAuthenticator{}, + expected: errNotClientAuthenticator, }, } for _, tC := range testCases { t.Run(tC.desc, func(t *testing.T) { - authenticator, err := tC.cfg.GetServerAuthenticator(tC.ext) - assert.ErrorIs(t, err, tC.expected) - assert.Nil(t, authenticator) + // prepare + cfg := &Authentication{ + AuthenticatorID: config.NewComponentID("mock"), + } + ext := map[config.ComponentID]component.Extension{ + config.NewComponentID("mock"): tC.authenticator, + } + + authenticator, err := cfg.GetClientAuthenticator(ext) + + // verify + if tC.expected != nil { + assert.ErrorIs(t, err, tC.expected) + assert.Nil(t, authenticator) + } else { + assert.NoError(t, err) + assert.NotNil(t, authenticator) + } }) } } + +func TestGetClientAuthenticatorFails(t *testing.T) { + cfg := &Authentication{ + AuthenticatorID: config.NewComponentID("does-not-exist"), + } + authenticator, err := cfg.GetClientAuthenticator(map[config.ComponentID]component.Extension{}) + assert.ErrorIs(t, err, errAuthenticatorNotFound) + assert.Nil(t, authenticator) +} diff --git a/config/configauth/mock_clientauth.go b/config/configauth/mock_clientauth.go index cd28cf999ea..a62ac041983 100644 --- a/config/configauth/mock_clientauth.go +++ b/config/configauth/mock_clientauth.go @@ -25,9 +25,8 @@ import ( ) var ( - _ HTTPClientAuthenticator = (*MockClientAuthenticator)(nil) - _ GRPCClientAuthenticator = (*MockClientAuthenticator)(nil) - errMockError = errors.New("mock Error") + _ ClientAuthenticator = (*MockClientAuthenticator)(nil) + errMockError = errors.New("mock Error") ) // MockClientAuthenticator provides a mock implementation of GRPCClientAuthenticator and HTTPClientAuthenticator interfaces diff --git a/config/configauth/mock_serverauth.go b/config/configauth/mock_serverauth.go index e8bf209a459..3fdd735fe1e 100644 --- a/config/configauth/mock_serverauth.go +++ b/config/configauth/mock_serverauth.go @@ -23,19 +23,19 @@ import ( ) var ( - _ ServerAuthenticator = (*MockAuthenticator)(nil) - _ component.Extension = (*MockAuthenticator)(nil) + _ ServerAuthenticator = (*MockServerAuthenticator)(nil) + _ component.Extension = (*MockServerAuthenticator)(nil) ) -// MockAuthenticator provides a testing mock for code dealing with authentication. -type MockAuthenticator struct { +// MockServerAuthenticator provides a testing mock for code dealing with authentication. +type MockServerAuthenticator struct { // AuthenticateFunc to use during the authentication phase of this mock. Optional. AuthenticateFunc AuthenticateFunc // TODO: implement the other funcs } // Authenticate executes the mock's AuthenticateFunc, if provided, or just returns the given context unchanged. -func (m *MockAuthenticator) Authenticate(ctx context.Context, headers map[string][]string) (context.Context, error) { +func (m *MockServerAuthenticator) Authenticate(ctx context.Context, headers map[string][]string) (context.Context, error) { if m.AuthenticateFunc == nil { return context.Background(), nil } @@ -43,21 +43,21 @@ func (m *MockAuthenticator) Authenticate(ctx context.Context, headers map[string } // GRPCUnaryServerInterceptor isn't currently implemented and always returns nil. -func (m *MockAuthenticator) GRPCUnaryServerInterceptor(context.Context, interface{}, *grpc.UnaryServerInfo, grpc.UnaryHandler) (interface{}, error) { +func (m *MockServerAuthenticator) GRPCUnaryServerInterceptor(context.Context, interface{}, *grpc.UnaryServerInfo, grpc.UnaryHandler) (interface{}, error) { return nil, nil } // GRPCStreamServerInterceptor isn't currently implemented and always returns nil. -func (m *MockAuthenticator) GRPCStreamServerInterceptor(interface{}, grpc.ServerStream, *grpc.StreamServerInfo, grpc.StreamHandler) error { +func (m *MockServerAuthenticator) GRPCStreamServerInterceptor(interface{}, grpc.ServerStream, *grpc.StreamServerInfo, grpc.StreamHandler) error { return nil } // Start isn't currently implemented and always returns nil. -func (m *MockAuthenticator) Start(context.Context, component.Host) error { +func (m *MockServerAuthenticator) Start(context.Context, component.Host) error { return nil } // Shutdown isn't currently implemented and always returns nil. -func (m *MockAuthenticator) Shutdown(ctx context.Context) error { +func (m *MockServerAuthenticator) Shutdown(ctx context.Context) error { return nil } diff --git a/config/configauth/mock_serverauth_test.go b/config/configauth/mock_serverauth_test.go index 329a406c907..3ae9efc37bb 100644 --- a/config/configauth/mock_serverauth_test.go +++ b/config/configauth/mock_serverauth_test.go @@ -23,7 +23,7 @@ import ( func TestAuthenticateFunc(t *testing.T) { // prepare - m := &MockAuthenticator{} + m := &MockServerAuthenticator{} called := false m.AuthenticateFunc = func(c context.Context, m map[string][]string) (context.Context, error) { called = true @@ -41,7 +41,7 @@ func TestAuthenticateFunc(t *testing.T) { func TestNilOperations(t *testing.T) { // prepare - m := &MockAuthenticator{} + m := &MockServerAuthenticator{} // test and verify origCtx := context.Background() diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index 3ba99ad8e35..9f58844452c 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -222,7 +222,7 @@ func (gcs *GRPCClientSettings) ToDialOptions(host component.Host) ([]grpc.DialOp return nil, fmt.Errorf("no extensions configuration available") } - grpcAuthenticator, cerr := gcs.Auth.GetGRPCClientAuthenticator(host.GetExtensions()) + grpcAuthenticator, cerr := gcs.Auth.GetClientAuthenticator(host.GetExtensions()) if cerr != nil { return nil, cerr } diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index b4fab3806e9..1c1c94b200c 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -137,7 +137,7 @@ func TestGrpcServerAuthSettings(t *testing.T) { } host := &mockHost{ ext: map[config.ComponentID]component.Extension{ - config.NewComponentID("mock"): &configauth.MockAuthenticator{}, + config.NewComponentID("mock"): &configauth.MockServerAuthenticator{}, }, } opts, err := gss.ToServerOption(host, componenttest.NewNopTelemetrySettings()) diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index f3d6d2c237b..423e70027a7 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -90,7 +90,7 @@ func (hcs *HTTPClientSettings) ToClient(ext map[config.ComponentID]component.Ext return nil, fmt.Errorf("extensions configuration not found") } - httpCustomAuthRoundTripper, aerr := hcs.Auth.GetHTTPClientAuthenticator(ext) + httpCustomAuthRoundTripper, aerr := hcs.Auth.GetClientAuthenticator(ext) if aerr != nil { return nil, aerr } From 28d64f76a440e12e8ff4dccd56446fabe9cb868d Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 26 Oct 2021 09:33:37 -0700 Subject: [PATCH 089/149] use archive instead of submodule (#4263) * remove opentelemetry-proto submodule * ensure opentelemetry-proto files are not checked in * cleanup comment --- .gitignore | 3 +++ .gitmodules | 3 --- Makefile | 16 ++++++++++++---- model/internal/opentelemetry-proto | 1 - 4 files changed, 15 insertions(+), 8 deletions(-) delete mode 160000 model/internal/opentelemetry-proto diff --git a/.gitignore b/.gitignore index 2b18e02802d..73d12f27d63 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ coverage.html # Wix *.wixobj *.wixpdb + +# OpenTelemetry proto files which are normally cleaned up +model/internal/opentelemetry-proto diff --git a/.gitmodules b/.gitmodules index 30647e69e3c..e69de29bb2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "model/internal/opentelemetry-proto"] - path = model/internal/opentelemetry-proto - url = https://github.com/open-telemetry/opentelemetry-proto diff --git a/Makefile b/Makefile index ebd8d457386..fad45afae25 100644 --- a/Makefile +++ b/Makefile @@ -307,6 +307,9 @@ gendependabot: $(eval SHELL:=/bin/bash) # The source directory for OTLP ProtoBufs. OPENTELEMETRY_PROTO_SRC_DIR=model/internal/opentelemetry-proto +# The SHA matching the current version of the proto to use +OPENTELEMETRY_PROTO_VERSION=v0.11.0 + # Find all .proto files. OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto)) @@ -323,13 +326,18 @@ DOCKER_PROTOBUF ?= otel/build-protobuf:0.4.1 PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD}/$(PROTO_INTERMEDIATE_DIR) ${DOCKER_PROTOBUF} --proto_path=${PWD} PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf -I./ +# Cleanup temporary directory +genproto-cleanup: + rm -Rf ${OPENTELEMETRY_PROTO_SRC_DIR} + # Generate OTLP Protobuf Go files. This will place generated files in PROTO_TARGET_GEN_DIR. -genproto: - git submodule update --init - # Call a sub-make to ensure OPENTELEMETRY_PROTO_FILES is populated after the submodule - # files are present. +genproto: genproto-cleanup + mkdir -p ${OPENTELEMETRY_PROTO_SRC_DIR} + curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-proto/tarball/${OPENTELEMETRY_PROTO_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_PROTO_SRC_DIR} + # Call a sub-make to ensure OPENTELEMETRY_PROTO_FILES is populated $(MAKE) genproto_sub $(MAKE) fmt + $(MAKE) genproto-cleanup genproto_sub: @echo Generating code for the following files: diff --git a/model/internal/opentelemetry-proto b/model/internal/opentelemetry-proto deleted file mode 160000 index b43e9b18b76..00000000000 --- a/model/internal/opentelemetry-proto +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b43e9b18b76abf3ee040164b55b9c355217151f3 From aaa0eb565c37b79671be8239a7689ea3fcd97cd4 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Date: Tue, 26 Oct 2021 13:07:09 -0400 Subject: [PATCH 090/149] Make sure otlphttp exporter tests include TraceID and SpanID (#4268) Related to https://github.com/open-telemetry/opentelemetry-collector/issues/4221 There was a report that TraceID and SpanID are correupted by otlphttp exporter. I added to TraceID and SpanID to try to reproduce the bug. The bug is not reproduced but keeping these in the test is useful. --- internal/testdata/trace.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/testdata/trace.go b/internal/testdata/trace.go index 516da1ccef4..afd866fecb0 100644 --- a/internal/testdata/trace.go +++ b/internal/testdata/trace.go @@ -101,6 +101,8 @@ func fillSpanOne(span pdata.Span) { span.SetStartTimestamp(TestSpanStartTimestamp) span.SetEndTimestamp(TestSpanEndTimestamp) span.SetDroppedAttributesCount(1) + span.SetTraceID(pdata.NewTraceID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10})) + span.SetSpanID(pdata.NewSpanID([8]byte{0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18})) evs := span.Events() ev0 := evs.AppendEmpty() ev0.SetTimestamp(TestSpanEventTimestamp) From 46c8e2290e45854aab8e62ed1b284b857ab2bda7 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 26 Oct 2021 11:09:46 -0700 Subject: [PATCH 091/149] Prove that issue 4221 is not an issue (#4269) Signed-off-by: Bogdan Drutu --- exporter/otlphttpexporter/otlp_test.go | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/exporter/otlphttpexporter/otlp_test.go b/exporter/otlphttpexporter/otlp_test.go index 530f971aef4..1b189697ec0 100644 --- a/exporter/otlphttpexporter/otlp_test.go +++ b/exporter/otlphttpexporter/otlp_test.go @@ -16,10 +16,14 @@ package otlphttpexporter import ( "context" + "encoding/base64" + "encoding/hex" "errors" "fmt" + "io/ioutil" "net" "net/http" + "net/http/httptest" "testing" "time" @@ -39,6 +43,7 @@ import ( "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/internal/testdata" "go.opentelemetry.io/collector/internal/testutil" + "go.opentelemetry.io/collector/model/otlpgrpc" "go.opentelemetry.io/collector/model/pdata" "go.opentelemetry.io/collector/receiver/otlpreceiver" ) @@ -292,6 +297,56 @@ func TestLogsRoundTrip(t *testing.T) { } } +func TestIssue_4221(t *testing.T) { + svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + defer func() { assert.NoError(t, r.Body.Close()) }() + data, err := ioutil.ReadAll(r.Body) + require.NoError(t, err) + base64Data := base64.StdEncoding.EncodeToString(data) + // Verify same base64 encoded string is received. + assert.Equal(t, "CscBCkkKIAoMc2VydmljZS5uYW1lEhAKDnVvcC5zdGFnZS1ldS0xCiUKGW91dHN5c3RlbXMubW9kdWxlLnZlcnNpb24SCAoGOTAzMzg2EnoKEQoMdW9wX2NhbmFyaWVzEgExEmUKEEMDhT8Ib0+Mhs8Zi2VR34QSCOVRPDJ5XEG5IgA5QE41aASRrxZBQE41aASRrxZKEAoKc3Bhbl9pbmRleBICGANKHwoNY29kZS5mdW5jdGlvbhIOCgxteUZ1bmN0aW9uMzZ6AA==", base64Data) + unbase64Data, err := base64.StdEncoding.DecodeString(base64Data) + require.NoError(t, err) + tr, err := otlpgrpc.UnmarshalTracesRequest(unbase64Data) + require.NoError(t, err) + span := tr.Traces().ResourceSpans().At(0).InstrumentationLibrarySpans().At(0).Spans().At(0) + assert.Equal(t, "4303853f086f4f8c86cf198b6551df84", span.TraceID().HexString()) + assert.Equal(t, "e5513c32795c41b9", span.SpanID().HexString()) + })) + + exp := startTracesExporter(t, "", svr.URL) + + md := pdata.NewTraces() + rms := md.ResourceSpans().AppendEmpty() + rms.Resource().Attributes().UpsertString("service.name", "uop.stage-eu-1") + rms.Resource().Attributes().UpsertString("outsystems.module.version", "903386") + ils := rms.InstrumentationLibrarySpans().AppendEmpty() + ils.InstrumentationLibrary().SetName("uop_canaries") + ils.InstrumentationLibrary().SetVersion("1") + span := ils.Spans().AppendEmpty() + + var traceIDBytes [16]byte + traceIDBytesSlice, err := hex.DecodeString("4303853f086f4f8c86cf198b6551df84") + require.NoError(t, err) + copy(traceIDBytes[:], traceIDBytesSlice) + span.SetTraceID(pdata.NewTraceID(traceIDBytes)) + assert.Equal(t, "4303853f086f4f8c86cf198b6551df84", span.TraceID().HexString()) + + var spanIDBytes [8]byte + spanIDBytesSlice, err := hex.DecodeString("e5513c32795c41b9") + require.NoError(t, err) + copy(spanIDBytes[:], spanIDBytesSlice) + span.SetSpanID(pdata.NewSpanID(spanIDBytes)) + assert.Equal(t, "e5513c32795c41b9", span.SpanID().HexString()) + + span.SetEndTimestamp(1634684637873000000) + span.Attributes().UpsertInt("span_index", 3) + span.Attributes().UpsertString("code.function", "myFunction36") + span.SetStartTimestamp(1634684637873000000) + + assert.NoError(t, exp.ConsumeTraces(context.Background(), md)) +} + func startTracesExporter(t *testing.T, baseURL string, overrideURL string) component.TracesExporter { factory := NewFactory() cfg := createExporterConfig(baseURL, factory.CreateDefaultConfig()) From 9488d4ca07108a1be68cc792c5c64c22a8fcdf87 Mon Sep 17 00:00:00 2001 From: Przemek Maciolek <58699843+pmm-sumo@users.noreply.github.com> Date: Wed, 27 Oct 2021 19:12:39 +0200 Subject: [PATCH 092/149] Extract source IP address into context for OTLP/HTTP (#4257) --- receiver/otlpreceiver/otlphttp.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/receiver/otlpreceiver/otlphttp.go b/receiver/otlpreceiver/otlphttp.go index dc5628b1a2a..dc5e2e91e7e 100644 --- a/receiver/otlpreceiver/otlphttp.go +++ b/receiver/otlpreceiver/otlphttp.go @@ -22,6 +22,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "go.opentelemetry.io/collector/client" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/logs" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metrics" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/trace" @@ -44,7 +45,12 @@ func handleTraces(resp http.ResponseWriter, req *http.Request, tracesReceiver *t return } - otlpResp, err := tracesReceiver.Export(req.Context(), otlpReq) + ctx := req.Context() + if c, ok := client.FromHTTP(req); ok { + ctx = client.NewContext(ctx, c) + } + + otlpResp, err := tracesReceiver.Export(ctx, otlpReq) if err != nil { writeError(resp, encoder, err, http.StatusInternalServerError) return @@ -70,7 +76,12 @@ func handleMetrics(resp http.ResponseWriter, req *http.Request, metricsReceiver return } - otlpResp, err := metricsReceiver.Export(req.Context(), otlpReq) + ctx := req.Context() + if c, ok := client.FromHTTP(req); ok { + ctx = client.NewContext(ctx, c) + } + + otlpResp, err := metricsReceiver.Export(ctx, otlpReq) if err != nil { writeError(resp, encoder, err, http.StatusInternalServerError) return @@ -96,7 +107,12 @@ func handleLogs(resp http.ResponseWriter, req *http.Request, logsReceiver *logs. return } - otlpResp, err := logsReceiver.Export(req.Context(), otlpReq) + ctx := req.Context() + if c, ok := client.FromHTTP(req); ok { + ctx = client.NewContext(ctx, c) + } + + otlpResp, err := logsReceiver.Export(ctx, otlpReq) if err != nil { writeError(resp, encoder, err, http.StatusInternalServerError) return From fd61bbbc9b5759b32f8e3218a522494c87ad008b Mon Sep 17 00:00:00 2001 From: Traian Schiau <55734665+trasc@users.noreply.github.com> Date: Wed, 27 Oct 2021 20:18:54 +0300 Subject: [PATCH 093/149] pdatagen - Add MoveTo method for struct types (#4240) * [pdatagen] Add MoveTo method for struct types * [pdatagen] Add MoveTo method for struct types - regenerate * [batchprocessor] Split benchmarks rework - Fix metric split benchmark - Ignore clone counters in split benchmarks * [batchprocessor] Use MoveTo in split * [batchprocessor] Skip long running split benchmarks * [batchprocessor] Improve coverage --- .../cmd/pdatagen/internal/base_structs.go | 15 +++ model/pdata/generated_common.go | 7 + model/pdata/generated_common_test.go | 8 ++ model/pdata/generated_log.go | 21 +++ model/pdata/generated_log_test.go | 24 ++++ model/pdata/generated_metrics.go | 105 +++++++++++++++ model/pdata/generated_metrics_test.go | 120 ++++++++++++++++++ model/pdata/generated_resource.go | 7 + model/pdata/generated_resource_test.go | 8 ++ model/pdata/generated_trace.go | 42 ++++++ model/pdata/generated_trace_test.go | 48 +++++++ processor/batchprocessor/splitlogs.go | 26 +++- processor/batchprocessor/splitlogs_test.go | 41 +++++- processor/batchprocessor/splitmetrics.go | 83 +++++++----- processor/batchprocessor/splitmetrics_test.go | 42 +++++- processor/batchprocessor/splittraces.go | 26 +++- processor/batchprocessor/splittraces_test.go | 40 +++++- 17 files changed, 620 insertions(+), 43 deletions(-) diff --git a/model/internal/cmd/pdatagen/internal/base_structs.go b/model/internal/cmd/pdatagen/internal/base_structs.go index 4bf219d89ff..1312f941f4f 100644 --- a/model/internal/cmd/pdatagen/internal/base_structs.go +++ b/model/internal/cmd/pdatagen/internal/base_structs.go @@ -40,6 +40,13 @@ func new${structName}(orig *${originName}) ${structName} { // This must be used only in testing code since no "Set" method available. 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 +func (ms ${structName}) MoveTo(dest ${structName}) { + *dest.orig = *ms.orig + *ms.orig = ${originName}{} }` const messageValueCopyToHeaderTemplate = `// CopyTo copies all properties from the current struct to the dest. @@ -48,6 +55,14 @@ func (ms ${structName}) CopyTo(dest ${structName}) {` const messageValueCopyToFooterTemplate = `}` const messageValueTestTemplate = ` +func Test${structName}_MoveTo(t *testing.T) { + ms := generateTest${structName}() + dest := New${structName}() + ms.MoveTo(dest) + assert.EqualValues(t, New${structName}(), ms) + assert.EqualValues(t, generateTest${structName}(), dest) +} + func Test${structName}_CopyTo(t *testing.T) { ms := New${structName}() generateTest${structName}().CopyTo(ms) diff --git a/model/pdata/generated_common.go b/model/pdata/generated_common.go index 0f970e6c6ae..4839690d6a1 100644 --- a/model/pdata/generated_common.go +++ b/model/pdata/generated_common.go @@ -44,6 +44,13 @@ 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 +func (ms InstrumentationLibrary) MoveTo(dest InstrumentationLibrary) { + *dest.orig = *ms.orig + *ms.orig = otlpcommon.InstrumentationLibrary{} +} + // Name returns the name associated with this InstrumentationLibrary. func (ms InstrumentationLibrary) Name() string { return (*ms.orig).Name diff --git a/model/pdata/generated_common_test.go b/model/pdata/generated_common_test.go index 1a61fe3a24d..ac07ddf6708 100644 --- a/model/pdata/generated_common_test.go +++ b/model/pdata/generated_common_test.go @@ -25,6 +25,14 @@ import ( otlpcommon "go.opentelemetry.io/collector/model/internal/data/protogen/common/v1" ) +func TestInstrumentationLibrary_MoveTo(t *testing.T) { + ms := generateTestInstrumentationLibrary() + dest := NewInstrumentationLibrary() + ms.MoveTo(dest) + assert.EqualValues(t, NewInstrumentationLibrary(), ms) + assert.EqualValues(t, generateTestInstrumentationLibrary(), dest) +} + func TestInstrumentationLibrary_CopyTo(t *testing.T) { ms := NewInstrumentationLibrary() generateTestInstrumentationLibrary().CopyTo(ms) diff --git a/model/pdata/generated_log.go b/model/pdata/generated_log.go index 110c9f88df5..ee46494ecf8 100644 --- a/model/pdata/generated_log.go +++ b/model/pdata/generated_log.go @@ -183,6 +183,13 @@ 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 +func (ms ResourceLogs) MoveTo(dest ResourceLogs) { + *dest.orig = *ms.orig + *ms.orig = otlplogs.ResourceLogs{} +} + // Resource returns the resource associated with this ResourceLogs. func (ms ResourceLogs) Resource() Resource { return newResource(&(*ms.orig).Resource) @@ -370,6 +377,13 @@ 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 +func (ms InstrumentationLibraryLogs) MoveTo(dest InstrumentationLibraryLogs) { + *dest.orig = *ms.orig + *ms.orig = otlplogs.InstrumentationLibraryLogs{} +} + // InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibraryLogs. func (ms InstrumentationLibraryLogs) InstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&(*ms.orig).InstrumentationLibrary) @@ -558,6 +572,13 @@ 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 +func (ms LogRecord) MoveTo(dest LogRecord) { + *dest.orig = *ms.orig + *ms.orig = otlplogs.LogRecord{} +} + // Timestamp returns the timestamp associated with this LogRecord. func (ms LogRecord) Timestamp() Timestamp { return Timestamp((*ms.orig).TimeUnixNano) diff --git a/model/pdata/generated_log_test.go b/model/pdata/generated_log_test.go index 001c7b7fc40..5af8d4d7270 100644 --- a/model/pdata/generated_log_test.go +++ b/model/pdata/generated_log_test.go @@ -135,6 +135,14 @@ func TestResourceLogsSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestResourceLogs_MoveTo(t *testing.T) { + ms := generateTestResourceLogs() + dest := NewResourceLogs() + ms.MoveTo(dest) + assert.EqualValues(t, NewResourceLogs(), ms) + assert.EqualValues(t, generateTestResourceLogs(), dest) +} + func TestResourceLogs_CopyTo(t *testing.T) { ms := NewResourceLogs() generateTestResourceLogs().CopyTo(ms) @@ -273,6 +281,14 @@ func TestInstrumentationLibraryLogsSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestInstrumentationLibraryLogs_MoveTo(t *testing.T) { + ms := generateTestInstrumentationLibraryLogs() + dest := NewInstrumentationLibraryLogs() + ms.MoveTo(dest) + assert.EqualValues(t, NewInstrumentationLibraryLogs(), ms) + assert.EqualValues(t, generateTestInstrumentationLibraryLogs(), dest) +} + func TestInstrumentationLibraryLogs_CopyTo(t *testing.T) { ms := NewInstrumentationLibraryLogs() generateTestInstrumentationLibraryLogs().CopyTo(ms) @@ -411,6 +427,14 @@ func TestLogSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestLogRecord_MoveTo(t *testing.T) { + ms := generateTestLogRecord() + dest := NewLogRecord() + ms.MoveTo(dest) + assert.EqualValues(t, NewLogRecord(), ms) + assert.EqualValues(t, generateTestLogRecord(), dest) +} + func TestLogRecord_CopyTo(t *testing.T) { ms := NewLogRecord() generateTestLogRecord().CopyTo(ms) diff --git a/model/pdata/generated_metrics.go b/model/pdata/generated_metrics.go index 01e3449ab45..10fc5736cc1 100644 --- a/model/pdata/generated_metrics.go +++ b/model/pdata/generated_metrics.go @@ -183,6 +183,13 @@ 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 +func (ms ResourceMetrics) MoveTo(dest ResourceMetrics) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.ResourceMetrics{} +} + // Resource returns the resource associated with this ResourceMetrics. func (ms ResourceMetrics) Resource() Resource { return newResource(&(*ms.orig).Resource) @@ -370,6 +377,13 @@ 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 +func (ms InstrumentationLibraryMetrics) MoveTo(dest InstrumentationLibraryMetrics) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.InstrumentationLibraryMetrics{} +} + // InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibraryMetrics. func (ms InstrumentationLibraryMetrics) InstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&(*ms.orig).InstrumentationLibrary) @@ -558,6 +572,13 @@ 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 +func (ms Metric) MoveTo(dest Metric) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.Metric{} +} + // Name returns the name associated with this Metric. func (ms Metric) Name() string { return (*ms.orig).Name @@ -619,6 +640,13 @@ 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 +func (ms Gauge) MoveTo(dest Gauge) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.Gauge{} +} + // DataPoints returns the DataPoints associated with this Gauge. func (ms Gauge) DataPoints() NumberDataPointSlice { return newNumberDataPointSlice(&(*ms.orig).DataPoints) @@ -652,6 +680,13 @@ 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 +func (ms Sum) MoveTo(dest Sum) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.Sum{} +} + // AggregationTemporality returns the aggregationtemporality associated with this Sum. func (ms Sum) AggregationTemporality() MetricAggregationTemporality { return MetricAggregationTemporality((*ms.orig).AggregationTemporality) @@ -707,6 +742,13 @@ 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 +func (ms Histogram) MoveTo(dest Histogram) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.Histogram{} +} + // AggregationTemporality returns the aggregationtemporality associated with this Histogram. func (ms Histogram) AggregationTemporality() MetricAggregationTemporality { return MetricAggregationTemporality((*ms.orig).AggregationTemporality) @@ -752,6 +794,13 @@ 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 +func (ms ExponentialHistogram) MoveTo(dest ExponentialHistogram) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.ExponentialHistogram{} +} + // AggregationTemporality returns the aggregationtemporality associated with this ExponentialHistogram. func (ms ExponentialHistogram) AggregationTemporality() MetricAggregationTemporality { return MetricAggregationTemporality((*ms.orig).AggregationTemporality) @@ -796,6 +845,13 @@ 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 +func (ms Summary) MoveTo(dest Summary) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.Summary{} +} + // DataPoints returns the DataPoints associated with this Summary. func (ms Summary) DataPoints() SummaryDataPointSlice { return newSummaryDataPointSlice(&(*ms.orig).DataPoints) @@ -966,6 +1022,13 @@ 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 +func (ms NumberDataPoint) MoveTo(dest NumberDataPoint) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.NumberDataPoint{} +} + // Attributes returns the Attributes associated with this NumberDataPoint. func (ms NumberDataPoint) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) @@ -1206,6 +1269,13 @@ 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 +func (ms HistogramDataPoint) MoveTo(dest HistogramDataPoint) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.HistogramDataPoint{} +} + // Attributes returns the Attributes associated with this HistogramDataPoint. func (ms HistogramDataPoint) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) @@ -1462,6 +1532,13 @@ 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 +func (ms ExponentialHistogramDataPoint) MoveTo(dest ExponentialHistogramDataPoint) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.ExponentialHistogramDataPoint{} +} + // Attributes returns the Attributes associated with this ExponentialHistogramDataPoint. func (ms ExponentialHistogramDataPoint) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) @@ -1590,6 +1667,13 @@ 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 +func (ms Buckets) MoveTo(dest Buckets) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.ExponentialHistogramDataPoint_Buckets{} +} + // Offset returns the offset associated with this Buckets. func (ms Buckets) Offset() int32 { return int32((*ms.orig).Offset) @@ -1776,6 +1860,13 @@ 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 +func (ms SummaryDataPoint) MoveTo(dest SummaryDataPoint) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.SummaryDataPoint{} +} + // Attributes returns the Attributes associated with this SummaryDataPoint. func (ms SummaryDataPoint) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) @@ -2007,6 +2098,13 @@ 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 +func (ms ValueAtQuantile) MoveTo(dest ValueAtQuantile) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.SummaryDataPoint_ValueAtQuantile{} +} + // Quantile returns the quantile associated with this ValueAtQuantile. func (ms ValueAtQuantile) Quantile() float64 { return (*ms.orig).Quantile @@ -2177,6 +2275,13 @@ 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 +func (ms Exemplar) MoveTo(dest Exemplar) { + *dest.orig = *ms.orig + *ms.orig = otlpmetrics.Exemplar{} +} + // Timestamp returns the timestamp associated with this Exemplar. func (ms Exemplar) Timestamp() Timestamp { return Timestamp((*ms.orig).TimeUnixNano) diff --git a/model/pdata/generated_metrics_test.go b/model/pdata/generated_metrics_test.go index 71b03c4cb04..1fa88bdfe76 100644 --- a/model/pdata/generated_metrics_test.go +++ b/model/pdata/generated_metrics_test.go @@ -135,6 +135,14 @@ func TestResourceMetricsSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestResourceMetrics_MoveTo(t *testing.T) { + ms := generateTestResourceMetrics() + dest := NewResourceMetrics() + ms.MoveTo(dest) + assert.EqualValues(t, NewResourceMetrics(), ms) + assert.EqualValues(t, generateTestResourceMetrics(), dest) +} + func TestResourceMetrics_CopyTo(t *testing.T) { ms := NewResourceMetrics() generateTestResourceMetrics().CopyTo(ms) @@ -273,6 +281,14 @@ func TestInstrumentationLibraryMetricsSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestInstrumentationLibraryMetrics_MoveTo(t *testing.T) { + ms := generateTestInstrumentationLibraryMetrics() + dest := NewInstrumentationLibraryMetrics() + ms.MoveTo(dest) + assert.EqualValues(t, NewInstrumentationLibraryMetrics(), ms) + assert.EqualValues(t, generateTestInstrumentationLibraryMetrics(), dest) +} + func TestInstrumentationLibraryMetrics_CopyTo(t *testing.T) { ms := NewInstrumentationLibraryMetrics() generateTestInstrumentationLibraryMetrics().CopyTo(ms) @@ -411,6 +427,14 @@ func TestMetricSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestMetric_MoveTo(t *testing.T) { + ms := generateTestMetric() + dest := NewMetric() + ms.MoveTo(dest) + assert.EqualValues(t, NewMetric(), ms) + assert.EqualValues(t, generateTestMetric(), dest) +} + func TestMetric_CopyTo(t *testing.T) { ms := NewMetric() generateTestMetric().CopyTo(ms) @@ -441,6 +465,14 @@ func TestMetric_Unit(t *testing.T) { assert.EqualValues(t, testValUnit, ms.Unit()) } +func TestGauge_MoveTo(t *testing.T) { + ms := generateTestGauge() + dest := NewGauge() + ms.MoveTo(dest) + assert.EqualValues(t, NewGauge(), ms) + assert.EqualValues(t, generateTestGauge(), dest) +} + func TestGauge_CopyTo(t *testing.T) { ms := NewGauge() generateTestGauge().CopyTo(ms) @@ -455,6 +487,14 @@ func TestGauge_DataPoints(t *testing.T) { assert.EqualValues(t, testValDataPoints, ms.DataPoints()) } +func TestSum_MoveTo(t *testing.T) { + ms := generateTestSum() + dest := NewSum() + ms.MoveTo(dest) + assert.EqualValues(t, NewSum(), ms) + assert.EqualValues(t, generateTestSum(), dest) +} + func TestSum_CopyTo(t *testing.T) { ms := NewSum() generateTestSum().CopyTo(ms) @@ -485,6 +525,14 @@ func TestSum_DataPoints(t *testing.T) { assert.EqualValues(t, testValDataPoints, ms.DataPoints()) } +func TestHistogram_MoveTo(t *testing.T) { + ms := generateTestHistogram() + dest := NewHistogram() + ms.MoveTo(dest) + assert.EqualValues(t, NewHistogram(), ms) + assert.EqualValues(t, generateTestHistogram(), dest) +} + func TestHistogram_CopyTo(t *testing.T) { ms := NewHistogram() generateTestHistogram().CopyTo(ms) @@ -507,6 +555,14 @@ func TestHistogram_DataPoints(t *testing.T) { assert.EqualValues(t, testValDataPoints, ms.DataPoints()) } +func TestExponentialHistogram_MoveTo(t *testing.T) { + ms := generateTestExponentialHistogram() + dest := NewExponentialHistogram() + ms.MoveTo(dest) + assert.EqualValues(t, NewExponentialHistogram(), ms) + assert.EqualValues(t, generateTestExponentialHistogram(), dest) +} + func TestExponentialHistogram_CopyTo(t *testing.T) { ms := NewExponentialHistogram() generateTestExponentialHistogram().CopyTo(ms) @@ -529,6 +585,14 @@ func TestExponentialHistogram_DataPoints(t *testing.T) { assert.EqualValues(t, testValDataPoints, ms.DataPoints()) } +func TestSummary_MoveTo(t *testing.T) { + ms := generateTestSummary() + dest := NewSummary() + ms.MoveTo(dest) + assert.EqualValues(t, NewSummary(), ms) + assert.EqualValues(t, generateTestSummary(), dest) +} + func TestSummary_CopyTo(t *testing.T) { ms := NewSummary() generateTestSummary().CopyTo(ms) @@ -653,6 +717,14 @@ func TestNumberDataPointSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestNumberDataPoint_MoveTo(t *testing.T) { + ms := generateTestNumberDataPoint() + dest := NewNumberDataPoint() + ms.MoveTo(dest) + assert.EqualValues(t, NewNumberDataPoint(), ms) + assert.EqualValues(t, generateTestNumberDataPoint(), dest) +} + func TestNumberDataPoint_CopyTo(t *testing.T) { ms := NewNumberDataPoint() generateTestNumberDataPoint().CopyTo(ms) @@ -824,6 +896,14 @@ func TestHistogramDataPointSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestHistogramDataPoint_MoveTo(t *testing.T) { + ms := generateTestHistogramDataPoint() + dest := NewHistogramDataPoint() + ms.MoveTo(dest) + assert.EqualValues(t, NewHistogramDataPoint(), ms) + assert.EqualValues(t, generateTestHistogramDataPoint(), dest) +} + func TestHistogramDataPoint_CopyTo(t *testing.T) { ms := NewHistogramDataPoint() generateTestHistogramDataPoint().CopyTo(ms) @@ -1012,6 +1092,14 @@ func TestExponentialHistogramDataPointSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestExponentialHistogramDataPoint_MoveTo(t *testing.T) { + ms := generateTestExponentialHistogramDataPoint() + dest := NewExponentialHistogramDataPoint() + ms.MoveTo(dest) + assert.EqualValues(t, NewExponentialHistogramDataPoint(), ms) + assert.EqualValues(t, generateTestExponentialHistogramDataPoint(), dest) +} + func TestExponentialHistogramDataPoint_CopyTo(t *testing.T) { ms := NewExponentialHistogramDataPoint() generateTestExponentialHistogramDataPoint().CopyTo(ms) @@ -1102,6 +1190,14 @@ func TestExponentialHistogramDataPoint_Flags(t *testing.T) { assert.EqualValues(t, testValFlags, ms.Flags()) } +func TestBuckets_MoveTo(t *testing.T) { + ms := generateTestBuckets() + dest := NewBuckets() + ms.MoveTo(dest) + assert.EqualValues(t, NewBuckets(), ms) + assert.EqualValues(t, generateTestBuckets(), dest) +} + func TestBuckets_CopyTo(t *testing.T) { ms := NewBuckets() generateTestBuckets().CopyTo(ms) @@ -1234,6 +1330,14 @@ func TestSummaryDataPointSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestSummaryDataPoint_MoveTo(t *testing.T) { + ms := generateTestSummaryDataPoint() + dest := NewSummaryDataPoint() + ms.MoveTo(dest) + assert.EqualValues(t, NewSummaryDataPoint(), ms) + assert.EqualValues(t, generateTestSummaryDataPoint(), dest) +} + func TestSummaryDataPoint_CopyTo(t *testing.T) { ms := NewSummaryDataPoint() generateTestSummaryDataPoint().CopyTo(ms) @@ -1406,6 +1510,14 @@ func TestValueAtQuantileSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestValueAtQuantile_MoveTo(t *testing.T) { + ms := generateTestValueAtQuantile() + dest := NewValueAtQuantile() + ms.MoveTo(dest) + assert.EqualValues(t, NewValueAtQuantile(), ms) + assert.EqualValues(t, generateTestValueAtQuantile(), dest) +} + func TestValueAtQuantile_CopyTo(t *testing.T) { ms := NewValueAtQuantile() generateTestValueAtQuantile().CopyTo(ms) @@ -1529,6 +1641,14 @@ func TestExemplarSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestExemplar_MoveTo(t *testing.T) { + ms := generateTestExemplar() + dest := NewExemplar() + ms.MoveTo(dest) + assert.EqualValues(t, NewExemplar(), ms) + assert.EqualValues(t, generateTestExemplar(), dest) +} + func TestExemplar_CopyTo(t *testing.T) { ms := NewExemplar() generateTestExemplar().CopyTo(ms) diff --git a/model/pdata/generated_resource.go b/model/pdata/generated_resource.go index 6e44dd276a4..1a29265e489 100644 --- a/model/pdata/generated_resource.go +++ b/model/pdata/generated_resource.go @@ -44,6 +44,13 @@ 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 +func (ms Resource) MoveTo(dest Resource) { + *dest.orig = *ms.orig + *ms.orig = otlpresource.Resource{} +} + // Attributes returns the Attributes associated with this Resource. func (ms Resource) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) diff --git a/model/pdata/generated_resource_test.go b/model/pdata/generated_resource_test.go index bc8295cd0db..5e9207eb83b 100644 --- a/model/pdata/generated_resource_test.go +++ b/model/pdata/generated_resource_test.go @@ -23,6 +23,14 @@ import ( "github.com/stretchr/testify/assert" ) +func TestResource_MoveTo(t *testing.T) { + ms := generateTestResource() + dest := NewResource() + ms.MoveTo(dest) + assert.EqualValues(t, NewResource(), ms) + assert.EqualValues(t, generateTestResource(), dest) +} + func TestResource_CopyTo(t *testing.T) { ms := NewResource() generateTestResource().CopyTo(ms) diff --git a/model/pdata/generated_trace.go b/model/pdata/generated_trace.go index e72a55b6329..93909bf4e95 100644 --- a/model/pdata/generated_trace.go +++ b/model/pdata/generated_trace.go @@ -183,6 +183,13 @@ 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 +func (ms ResourceSpans) MoveTo(dest ResourceSpans) { + *dest.orig = *ms.orig + *ms.orig = otlptrace.ResourceSpans{} +} + // Resource returns the resource associated with this ResourceSpans. func (ms ResourceSpans) Resource() Resource { return newResource(&(*ms.orig).Resource) @@ -370,6 +377,13 @@ 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 +func (ms InstrumentationLibrarySpans) MoveTo(dest InstrumentationLibrarySpans) { + *dest.orig = *ms.orig + *ms.orig = otlptrace.InstrumentationLibrarySpans{} +} + // InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibrarySpans. func (ms InstrumentationLibrarySpans) InstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&(*ms.orig).InstrumentationLibrary) @@ -558,6 +572,13 @@ 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 +func (ms Span) MoveTo(dest Span) { + *dest.orig = *ms.orig + *ms.orig = otlptrace.Span{} +} + // TraceID returns the traceid associated with this Span. func (ms Span) TraceID() TraceID { return TraceID{orig: ((*ms.orig).TraceId)} @@ -868,6 +889,13 @@ 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 +func (ms SpanEvent) MoveTo(dest SpanEvent) { + *dest.orig = *ms.orig + *ms.orig = otlptrace.Span_Event{} +} + // Timestamp returns the timestamp associated with this SpanEvent. func (ms SpanEvent) Timestamp() Timestamp { return Timestamp((*ms.orig).TimeUnixNano) @@ -1073,6 +1101,13 @@ 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 +func (ms SpanLink) MoveTo(dest SpanLink) { + *dest.orig = *ms.orig + *ms.orig = otlptrace.Span_Link{} +} + // TraceID returns the traceid associated with this SpanLink. func (ms SpanLink) TraceID() TraceID { return TraceID{orig: ((*ms.orig).TraceId)} @@ -1151,6 +1186,13 @@ 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 +func (ms SpanStatus) MoveTo(dest SpanStatus) { + *dest.orig = *ms.orig + *ms.orig = otlptrace.Status{} +} + // Code returns the code associated with this SpanStatus. func (ms SpanStatus) Code() StatusCode { return StatusCode((*ms.orig).Code) diff --git a/model/pdata/generated_trace_test.go b/model/pdata/generated_trace_test.go index 3eb4b35ccc3..7e0575110af 100644 --- a/model/pdata/generated_trace_test.go +++ b/model/pdata/generated_trace_test.go @@ -135,6 +135,14 @@ func TestResourceSpansSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestResourceSpans_MoveTo(t *testing.T) { + ms := generateTestResourceSpans() + dest := NewResourceSpans() + ms.MoveTo(dest) + assert.EqualValues(t, NewResourceSpans(), ms) + assert.EqualValues(t, generateTestResourceSpans(), dest) +} + func TestResourceSpans_CopyTo(t *testing.T) { ms := NewResourceSpans() generateTestResourceSpans().CopyTo(ms) @@ -273,6 +281,14 @@ func TestInstrumentationLibrarySpansSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestInstrumentationLibrarySpans_MoveTo(t *testing.T) { + ms := generateTestInstrumentationLibrarySpans() + dest := NewInstrumentationLibrarySpans() + ms.MoveTo(dest) + assert.EqualValues(t, NewInstrumentationLibrarySpans(), ms) + assert.EqualValues(t, generateTestInstrumentationLibrarySpans(), dest) +} + func TestInstrumentationLibrarySpans_CopyTo(t *testing.T) { ms := NewInstrumentationLibrarySpans() generateTestInstrumentationLibrarySpans().CopyTo(ms) @@ -411,6 +427,14 @@ func TestSpanSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestSpan_MoveTo(t *testing.T) { + ms := generateTestSpan() + dest := NewSpan() + ms.MoveTo(dest) + assert.EqualValues(t, NewSpan(), ms) + assert.EqualValues(t, generateTestSpan(), dest) +} + func TestSpan_CopyTo(t *testing.T) { ms := NewSpan() generateTestSpan().CopyTo(ms) @@ -645,6 +669,14 @@ func TestSpanEventSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestSpanEvent_MoveTo(t *testing.T) { + ms := generateTestSpanEvent() + dest := NewSpanEvent() + ms.MoveTo(dest) + assert.EqualValues(t, NewSpanEvent(), ms) + assert.EqualValues(t, generateTestSpanEvent(), dest) +} + func TestSpanEvent_CopyTo(t *testing.T) { ms := NewSpanEvent() generateTestSpanEvent().CopyTo(ms) @@ -793,6 +825,14 @@ func TestSpanLinkSlice_RemoveIf(t *testing.T) { assert.Equal(t, 5, filtered.Len()) } +func TestSpanLink_MoveTo(t *testing.T) { + ms := generateTestSpanLink() + dest := NewSpanLink() + ms.MoveTo(dest) + assert.EqualValues(t, NewSpanLink(), ms) + assert.EqualValues(t, generateTestSpanLink(), dest) +} + func TestSpanLink_CopyTo(t *testing.T) { ms := NewSpanLink() generateTestSpanLink().CopyTo(ms) @@ -839,6 +879,14 @@ func TestSpanLink_DroppedAttributesCount(t *testing.T) { assert.EqualValues(t, testValDroppedAttributesCount, ms.DroppedAttributesCount()) } +func TestSpanStatus_MoveTo(t *testing.T) { + ms := generateTestSpanStatus() + dest := NewSpanStatus() + ms.MoveTo(dest) + assert.EqualValues(t, NewSpanStatus(), ms) + assert.EqualValues(t, generateTestSpanStatus(), dest) +} + func TestSpanStatus_CopyTo(t *testing.T) { ms := NewSpanStatus() generateTestSpanStatus().CopyTo(ms) diff --git a/processor/batchprocessor/splitlogs.go b/processor/batchprocessor/splitlogs.go index b95ce446e44..9bc8bcfc89f 100644 --- a/processor/batchprocessor/splitlogs.go +++ b/processor/batchprocessor/splitlogs.go @@ -32,6 +32,14 @@ func splitLogs(size int, src pdata.Logs) pdata.Logs { return false } + // If it fully fits + srcRsCount := resourceLogsCount(srcRs) + if (totalCopiedLogs + srcRsCount) <= size { + totalCopiedLogs += srcRsCount + srcRs.MoveTo(dest.ResourceLogs().AppendEmpty()) + return true + } + destRs := dest.ResourceLogs().AppendEmpty() srcRs.Resource().CopyTo(destRs.Resource()) @@ -41,23 +49,23 @@ func splitLogs(size int, src pdata.Logs) pdata.Logs { return false } - destIlm := destRs.InstrumentationLibraryLogs().AppendEmpty() - srcIlm.InstrumentationLibrary().CopyTo(destIlm.InstrumentationLibrary()) - // If possible to move all metrics do that. srcLogsLen := srcIlm.Logs().Len() if size >= srcLogsLen+totalCopiedLogs { totalCopiedLogs += srcLogsLen - srcIlm.Logs().MoveAndAppendTo(destIlm.Logs()) + srcIlm.MoveTo(destRs.InstrumentationLibraryLogs().AppendEmpty()) return true } + destIlm := destRs.InstrumentationLibraryLogs().AppendEmpty() + srcIlm.InstrumentationLibrary().CopyTo(destIlm.InstrumentationLibrary()) + srcIlm.Logs().RemoveIf(func(srcMetric pdata.LogRecord) bool { // If we are done skip everything else. if totalCopiedLogs == size { return false } - srcMetric.CopyTo(destIlm.Logs().AppendEmpty()) + srcMetric.MoveTo(destIlm.Logs().AppendEmpty()) totalCopiedLogs++ return true }) @@ -68,3 +76,11 @@ func splitLogs(size int, src pdata.Logs) pdata.Logs { return dest } + +// resourceLogsCount calculates the total number of logs. +func resourceLogsCount(rs pdata.ResourceLogs) (count int) { + for k := 0; k < rs.InstrumentationLibraryLogs().Len(); k++ { + count += rs.InstrumentationLibraryLogs().At(k).Logs().Len() + } + return +} diff --git a/processor/batchprocessor/splitlogs_test.go b/processor/batchprocessor/splitlogs_test.go index 5e3e3837a5c..229ccf5aff6 100644 --- a/processor/batchprocessor/splitlogs_test.go +++ b/processor/batchprocessor/splitlogs_test.go @@ -138,10 +138,19 @@ func BenchmarkSplitLogs(b *testing.B) { } } + if b.N > 100000 { + b.Skipf("SKIP: b.N too high, set -benchtine=x with n < 100000") + } + + clones := make([]pdata.Logs, b.N) + for n := 0; n < b.N; n++ { + clones[n] = md.Clone() + } + b.ReportAllocs() b.ResetTimer() for n := 0; n < b.N; n++ { - cloneReq := md.Clone() + cloneReq := clones[n] split := splitLogs(128, cloneReq) if split.LogRecordCount() != 128 || cloneReq.LogRecordCount() != 400-128 { b.Fail() @@ -169,3 +178,33 @@ func BenchmarkCloneLogs(b *testing.B) { } } } + +func TestSplitLogsMultipleILL(t *testing.T) { + td := testdata.GenerateLogsManyLogRecordsSameResource(20) + logs := td.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0).Logs() + for i := 0; i < logs.Len(); i++ { + logs.At(i).SetName(getTestLogName(0, i)) + } + // add second index to ILL + td.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0). + CopyTo(td.ResourceLogs().At(0).InstrumentationLibraryLogs().AppendEmpty()) + logs = td.ResourceLogs().At(0).InstrumentationLibraryLogs().At(1).Logs() + for i := 0; i < logs.Len(); i++ { + logs.At(i).SetName(getTestLogName(1, i)) + } + + // add third index to ILL + td.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0). + CopyTo(td.ResourceLogs().At(0).InstrumentationLibraryLogs().AppendEmpty()) + logs = td.ResourceLogs().At(0).InstrumentationLibraryLogs().At(2).Logs() + for i := 0; i < logs.Len(); i++ { + logs.At(i).SetName(getTestLogName(2, i)) + } + + splitSize := 40 + split := splitLogs(splitSize, td) + assert.Equal(t, splitSize, split.LogRecordCount()) + assert.Equal(t, 20, td.LogRecordCount()) + assert.Equal(t, "test-log-int-0-0", split.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0).Logs().At(0).Name()) + assert.Equal(t, "test-log-int-0-4", split.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0).Logs().At(4).Name()) +} diff --git a/processor/batchprocessor/splitmetrics.go b/processor/batchprocessor/splitmetrics.go index b842929c113..04a33f65ce6 100644 --- a/processor/batchprocessor/splitmetrics.go +++ b/processor/batchprocessor/splitmetrics.go @@ -33,6 +33,14 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { return false } + // If it fully fits + srcRsDataPointCount := resourceMetricsDataPointCount(srcRs) + if (totalCopiedDataPoints + srcRsDataPointCount) <= size { + totalCopiedDataPoints += srcRsDataPointCount + srcRs.MoveTo(dest.ResourceMetrics().AppendEmpty()) + return true + } + destRs := dest.ResourceMetrics().AppendEmpty() srcRs.Resource().CopyTo(destRs.Resource()) @@ -42,17 +50,17 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { return false } - destIlm := destRs.InstrumentationLibraryMetrics().AppendEmpty() - srcIlm.InstrumentationLibrary().CopyTo(destIlm.InstrumentationLibrary()) - // If possible to move all metrics do that. srcDataPointCount := metricSliceDataPointCount(srcIlm.Metrics()) if size-totalCopiedDataPoints >= srcDataPointCount { totalCopiedDataPoints += srcDataPointCount - srcIlm.Metrics().MoveAndAppendTo(destIlm.Metrics()) + srcIlm.MoveTo(destRs.InstrumentationLibraryMetrics().AppendEmpty()) return true } + destIlm := destRs.InstrumentationLibraryMetrics().AppendEmpty() + srcIlm.InstrumentationLibrary().CopyTo(destIlm.InstrumentationLibrary()) + srcIlm.Metrics().RemoveIf(func(srcMetric pdata.Metric) bool { // If we are done skip everything else. if totalCopiedDataPoints == size { @@ -71,6 +79,14 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { return dest } +// resourceMetricsDataPointCount calculates the total number of data points. +func resourceMetricsDataPointCount(rs pdata.ResourceMetrics) (dataPointCount int) { + for k := 0; k < rs.InstrumentationLibraryMetrics().Len(); k++ { + dataPointCount += metricSliceDataPointCount(rs.InstrumentationLibraryMetrics().At(k).Metrics()) + } + return +} + // metricSliceDataPointCount calculates the total number of data points. func metricSliceDataPointCount(ms pdata.MetricSlice) (dataPointCount int) { for k := 0; k < ms.Len(); k++ { @@ -98,13 +114,10 @@ func metricDataPointCount(ms pdata.Metric) (dataPointCount int) { // Returns size of moved data and boolean describing, whether the metric should be removed from original slice. func splitMetric(ms, dest pdata.Metric, size int) (int, bool) { if metricDataPointCount(ms) <= size { - ms.CopyTo(dest) - return metricDataPointCount(ms), true + ms.MoveTo(dest) + return metricDataPointCount(dest), true } - msSize, i := metricDataPointCount(ms)-size, 0 - filterDataPoints := func() bool { i++; return i <= msSize } - dest.SetDataType(ms.DataType()) dest.SetName(ms.Name()) dest.SetDescription(ms.Description()) @@ -115,41 +128,53 @@ func splitMetric(ms, dest pdata.Metric, size int) (int, bool) { src := ms.Gauge().DataPoints() dst := dest.Gauge().DataPoints() dst.EnsureCapacity(size) - for j := 0; j < size; j++ { - src.At(j).CopyTo(dst.AppendEmpty()) - } - src.RemoveIf(func(_ pdata.NumberDataPoint) bool { - return filterDataPoints() + i := 0 + src.RemoveIf(func(dp pdata.NumberDataPoint) bool { + defer func() { i++ }() + if i < size { + dp.MoveTo(dst.AppendEmpty()) + return true + } + return false }) case pdata.MetricDataTypeSum: src := ms.Sum().DataPoints() dst := dest.Sum().DataPoints() dst.EnsureCapacity(size) - for j := 0; j < size; j++ { - src.At(j).CopyTo(dst.AppendEmpty()) - } - src.RemoveIf(func(_ pdata.NumberDataPoint) bool { - return filterDataPoints() + i := 0 + src.RemoveIf(func(dp pdata.NumberDataPoint) bool { + defer func() { i++ }() + if i < size { + dp.MoveTo(dst.AppendEmpty()) + return true + } + return false }) case pdata.MetricDataTypeHistogram: src := ms.Histogram().DataPoints() dst := dest.Histogram().DataPoints() dst.EnsureCapacity(size) - for j := 0; j < size; j++ { - src.At(j).CopyTo(dst.AppendEmpty()) - } - src.RemoveIf(func(_ pdata.HistogramDataPoint) bool { - return filterDataPoints() + i := 0 + src.RemoveIf(func(dp pdata.HistogramDataPoint) bool { + defer func() { i++ }() + if i < size { + dp.MoveTo(dst.AppendEmpty()) + return true + } + return false }) case pdata.MetricDataTypeSummary: src := ms.Summary().DataPoints() dst := dest.Summary().DataPoints() dst.EnsureCapacity(size) - for j := 0; j < size; j++ { - src.At(j).CopyTo(dst.AppendEmpty()) - } - src.RemoveIf(func(_ pdata.SummaryDataPoint) bool { - return filterDataPoints() + i := 0 + src.RemoveIf(func(dp pdata.SummaryDataPoint) bool { + defer func() { i++ }() + if i < size { + dp.MoveTo(dst.AppendEmpty()) + return true + } + return false }) } return size, false diff --git a/processor/batchprocessor/splitmetrics_test.go b/processor/batchprocessor/splitmetrics_test.go index 98e860fe6be..fee708927c2 100644 --- a/processor/batchprocessor/splitmetrics_test.go +++ b/processor/batchprocessor/splitmetrics_test.go @@ -147,11 +147,20 @@ func BenchmarkSplitMetrics(b *testing.B) { } } + if b.N > 100000 { + b.Skipf("SKIP: b.N too high, set -benchtine=x with n < 100000") + } + + dataPointCount := metricDataPointCount(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0)) + clones := make([]pdata.Metrics, b.N) + for n := 0; n < b.N; n++ { + clones[n] = md.Clone() + } b.ReportAllocs() b.ResetTimer() for n := 0; n < b.N; n++ { - cloneReq := md.Clone() - split := splitMetrics(128, cloneReq) + cloneReq := clones[n] + split := splitMetrics(128*dataPointCount, cloneReq) if split.MetricCount() != 128 || cloneReq.MetricCount() != 400-128 { b.Fail() } @@ -236,3 +245,32 @@ func TestSplitMetricsBatchSizeSmallerThanDataPointCount(t *testing.T) { 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()) } + +func TestSplitMetricsMultipleILM(t *testing.T) { + md := testdata.GenerateMetricsManyMetricsSameResource(20) + metrics := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() + dataPointCount := metricDataPointCount(metrics.At(0)) + for i := 0; i < metrics.Len(); i++ { + metrics.At(i).SetName(getTestMetricName(0, i)) + assert.Equal(t, dataPointCount, metricDataPointCount(metrics.At(i))) + } + // add second index to ilm + md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0). + CopyTo(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().AppendEmpty()) + + // add a third index to ilm + md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0). + CopyTo(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().AppendEmpty()) + metrics = md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(2).Metrics() + for i := 0; i < metrics.Len(); i++ { + metrics.At(i).SetName(getTestMetricName(2, i)) + } + + splitMetricCount := 40 + splitSize := splitMetricCount * dataPointCount + split := splitMetrics(splitSize, md) + assert.Equal(t, splitMetricCount, split.MetricCount()) + assert.Equal(t, 20, md.MetricCount()) + assert.Equal(t, "test-metric-int-0-0", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0).Name()) + assert.Equal(t, "test-metric-int-0-4", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(4).Name()) +} diff --git a/processor/batchprocessor/splittraces.go b/processor/batchprocessor/splittraces.go index 11465bb442b..95b23a42abc 100644 --- a/processor/batchprocessor/splittraces.go +++ b/processor/batchprocessor/splittraces.go @@ -32,6 +32,14 @@ func splitTraces(size int, src pdata.Traces) pdata.Traces { return false } + // If it fully fits + srcRsCount := resourceSpamsCount(srcRs) + if (totalCopiedSpans + srcRsCount) <= size { + totalCopiedSpans += srcRsCount + srcRs.MoveTo(dest.ResourceSpans().AppendEmpty()) + return true + } + destRs := dest.ResourceSpans().AppendEmpty() srcRs.Resource().CopyTo(destRs.Resource()) @@ -41,23 +49,23 @@ func splitTraces(size int, src pdata.Traces) pdata.Traces { return false } - destIls := destRs.InstrumentationLibrarySpans().AppendEmpty() - srcIls.InstrumentationLibrary().CopyTo(destIls.InstrumentationLibrary()) - // If possible to move all metrics do that. srcSpansLen := srcIls.Spans().Len() if size-totalCopiedSpans >= srcSpansLen { totalCopiedSpans += srcSpansLen - srcIls.Spans().MoveAndAppendTo(destIls.Spans()) + srcIls.MoveTo(destRs.InstrumentationLibrarySpans().AppendEmpty()) return true } + destIls := destRs.InstrumentationLibrarySpans().AppendEmpty() + srcIls.InstrumentationLibrary().CopyTo(destIls.InstrumentationLibrary()) + srcIls.Spans().RemoveIf(func(srcSpan pdata.Span) bool { // If we are done skip everything else. if totalCopiedSpans == size { return false } - srcSpan.CopyTo(destIls.Spans().AppendEmpty()) + srcSpan.MoveTo(destIls.Spans().AppendEmpty()) totalCopiedSpans++ return true }) @@ -68,3 +76,11 @@ func splitTraces(size int, src pdata.Traces) pdata.Traces { return dest } + +// resourceSpamsCount calculates the total number of spans. +func resourceSpamsCount(rs pdata.ResourceSpans) (count int) { + for k := 0; k < rs.InstrumentationLibrarySpans().Len(); k++ { + count += rs.InstrumentationLibrarySpans().At(k).Spans().Len() + } + return +} diff --git a/processor/batchprocessor/splittraces_test.go b/processor/batchprocessor/splittraces_test.go index dcfdb5877a4..6de10da9598 100644 --- a/processor/batchprocessor/splittraces_test.go +++ b/processor/batchprocessor/splittraces_test.go @@ -138,10 +138,18 @@ func BenchmarkSplitTraces(b *testing.B) { } } + if b.N > 100000 { + b.Skipf("SKIP: b.N too high, set -benchtine=x with n < 100000") + } + + clones := make([]pdata.Traces, b.N) + for n := 0; n < b.N; n++ { + clones[n] = td.Clone() + } b.ReportAllocs() b.ResetTimer() for n := 0; n < b.N; n++ { - cloneReq := td.Clone() + cloneReq := clones[n] split := splitTraces(128, cloneReq) if split.SpanCount() != 128 || cloneReq.SpanCount() != 400-128 { b.Fail() @@ -169,3 +177,33 @@ func BenchmarkCloneSpans(b *testing.B) { } } } + +func TestSplitTracesMultipleILS(t *testing.T) { + td := testdata.GenerateTracesManySpansSameResource(20) + spans := td.ResourceSpans().At(0).InstrumentationLibrarySpans().At(0).Spans() + for i := 0; i < spans.Len(); i++ { + spans.At(i).SetName(getTestSpanName(0, i)) + } + // add second index to ILS + td.ResourceSpans().At(0).InstrumentationLibrarySpans().At(0). + CopyTo(td.ResourceSpans().At(0).InstrumentationLibrarySpans().AppendEmpty()) + spans = td.ResourceSpans().At(0).InstrumentationLibrarySpans().At(1).Spans() + for i := 0; i < spans.Len(); i++ { + spans.At(i).SetName(getTestSpanName(1, i)) + } + + // add third index to ILS + td.ResourceSpans().At(0).InstrumentationLibrarySpans().At(0). + CopyTo(td.ResourceSpans().At(0).InstrumentationLibrarySpans().AppendEmpty()) + spans = td.ResourceSpans().At(0).InstrumentationLibrarySpans().At(2).Spans() + for i := 0; i < spans.Len(); i++ { + spans.At(i).SetName(getTestSpanName(2, i)) + } + + splitSize := 40 + split := splitTraces(splitSize, td) + assert.Equal(t, splitSize, split.SpanCount()) + assert.Equal(t, 20, td.SpanCount()) + assert.Equal(t, "test-span-0-0", split.ResourceSpans().At(0).InstrumentationLibrarySpans().At(0).Spans().At(0).Name()) + assert.Equal(t, "test-span-0-4", split.ResourceSpans().At(0).InstrumentationLibrarySpans().At(0).Spans().At(4).Name()) +} From ea8b4f421e6938af1c4454a5cd1665b5e463402a Mon Sep 17 00:00:00 2001 From: "Daniel (Shijun) Qian" Date: Thu, 28 Oct 2021 01:30:08 +0800 Subject: [PATCH 094/149] Replace IsAnInteractiveSession by IsWindowsService (#4253) * Replace IsAnInteractiveSession by IsWindowsService * rename checkUseInteractiveMode to checkWindowsService --- cmd/otelcol/main_windows.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/otelcol/main_windows.go b/cmd/otelcol/main_windows.go index fa88a4d8c49..96b6d303051 100644 --- a/cmd/otelcol/main_windows.go +++ b/cmd/otelcol/main_windows.go @@ -27,7 +27,7 @@ import ( ) func run(set service.CollectorSettings) error { - if useInteractiveMode, err := checkUseInteractiveMode(); err != nil { + if useInteractiveMode, err := checkWindowsService(); err != nil { return err } else if useInteractiveMode { return runInteractive(set) @@ -36,7 +36,7 @@ func run(set service.CollectorSettings) error { } } -func checkUseInteractiveMode() (bool, error) { +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 @@ -45,10 +45,10 @@ func checkUseInteractiveMode() (bool, error) { 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) + 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 isInteractiveSession, nil + return isWindowsService, nil } } From 1662562f1a081b5dd78ec0aea505ef200bc16c91 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Wed, 27 Oct 2021 15:58:12 -0700 Subject: [PATCH 095/149] nit: clean up test variable names (#4281) SetupTelemetry returns TestTelemetry, the variable set didn't reflect this. --- exporter/exporterhelper/logs_test.go | 10 +- exporter/exporterhelper/metrics_test.go | 10 +- exporter/exporterhelper/obsreport_test.go | 6 +- exporter/exporterhelper/queued_retry_test.go | 6 +- exporter/exporterhelper/traces_test.go | 10 +- obsreport/obsreport_test.go | 98 +++++++++---------- obsreport/obsreporttest/obsreporttest_test.go | 36 +++---- receiver/otlpreceiver/otlp_test.go | 16 +-- .../scraperhelper/scrapercontroller_test.go | 8 +- 9 files changed, 100 insertions(+), 100 deletions(-) diff --git a/exporter/exporterhelper/logs_test.go b/exporter/exporterhelper/logs_test.go index a683f00667b..baa3e894bf2 100644 --- a/exporter/exporterhelper/logs_test.go +++ b/exporter/exporterhelper/logs_test.go @@ -125,16 +125,16 @@ func TestLogsExporter_WithRecordLogs_ReturnError(t *testing.T) { } func TestLogsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) rCfg := DefaultRetrySettings() qCfg := DefaultQueueSettings() qCfg.NumConsumers = 1 qCfg.QueueSize = 2 wantErr := errors.New("some-error") - te, err := NewLogsExporter(&fakeLogsExporterConfig, set.ToExporterCreateSettings(), newPushLogsData(wantErr), WithRetry(rCfg), WithQueue(qCfg)) + te, err := NewLogsExporter(&fakeLogsExporterConfig, tt.ToExporterCreateSettings(), newPushLogsData(wantErr), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) require.NotNil(t, te) @@ -205,9 +205,9 @@ func newPushLogsData(retError error) consumerhelper.ConsumeLogsFunc { } func checkRecordedMetricsForLogsExporter(t *testing.T, le component.LogsExporter, wantError error) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) ld := testdata.GenerateLogsTwoLogRecordsSameResource() const numBatches = 7 diff --git a/exporter/exporterhelper/metrics_test.go b/exporter/exporterhelper/metrics_test.go index 3075cc902c4..a4ea5ee3cb8 100644 --- a/exporter/exporterhelper/metrics_test.go +++ b/exporter/exporterhelper/metrics_test.go @@ -124,16 +124,16 @@ func TestMetricsExporter_WithRecordMetrics_ReturnError(t *testing.T) { } func TestMetricsExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) rCfg := DefaultRetrySettings() qCfg := DefaultQueueSettings() qCfg.NumConsumers = 1 qCfg.QueueSize = 2 wantErr := errors.New("some-error") - te, err := NewMetricsExporter(&fakeMetricsExporterConfig, set.ToExporterCreateSettings(), newPushMetricsData(wantErr), WithRetry(rCfg), WithQueue(qCfg)) + te, err := NewMetricsExporter(&fakeMetricsExporterConfig, tt.ToExporterCreateSettings(), newPushMetricsData(wantErr), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) require.NotNil(t, te) @@ -206,9 +206,9 @@ func newPushMetricsData(retError error) consumerhelper.ConsumeMetricsFunc { } func checkRecordedMetricsForMetricsExporter(t *testing.T, me component.MetricsExporter, wantError error) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) md := testdata.GenerateMetricsTwoMetrics() const numBatches = 7 diff --git a/exporter/exporterhelper/obsreport_test.go b/exporter/exporterhelper/obsreport_test.go index 8a90ddc1862..7d3c6dfbfd5 100644 --- a/exporter/exporterhelper/obsreport_test.go +++ b/exporter/exporterhelper/obsreport_test.go @@ -29,9 +29,9 @@ import ( ) func TestExportEnqueueFailure(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) exporter := config.NewComponentID("fakeExporter") @@ -39,7 +39,7 @@ func TestExportEnqueueFailure(t *testing.T) { obsrep := newObsExporter(obsreport.ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, - ExporterCreateSettings: set.ToExporterCreateSettings(), + ExporterCreateSettings: tt.ToExporterCreateSettings(), }, insts) logRecords := int64(7) diff --git a/exporter/exporterhelper/queued_retry_test.go b/exporter/exporterhelper/queued_retry_test.go index 87b8969049c..9812c601393 100644 --- a/exporter/exporterhelper/queued_retry_test.go +++ b/exporter/exporterhelper/queued_retry_test.go @@ -300,13 +300,13 @@ func TestQueuedRetry_DropOnFull(t *testing.T) { } func TestQueuedRetryHappyPath(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) qCfg := DefaultQueueSettings() rCfg := DefaultRetrySettings() - be := newBaseExporter(&defaultExporterCfg, set.ToExporterCreateSettings(), fromOptions(WithRetry(rCfg), WithQueue(qCfg)), "", nopRequestUnmarshaler()) + be := newBaseExporter(&defaultExporterCfg, tt.ToExporterCreateSettings(), fromOptions(WithRetry(rCfg), WithQueue(qCfg)), "", nopRequestUnmarshaler()) ocs := newObservabilityConsumerSender(be.qrSender.consumerSender) be.qrSender.consumerSender = ocs require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost())) diff --git a/exporter/exporterhelper/traces_test.go b/exporter/exporterhelper/traces_test.go index 8d1987e5cc0..4d8e26f2275 100644 --- a/exporter/exporterhelper/traces_test.go +++ b/exporter/exporterhelper/traces_test.go @@ -122,16 +122,16 @@ func TestTracesExporter_WithRecordMetrics_ReturnError(t *testing.T) { } func TestTracesExporter_WithRecordEnqueueFailedMetrics(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) rCfg := DefaultRetrySettings() qCfg := DefaultQueueSettings() qCfg.NumConsumers = 1 qCfg.QueueSize = 2 wantErr := errors.New("some-error") - te, err := NewTracesExporter(&fakeTracesExporterConfig, set.ToExporterCreateSettings(), newTraceDataPusher(wantErr), WithRetry(rCfg), WithQueue(qCfg)) + te, err := NewTracesExporter(&fakeTracesExporterConfig, tt.ToExporterCreateSettings(), newTraceDataPusher(wantErr), WithRetry(rCfg), WithQueue(qCfg)) require.NoError(t, err) require.NotNil(t, te) @@ -206,9 +206,9 @@ func newTraceDataPusher(retError error) consumerhelper.ConsumeTracesFunc { } func checkRecordedMetricsForTracesExporter(t *testing.T, te component.TracesExporter, wantError error) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) td := testdata.GenerateTracesTwoSpansSameResource() const numBatches = 7 diff --git a/obsreport/obsreport_test.go b/obsreport/obsreport_test.go index e0a588472ce..78c7fe46b36 100644 --- a/obsreport/obsreport_test.go +++ b/obsreport/obsreport_test.go @@ -52,11 +52,11 @@ type testParams struct { } func TestReceiveTraceDataOp(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + parentCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() params := []testParams{ @@ -67,14 +67,14 @@ func TestReceiveTraceDataOp(t *testing.T) { rec := NewReceiver(ReceiverSettings{ ReceiverID: receiver, Transport: transport, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartTracesOp(parentCtx) assert.NotNil(t, ctx) rec.EndTracesOp(ctx, format, params[i].items, param.err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) var acceptedSpans, refusedSpans int @@ -100,11 +100,11 @@ func TestReceiveTraceDataOp(t *testing.T) { } func TestReceiveLogsOp(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + parentCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() params := []testParams{ @@ -115,14 +115,14 @@ func TestReceiveLogsOp(t *testing.T) { rec := NewReceiver(ReceiverSettings{ ReceiverID: receiver, Transport: transport, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartLogsOp(parentCtx) assert.NotNil(t, ctx) rec.EndLogsOp(ctx, format, params[i].items, param.err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) var acceptedLogRecords, refusedLogRecords int @@ -148,11 +148,11 @@ func TestReceiveLogsOp(t *testing.T) { } func TestReceiveMetricsOp(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + parentCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() params := []testParams{ @@ -163,14 +163,14 @@ func TestReceiveMetricsOp(t *testing.T) { rec := NewReceiver(ReceiverSettings{ ReceiverID: receiver, Transport: transport, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartMetricsOp(parentCtx) assert.NotNil(t, ctx) rec.EndMetricsOp(ctx, format, params[i].items, param.err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) var acceptedMetricPoints, refusedMetricPoints int @@ -197,11 +197,11 @@ func TestReceiveMetricsOp(t *testing.T) { } func TestScrapeMetricsDataOp(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + parentCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() params := []testParams{ @@ -213,14 +213,14 @@ func TestScrapeMetricsDataOp(t *testing.T) { scrp := NewScraper(ScraperSettings{ ReceiverID: receiver, Scraper: scraper, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := scrp.StartMetricsOp(parentCtx) assert.NotNil(t, ctx) scrp.EndMetricsOp(ctx, params[i].items, params[i].err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) var scrapedMetricPoints, erroredMetricPoints int @@ -255,17 +255,17 @@ func TestScrapeMetricsDataOp(t *testing.T) { } func TestExportTraceDataOp(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + parentCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() obsrep := NewExporter(ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, - ExporterCreateSettings: set.ToExporterCreateSettings(), + ExporterCreateSettings: tt.ToExporterCreateSettings(), }) params := []testParams{ @@ -278,7 +278,7 @@ func TestExportTraceDataOp(t *testing.T) { obsrep.EndTracesOp(ctx, params[i].items, params[i].err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) var sentSpans, failedToSendSpans int @@ -305,17 +305,17 @@ func TestExportTraceDataOp(t *testing.T) { } func TestExportMetricsOp(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + parentCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() obsrep := NewExporter(ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, - ExporterCreateSettings: set.ToExporterCreateSettings(), + ExporterCreateSettings: tt.ToExporterCreateSettings(), }) params := []testParams{ @@ -329,7 +329,7 @@ func TestExportMetricsOp(t *testing.T) { obsrep.EndMetricsOp(ctx, params[i].items, params[i].err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) var sentMetricPoints, failedToSendMetricPoints int @@ -356,17 +356,17 @@ func TestExportMetricsOp(t *testing.T) { } func TestExportLogsOp(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - parentCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + parentCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() obsrep := NewExporter(ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, - ExporterCreateSettings: set.ToExporterCreateSettings(), + ExporterCreateSettings: tt.ToExporterCreateSettings(), }) params := []testParams{ @@ -380,7 +380,7 @@ func TestExportLogsOp(t *testing.T) { obsrep.EndLogsOp(ctx, params[i].items, params[i].err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) var sentLogRecords, failedToSendLogRecords int @@ -407,11 +407,11 @@ func TestExportLogsOp(t *testing.T) { } func TestReceiveWithLongLivedCtx(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) - longLivedCtx, parentSpan := set.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) + longLivedCtx, parentSpan := tt.TracerProvider.Tracer("test").Start(context.Background(), t.Name()) defer parentSpan.End() params := []testParams{ @@ -425,14 +425,14 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { ReceiverID: receiver, Transport: transport, LongLivedCtx: true, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartTracesOp(longLivedCtx) assert.NotNil(t, ctx) rec.EndTracesOp(ctx, format, params[i].items, params[i].err) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() require.Equal(t, len(params), len(spans)) for i, span := range spans { @@ -460,9 +460,9 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { } func TestProcessorTraceData(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) const acceptedSpans = 27 const refusedSpans = 19 @@ -471,7 +471,7 @@ func TestProcessorTraceData(t *testing.T) { obsrep := NewProcessor(ProcessorSettings{ Level: configtelemetry.LevelNormal, ProcessorID: processor, - ProcessorCreateSettings: set.ToProcessorCreateSettings(), + ProcessorCreateSettings: tt.ToProcessorCreateSettings(), }) obsrep.TracesAccepted(context.Background(), acceptedSpans) obsrep.TracesRefused(context.Background(), refusedSpans) @@ -481,9 +481,9 @@ func TestProcessorTraceData(t *testing.T) { } func TestProcessorMetricsData(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) const acceptedPoints = 29 const refusedPoints = 11 @@ -492,7 +492,7 @@ func TestProcessorMetricsData(t *testing.T) { obsrep := NewProcessor(ProcessorSettings{ Level: configtelemetry.LevelNormal, ProcessorID: processor, - ProcessorCreateSettings: set.ToProcessorCreateSettings(), + ProcessorCreateSettings: tt.ToProcessorCreateSettings(), }) obsrep.MetricsAccepted(context.Background(), acceptedPoints) obsrep.MetricsRefused(context.Background(), refusedPoints) @@ -524,9 +524,9 @@ func TestBuildProcessorCustomMetricName(t *testing.T) { } func TestProcessorLogRecords(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) const acceptedRecords = 29 const refusedRecords = 11 @@ -535,7 +535,7 @@ func TestProcessorLogRecords(t *testing.T) { obsrep := NewProcessor(ProcessorSettings{ Level: configtelemetry.LevelNormal, ProcessorID: processor, - ProcessorCreateSettings: set.ToProcessorCreateSettings(), + ProcessorCreateSettings: tt.ToProcessorCreateSettings(), }) obsrep.LogsAccepted(context.Background(), acceptedRecords) obsrep.LogsRefused(context.Background(), refusedRecords) diff --git a/obsreport/obsreporttest/obsreporttest_test.go b/obsreport/obsreporttest/obsreporttest_test.go index 1d74bb055e6..049b61b747b 100644 --- a/obsreport/obsreporttest/obsreporttest_test.go +++ b/obsreport/obsreporttest/obsreporttest_test.go @@ -38,14 +38,14 @@ var ( ) func TestCheckReceiverTracesViews(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ ReceiverID: receiver, Transport: transport, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartTracesOp(context.Background()) assert.NotNil(t, ctx) @@ -59,14 +59,14 @@ func TestCheckReceiverTracesViews(t *testing.T) { } func TestCheckReceiverMetricsViews(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ ReceiverID: receiver, Transport: transport, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartMetricsOp(context.Background()) assert.NotNil(t, ctx) @@ -76,14 +76,14 @@ func TestCheckReceiverMetricsViews(t *testing.T) { } func TestCheckReceiverLogsViews(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ ReceiverID: receiver, Transport: transport, - ReceiverCreateSettings: set.ToReceiverCreateSettings(), + ReceiverCreateSettings: tt.ToReceiverCreateSettings(), }) ctx := rec.StartLogsOp(context.Background()) assert.NotNil(t, ctx) @@ -93,14 +93,14 @@ func TestCheckReceiverLogsViews(t *testing.T) { } func TestCheckExporterTracesViews(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) obsrep := obsreport.NewExporter(obsreport.ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, - ExporterCreateSettings: set.ToExporterCreateSettings(), + ExporterCreateSettings: tt.ToExporterCreateSettings(), }) ctx := obsrep.StartTracesOp(context.Background()) assert.NotNil(t, ctx) @@ -111,14 +111,14 @@ func TestCheckExporterTracesViews(t *testing.T) { } func TestCheckExporterMetricsViews(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) obsrep := obsreport.NewExporter(obsreport.ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, - ExporterCreateSettings: set.ToExporterCreateSettings(), + ExporterCreateSettings: tt.ToExporterCreateSettings(), }) ctx := obsrep.StartMetricsOp(context.Background()) assert.NotNil(t, ctx) @@ -129,14 +129,14 @@ func TestCheckExporterMetricsViews(t *testing.T) { } func TestCheckExporterLogsViews(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) obsrep := obsreport.NewExporter(obsreport.ExporterSettings{ Level: configtelemetry.LevelNormal, ExporterID: exporter, - ExporterCreateSettings: set.ToExporterCreateSettings(), + ExporterCreateSettings: tt.ToExporterCreateSettings(), }) ctx := obsrep.StartLogsOp(context.Background()) assert.NotNil(t, ctx) diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 1690a91bbb9..62db332d2e3 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -497,11 +497,11 @@ func TestOTLPReceiverTrace_HandleNextConsumerResponse(t *testing.T) { }, } for _, exporter := range exporters { - for _, tt := range tests { - t.Run(tt.name+"/"+exporter.receiverTag, func(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + for _, test := range tests { + t.Run(test.name+"/"+exporter.receiverTag, func(t *testing.T) { + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) sink := &internalconsumertest.ErrOrSinkConsumer{TracesSink: new(consumertest.TracesSink)} @@ -514,11 +514,11 @@ func TestOTLPReceiverTrace_HandleNextConsumerResponse(t *testing.T) { require.NoError(t, err) defer cc.Close() - for _, ingestionState := range tt.ingestionStates { + for _, ingestionState := range test.ingestionStates { if ingestionState.okToIngest { sink.SetConsumeError(nil) } else { - sink.SetConsumeError(fmt.Errorf("%q: consumer error", tt.name)) + sink.SetConsumeError(fmt.Errorf("%q: consumer error", test.name)) } err = exporter.exportFn(cc, req) @@ -528,9 +528,9 @@ func TestOTLPReceiverTrace_HandleNextConsumerResponse(t *testing.T) { assert.Equal(t, ingestionState.expectedCode, status.Code()) } - require.Equal(t, tt.expectedReceivedBatches, len(sink.AllTraces())) + require.Equal(t, test.expectedReceivedBatches, len(sink.AllTraces())) - require.NoError(t, obsreporttest.CheckReceiverTraces(config.NewComponentIDWithName(typeStr, exporter.receiverTag), "grpc", int64(tt.expectedReceivedBatches), int64(tt.expectedIngestionBlockedRPCs))) + require.NoError(t, obsreporttest.CheckReceiverTraces(config.NewComponentIDWithName(typeStr, exporter.receiverTag), "grpc", int64(test.expectedReceivedBatches), int64(test.expectedIngestionBlockedRPCs))) }) } } diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index ecf8dc47d34..d4c4872466d 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -138,9 +138,9 @@ func TestScrapeController(t *testing.T) { for _, test := range testCases { t.Run(test.name, func(t *testing.T) { - set, err := obsreporttest.SetupTelemetry() + tt, err := obsreporttest.SetupTelemetry() require.NoError(t, err) - defer set.Shutdown(context.Background()) + defer tt.Shutdown(context.Background()) initializeChs := make([]chan bool, test.scrapers) scrapeMetricsChs := make([]chan int, test.scrapers) @@ -161,7 +161,7 @@ func TestScrapeController(t *testing.T) { cfg = test.scraperControllerSettings } - mr, err := NewScraperControllerReceiver(cfg, set.ToReceiverCreateSettings(), nextConsumer, options...) + mr, err := NewScraperControllerReceiver(cfg, tt.ToReceiverCreateSettings(), nextConsumer, options...) if test.expectedNewErr != "" { assert.EqualError(t, err, test.expectedNewErr) return @@ -199,7 +199,7 @@ func TestScrapeController(t *testing.T) { assert.GreaterOrEqual(t, sink.DataPointCount(), iterations) } - spans := set.SpanRecorder.Ended() + spans := tt.SpanRecorder.Ended() assertReceiverSpan(t, spans) assertReceiverViews(t, sink) assertScraperSpan(t, test.scrapeErr, spans) From 02353b4646b4ceca0dd6cb6dd15c3144d0995ecb Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Wed, 27 Oct 2021 15:58:52 -0700 Subject: [PATCH 096/149] Add note about using multimod to the release doc (#4280) Adding info about running multimod as part of the release process. Also fixing a typo in the repo name used to produce the changelog in the core repo steps. Fixes #4204 --- docs/release.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/release.md b/docs/release.md index 191c359a7ea..bcfc8af1ee8 100644 --- a/docs/release.md +++ b/docs/release.md @@ -18,9 +18,11 @@ We release both core and contrib collectors with the same versions where the con 1. Determine the version number that will be assigned to the release. Collector uses semver, with the exception that while we are still in Beta stage breaking changes are allowed without incrementing major version number. For breaking changes we increment the minor version number and set the patch number to 0. -1. Prepare Core for release. Update CHANGELOG.md file and rename the Unreleased section to the new release name. Add a new unreleased section at top. - - Use commit history feature to get the list of commits since the last release to help understand what should be in the release notes, e.g.: https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/${last_release}...main. Submit a PR with the changes and get the PR approved and merged. +1. Prepare Core for release. + * Update CHANGELOG.md file and rename the Unreleased section to the new release name. Add a new unreleased section at top. Use commit history feature to get the list of commits since the last release to help understand what should be in the release notes, e.g.: https://github.com/open-telemetry/opentelemetry-collector/compare/${last_release}...main. Submit a PR with the changes and get the PR approved and merged. + * Use multimod to update the version of the collector package + * Update [versions.yaml](https://github.com/open-telemetry/opentelemetry-collector/blob/main/versions.yaml) + * Run `make multimod-prerelease` 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). @@ -32,7 +34,11 @@ We release both core and contrib collectors with the same versions where the con ## Releasing opentelemetry-collector-contrib -1. Prepare Contrib for release. Update CHANGELOG.md file and rename the Unreleased section to the new release name. Add a new unreleased section at top. Refer to Core release notes (assuming the previous release of Core and Contrib was also performed simultaneously), and in addition to that list changes that happened in the Contrib repo. +1. Prepare Contrib for release. + * Update CHANGELOG.md file and rename the Unreleased section to the new release name. Add a new unreleased section at top. Refer to Core release notes (assuming the previous release of Core and Contrib was also performed simultaneously), and in addition to that list changes that happened in the Contrib repo. + * Use multimod to update the version of the collector package + * Update [versions.yaml](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/versions.yaml) + * Run `make multimod-prerelease` 1. Update the Core dependency to the Core version we just released with `make update-otel` command, e.g, `make update-otel OTEL_VERSION=v0.4.0`. Create a PR with both the changes, get it approved and merged. From db6d31e9acc546e043b7b5564377bd76998e74bd Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Wed, 27 Oct 2021 16:00:20 -0700 Subject: [PATCH 097/149] Prepare collector-base for version v0.38.0 (#4279) - update changelog - update version to 0.38.0 - run make multimod-prerelease --- CHANGELOG.md | 27 +++++++++++++++++++++------ go.mod | 2 +- versions.yaml | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3d193abaa6..1211ba37c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +2,30 @@ ## Unreleased -## 🛑 Breaking changes 🛑 -- Removed `configauth.HTTPClientAuthenticator` and `configauth.GRPCClientAuthenticator` in favor of `configauth.ClientAuthenticator` (#4255) +## v0.38.0 Beta ## 🛑 Breaking changes 🛑 -- Rename `parserprovider.MapProvider` as `config.MapProvider` (#4178) -- Rename `parserprovider.Watchable` as `config.WatchableMapProvider` (#4178) -- Remove deprecated no-op flags to setup Collector's logging "--log-level", "--log-profile", "--log-format" (#4213) -- Move `cmd/pdatagen` as internal package `model/internal/cmd/pdatagen` (#4243) +- Removed `configauth.HTTPClientAuthenticator` and `configauth.GRPCClientAuthenticator` in favor of `configauth.ClientAuthenticator`. (#4255) +- Rename `parserprovider.MapProvider` as `config.MapProvider`. (#4178) +- Rename `parserprovider.Watchable` as `config.WatchableMapProvider`. (#4178) +- Remove deprecated no-op flags to setup Collector's logging "--log-level", "--log-profile", "--log-format". (#4213) +- Move `cmd/pdatagen` as internal package `model/internal/cmd/pdatagen`. (#4243) +- Use directly the ComponentID in configauth. (#4238) +- Refactor configauth, getters use the map instead of iteration. (#4234) +- Change scraperhelper to follow the recommended append model for pdata. (#4202) + +## 💡 Enhancements 💡 + +- Update proto to 0.11.0. (#4209) +- Change pdata to use the newly added [Traces|Metrics|Logs]Data. (#4214) +- Add ExponentialHistogram field to pdata. (#4219) +- Make sure otlphttp exporter tests include TraceID and SpanID. (#4268) +- Use multimod tool in release process. (#4229) +- Change queue metrics to use opencensus metrics instead of stats, close to otel-go. (#4220) +- Make receiver data delivery guarantees explicit (#4262) +- Simplify unmarshal logic by adding more supported hooks. (#4237) +- Add unmarshaler for otlpgrpc.[*]Request and otlpgrp.[*]Response (#4215) ## v0.37.0 Beta diff --git a/go.mod b/go.mod index 599f1647c22..1cc52315318 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,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.37.0 + go.opentelemetry.io/collector/model v0.38.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 go.opentelemetry.io/contrib/zpages v0.25.0 diff --git a/versions.yaml b/versions.yaml index f6e64fb5e0c..f6d6298764d 100644 --- a/versions.yaml +++ b/versions.yaml @@ -14,7 +14,7 @@ module-sets: collector-base: - version: v0.37.0 + version: v0.38.0 modules: - go.opentelemetry.io/collector - go.opentelemetry.io/collector/model From 075d83a0488dfb811ab819c4023f9c4263c4f857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 28 Oct 2021 13:31:58 +0200 Subject: [PATCH 098/149] Move builder to subdirectory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- {.github => builder/.github}/CODEOWNERS | 0 {.github => builder/.github}/mergify.yml | 0 {.github => builder/.github}/workflows/go.yaml | 0 {.github => builder/.github}/workflows/integration-test.yaml | 0 {.github => builder/.github}/workflows/release.yml | 0 .gitignore => builder/.gitignore | 0 .golangci.yaml => builder/.golangci.yaml | 0 .goreleaser.yml => builder/.goreleaser.yml | 0 LICENSE => builder/LICENSE | 0 README.md => builder/README.md | 0 RELEASE.md => builder/RELEASE.md | 0 {cmd => builder/cmd}/root.go | 0 go.mod => builder/go.mod | 0 go.sum => builder/go.sum | 0 header.txt => builder/header.txt | 0 {internal => builder/internal}/builder/config.go | 0 {internal => builder/internal}/builder/config_test.go | 0 {internal => builder/internal}/builder/main.go | 0 {internal => builder/internal}/scaffold/components.go | 0 {internal => builder/internal}/scaffold/gomod.go | 0 {internal => builder/internal}/scaffold/main.go | 0 main.go => builder/main.go | 0 {test => builder/test}/README.md | 0 {test => builder/test}/nocore.builder.yaml | 0 {test => builder/test}/nocore.otel.yaml | 0 {test => builder/test}/replaces.builder.yaml | 0 {test => builder/test}/replaces.otel.yaml | 0 {test => builder/test}/test.sh | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename {.github => builder/.github}/CODEOWNERS (100%) rename {.github => builder/.github}/mergify.yml (100%) rename {.github => builder/.github}/workflows/go.yaml (100%) rename {.github => builder/.github}/workflows/integration-test.yaml (100%) rename {.github => builder/.github}/workflows/release.yml (100%) rename .gitignore => builder/.gitignore (100%) rename .golangci.yaml => builder/.golangci.yaml (100%) rename .goreleaser.yml => builder/.goreleaser.yml (100%) rename LICENSE => builder/LICENSE (100%) rename README.md => builder/README.md (100%) rename RELEASE.md => builder/RELEASE.md (100%) rename {cmd => builder/cmd}/root.go (100%) rename go.mod => builder/go.mod (100%) rename go.sum => builder/go.sum (100%) rename header.txt => builder/header.txt (100%) rename {internal => builder/internal}/builder/config.go (100%) rename {internal => builder/internal}/builder/config_test.go (100%) rename {internal => builder/internal}/builder/main.go (100%) rename {internal => builder/internal}/scaffold/components.go (100%) rename {internal => builder/internal}/scaffold/gomod.go (100%) rename {internal => builder/internal}/scaffold/main.go (100%) rename main.go => builder/main.go (100%) rename {test => builder/test}/README.md (100%) rename {test => builder/test}/nocore.builder.yaml (100%) rename {test => builder/test}/nocore.otel.yaml (100%) rename {test => builder/test}/replaces.builder.yaml (100%) rename {test => builder/test}/replaces.otel.yaml (100%) rename {test => builder/test}/test.sh (100%) diff --git a/.github/CODEOWNERS b/builder/.github/CODEOWNERS similarity index 100% rename from .github/CODEOWNERS rename to builder/.github/CODEOWNERS diff --git a/.github/mergify.yml b/builder/.github/mergify.yml similarity index 100% rename from .github/mergify.yml rename to builder/.github/mergify.yml diff --git a/.github/workflows/go.yaml b/builder/.github/workflows/go.yaml similarity index 100% rename from .github/workflows/go.yaml rename to builder/.github/workflows/go.yaml diff --git a/.github/workflows/integration-test.yaml b/builder/.github/workflows/integration-test.yaml similarity index 100% rename from .github/workflows/integration-test.yaml rename to builder/.github/workflows/integration-test.yaml diff --git a/.github/workflows/release.yml b/builder/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release.yml rename to builder/.github/workflows/release.yml diff --git a/.gitignore b/builder/.gitignore similarity index 100% rename from .gitignore rename to builder/.gitignore diff --git a/.golangci.yaml b/builder/.golangci.yaml similarity index 100% rename from .golangci.yaml rename to builder/.golangci.yaml diff --git a/.goreleaser.yml b/builder/.goreleaser.yml similarity index 100% rename from .goreleaser.yml rename to builder/.goreleaser.yml diff --git a/LICENSE b/builder/LICENSE similarity index 100% rename from LICENSE rename to builder/LICENSE diff --git a/README.md b/builder/README.md similarity index 100% rename from README.md rename to builder/README.md diff --git a/RELEASE.md b/builder/RELEASE.md similarity index 100% rename from RELEASE.md rename to builder/RELEASE.md diff --git a/cmd/root.go b/builder/cmd/root.go similarity index 100% rename from cmd/root.go rename to builder/cmd/root.go diff --git a/go.mod b/builder/go.mod similarity index 100% rename from go.mod rename to builder/go.mod diff --git a/go.sum b/builder/go.sum similarity index 100% rename from go.sum rename to builder/go.sum diff --git a/header.txt b/builder/header.txt similarity index 100% rename from header.txt rename to builder/header.txt diff --git a/internal/builder/config.go b/builder/internal/builder/config.go similarity index 100% rename from internal/builder/config.go rename to builder/internal/builder/config.go diff --git a/internal/builder/config_test.go b/builder/internal/builder/config_test.go similarity index 100% rename from internal/builder/config_test.go rename to builder/internal/builder/config_test.go diff --git a/internal/builder/main.go b/builder/internal/builder/main.go similarity index 100% rename from internal/builder/main.go rename to builder/internal/builder/main.go diff --git a/internal/scaffold/components.go b/builder/internal/scaffold/components.go similarity index 100% rename from internal/scaffold/components.go rename to builder/internal/scaffold/components.go diff --git a/internal/scaffold/gomod.go b/builder/internal/scaffold/gomod.go similarity index 100% rename from internal/scaffold/gomod.go rename to builder/internal/scaffold/gomod.go diff --git a/internal/scaffold/main.go b/builder/internal/scaffold/main.go similarity index 100% rename from internal/scaffold/main.go rename to builder/internal/scaffold/main.go diff --git a/main.go b/builder/main.go similarity index 100% rename from main.go rename to builder/main.go diff --git a/test/README.md b/builder/test/README.md similarity index 100% rename from test/README.md rename to builder/test/README.md diff --git a/test/nocore.builder.yaml b/builder/test/nocore.builder.yaml similarity index 100% rename from test/nocore.builder.yaml rename to builder/test/nocore.builder.yaml diff --git a/test/nocore.otel.yaml b/builder/test/nocore.otel.yaml similarity index 100% rename from test/nocore.otel.yaml rename to builder/test/nocore.otel.yaml diff --git a/test/replaces.builder.yaml b/builder/test/replaces.builder.yaml similarity index 100% rename from test/replaces.builder.yaml rename to builder/test/replaces.builder.yaml diff --git a/test/replaces.otel.yaml b/builder/test/replaces.otel.yaml similarity index 100% rename from test/replaces.otel.yaml rename to builder/test/replaces.otel.yaml diff --git a/test/test.sh b/builder/test/test.sh similarity index 100% rename from test/test.sh rename to builder/test/test.sh From eb3601a05900f70e46c058facf16461efa7b09f0 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 28 Oct 2021 08:49:32 -0700 Subject: [PATCH 099/149] Avoid potential integer overflow (#4277) Signed-off-by: Bogdan Drutu --- internal/testutil/testutil.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 6b8ac9d402c..33d1ce08fc9 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -75,7 +75,7 @@ func GetAvailablePort(t *testing.T) uint16 { } } - portInt, err := strconv.Atoi(port) + portInt, err := strconv.ParseUint(port, 10, 16) require.NoError(t, err) return uint16(portInt) From 87405ddaa41ac7bd723c54e2ca7dc6d2d5358ec7 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 28 Oct 2021 08:49:51 -0700 Subject: [PATCH 100/149] Small cleanup for batchprocessor split logic (#4284) Signed-off-by: Bogdan Drutu --- processor/batchprocessor/splitlogs_test.go | 83 +++++------- processor/batchprocessor/splitmetrics.go | 126 +++++++++--------- processor/batchprocessor/splitmetrics_test.go | 83 +++++------- processor/batchprocessor/splittraces_test.go | 60 ++++----- 4 files changed, 156 insertions(+), 196 deletions(-) diff --git a/processor/batchprocessor/splitlogs_test.go b/processor/batchprocessor/splitlogs_test.go index 229ccf5aff6..1cd428f2f71 100644 --- a/processor/batchprocessor/splitlogs_test.go +++ b/processor/batchprocessor/splitlogs_test.go @@ -127,58 +127,6 @@ func TestSplitLogsMultipleResourceLogs_split_size_greater_than_log_size(t *testi assert.Equal(t, "test-log-int-1-4", split.ResourceLogs().At(1).InstrumentationLibraryLogs().At(0).Logs().At(4).Name()) } -func BenchmarkSplitLogs(b *testing.B) { - md := pdata.NewLogs() - rms := md.ResourceLogs() - for i := 0; i < 20; i++ { - testdata.GenerateLogsManyLogRecordsSameResource(20).ResourceLogs().MoveAndAppendTo(md.ResourceLogs()) - ms := rms.At(rms.Len() - 1).InstrumentationLibraryLogs().At(0).Logs() - for i := 0; i < ms.Len(); i++ { - ms.At(i).SetName(getTestLogName(1, i)) - } - } - - if b.N > 100000 { - b.Skipf("SKIP: b.N too high, set -benchtine=x with n < 100000") - } - - clones := make([]pdata.Logs, b.N) - for n := 0; n < b.N; n++ { - clones[n] = md.Clone() - } - - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - cloneReq := clones[n] - split := splitLogs(128, cloneReq) - if split.LogRecordCount() != 128 || cloneReq.LogRecordCount() != 400-128 { - b.Fail() - } - } -} - -func BenchmarkCloneLogs(b *testing.B) { - md := pdata.NewLogs() - rms := md.ResourceLogs() - for i := 0; i < 20; i++ { - testdata.GenerateLogsManyLogRecordsSameResource(20).ResourceLogs().MoveAndAppendTo(md.ResourceLogs()) - ms := rms.At(rms.Len() - 1).InstrumentationLibraryLogs().At(0).Logs() - for i := 0; i < ms.Len(); i++ { - ms.At(i).SetName(getTestLogName(1, i)) - } - } - - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - cloneReq := md.Clone() - if cloneReq.LogRecordCount() != 400 { - b.Fail() - } - } -} - func TestSplitLogsMultipleILL(t *testing.T) { td := testdata.GenerateLogsManyLogRecordsSameResource(20) logs := td.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0).Logs() @@ -208,3 +156,34 @@ func TestSplitLogsMultipleILL(t *testing.T) { assert.Equal(t, "test-log-int-0-0", split.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0).Logs().At(0).Name()) assert.Equal(t, "test-log-int-0-4", split.ResourceLogs().At(0).InstrumentationLibraryLogs().At(0).Logs().At(4).Name()) } + +func BenchmarkSplitLogs(b *testing.B) { + md := pdata.NewLogs() + rms := md.ResourceLogs() + for i := 0; i < 20; i++ { + testdata.GenerateLogsManyLogRecordsSameResource(20).ResourceLogs().MoveAndAppendTo(md.ResourceLogs()) + ms := rms.At(rms.Len() - 1).InstrumentationLibraryLogs().At(0).Logs() + for i := 0; i < ms.Len(); i++ { + ms.At(i).SetName(getTestLogName(1, i)) + } + } + + if b.N > 100000 { + b.Skipf("SKIP: b.N too high, set -benchtime=x with n < 100000") + } + + clones := make([]pdata.Logs, b.N) + for n := 0; n < b.N; n++ { + clones[n] = md.Clone() + } + + b.ReportAllocs() + b.ResetTimer() + for n := 0; n < b.N; n++ { + cloneReq := clones[n] + split := splitLogs(128, cloneReq) + if split.LogRecordCount() != 128 || cloneReq.LogRecordCount() != 400-128 { + b.Fail() + } + } +} diff --git a/processor/batchprocessor/splitmetrics.go b/processor/batchprocessor/splitmetrics.go index 04a33f65ce6..a92461f491f 100644 --- a/processor/batchprocessor/splitmetrics.go +++ b/processor/batchprocessor/splitmetrics.go @@ -80,42 +80,46 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { } // resourceMetricsDataPointCount calculates the total number of data points. -func resourceMetricsDataPointCount(rs pdata.ResourceMetrics) (dataPointCount int) { - for k := 0; k < rs.InstrumentationLibraryMetrics().Len(); k++ { - dataPointCount += metricSliceDataPointCount(rs.InstrumentationLibraryMetrics().At(k).Metrics()) +func resourceMetricsDataPointCount(rs pdata.ResourceMetrics) int { + dataPointCount := 0 + ilms := rs.InstrumentationLibraryMetrics() + for k := 0; k < ilms.Len(); k++ { + dataPointCount += metricSliceDataPointCount(ilms.At(k).Metrics()) } - return + return dataPointCount } // metricSliceDataPointCount calculates the total number of data points. -func metricSliceDataPointCount(ms pdata.MetricSlice) (dataPointCount int) { +func metricSliceDataPointCount(ms pdata.MetricSlice) int { + dataPointCount := 0 for k := 0; k < ms.Len(); k++ { dataPointCount += metricDataPointCount(ms.At(k)) } - return + return dataPointCount } // metricDataPointCount calculates the total number of data points. -func metricDataPointCount(ms pdata.Metric) (dataPointCount int) { +func metricDataPointCount(ms pdata.Metric) int { switch ms.DataType() { case pdata.MetricDataTypeGauge: - dataPointCount = ms.Gauge().DataPoints().Len() + return ms.Gauge().DataPoints().Len() case pdata.MetricDataTypeSum: - dataPointCount = ms.Sum().DataPoints().Len() + return ms.Sum().DataPoints().Len() case pdata.MetricDataTypeHistogram: - dataPointCount = ms.Histogram().DataPoints().Len() + return ms.Histogram().DataPoints().Len() case pdata.MetricDataTypeSummary: - dataPointCount = ms.Summary().DataPoints().Len() + return ms.Summary().DataPoints().Len() } - return + return 0 } // splitMetric removes metric points from the input data and moves data of the specified size to destination. // Returns size of moved data and boolean describing, whether the metric should be removed from original slice. func splitMetric(ms, dest pdata.Metric, size int) (int, bool) { - if metricDataPointCount(ms) <= size { + mdDPC := metricDataPointCount(ms) + if mdDPC <= size { ms.MoveTo(dest) - return metricDataPointCount(dest), true + return mdDPC, true } dest.SetDataType(ms.DataType()) @@ -125,57 +129,55 @@ func splitMetric(ms, dest pdata.Metric, size int) (int, bool) { switch ms.DataType() { case pdata.MetricDataTypeGauge: - src := ms.Gauge().DataPoints() - dst := dest.Gauge().DataPoints() - dst.EnsureCapacity(size) - i := 0 - src.RemoveIf(func(dp pdata.NumberDataPoint) bool { - defer func() { i++ }() - if i < size { - dp.MoveTo(dst.AppendEmpty()) - return true - } - return false - }) + return splitNumberDataPoints(ms.Gauge().DataPoints(), dest.Gauge().DataPoints(), size) case pdata.MetricDataTypeSum: - src := ms.Sum().DataPoints() - dst := dest.Sum().DataPoints() - dst.EnsureCapacity(size) - i := 0 - src.RemoveIf(func(dp pdata.NumberDataPoint) bool { - defer func() { i++ }() - if i < size { - dp.MoveTo(dst.AppendEmpty()) - return true - } - return false - }) + return splitNumberDataPoints(ms.Sum().DataPoints(), dest.Sum().DataPoints(), size) case pdata.MetricDataTypeHistogram: - src := ms.Histogram().DataPoints() - dst := dest.Histogram().DataPoints() - dst.EnsureCapacity(size) - i := 0 - src.RemoveIf(func(dp pdata.HistogramDataPoint) bool { - defer func() { i++ }() - if i < size { - dp.MoveTo(dst.AppendEmpty()) - return true - } - return false - }) + return splitHistogramDataPoints(ms.Histogram().DataPoints(), dest.Histogram().DataPoints(), size) case pdata.MetricDataTypeSummary: - src := ms.Summary().DataPoints() - dst := dest.Summary().DataPoints() - dst.EnsureCapacity(size) - i := 0 - src.RemoveIf(func(dp pdata.SummaryDataPoint) bool { - defer func() { i++ }() - if i < size { - dp.MoveTo(dst.AppendEmpty()) - return true - } - return false - }) + return splitSummaryDataPoints(ms.Summary().DataPoints(), dest.Summary().DataPoints(), size) } return size, false } + +func splitNumberDataPoints(src, dst pdata.NumberDataPointSlice, size int) (int, bool) { + dst.EnsureCapacity(size) + i := 0 + src.RemoveIf(func(dp pdata.NumberDataPoint) bool { + if i < size { + dp.MoveTo(dst.AppendEmpty()) + i++ + return true + } + return false + }) + return size, false +} + +func splitHistogramDataPoints(src, dst pdata.HistogramDataPointSlice, size int) (int, bool) { + dst.EnsureCapacity(size) + i := 0 + src.RemoveIf(func(dp pdata.HistogramDataPoint) 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 + src.RemoveIf(func(dp pdata.SummaryDataPoint) bool { + if i < size { + dp.MoveTo(dst.AppendEmpty()) + i++ + return true + } + return false + }) + return size, false +} diff --git a/processor/batchprocessor/splitmetrics_test.go b/processor/batchprocessor/splitmetrics_test.go index fee708927c2..3218e707ed7 100644 --- a/processor/batchprocessor/splitmetrics_test.go +++ b/processor/batchprocessor/splitmetrics_test.go @@ -136,58 +136,6 @@ func TestSplitMetricsMultipleResourceSpans_SplitSizeGreaterThanMetricSize(t *tes assert.Equal(t, "test-metric-int-1-4", split.ResourceMetrics().At(1).InstrumentationLibraryMetrics().At(0).Metrics().At(4).Name()) } -func BenchmarkSplitMetrics(b *testing.B) { - md := pdata.NewMetrics() - rms := md.ResourceMetrics() - for i := 0; i < 20; i++ { - testdata.GenerateMetricsManyMetricsSameResource(20).ResourceMetrics().MoveAndAppendTo(md.ResourceMetrics()) - ms := rms.At(rms.Len() - 1).InstrumentationLibraryMetrics().At(0).Metrics() - for i := 0; i < ms.Len(); i++ { - ms.At(i).SetName(getTestMetricName(1, i)) - } - } - - if b.N > 100000 { - b.Skipf("SKIP: b.N too high, set -benchtine=x with n < 100000") - } - - dataPointCount := metricDataPointCount(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0)) - clones := make([]pdata.Metrics, b.N) - for n := 0; n < b.N; n++ { - clones[n] = md.Clone() - } - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - cloneReq := clones[n] - split := splitMetrics(128*dataPointCount, cloneReq) - if split.MetricCount() != 128 || cloneReq.MetricCount() != 400-128 { - b.Fail() - } - } -} - -func BenchmarkCloneMetrics(b *testing.B) { - md := pdata.NewMetrics() - rms := md.ResourceMetrics() - for i := 0; i < 20; i++ { - testdata.GenerateMetricsManyMetricsSameResource(20).ResourceMetrics().MoveAndAppendTo(md.ResourceMetrics()) - ms := rms.At(rms.Len() - 1).InstrumentationLibraryMetrics().At(0).Metrics() - for i := 0; i < ms.Len(); i++ { - ms.At(i).SetName(getTestMetricName(1, i)) - } - } - - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - cloneReq := md.Clone() - if cloneReq.MetricCount() != 400 { - b.Fail() - } - } -} - func TestSplitMetricsUneven(t *testing.T) { md := testdata.GenerateMetricsManyMetricsSameResource(10) metrics := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() @@ -274,3 +222,34 @@ func TestSplitMetricsMultipleILM(t *testing.T) { assert.Equal(t, "test-metric-int-0-0", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0).Name()) assert.Equal(t, "test-metric-int-0-4", split.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(4).Name()) } + +func BenchmarkSplitMetrics(b *testing.B) { + md := pdata.NewMetrics() + rms := md.ResourceMetrics() + for i := 0; i < 20; i++ { + testdata.GenerateMetricsManyMetricsSameResource(20).ResourceMetrics().MoveAndAppendTo(md.ResourceMetrics()) + ms := rms.At(rms.Len() - 1).InstrumentationLibraryMetrics().At(0).Metrics() + for i := 0; i < ms.Len(); i++ { + ms.At(i).SetName(getTestMetricName(1, i)) + } + } + + if b.N > 100000 { + b.Skipf("SKIP: b.N too high, set -benchtime=x with n < 100000") + } + + dataPointCount := metricDataPointCount(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0)) + clones := make([]pdata.Metrics, b.N) + for n := 0; n < b.N; n++ { + clones[n] = md.Clone() + } + b.ReportAllocs() + b.ResetTimer() + for n := 0; n < b.N; n++ { + cloneReq := clones[n] + split := splitMetrics(128*dataPointCount, cloneReq) + if split.MetricCount() != 128 || cloneReq.MetricCount() != 400-128 { + b.Fail() + } + } +} diff --git a/processor/batchprocessor/splittraces_test.go b/processor/batchprocessor/splittraces_test.go index 6de10da9598..df4c8b7e039 100644 --- a/processor/batchprocessor/splittraces_test.go +++ b/processor/batchprocessor/splittraces_test.go @@ -127,36 +127,6 @@ func TestSplitTracesMultipleResourceSpans_SplitSizeGreaterThanSpanSize(t *testin assert.Equal(t, "test-span-1-4", split.ResourceSpans().At(1).InstrumentationLibrarySpans().At(0).Spans().At(4).Name()) } -func BenchmarkSplitTraces(b *testing.B) { - td := pdata.NewTraces() - rms := td.ResourceSpans() - for i := 0; i < 20; i++ { - testdata.GenerateTracesManySpansSameResource(20).ResourceSpans().MoveAndAppendTo(td.ResourceSpans()) - ms := rms.At(rms.Len() - 1).InstrumentationLibrarySpans().At(0).Spans() - for i := 0; i < ms.Len(); i++ { - ms.At(i).SetName(getTestMetricName(1, i)) - } - } - - if b.N > 100000 { - b.Skipf("SKIP: b.N too high, set -benchtine=x with n < 100000") - } - - clones := make([]pdata.Traces, b.N) - for n := 0; n < b.N; n++ { - clones[n] = td.Clone() - } - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - cloneReq := clones[n] - split := splitTraces(128, cloneReq) - if split.SpanCount() != 128 || cloneReq.SpanCount() != 400-128 { - b.Fail() - } - } -} - func BenchmarkCloneSpans(b *testing.B) { td := pdata.NewTraces() rms := td.ResourceSpans() @@ -207,3 +177,33 @@ func TestSplitTracesMultipleILS(t *testing.T) { assert.Equal(t, "test-span-0-0", split.ResourceSpans().At(0).InstrumentationLibrarySpans().At(0).Spans().At(0).Name()) assert.Equal(t, "test-span-0-4", split.ResourceSpans().At(0).InstrumentationLibrarySpans().At(0).Spans().At(4).Name()) } + +func BenchmarkSplitTraces(b *testing.B) { + td := pdata.NewTraces() + rms := td.ResourceSpans() + for i := 0; i < 20; i++ { + testdata.GenerateTracesManySpansSameResource(20).ResourceSpans().MoveAndAppendTo(td.ResourceSpans()) + ms := rms.At(rms.Len() - 1).InstrumentationLibrarySpans().At(0).Spans() + for i := 0; i < ms.Len(); i++ { + ms.At(i).SetName(getTestMetricName(1, i)) + } + } + + if b.N > 100000 { + b.Skipf("SKIP: b.N too high, set -benchtime=x with n < 100000") + } + + clones := make([]pdata.Traces, b.N) + for n := 0; n < b.N; n++ { + clones[n] = td.Clone() + } + b.ReportAllocs() + b.ResetTimer() + for n := 0; n < b.N; n++ { + cloneReq := clones[n] + split := splitTraces(128, cloneReq) + if split.SpanCount() != 128 || cloneReq.SpanCount() != 400-128 { + b.Fail() + } + } +} From 72e4e3f05da371b92cd1f118b83ddd70ea3e0b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 28 Oct 2021 21:14:52 +0200 Subject: [PATCH 101/149] Disable current workflows for builder (#4287) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Disable current workflows for builder Signed-off-by: Juraci Paixão Kröhling * Re-enable codeql for builder Signed-off-by: Juraci Paixão Kröhling --- .github/workflows/api-compatibility.yml | 2 ++ .github/workflows/build-and-test-windows.yaml | 4 ++++ .github/workflows/build-and-test.yml | 4 ++++ .github/workflows/check-links.yaml | 4 ++++ .github/workflows/contrib-tests.yml | 4 ++++ .github/workflows/dependabot.yml | 2 ++ 6 files changed, 20 insertions(+) diff --git a/.github/workflows/api-compatibility.yml b/.github/workflows/api-compatibility.yml index 521077a92f1..0d496abc0fd 100644 --- a/.github/workflows/api-compatibility.yml +++ b/.github/workflows/api-compatibility.yml @@ -7,6 +7,8 @@ name: "Inform Incompatible PRs" on: pull_request: + paths-ignore: + - 'builder/**' branches: - main diff --git a/.github/workflows/build-and-test-windows.yaml b/.github/workflows/build-and-test-windows.yaml index 308fd0c3b06..ef921e667e0 100644 --- a/.github/workflows/build-and-test-windows.yaml +++ b/.github/workflows/build-and-test-windows.yaml @@ -2,9 +2,13 @@ name: build-and-test-windows on: push: branches: [ main ] + paths-ignore: + - 'builder/**' tags: - 'v[0-9]+.[0-9]+.[0-9]+*' pull_request: + paths-ignore: + - 'builder/**' jobs: windows-unittest: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c3a16e32b11..a1bbd37c36e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,9 +2,13 @@ name: build-and-test on: push: branches: [main] + paths-ignore: + - 'builder/**' tags: - "v[0-9]+.[0-9]+.[0-9]+*" pull_request: + paths-ignore: + - 'builder/**' jobs: setup-environment: diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index cc90075f0c1..62b026dc9d8 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -2,7 +2,11 @@ name: check-links on: push: branches: [ main ] + paths-ignore: + - 'builder/**' pull_request: + paths-ignore: + - 'builder/**' jobs: check-links: diff --git a/.github/workflows/contrib-tests.yml b/.github/workflows/contrib-tests.yml index 2473041bd12..547e5e42015 100644 --- a/.github/workflows/contrib-tests.yml +++ b/.github/workflows/contrib-tests.yml @@ -2,9 +2,13 @@ name: contrib-tests on: push: branches: [ main ] + paths-ignore: + - 'builder/**' tags: - v[0-9]+.[0-9]+.[0-9]+.* pull_request: + paths-ignore: + - 'builder/**' jobs: contrib_tests: diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 8460dc731fc..5df9ac56ed6 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -3,6 +3,8 @@ name: Dependabot-Tidier on: pull_request: types: [ labeled ] + paths-ignore: + - 'builder/**' jobs: mod_tidier: From 5abd73ac988151a50f6c3dcf977d1b749d747501 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 28 Oct 2021 13:20:46 -0700 Subject: [PATCH 102/149] Move cache/go-build in a different cache to allow unittest/coverage to use it (#4289) Signed-off-by: Bogdan Drutu --- .github/workflows/build-and-test.yml | 48 +++++++++------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a1bbd37c36e..b6443b26805 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -27,12 +27,8 @@ jobs: - name: Cache Go id: module-cache uses: actions/cache@v2 - env: - cache-name: cache-go-modules with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build + path: /home/runner/go/pkg/mod key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Install dependencies if: steps.module-cache.outputs.cache-hit != 'true' @@ -40,8 +36,6 @@ jobs: - name: Cache Tools id: tool-cache uses: actions/cache@v2 - env: - cache-name: cache-tool-binaries with: path: /home/runner/go/bin key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} @@ -65,18 +59,12 @@ jobs: - name: Cache Go id: module-cache uses: actions/cache@v2 - env: - cache-name: cache-go-modules with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build + path: /home/runner/go/pkg/mod key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Cache Tools id: tool-cache uses: actions/cache@v2 - env: - cache-name: cache-tool-binaries with: path: /home/runner/go/bin key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} @@ -113,21 +101,20 @@ jobs: - name: Cache Go id: module-cache uses: actions/cache@v2 - env: - cache-name: cache-go-modules with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build + path: /home/runner/go/pkg/mod key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Cache Tools id: tool-cache uses: actions/cache@v2 - env: - cache-name: cache-tool-binaries with: path: /home/runner/go/bin key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} + - name: Cache Build + uses: actions/cache@v2 + with: + path: /home/runner/.cache/go-build + key: go-build-unittest-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Run Unit Tests run: make gotest test-coverage: @@ -147,21 +134,20 @@ jobs: - name: Cache Go id: module-cache uses: actions/cache@v2 - env: - cache-name: cache-go-modules with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build + path: /home/runner/go/pkg/mod key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Cache Tools id: tool-cache uses: actions/cache@v2 - env: - cache-name: cache-tool-binaries with: path: /home/runner/go/bin key: tools-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod', './cmd/mdatagen/go.mod', './cmd/mdatagen/*.go') }} + - name: Cache Build + uses: actions/cache@v2 + with: + path: /home/runner/.cache/go-build + key: go-build-coverage-${{ runner.os }}-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Run Unit Tests With Coverage run: make gotest-with-cover - name: Upload coverage report @@ -187,12 +173,8 @@ jobs: - name: Cache Go id: module-cache uses: actions/cache@v2 - env: - cache-name: cache-go-modules with: - path: | - /home/runner/go/pkg/mod - /home/runner/.cache/go-build + 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 From 4063a46ba205f6e13b6061f4276226bea91646a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 28 Oct 2021 22:32:11 +0200 Subject: [PATCH 103/149] Move opentelemetry-collector-builder to core (#4286) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial commit * Add CODEOWNERS file (#2) * Add CODEOWNERS file * Update CODEOWNERS * Moved from github.com/observatorium/opentelemetry-collector-builder (#3) Signed-off-by: Juraci Paixão Kröhling * fixed panics (#6) Signed-off-by: Joe Elliott * Replace master with main in CI and mergify files (#8) Signed-off-by: Juraci Paixão Kröhling * Bump to OpenTelemetry Collector 0.20.0 (#10) Closes #9 Signed-off-by: Juraci Paixão Kröhling * Explicitly enable Go modules in quickstart instructions (#13) * Update to collector v0.21.0 (#17) Fixes #16 Signed-off-by: Juraci Paixão Kröhling * Update to collector v0.22.0 (#19) * Download go modules before building (#20) Fixes #14 * Add version command (#25) Signed-off-by: Ashmita Bohara * Pass errors from cobra Execute back to main for correct exit code (#28) * pass errors from cobra execute back to main * print the error * Update to collector v0.23.0 (#27) * Generate a warning if the builder and collector base version mismatch (#30) * Generate a warning if the builder and collector base version mismatch * Show current default version in the warning message * Update to OpenTelemetry Collector 0.24.0 * Don't use %w formatting with log.Fatal (#35) * Update to OpenTelemetry Collector 0.25.0 (#36) Signed-off-by: Serge Catudal * Update to 0.26.0 and update BuildInfo (#39) * Sync build and CI Go versions at latest 1.16 (#34) * Sync build and CI Go versions at latest 1.16 * Run go mod tidy * Set go binary to use in the compilation phase in tests Signed-off-by: Juraci Paixão Kröhling Co-authored-by: Juraci Paixão Kröhling * Add option to generate go code only (no compile) (#40) * Issue#24 Add option to generate go code only (no compile) * Update cmd/root.go logging Suggested by @jpkkrohling Co-authored-by: Juraci Paixão Kröhling * remove verbose help .. created by corba * suggestion by jpkrohling to keep generateandcompile * lint error: remove unused var * reword cmd option and add back help message for default Co-authored-by: Juraci Paixão Kröhling * Don't reuse exec.Cmd (#42) * Update to OpenTelemetry Collector 0.27.0 (#43) * Add CI Badge (#47) * Update to Collector v0.28.0 (#49) * Update to Collector v0.28.0 Closes #48 Addresses the breaking API change in https://github.com/open-telemetry/opentelemetry-collector/pull/3163, besides the usual version number changes. Signed-off-by: Fangyi Zhou * Use `go mod tidy` instead of `go mod download` It appears that this magically resolves the go.mod file issue. https://stackoverflow.com/questions/67203641/missing-go-sum-entry-for-module-providing-package-package-name Signed-off-by: Fangyi Zhou * Account for go mod download in go1.17 not updating go.sum (#50) * Update to collector v0.29.0 (#54) * Update replaces.builder.yaml * Update nocore.builder.yaml * Update config.go * Update README.md * Update main.go * Update to collector v0.30.0 (#57) * cmd: fix module flag default value to github.com/open-telemetry (#58) Signed-off-by: Koichi Shiraishi * Update to collector v0.31.0 (#60) * Update to v0.33.0 (#62) Signed-off-by: Anthony J Mirabella * Add excludes support to generated go.mod (#63) Signed-off-by: Anthony J Mirabella Co-authored-by: Juraci Paixão Kröhling * Small cleanup for the builder files (#64) Signed-off-by: Bogdan Drutu * Support building with Go 1.17 (#66) * Support building with Go 1.17 Fixes #65 Signed-off-by: Juraci Paixão Kröhling * Update workflows to use Go 1.17 Signed-off-by: Juraci Paixão Kröhling * Add gosec exceptions for exec.Command Signed-off-by: Juraci Paixão Kröhling * Update to OpenTelemetry core 0.34.0 (#68) Fixes #67 Signed-off-by: Juraci Paixão Kröhling * Upgrade to OpenTelemetry Collector 0.35.0 (#70) Signed-off-by: Fangyi Zhou * Upgrade to OpenTelemetry Collector 0.36.0 (#76) * Generate custom service code for Windows (#75) * update main to include windows service code * use main version from tag 0.35.0 * update main function * align with upstream v0.36.0 tag * dummy change to trigger build * Revert "dummy change to trigger build" This reverts commit 629d499461da2d2c240bf1e495b5fe0558e3547f. * Remove Core from Module type (#77) Fixes #15 Signed-off-by: yugo-horie * release 0.37.0 (#78) * release 0.37.0 * update use of NewCommand * Move builder to subdirectory Signed-off-by: Juraci Paixão Kröhling Co-authored-by: Bogdan Drutu Co-authored-by: Bogdan Drutu Co-authored-by: Joe Elliott Co-authored-by: Eric Yang Co-authored-by: Brian Gibbins Co-authored-by: Ashmita Co-authored-by: Fangyi Zhou Co-authored-by: Shaun Creary <65406540+crearys@users.noreply.github.com> Co-authored-by: Patryk Małek <69143962+pmalek-sumo@users.noreply.github.com> Co-authored-by: Serge Catudal Co-authored-by: Aaron Stone Co-authored-by: Patryk Małek Co-authored-by: Aaron Stone Co-authored-by: Kelvin Lo Co-authored-by: Himanshu Co-authored-by: Y.Horie Co-authored-by: Koichi Shiraishi Co-authored-by: Anthony Mirabella Co-authored-by: Cal Loomis <68860480+loomis-relativity@users.noreply.github.com> Co-authored-by: alrex --- builder/.github/CODEOWNERS | 15 + builder/.github/mergify.yml | 19 + builder/.github/workflows/go.yaml | 56 +++ .../.github/workflows/integration-test.yaml | 24 ++ builder/.github/workflows/release.yml | 29 ++ builder/.gitignore | 40 +++ builder/.golangci.yaml | 18 + builder/.goreleaser.yml | 33 ++ builder/LICENSE | 202 +++++++++++ builder/README.md | 88 +++++ builder/RELEASE.md | 12 + builder/cmd/root.go | 124 +++++++ builder/go.mod | 49 +++ builder/go.sum | 326 ++++++++++++++++++ builder/header.txt | 13 + builder/internal/builder/config.go | 170 +++++++++ builder/internal/builder/config_test.go | 126 +++++++ builder/internal/builder/main.go | 159 +++++++++ builder/internal/scaffold/components.go | 130 +++++++ builder/internal/scaffold/gomod.go | 56 +++ builder/internal/scaffold/main.go | 160 +++++++++ builder/main.go | 29 ++ builder/test/README.md | 3 + builder/test/nocore.builder.yaml | 14 + builder/test/nocore.otel.yaml | 22 ++ builder/test/replaces.builder.yaml | 10 + builder/test/replaces.otel.yaml | 36 ++ builder/test/test.sh | 100 ++++++ 28 files changed, 2063 insertions(+) create mode 100644 builder/.github/CODEOWNERS create mode 100644 builder/.github/mergify.yml create mode 100644 builder/.github/workflows/go.yaml create mode 100644 builder/.github/workflows/integration-test.yaml create mode 100644 builder/.github/workflows/release.yml create mode 100644 builder/.gitignore create mode 100644 builder/.golangci.yaml create mode 100644 builder/.goreleaser.yml create mode 100644 builder/LICENSE create mode 100644 builder/README.md create mode 100644 builder/RELEASE.md create mode 100644 builder/cmd/root.go create mode 100644 builder/go.mod create mode 100644 builder/go.sum create mode 100644 builder/header.txt create mode 100644 builder/internal/builder/config.go create mode 100644 builder/internal/builder/config_test.go create mode 100644 builder/internal/builder/main.go create mode 100644 builder/internal/scaffold/components.go create mode 100644 builder/internal/scaffold/gomod.go create mode 100644 builder/internal/scaffold/main.go create mode 100644 builder/main.go create mode 100644 builder/test/README.md create mode 100644 builder/test/nocore.builder.yaml create mode 100644 builder/test/nocore.otel.yaml create mode 100644 builder/test/replaces.builder.yaml create mode 100755 builder/test/replaces.otel.yaml create mode 100755 builder/test/test.sh diff --git a/builder/.github/CODEOWNERS b/builder/.github/CODEOWNERS new file mode 100644 index 00000000000..09c8dc2a8f8 --- /dev/null +++ b/builder/.github/CODEOWNERS @@ -0,0 +1,15 @@ +##################################################### +# +# List of approvers for OpenTelemetry Collector Builder +# +##################################################### +# +# Learn about membership in OpenTelemetry community: +# https://github.com/open-telemetry/community/blob/master/community-membership.md +# +# +# Learn about CODEOWNERS file format: +# https://help.github.com/en/articles/about-code-owners +# + +* @open-telemetry/collector-approvers @open-telemetry/collector-builder-approvers diff --git a/builder/.github/mergify.yml b/builder/.github/mergify.yml new file mode 100644 index 00000000000..ca5b7649f62 --- /dev/null +++ b/builder/.github/mergify.yml @@ -0,0 +1,19 @@ +pull_request_rules: + - name: remove outdated reviews + conditions: + - base=main + actions: + dismiss_reviews: {} + + - name: Automatic merge when all checks pass and the PR is approved + conditions: + - "#approved-reviews-by>=1" + - "-draft" + - "status-success=Unit tests" + - "status-success=Code standards (linting)" + - "status-success=Security" + - "status-success=Integration test" + actions: + merge: + method: squash + commit_message: title+body diff --git a/builder/.github/workflows/go.yaml b/builder/.github/workflows/go.yaml new file mode 100644 index 00000000000..f7893d6fb4f --- /dev/null +++ b/builder/.github/workflows/go.yaml @@ -0,0 +1,56 @@ +name: "Continuous Integration" + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + unit-tests: + name: Unit tests + runs-on: ubuntu-20.04 + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Test + run: go test -v ./... + + lint: + name: Code standards (linting) + runs-on: ubuntu-20.04 + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.29 + args: --enable=gosec,maligned,misspell + only-new-issues: true + + security: + name: Security + runs-on: ubuntu-20.04 + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: go + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/builder/.github/workflows/integration-test.yaml b/builder/.github/workflows/integration-test.yaml new file mode 100644 index 00000000000..7fbe81bcbac --- /dev/null +++ b/builder/.github/workflows/integration-test.yaml @@ -0,0 +1,24 @@ +name: Integration tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + integration-test: + name: Integration test + runs-on: ubuntu-20.04 + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Test + run: ./test/test.sh diff --git a/builder/.github/workflows/release.yml b/builder/.github/workflows/release.yml new file mode 100644 index 00000000000..8cb55ebb47a --- /dev/null +++ b/builder/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: goreleaser + +on: + push: + tags: + - 'v*' + +jobs: + goreleaser: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/builder/.gitignore b/builder/.gitignore new file mode 100644 index 00000000000..011870efb61 --- /dev/null +++ b/builder/.gitignore @@ -0,0 +1,40 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/go,vscode +# Edit at https://www.toptal.com/developers/gitignore?templates=go,vscode + +### Go ### +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +### Go Patch ### +/vendor/ +/Godeps/ + +### vscode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +### goland ### +.idea + +# End of https://www.toptal.com/developers/gitignore/api/go,vscode + +/dist/ +opentelemetry-collector-builder diff --git a/builder/.golangci.yaml b/builder/.golangci.yaml new file mode 100644 index 00000000000..7a659b2ad8b --- /dev/null +++ b/builder/.golangci.yaml @@ -0,0 +1,18 @@ +# all available settings of specific linters +linters-settings: + goheader: + template-path: header.txt + goimports: + local-prefixes: github.com/open-telemetry/opentelemetry-collector-builder + maligned: + suggest-new: true + misspell: + locale: US + +linters: + enable: + - goheader + - goimports + - maligned + - misspell + - gosec diff --git a/builder/.goreleaser.yml b/builder/.goreleaser.yml new file mode 100644 index 00000000000..1c068ac733f --- /dev/null +++ b/builder/.goreleaser.yml @@ -0,0 +1,33 @@ +before: + hooks: + - go mod download +builds: + - flags: + - -trimpath + ldflags: + - -s -w -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.version={{.Version}} -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.date={{.Date}} + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm + - arm64 + goarm: + - 6 + - 7 +archives: + - format: binary +checksum: + name_template: "checksums.txt" +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/builder/LICENSE b/builder/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/builder/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/builder/README.md b/builder/README.md new file mode 100644 index 00000000000..c13c5b020a2 --- /dev/null +++ b/builder/README.md @@ -0,0 +1,88 @@ +# OpenTelemetry Collector builder +[![CI](https://github.com/open-telemetry/opentelemetry-collector-builder/actions/workflows/go.yaml/badge.svg)](https://github.com/open-telemetry/opentelemetry-collector-builder/actions/workflows/go.yaml?query=branch%3Amain) + +This program generates a custom OpenTelemetry Collector binary based on a given configuration. + +## TL;DR +```console +$ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder +$ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.37.0 +``` diff --git a/builder/RELEASE.md b/builder/RELEASE.md new file mode 100644 index 00000000000..b0552500521 --- /dev/null +++ b/builder/RELEASE.md @@ -0,0 +1,12 @@ +# Releasing the OpenTelemetry Collector Builder + +This project uses [`goreleaser`](https://github.com/goreleaser/goreleaser) to manage the release of new versions. + +To release a new version, simply add a tag named `vX.Y.Z`, like: + +``` +git tag -a v0.1.1 -m "Release v0.1.1" +git push upstream v0.1.1 +``` + +A new GitHub workflow should be started, and at the end, a GitHub release should have been created, similar with the ["Release v0.1.0"](https://github.com/open-telemetry/opentelemetry-collector-builder/releases/tag/v0.1.0). \ No newline at end of file diff --git a/builder/cmd/root.go b/builder/cmd/root.go new file mode 100644 index 00000000000..229853ff798 --- /dev/null +++ b/builder/cmd/root.go @@ -0,0 +1,124 @@ +// Copyright 2020 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 cmd + +import ( + "fmt" + "strings" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "github.com/open-telemetry/opentelemetry-collector-builder/internal/builder" +) + +var ( + version = "dev" + date = "unknown" + + cfgFile string + cfg = builder.DefaultConfig() + + versionCmd = &cobra.Command{ + Use: "version", + Short: "Version of opentelemetry-collector-builder", + Long: "Prints the version of opentelemetry-collector-builder binary", + Run: func(cmd *cobra.Command, args []string) { + fmt.Println(version) + }, + } +) + +// Execute is the main entrypoint for this application +func Execute() error { + cobra.OnInitialize(initConfig) + + cmd := &cobra.Command{ + Use: "opentelemetry-collector-builder", + Long: fmt.Sprintf("OpenTelemetry Collector distribution builder (%s)", version), + RunE: func(cmd *cobra.Command, args []string) error { + + if err := cfg.Validate(); err != nil { + cfg.Logger.Error(err, "invalid configuration") + return err + } + + if err := cfg.ParseModules(); err != nil { + cfg.Logger.Error(err, "invalid module configuration") + return err + } + + return builder.GenerateAndCompile(cfg) + }, + } + + // the external config file + cmd.Flags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.otelcol-builder.yaml)") + + // the distribution parameters, which we accept as CLI flags as well + cmd.Flags().BoolVar(&cfg.SkipCompilation, "skip-compilation", false, "Whether builder should only generate go code with no compile of the collector (default false)") + cmd.Flags().StringVar(&cfg.Distribution.ExeName, "name", "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") + cmd.Flags().StringVar(&cfg.Distribution.LongName, "description", "Custom OpenTelemetry Collector distribution", "A descriptive name for the OpenTelemetry Collector distribution") + cmd.Flags().StringVar(&cfg.Distribution.Version, "version", "1.0.0", "The version for the OpenTelemetry Collector distribution") + cmd.Flags().BoolVar(&cfg.Distribution.IncludeCore, "include-core", true, "Whether the core components should be included in the distribution") + cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") + cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files") + cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "", "The Go binary to use during the compilation phase. Default: go from the PATH") + cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/open-telemetry/opentelemetry-collector-builder", "The Go module for the new distribution") + + // version of this binary + cmd.AddCommand(versionCmd) + + // tie Viper to flags + if err := viper.BindPFlags(cmd.Flags()); err != nil { + cfg.Logger.Error(err, "failed to bind flags") + return err + } + + if err := cmd.Execute(); err != nil { + cfg.Logger.Error(err, "failed to run") + return err + } + + return nil +} + +func initConfig() { + cfg.Logger.Info("OpenTelemetry Collector distribution builder", "version", version, "date", date) + + // a couple of Viper goodies, to make it easier to use env vars when flags are not desirable + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + viper.AutomaticEnv() + + // load values from config file -- required for the modules configuration + if cfgFile != "" { + viper.SetConfigFile(cfgFile) + } else { + viper.AddConfigPath("$HOME") + viper.SetConfigName(".otelcol-builder") + } + + // load the config file + if err := viper.ReadInConfig(); err == nil { + cfg.Logger.Info("Using config file", "path", viper.ConfigFileUsed()) + } + + // convert Viper's internal state into our configuration object + if err := viper.Unmarshal(&cfg); err != nil { + cfg.Logger.Error(err, "failed to parse the config") + cobra.CheckErr(err) + return + } +} diff --git a/builder/go.mod b/builder/go.mod new file mode 100644 index 00000000000..a6374f62af0 --- /dev/null +++ b/builder/go.mod @@ -0,0 +1,49 @@ +// Copyright 2020 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. + +module github.com/open-telemetry/opentelemetry-collector-builder + +go 1.17 + +require ( + github.com/go-logr/logr v0.2.1 + github.com/go-logr/zapr v0.2.0 + github.com/spf13/cobra v1.1.3 + github.com/spf13/viper v1.7.1 + github.com/stretchr/testify v1.6.1 + go.uber.org/zap v1.10.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/spf13/afero v1.1.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + go.uber.org/atomic v1.4.0 // indirect + go.uber.org/multierr v1.1.0 // indirect + golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect + golang.org/x/text v0.3.2 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/builder/go.sum b/builder/go.sum new file mode 100644 index 00000000000..a8b2e2225e9 --- /dev/null +++ b/builder/go.sum @@ -0,0 +1,326 @@ +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= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +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/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/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/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +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= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +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-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= +github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= +github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +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-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-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +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.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +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/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/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_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +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.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +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= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/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-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= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +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-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/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= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +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 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/builder/header.txt b/builder/header.txt new file mode 100644 index 00000000000..1038a144623 --- /dev/null +++ b/builder/header.txt @@ -0,0 +1,13 @@ +Copyright 2020 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. \ No newline at end of file diff --git a/builder/internal/builder/config.go b/builder/internal/builder/config.go new file mode 100644 index 00000000000..059fea92f92 --- /dev/null +++ b/builder/internal/builder/config.go @@ -0,0 +1,170 @@ +// Copyright 2020 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 ( + "errors" + "fmt" + "io/ioutil" + "os" + "os/exec" + "strings" + + "github.com/go-logr/logr" + "github.com/go-logr/zapr" + "go.uber.org/zap" +) + +const defaultOtelColVersion = "0.37.0" + +// ErrInvalidGoMod indicates an invalid gomod +var ErrInvalidGoMod = errors.New("invalid gomod specification for module") + +// ErrDeprecatedCore indicates deprecated core +var ErrDeprecatedCore = errors.New("mod.Core has deprecated, you should not be used anymore and required to be set mod.GoMod instead") + +// Config holds the builder's configuration +type Config struct { + Logger logr.Logger + SkipCompilation bool + + Distribution Distribution `mapstructure:"dist"` + Exporters []Module `mapstructure:"exporters"` + Extensions []Module `mapstructure:"extensions"` + Receivers []Module `mapstructure:"receivers"` + Processors []Module `mapstructure:"processors"` + Replaces []string `mapstructure:"replaces"` + Excludes []string `mapstructure:"excludes"` +} + +// Distribution holds the parameters for the final binary +type Distribution struct { + Module string `mapstructure:"module"` + ExeName string `mapstructure:"name"` + Go string `mapstructure:"go"` + LongName string `mapstructure:"description"` + OtelColVersion string `mapstructure:"otelcol_version"` + IncludeCore bool `mapstructure:"include_core"` + OutputPath string `mapstructure:"output_path"` + Version string `mapstructure:"version"` +} + +// Module represents a receiver, exporter, processor or extension for the distribution +type Module struct { + Name string `mapstructure:"name"` // if not specified, this is package part of the go mod (last part of the path) + Import string `mapstructure:"import"` // if not specified, this is the path part of the go mods + GoMod string `mapstructure:"gomod"` // a gomod-compatible spec for the module + Path string `mapstructure:"path"` // an optional path to the local version of this module + Core *bool `mapstructure:"core"` // whether this module comes from core. For this property isn't referred from anywhere, it might be removed. please see #15. + +} + +// DefaultConfig creates a new config, with default values +func DefaultConfig() Config { + zapLog, err := zap.NewDevelopment() + if err != nil { + panic(fmt.Sprintf("failed to obtain a logger instance: %v", err)) + } + log := zapr.NewLogger(zapLog) + + outputDir, err := ioutil.TempDir("", "otelcol-distribution") + if err != nil { + log.Error(err, "failed to obtain a temporary directory") + } + + return Config{ + Logger: log, + Distribution: Distribution{ + OutputPath: outputDir, + OtelColVersion: defaultOtelColVersion, + }, + } +} + +// Validate checks whether the current configuration is valid +func (c *Config) Validate() error { + // #nosec G204 + if _, err := exec.Command(c.Distribution.Go, "env").CombinedOutput(); err != nil { + path, err := exec.LookPath("go") + if err != nil { + return ErrGoNotFound + } + c.Distribution.Go = path + } + c.Logger.Info("Using go", "Go executable", c.Distribution.Go) + + return nil +} + +// ParseModules will parse the Modules entries and populate the missing values +func (c *Config) ParseModules() error { + var err error + + c.Extensions, err = parseModules(c.Extensions) + if err != nil { + return err + } + + c.Receivers, err = parseModules(c.Receivers) + if err != nil { + return err + } + + c.Exporters, err = parseModules(c.Exporters) + if err != nil { + return err + } + + c.Processors, err = parseModules(c.Processors) + if err != nil { + return err + } + + return nil +} + +func parseModules(mods []Module) ([]Module, error) { + var parsedModules []Module + for _, mod := range mods { + if mod.Core != nil { + return mods, ErrDeprecatedCore + } + if mod.GoMod == "" { + return mods, fmt.Errorf("%w, module: %q", ErrInvalidGoMod, mod.GoMod) + } + + if mod.Import == "" { + mod.Import = strings.Split(mod.GoMod, " ")[0] + } + + if mod.Name == "" { + parts := strings.Split(mod.Import, "/") + mod.Name = parts[len(parts)-1] + } + + if strings.HasPrefix(mod.Path, "./") { + path, err := os.Getwd() + if err != nil { + return mods, fmt.Errorf("module has a relative Path element, but we couldn't get the current working dir: %v", err) + } + + mod.Path = fmt.Sprintf("%s/%s", path, mod.Path[2:]) + } + + parsedModules = append(parsedModules, mod) + } + + return parsedModules, nil +} diff --git a/builder/internal/builder/config_test.go b/builder/internal/builder/config_test.go new file mode 100644 index 00000000000..1528ae30d28 --- /dev/null +++ b/builder/internal/builder/config_test.go @@ -0,0 +1,126 @@ +// Copyright 2020 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 ( + "errors" + "os" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestParseModules(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{{ + GoMod: "github.com/org/repo v0.1.2", + }}, + } + + // test + err := cfg.ParseModules() + assert.NoError(t, err) + + // verify + assert.Equal(t, "github.com/org/repo v0.1.2", cfg.Extensions[0].GoMod) + assert.Equal(t, "github.com/org/repo", cfg.Extensions[0].Import) + assert.Equal(t, "repo", cfg.Extensions[0].Name) +} + +func TestRelativePath(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{{ + GoMod: "some-module", + Path: "./some-module", + }}, + } + + // test + err := cfg.ParseModules() + assert.NoError(t, err) + + // verify + cwd, err := os.Getwd() + require.NoError(t, err) + assert.True(t, strings.HasPrefix(cfg.Extensions[0].Path, "/")) + assert.True(t, strings.HasPrefix(cfg.Extensions[0].Path, cwd)) +} + +func TestModuleFromCore(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{ // see issue-12 + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + GoMod: "go.opentelemetry.io/collector v0.37.0", + }, + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + GoMod: "go.opentelemetry.io/collector v0.37.0", + Core: nil, + }, + }, + } + + // test + err := cfg.ParseModules() + assert.NoError(t, err) + + // verify + assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "jaegerreceiver")) +} + +func TestDeprecatedCore(t *testing.T) { + // prepare + coreTrue := true + coreFalse := false + cfg := Config{ + Extensions: []Module{ + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + Core: &coreTrue, + }, + { + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + Core: &coreFalse, + }, + }, + } + + // test + err := cfg.ParseModules() + + // verify + assert.True(t, errors.Is(err, ErrDeprecatedCore)) +} + +func TestInvalidModule(t *testing.T) { + // prepare + cfg := Config{ + Extensions: []Module{{ + Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", + }}, + } + + // test + err := cfg.ParseModules() + + // verify + assert.True(t, errors.Is(err, ErrInvalidGoMod)) +} diff --git a/builder/internal/builder/main.go b/builder/internal/builder/main.go new file mode 100644 index 00000000000..8cc9c9f784c --- /dev/null +++ b/builder/internal/builder/main.go @@ -0,0 +1,159 @@ +// Copyright 2020 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 ( + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "text/template" + "time" + + "github.com/open-telemetry/opentelemetry-collector-builder/internal/scaffold" +) + +var ( + // ErrGoNotFound is returned when a Go binary hasn't been found + ErrGoNotFound = errors.New("go binary not found") +) + +// GenerateAndCompile will generate the source files based on the given configuration, update go mod, and will compile into a binary +func GenerateAndCompile(cfg Config) error { + if err := Generate(cfg); err != nil { + return err + } + + // run go get to update go.mod and go.sum files + if err := GetModules(cfg); err != nil { + return err + } + + return Compile(cfg) +} + +// Generate assembles a new distribution based on the given configuration +func Generate(cfg Config) error { + // create a warning message for non-aligned builder and collector base + if cfg.Distribution.OtelColVersion != defaultOtelColVersion { + cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", "builder-version", defaultOtelColVersion) + } + // if the file does not exist, try to create it + if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) { + if err := os.Mkdir(cfg.Distribution.OutputPath, 0755); err != nil { + 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) + } + + for _, file := range []struct { + outFile string + tmpl string + }{ + { + "main.go", + scaffold.Main, + }, + { + "main_others.go", + scaffold.MainOthers, + }, + { + "main_windows.go", + scaffold.MainWindows, + }, + // components.go + { + "components.go", + scaffold.Components, + }, + { + "go.mod", + scaffold.Gomod, + }, + } { + 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) + } + } + + cfg.Logger.Info("Sources created", "path", cfg.Distribution.OutputPath) + return nil +} + +// Compile generates a binary from the sources based on the configuration +func Compile(cfg Config) error { + if cfg.SkipCompilation { + cfg.Logger.Info("Generating source codes only, the distribution will not be compiled.") + return nil + } + + cfg.Logger.Info("Compiling") + // #nosec G204 + cmd := exec.Command(cfg.Distribution.Go, "build", "-ldflags=-s -w", "-trimpath", "-o", cfg.Distribution.ExeName) + cmd.Dir = cfg.Distribution.OutputPath + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("failed to compile the OpenTelemetry Collector distribution: %w. Output: %q", err, out) + } + cfg.Logger.Info("Compiled", "binary", fmt.Sprintf("%s/%s", cfg.Distribution.OutputPath, cfg.Distribution.ExeName)) + + return nil +} + +// GetModules retrieves the go modules, updating go.mod and go.sum in the process +func GetModules(cfg Config) error { + // #nosec G204 + cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.17") + cmd.Dir = cfg.Distribution.OutputPath + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("failed to update go.mod: %w. Output: %q", err, out) + } + + cfg.Logger.Info("Getting go modules") + // basic retry if error from go mod command (in case of transient network error). This could be improved + // retry 3 times with 5 second spacing interval + retries := 3 + failReason := "unknown" + for i := 1; i <= retries; i++ { + // #nosec G204 + cmd := exec.Command(cfg.Distribution.Go, "mod", "download", "all") + cmd.Dir = cfg.Distribution.OutputPath + if out, err := cmd.CombinedOutput(); err != nil { + failReason = fmt.Sprintf("%s. Output: %q", err, out) + cfg.Logger.Info("Failed modules download", "retry", fmt.Sprintf("%d/%d", i, retries)) + time.Sleep(5 * time.Second) + continue + } + return nil + } + 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 + } + + out, err := os.Create(filepath.Join(cfg.Distribution.OutputPath, outFile)) + if err != nil { + return err + } + + return t.Execute(out, tmplParams) +} diff --git a/builder/internal/scaffold/components.go b/builder/internal/scaffold/components.go new file mode 100644 index 00000000000..4173576ee48 --- /dev/null +++ b/builder/internal/scaffold/components.go @@ -0,0 +1,130 @@ +// Copyright 2020 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 + +const Components = ` +// Copyright 2020 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 main + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer/consumererror" + {{- if .Distribution.IncludeCore}} + "go.opentelemetry.io/collector/service/defaultcomponents" + {{- end}} + + // extensions + {{- range .Extensions}} + {{.Name}} "{{.Import}}" + {{- end}} + + // receivers + {{- range .Receivers}} + {{.Name}} "{{.Import}}" + {{- end}} + + // exporters + {{- range .Exporters}} + {{.Name}} "{{.Import}}" + {{- end}} + + // processors + {{- range .Processors}} + {{.Name}} "{{.Import}}" + {{- end}} +) + +func components() (component.Factories, error) { + var errs []error + var err error + var factories component.Factories + + {{- if .Distribution.IncludeCore}} + factories, err = defaultcomponents.Components() + if err != nil { + return component.Factories{}, err + } + {{- else}} + factories = component.Factories{} + {{- end}} + + extensions := []component.ExtensionFactory{ + {{- range .Extensions}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, ext := range factories.Extensions { + extensions = append(extensions, ext) + } + factories.Extensions, err = component.MakeExtensionFactoryMap(extensions...) + if err != nil { + errs = append(errs, err) + } + + receivers := []component.ReceiverFactory{ + {{- range .Receivers}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, rcv := range factories.Receivers { + receivers = append(receivers, rcv) + } + factories.Receivers, err = component.MakeReceiverFactoryMap(receivers...) + if err != nil { + errs = append(errs, err) + } + + exporters := []component.ExporterFactory{ + {{- range .Exporters}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, exp := range factories.Exporters { + exporters = append(exporters, exp) + } + factories.Exporters, err = component.MakeExporterFactoryMap(exporters...) + if err != nil { + errs = append(errs, err) + } + + processors := []component.ProcessorFactory{ + {{- range .Processors}} + {{.Name}}.NewFactory(), + {{- end}} + } + for _, pr := range factories.Processors { + processors = append(processors, pr) + } + factories.Processors, err = component.MakeProcessorFactoryMap(processors...) + if err != nil { + errs = append(errs, err) + } + + return factories, consumererror.Combine(errs) +} +` diff --git a/builder/internal/scaffold/gomod.go b/builder/internal/scaffold/gomod.go new file mode 100644 index 00000000000..275f5c92a15 --- /dev/null +++ b/builder/internal/scaffold/gomod.go @@ -0,0 +1,56 @@ +// Copyright 2020 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 + +const Gomod = ` +module {{.Distribution.Module}} + +go 1.17 + +require ( + {{- range .Extensions}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + {{- range .Receivers}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + {{- range .Exporters}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + {{- range .Processors}} + {{if .GoMod}}{{.GoMod}}{{end}} + {{- end}} + go.opentelemetry.io/collector v{{.Distribution.OtelColVersion}} +) + +{{- range .Extensions}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Receivers}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Exporters}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Processors}} +{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} +{{- end}} +{{- range .Replaces}} +replace {{.}} +{{- end}} +{{- range .Excludes}} +exclude {{.}} +{{- end}} +` diff --git a/builder/internal/scaffold/main.go b/builder/internal/scaffold/main.go new file mode 100644 index 00000000000..3fbaed58963 --- /dev/null +++ b/builder/internal/scaffold/main.go @@ -0,0 +1,160 @@ +// Copyright 2020 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 + +const Main = ` +// Copyright 2020 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.ExeName }}", + Description: "{{ .Distribution.LongName }}", + 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 +} +` diff --git a/builder/main.go b/builder/main.go new file mode 100644 index 00000000000..0ef002a58d7 --- /dev/null +++ b/builder/main.go @@ -0,0 +1,29 @@ +// Copyright 2020 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 main + +import ( + "fmt" + "os" + + "github.com/open-telemetry/opentelemetry-collector-builder/cmd" +) + +func main() { + if err := cmd.Execute(); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } +} diff --git a/builder/test/README.md b/builder/test/README.md new file mode 100644 index 00000000000..8c2b6f06bea --- /dev/null +++ b/builder/test/README.md @@ -0,0 +1,3 @@ += Testing for the OpenTelemetry Collector Builder + +This is a set of end-to-end tests for the builder. As such, it includes only positive tests, based on the manifest files in this directory. Each manifest is expected to be in a working state and should yield an OpenTelemetry Collector instance that is ready within a time interval. "Ready" is defined by calling its healthcheck endpoint. diff --git a/builder/test/nocore.builder.yaml b/builder/test/nocore.builder.yaml new file mode 100644 index 00000000000..abebfad3d7c --- /dev/null +++ b/builder/test/nocore.builder.yaml @@ -0,0 +1,14 @@ +dist: + module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore + otelcol_version: 0.37.0 + include_core: false + +receivers: + - import: go.opentelemetry.io/collector/receiver/otlpreceiver + gomod: go.opentelemetry.io/collector v0.37.0 +exporters: + - import: go.opentelemetry.io/collector/exporter/loggingexporter + gomod: go.opentelemetry.io/collector v0.37.0 +extensions: + - import: go.opentelemetry.io/collector/extension/zpagesextension + gomod: go.opentelemetry.io/collector v0.37.0 diff --git a/builder/test/nocore.otel.yaml b/builder/test/nocore.otel.yaml new file mode 100644 index 00000000000..e0d615cd3d9 --- /dev/null +++ b/builder/test/nocore.otel.yaml @@ -0,0 +1,22 @@ +extensions: + zpages: + +receivers: + otlp: + protocols: + grpc: + +processors: + +exporters: + logging: + +service: + extensions: [zpages] + pipelines: + traces: + receivers: + - otlp + processors: [] + exporters: + - logging diff --git a/builder/test/replaces.builder.yaml b/builder/test/replaces.builder.yaml new file mode 100644 index 00000000000..aead637b646 --- /dev/null +++ b/builder/test/replaces.builder.yaml @@ -0,0 +1,10 @@ +dist: + module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces + otelcol_version: 0.37.0 + +processors: + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.37.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.37.0 + +replaces: + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.37.0 diff --git a/builder/test/replaces.otel.yaml b/builder/test/replaces.otel.yaml new file mode 100755 index 00000000000..ebf08a2d925 --- /dev/null +++ b/builder/test/replaces.otel.yaml @@ -0,0 +1,36 @@ +extensions: + zpages: + +receivers: + otlp: + protocols: + grpc: + endpoint: localhost:4317 + +processors: + resourcedetection: + detectors: + - env + routing: + default_exporters: + - logging + from_attribute: X-Tenant + table: + - value: acme + exporters: + - logging + +exporters: + logging: + +service: + extensions: [zpages] + pipelines: + traces: + receivers: + - otlp + processors: + - resourcedetection + - routing + exporters: + - logging diff --git a/builder/test/test.sh b/builder/test/test.sh new file mode 100755 index 00000000000..bc4d598a8dc --- /dev/null +++ b/builder/test/test.sh @@ -0,0 +1,100 @@ +#!/bin/bash + +GOBIN=$(go env GOBIN) +if [[ "$GO" == "" ]]; then + GOBIN=$(which go) +fi + +if [[ "$GOBIN" == "" ]]; then + echo "Could not determine which Go binary to use." + exit 1 +fi + +echo "Using ${GOBIN} to compile the distributions." + +# each attempt pauses for 100ms before retrying +max_retries=50 + +tests="replaces nocore" + +base=`mktemp -d` +echo "Running the tests in ${base}" + +failed=false +for test in $tests +do + out="${base}/${test}" + mkdir -p "${out}" + if [ $? != 0 ]; then + echo "❌ FAIL ${test}. Failed to create test directory for the test. Aborting tests." + exit 2 + fi + + echo "Starting test '${test}' at `date`" >> "${out}/test.log" + + go run . --go "${GOBIN}" --config "./test/${test}.builder.yaml" --output-path "${out}" --name otelcol-built-test > "${out}/builder.log" 2>&1 + if [ $? != 0 ]; then + echo "❌ FAIL ${test}. Failed to compile the test ${test}. Build logs:" + cat "${out}/builder.log" + failed=true + continue + fi + + if [ ! -f "${out}/otelcol-built-test" ]; then + echo "❌ FAIL ${test}. Binary not found for ${test} at '${out}/otelcol-built-test'. Build logs:" + cat "${out}/builder.log" + failed=true + continue + fi + + # start the distribution + "${out}/otelcol-built-test" --config "./test/${test}.otel.yaml" > "${out}/otelcol.log" 2>&1 & + pid=$! + + retries=0 + while true + do + kill -0 "${pid}" >/dev/null 2>&1 + if [ $? != 0 ]; then + echo "❌ FAIL ${test}. The OpenTelemetry Collector isn't running. Startup log:" + cat "${out}/otelcol.log" + failed=true + break + fi + + curl -s http://localhost:55679/debug/servicez | grep Uptime > /dev/null + if [ $? == 0 ]; then + echo "✅ PASS ${test}" + + kill "${pid}" + if [ $? != 0 ]; then + echo "Failed to stop the running instance for test ${test}. Return code: $? . Skipping tests." + exit 4 + fi + break + fi + + echo "Server still unavailable for test '${test}'" >> "${out}/test.log" + + let "retries++" + if [ "$retries" -gt "$max_retries" ]; then + echo "❌ FAIL ${test}. Server wasn't up after about 5s." + failed=true + + kill "${pid}" + if [ $? != 0 ]; then + echo "Failed to stop the running instance for test ${test}. Return code: $? . Skipping tests." + exit 8 + fi + break + fi + sleep 0.1s + done + + echo "Stopping server for '${test}' (pid: ${pid})" >> "${out}/test.log" + wait ${pid} +done + +if [[ "$failed" == "true" ]]; then + exit 1 +fi From e275dd3e9ccdc16051a84a0020a45c17a5dfa305 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 28 Oct 2021 13:39:41 -0700 Subject: [PATCH 104/149] Revert "Move opentelemetry-collector-builder to core (#4286)" (#4290) This reverts commit 4063a46ba205f6e13b6061f4276226bea91646a5. --- builder/.github/CODEOWNERS | 15 - builder/.github/mergify.yml | 19 - builder/.github/workflows/go.yaml | 56 --- .../.github/workflows/integration-test.yaml | 24 -- builder/.github/workflows/release.yml | 29 -- builder/.gitignore | 40 --- builder/.golangci.yaml | 18 - builder/.goreleaser.yml | 33 -- builder/LICENSE | 202 ----------- builder/README.md | 88 ----- builder/RELEASE.md | 12 - builder/cmd/root.go | 124 ------- builder/go.mod | 49 --- builder/go.sum | 326 ------------------ builder/header.txt | 13 - builder/internal/builder/config.go | 170 --------- builder/internal/builder/config_test.go | 126 ------- builder/internal/builder/main.go | 159 --------- builder/internal/scaffold/components.go | 130 ------- builder/internal/scaffold/gomod.go | 56 --- builder/internal/scaffold/main.go | 160 --------- builder/main.go | 29 -- builder/test/README.md | 3 - builder/test/nocore.builder.yaml | 14 - builder/test/nocore.otel.yaml | 22 -- builder/test/replaces.builder.yaml | 10 - builder/test/replaces.otel.yaml | 36 -- builder/test/test.sh | 100 ------ 28 files changed, 2063 deletions(-) delete mode 100644 builder/.github/CODEOWNERS delete mode 100644 builder/.github/mergify.yml delete mode 100644 builder/.github/workflows/go.yaml delete mode 100644 builder/.github/workflows/integration-test.yaml delete mode 100644 builder/.github/workflows/release.yml delete mode 100644 builder/.gitignore delete mode 100644 builder/.golangci.yaml delete mode 100644 builder/.goreleaser.yml delete mode 100644 builder/LICENSE delete mode 100644 builder/README.md delete mode 100644 builder/RELEASE.md delete mode 100644 builder/cmd/root.go delete mode 100644 builder/go.mod delete mode 100644 builder/go.sum delete mode 100644 builder/header.txt delete mode 100644 builder/internal/builder/config.go delete mode 100644 builder/internal/builder/config_test.go delete mode 100644 builder/internal/builder/main.go delete mode 100644 builder/internal/scaffold/components.go delete mode 100644 builder/internal/scaffold/gomod.go delete mode 100644 builder/internal/scaffold/main.go delete mode 100644 builder/main.go delete mode 100644 builder/test/README.md delete mode 100644 builder/test/nocore.builder.yaml delete mode 100644 builder/test/nocore.otel.yaml delete mode 100644 builder/test/replaces.builder.yaml delete mode 100755 builder/test/replaces.otel.yaml delete mode 100755 builder/test/test.sh diff --git a/builder/.github/CODEOWNERS b/builder/.github/CODEOWNERS deleted file mode 100644 index 09c8dc2a8f8..00000000000 --- a/builder/.github/CODEOWNERS +++ /dev/null @@ -1,15 +0,0 @@ -##################################################### -# -# List of approvers for OpenTelemetry Collector Builder -# -##################################################### -# -# Learn about membership in OpenTelemetry community: -# https://github.com/open-telemetry/community/blob/master/community-membership.md -# -# -# Learn about CODEOWNERS file format: -# https://help.github.com/en/articles/about-code-owners -# - -* @open-telemetry/collector-approvers @open-telemetry/collector-builder-approvers diff --git a/builder/.github/mergify.yml b/builder/.github/mergify.yml deleted file mode 100644 index ca5b7649f62..00000000000 --- a/builder/.github/mergify.yml +++ /dev/null @@ -1,19 +0,0 @@ -pull_request_rules: - - name: remove outdated reviews - conditions: - - base=main - actions: - dismiss_reviews: {} - - - name: Automatic merge when all checks pass and the PR is approved - conditions: - - "#approved-reviews-by>=1" - - "-draft" - - "status-success=Unit tests" - - "status-success=Code standards (linting)" - - "status-success=Security" - - "status-success=Integration test" - actions: - merge: - method: squash - commit_message: title+body diff --git a/builder/.github/workflows/go.yaml b/builder/.github/workflows/go.yaml deleted file mode 100644 index f7893d6fb4f..00000000000 --- a/builder/.github/workflows/go.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: "Continuous Integration" - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - unit-tests: - name: Unit tests - runs-on: ubuntu-20.04 - steps: - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Test - run: go test -v ./... - - lint: - name: Code standards (linting) - runs-on: ubuntu-20.04 - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.29 - args: --enable=gosec,maligned,misspell - only-new-issues: true - - security: - name: Security - runs-on: ubuntu-20.04 - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: go - - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/builder/.github/workflows/integration-test.yaml b/builder/.github/workflows/integration-test.yaml deleted file mode 100644 index 7fbe81bcbac..00000000000 --- a/builder/.github/workflows/integration-test.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Integration tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - integration-test: - name: Integration test - runs-on: ubuntu-20.04 - steps: - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Test - run: ./test/test.sh diff --git a/builder/.github/workflows/release.yml b/builder/.github/workflows/release.yml deleted file mode 100644 index 8cb55ebb47a..00000000000 --- a/builder/.github/workflows/release.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: goreleaser - -on: - push: - tags: - - 'v*' - -jobs: - goreleaser: - runs-on: ubuntu-20.04 - steps: - - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/builder/.gitignore b/builder/.gitignore deleted file mode 100644 index 011870efb61..00000000000 --- a/builder/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ - -# Created by https://www.toptal.com/developers/gitignore/api/go,vscode -# Edit at https://www.toptal.com/developers/gitignore?templates=go,vscode - -### Go ### -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -### Go Patch ### -/vendor/ -/Godeps/ - -### vscode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -### goland ### -.idea - -# End of https://www.toptal.com/developers/gitignore/api/go,vscode - -/dist/ -opentelemetry-collector-builder diff --git a/builder/.golangci.yaml b/builder/.golangci.yaml deleted file mode 100644 index 7a659b2ad8b..00000000000 --- a/builder/.golangci.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# all available settings of specific linters -linters-settings: - goheader: - template-path: header.txt - goimports: - local-prefixes: github.com/open-telemetry/opentelemetry-collector-builder - maligned: - suggest-new: true - misspell: - locale: US - -linters: - enable: - - goheader - - goimports - - maligned - - misspell - - gosec diff --git a/builder/.goreleaser.yml b/builder/.goreleaser.yml deleted file mode 100644 index 1c068ac733f..00000000000 --- a/builder/.goreleaser.yml +++ /dev/null @@ -1,33 +0,0 @@ -before: - hooks: - - go mod download -builds: - - flags: - - -trimpath - ldflags: - - -s -w -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.version={{.Version}} -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.date={{.Date}} - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - arm - - arm64 - goarm: - - 6 - - 7 -archives: - - format: binary -checksum: - name_template: "checksums.txt" -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - "^docs:" - - "^test:" diff --git a/builder/LICENSE b/builder/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/builder/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/builder/README.md b/builder/README.md deleted file mode 100644 index c13c5b020a2..00000000000 --- a/builder/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# OpenTelemetry Collector builder -[![CI](https://github.com/open-telemetry/opentelemetry-collector-builder/actions/workflows/go.yaml/badge.svg)](https://github.com/open-telemetry/opentelemetry-collector-builder/actions/workflows/go.yaml?query=branch%3Amain) - -This program generates a custom OpenTelemetry Collector binary based on a given configuration. - -## TL;DR -```console -$ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder -$ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.37.0 -``` diff --git a/builder/RELEASE.md b/builder/RELEASE.md deleted file mode 100644 index b0552500521..00000000000 --- a/builder/RELEASE.md +++ /dev/null @@ -1,12 +0,0 @@ -# Releasing the OpenTelemetry Collector Builder - -This project uses [`goreleaser`](https://github.com/goreleaser/goreleaser) to manage the release of new versions. - -To release a new version, simply add a tag named `vX.Y.Z`, like: - -``` -git tag -a v0.1.1 -m "Release v0.1.1" -git push upstream v0.1.1 -``` - -A new GitHub workflow should be started, and at the end, a GitHub release should have been created, similar with the ["Release v0.1.0"](https://github.com/open-telemetry/opentelemetry-collector-builder/releases/tag/v0.1.0). \ No newline at end of file diff --git a/builder/cmd/root.go b/builder/cmd/root.go deleted file mode 100644 index 229853ff798..00000000000 --- a/builder/cmd/root.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020 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 cmd - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "github.com/open-telemetry/opentelemetry-collector-builder/internal/builder" -) - -var ( - version = "dev" - date = "unknown" - - cfgFile string - cfg = builder.DefaultConfig() - - versionCmd = &cobra.Command{ - Use: "version", - Short: "Version of opentelemetry-collector-builder", - Long: "Prints the version of opentelemetry-collector-builder binary", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println(version) - }, - } -) - -// Execute is the main entrypoint for this application -func Execute() error { - cobra.OnInitialize(initConfig) - - cmd := &cobra.Command{ - Use: "opentelemetry-collector-builder", - Long: fmt.Sprintf("OpenTelemetry Collector distribution builder (%s)", version), - RunE: func(cmd *cobra.Command, args []string) error { - - if err := cfg.Validate(); err != nil { - cfg.Logger.Error(err, "invalid configuration") - return err - } - - if err := cfg.ParseModules(); err != nil { - cfg.Logger.Error(err, "invalid module configuration") - return err - } - - return builder.GenerateAndCompile(cfg) - }, - } - - // the external config file - cmd.Flags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.otelcol-builder.yaml)") - - // the distribution parameters, which we accept as CLI flags as well - cmd.Flags().BoolVar(&cfg.SkipCompilation, "skip-compilation", false, "Whether builder should only generate go code with no compile of the collector (default false)") - cmd.Flags().StringVar(&cfg.Distribution.ExeName, "name", "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") - cmd.Flags().StringVar(&cfg.Distribution.LongName, "description", "Custom OpenTelemetry Collector distribution", "A descriptive name for the OpenTelemetry Collector distribution") - cmd.Flags().StringVar(&cfg.Distribution.Version, "version", "1.0.0", "The version for the OpenTelemetry Collector distribution") - cmd.Flags().BoolVar(&cfg.Distribution.IncludeCore, "include-core", true, "Whether the core components should be included in the distribution") - cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") - cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files") - cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "", "The Go binary to use during the compilation phase. Default: go from the PATH") - cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/open-telemetry/opentelemetry-collector-builder", "The Go module for the new distribution") - - // version of this binary - cmd.AddCommand(versionCmd) - - // tie Viper to flags - if err := viper.BindPFlags(cmd.Flags()); err != nil { - cfg.Logger.Error(err, "failed to bind flags") - return err - } - - if err := cmd.Execute(); err != nil { - cfg.Logger.Error(err, "failed to run") - return err - } - - return nil -} - -func initConfig() { - cfg.Logger.Info("OpenTelemetry Collector distribution builder", "version", version, "date", date) - - // a couple of Viper goodies, to make it easier to use env vars when flags are not desirable - viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - viper.AutomaticEnv() - - // load values from config file -- required for the modules configuration - if cfgFile != "" { - viper.SetConfigFile(cfgFile) - } else { - viper.AddConfigPath("$HOME") - viper.SetConfigName(".otelcol-builder") - } - - // load the config file - if err := viper.ReadInConfig(); err == nil { - cfg.Logger.Info("Using config file", "path", viper.ConfigFileUsed()) - } - - // convert Viper's internal state into our configuration object - if err := viper.Unmarshal(&cfg); err != nil { - cfg.Logger.Error(err, "failed to parse the config") - cobra.CheckErr(err) - return - } -} diff --git a/builder/go.mod b/builder/go.mod deleted file mode 100644 index a6374f62af0..00000000000 --- a/builder/go.mod +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020 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. - -module github.com/open-telemetry/opentelemetry-collector-builder - -go 1.17 - -require ( - github.com/go-logr/logr v0.2.1 - github.com/go-logr/zapr v0.2.0 - github.com/spf13/cobra v1.1.3 - github.com/spf13/viper v1.7.1 - github.com/stretchr/testify v1.6.1 - go.uber.org/zap v1.10.0 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.4.7 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/magiconair/properties v1.8.1 // indirect - github.com/mitchellh/mapstructure v1.1.2 // indirect - github.com/pelletier/go-toml v1.2.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/spf13/afero v1.1.2 // indirect - github.com/spf13/cast v1.3.0 // indirect - github.com/spf13/jwalterweatherman v1.0.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.2.0 // indirect - go.uber.org/atomic v1.4.0 // indirect - go.uber.org/multierr v1.1.0 // indirect - golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect - golang.org/x/text v0.3.2 // indirect - gopkg.in/ini.v1 v1.51.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect -) diff --git a/builder/go.sum b/builder/go.sum deleted file mode 100644 index a8b2e2225e9..00000000000 --- a/builder/go.sum +++ /dev/null @@ -1,326 +0,0 @@ -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= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -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/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/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/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -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= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -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-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= -github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= -github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -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-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-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -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.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -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/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/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_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= -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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -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.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -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= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/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-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= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/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= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -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-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/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= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -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 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/builder/header.txt b/builder/header.txt deleted file mode 100644 index 1038a144623..00000000000 --- a/builder/header.txt +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2020 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. \ No newline at end of file diff --git a/builder/internal/builder/config.go b/builder/internal/builder/config.go deleted file mode 100644 index 059fea92f92..00000000000 --- a/builder/internal/builder/config.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2020 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 ( - "errors" - "fmt" - "io/ioutil" - "os" - "os/exec" - "strings" - - "github.com/go-logr/logr" - "github.com/go-logr/zapr" - "go.uber.org/zap" -) - -const defaultOtelColVersion = "0.37.0" - -// ErrInvalidGoMod indicates an invalid gomod -var ErrInvalidGoMod = errors.New("invalid gomod specification for module") - -// ErrDeprecatedCore indicates deprecated core -var ErrDeprecatedCore = errors.New("mod.Core has deprecated, you should not be used anymore and required to be set mod.GoMod instead") - -// Config holds the builder's configuration -type Config struct { - Logger logr.Logger - SkipCompilation bool - - Distribution Distribution `mapstructure:"dist"` - Exporters []Module `mapstructure:"exporters"` - Extensions []Module `mapstructure:"extensions"` - Receivers []Module `mapstructure:"receivers"` - Processors []Module `mapstructure:"processors"` - Replaces []string `mapstructure:"replaces"` - Excludes []string `mapstructure:"excludes"` -} - -// Distribution holds the parameters for the final binary -type Distribution struct { - Module string `mapstructure:"module"` - ExeName string `mapstructure:"name"` - Go string `mapstructure:"go"` - LongName string `mapstructure:"description"` - OtelColVersion string `mapstructure:"otelcol_version"` - IncludeCore bool `mapstructure:"include_core"` - OutputPath string `mapstructure:"output_path"` - Version string `mapstructure:"version"` -} - -// Module represents a receiver, exporter, processor or extension for the distribution -type Module struct { - Name string `mapstructure:"name"` // if not specified, this is package part of the go mod (last part of the path) - Import string `mapstructure:"import"` // if not specified, this is the path part of the go mods - GoMod string `mapstructure:"gomod"` // a gomod-compatible spec for the module - Path string `mapstructure:"path"` // an optional path to the local version of this module - Core *bool `mapstructure:"core"` // whether this module comes from core. For this property isn't referred from anywhere, it might be removed. please see #15. - -} - -// DefaultConfig creates a new config, with default values -func DefaultConfig() Config { - zapLog, err := zap.NewDevelopment() - if err != nil { - panic(fmt.Sprintf("failed to obtain a logger instance: %v", err)) - } - log := zapr.NewLogger(zapLog) - - outputDir, err := ioutil.TempDir("", "otelcol-distribution") - if err != nil { - log.Error(err, "failed to obtain a temporary directory") - } - - return Config{ - Logger: log, - Distribution: Distribution{ - OutputPath: outputDir, - OtelColVersion: defaultOtelColVersion, - }, - } -} - -// Validate checks whether the current configuration is valid -func (c *Config) Validate() error { - // #nosec G204 - if _, err := exec.Command(c.Distribution.Go, "env").CombinedOutput(); err != nil { - path, err := exec.LookPath("go") - if err != nil { - return ErrGoNotFound - } - c.Distribution.Go = path - } - c.Logger.Info("Using go", "Go executable", c.Distribution.Go) - - return nil -} - -// ParseModules will parse the Modules entries and populate the missing values -func (c *Config) ParseModules() error { - var err error - - c.Extensions, err = parseModules(c.Extensions) - if err != nil { - return err - } - - c.Receivers, err = parseModules(c.Receivers) - if err != nil { - return err - } - - c.Exporters, err = parseModules(c.Exporters) - if err != nil { - return err - } - - c.Processors, err = parseModules(c.Processors) - if err != nil { - return err - } - - return nil -} - -func parseModules(mods []Module) ([]Module, error) { - var parsedModules []Module - for _, mod := range mods { - if mod.Core != nil { - return mods, ErrDeprecatedCore - } - if mod.GoMod == "" { - return mods, fmt.Errorf("%w, module: %q", ErrInvalidGoMod, mod.GoMod) - } - - if mod.Import == "" { - mod.Import = strings.Split(mod.GoMod, " ")[0] - } - - if mod.Name == "" { - parts := strings.Split(mod.Import, "/") - mod.Name = parts[len(parts)-1] - } - - if strings.HasPrefix(mod.Path, "./") { - path, err := os.Getwd() - if err != nil { - return mods, fmt.Errorf("module has a relative Path element, but we couldn't get the current working dir: %v", err) - } - - mod.Path = fmt.Sprintf("%s/%s", path, mod.Path[2:]) - } - - parsedModules = append(parsedModules, mod) - } - - return parsedModules, nil -} diff --git a/builder/internal/builder/config_test.go b/builder/internal/builder/config_test.go deleted file mode 100644 index 1528ae30d28..00000000000 --- a/builder/internal/builder/config_test.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2020 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 ( - "errors" - "os" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestParseModules(t *testing.T) { - // prepare - cfg := Config{ - Extensions: []Module{{ - GoMod: "github.com/org/repo v0.1.2", - }}, - } - - // test - err := cfg.ParseModules() - assert.NoError(t, err) - - // verify - assert.Equal(t, "github.com/org/repo v0.1.2", cfg.Extensions[0].GoMod) - assert.Equal(t, "github.com/org/repo", cfg.Extensions[0].Import) - assert.Equal(t, "repo", cfg.Extensions[0].Name) -} - -func TestRelativePath(t *testing.T) { - // prepare - cfg := Config{ - Extensions: []Module{{ - GoMod: "some-module", - Path: "./some-module", - }}, - } - - // test - err := cfg.ParseModules() - assert.NoError(t, err) - - // verify - cwd, err := os.Getwd() - require.NoError(t, err) - assert.True(t, strings.HasPrefix(cfg.Extensions[0].Path, "/")) - assert.True(t, strings.HasPrefix(cfg.Extensions[0].Path, cwd)) -} - -func TestModuleFromCore(t *testing.T) { - // prepare - cfg := Config{ - Extensions: []Module{ // see issue-12 - { - Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - GoMod: "go.opentelemetry.io/collector v0.37.0", - }, - { - Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - GoMod: "go.opentelemetry.io/collector v0.37.0", - Core: nil, - }, - }, - } - - // test - err := cfg.ParseModules() - assert.NoError(t, err) - - // verify - assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "jaegerreceiver")) -} - -func TestDeprecatedCore(t *testing.T) { - // prepare - coreTrue := true - coreFalse := false - cfg := Config{ - Extensions: []Module{ - { - Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - Core: &coreTrue, - }, - { - Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - Core: &coreFalse, - }, - }, - } - - // test - err := cfg.ParseModules() - - // verify - assert.True(t, errors.Is(err, ErrDeprecatedCore)) -} - -func TestInvalidModule(t *testing.T) { - // prepare - cfg := Config{ - Extensions: []Module{{ - Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver", - }}, - } - - // test - err := cfg.ParseModules() - - // verify - assert.True(t, errors.Is(err, ErrInvalidGoMod)) -} diff --git a/builder/internal/builder/main.go b/builder/internal/builder/main.go deleted file mode 100644 index 8cc9c9f784c..00000000000 --- a/builder/internal/builder/main.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2020 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 ( - "errors" - "fmt" - "os" - "os/exec" - "path/filepath" - "text/template" - "time" - - "github.com/open-telemetry/opentelemetry-collector-builder/internal/scaffold" -) - -var ( - // ErrGoNotFound is returned when a Go binary hasn't been found - ErrGoNotFound = errors.New("go binary not found") -) - -// GenerateAndCompile will generate the source files based on the given configuration, update go mod, and will compile into a binary -func GenerateAndCompile(cfg Config) error { - if err := Generate(cfg); err != nil { - return err - } - - // run go get to update go.mod and go.sum files - if err := GetModules(cfg); err != nil { - return err - } - - return Compile(cfg) -} - -// Generate assembles a new distribution based on the given configuration -func Generate(cfg Config) error { - // create a warning message for non-aligned builder and collector base - if cfg.Distribution.OtelColVersion != defaultOtelColVersion { - cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", "builder-version", defaultOtelColVersion) - } - // if the file does not exist, try to create it - if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) { - if err := os.Mkdir(cfg.Distribution.OutputPath, 0755); err != nil { - 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) - } - - for _, file := range []struct { - outFile string - tmpl string - }{ - { - "main.go", - scaffold.Main, - }, - { - "main_others.go", - scaffold.MainOthers, - }, - { - "main_windows.go", - scaffold.MainWindows, - }, - // components.go - { - "components.go", - scaffold.Components, - }, - { - "go.mod", - scaffold.Gomod, - }, - } { - 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) - } - } - - cfg.Logger.Info("Sources created", "path", cfg.Distribution.OutputPath) - return nil -} - -// Compile generates a binary from the sources based on the configuration -func Compile(cfg Config) error { - if cfg.SkipCompilation { - cfg.Logger.Info("Generating source codes only, the distribution will not be compiled.") - return nil - } - - cfg.Logger.Info("Compiling") - // #nosec G204 - cmd := exec.Command(cfg.Distribution.Go, "build", "-ldflags=-s -w", "-trimpath", "-o", cfg.Distribution.ExeName) - cmd.Dir = cfg.Distribution.OutputPath - if out, err := cmd.CombinedOutput(); err != nil { - return fmt.Errorf("failed to compile the OpenTelemetry Collector distribution: %w. Output: %q", err, out) - } - cfg.Logger.Info("Compiled", "binary", fmt.Sprintf("%s/%s", cfg.Distribution.OutputPath, cfg.Distribution.ExeName)) - - return nil -} - -// GetModules retrieves the go modules, updating go.mod and go.sum in the process -func GetModules(cfg Config) error { - // #nosec G204 - cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.17") - cmd.Dir = cfg.Distribution.OutputPath - if out, err := cmd.CombinedOutput(); err != nil { - return fmt.Errorf("failed to update go.mod: %w. Output: %q", err, out) - } - - cfg.Logger.Info("Getting go modules") - // basic retry if error from go mod command (in case of transient network error). This could be improved - // retry 3 times with 5 second spacing interval - retries := 3 - failReason := "unknown" - for i := 1; i <= retries; i++ { - // #nosec G204 - cmd := exec.Command(cfg.Distribution.Go, "mod", "download", "all") - cmd.Dir = cfg.Distribution.OutputPath - if out, err := cmd.CombinedOutput(); err != nil { - failReason = fmt.Sprintf("%s. Output: %q", err, out) - cfg.Logger.Info("Failed modules download", "retry", fmt.Sprintf("%d/%d", i, retries)) - time.Sleep(5 * time.Second) - continue - } - return nil - } - 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 - } - - out, err := os.Create(filepath.Join(cfg.Distribution.OutputPath, outFile)) - if err != nil { - return err - } - - return t.Execute(out, tmplParams) -} diff --git a/builder/internal/scaffold/components.go b/builder/internal/scaffold/components.go deleted file mode 100644 index 4173576ee48..00000000000 --- a/builder/internal/scaffold/components.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2020 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 - -const Components = ` -// Copyright 2020 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 main - -import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer/consumererror" - {{- if .Distribution.IncludeCore}} - "go.opentelemetry.io/collector/service/defaultcomponents" - {{- end}} - - // extensions - {{- range .Extensions}} - {{.Name}} "{{.Import}}" - {{- end}} - - // receivers - {{- range .Receivers}} - {{.Name}} "{{.Import}}" - {{- end}} - - // exporters - {{- range .Exporters}} - {{.Name}} "{{.Import}}" - {{- end}} - - // processors - {{- range .Processors}} - {{.Name}} "{{.Import}}" - {{- end}} -) - -func components() (component.Factories, error) { - var errs []error - var err error - var factories component.Factories - - {{- if .Distribution.IncludeCore}} - factories, err = defaultcomponents.Components() - if err != nil { - return component.Factories{}, err - } - {{- else}} - factories = component.Factories{} - {{- end}} - - extensions := []component.ExtensionFactory{ - {{- range .Extensions}} - {{.Name}}.NewFactory(), - {{- end}} - } - for _, ext := range factories.Extensions { - extensions = append(extensions, ext) - } - factories.Extensions, err = component.MakeExtensionFactoryMap(extensions...) - if err != nil { - errs = append(errs, err) - } - - receivers := []component.ReceiverFactory{ - {{- range .Receivers}} - {{.Name}}.NewFactory(), - {{- end}} - } - for _, rcv := range factories.Receivers { - receivers = append(receivers, rcv) - } - factories.Receivers, err = component.MakeReceiverFactoryMap(receivers...) - if err != nil { - errs = append(errs, err) - } - - exporters := []component.ExporterFactory{ - {{- range .Exporters}} - {{.Name}}.NewFactory(), - {{- end}} - } - for _, exp := range factories.Exporters { - exporters = append(exporters, exp) - } - factories.Exporters, err = component.MakeExporterFactoryMap(exporters...) - if err != nil { - errs = append(errs, err) - } - - processors := []component.ProcessorFactory{ - {{- range .Processors}} - {{.Name}}.NewFactory(), - {{- end}} - } - for _, pr := range factories.Processors { - processors = append(processors, pr) - } - factories.Processors, err = component.MakeProcessorFactoryMap(processors...) - if err != nil { - errs = append(errs, err) - } - - return factories, consumererror.Combine(errs) -} -` diff --git a/builder/internal/scaffold/gomod.go b/builder/internal/scaffold/gomod.go deleted file mode 100644 index 275f5c92a15..00000000000 --- a/builder/internal/scaffold/gomod.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020 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 - -const Gomod = ` -module {{.Distribution.Module}} - -go 1.17 - -require ( - {{- range .Extensions}} - {{if .GoMod}}{{.GoMod}}{{end}} - {{- end}} - {{- range .Receivers}} - {{if .GoMod}}{{.GoMod}}{{end}} - {{- end}} - {{- range .Exporters}} - {{if .GoMod}}{{.GoMod}}{{end}} - {{- end}} - {{- range .Processors}} - {{if .GoMod}}{{.GoMod}}{{end}} - {{- end}} - go.opentelemetry.io/collector v{{.Distribution.OtelColVersion}} -) - -{{- range .Extensions}} -{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} -{{- end}} -{{- range .Receivers}} -{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} -{{- end}} -{{- range .Exporters}} -{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} -{{- end}} -{{- range .Processors}} -{{if ne .Path ""}}replace {{.GoMod}} => {{.Path}}{{end}} -{{- end}} -{{- range .Replaces}} -replace {{.}} -{{- end}} -{{- range .Excludes}} -exclude {{.}} -{{- end}} -` diff --git a/builder/internal/scaffold/main.go b/builder/internal/scaffold/main.go deleted file mode 100644 index 3fbaed58963..00000000000 --- a/builder/internal/scaffold/main.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2020 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 - -const Main = ` -// Copyright 2020 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.ExeName }}", - Description: "{{ .Distribution.LongName }}", - 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 -} -` diff --git a/builder/main.go b/builder/main.go deleted file mode 100644 index 0ef002a58d7..00000000000 --- a/builder/main.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020 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 main - -import ( - "fmt" - "os" - - "github.com/open-telemetry/opentelemetry-collector-builder/cmd" -) - -func main() { - if err := cmd.Execute(); err != nil { - fmt.Println(err.Error()) - os.Exit(1) - } -} diff --git a/builder/test/README.md b/builder/test/README.md deleted file mode 100644 index 8c2b6f06bea..00000000000 --- a/builder/test/README.md +++ /dev/null @@ -1,3 +0,0 @@ -= Testing for the OpenTelemetry Collector Builder - -This is a set of end-to-end tests for the builder. As such, it includes only positive tests, based on the manifest files in this directory. Each manifest is expected to be in a working state and should yield an OpenTelemetry Collector instance that is ready within a time interval. "Ready" is defined by calling its healthcheck endpoint. diff --git a/builder/test/nocore.builder.yaml b/builder/test/nocore.builder.yaml deleted file mode 100644 index abebfad3d7c..00000000000 --- a/builder/test/nocore.builder.yaml +++ /dev/null @@ -1,14 +0,0 @@ -dist: - module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore - otelcol_version: 0.37.0 - include_core: false - -receivers: - - import: go.opentelemetry.io/collector/receiver/otlpreceiver - gomod: go.opentelemetry.io/collector v0.37.0 -exporters: - - import: go.opentelemetry.io/collector/exporter/loggingexporter - gomod: go.opentelemetry.io/collector v0.37.0 -extensions: - - import: go.opentelemetry.io/collector/extension/zpagesextension - gomod: go.opentelemetry.io/collector v0.37.0 diff --git a/builder/test/nocore.otel.yaml b/builder/test/nocore.otel.yaml deleted file mode 100644 index e0d615cd3d9..00000000000 --- a/builder/test/nocore.otel.yaml +++ /dev/null @@ -1,22 +0,0 @@ -extensions: - zpages: - -receivers: - otlp: - protocols: - grpc: - -processors: - -exporters: - logging: - -service: - extensions: [zpages] - pipelines: - traces: - receivers: - - otlp - processors: [] - exporters: - - logging diff --git a/builder/test/replaces.builder.yaml b/builder/test/replaces.builder.yaml deleted file mode 100644 index aead637b646..00000000000 --- a/builder/test/replaces.builder.yaml +++ /dev/null @@ -1,10 +0,0 @@ -dist: - module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces - otelcol_version: 0.37.0 - -processors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.37.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.37.0 - -replaces: - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.37.0 diff --git a/builder/test/replaces.otel.yaml b/builder/test/replaces.otel.yaml deleted file mode 100755 index ebf08a2d925..00000000000 --- a/builder/test/replaces.otel.yaml +++ /dev/null @@ -1,36 +0,0 @@ -extensions: - zpages: - -receivers: - otlp: - protocols: - grpc: - endpoint: localhost:4317 - -processors: - resourcedetection: - detectors: - - env - routing: - default_exporters: - - logging - from_attribute: X-Tenant - table: - - value: acme - exporters: - - logging - -exporters: - logging: - -service: - extensions: [zpages] - pipelines: - traces: - receivers: - - otlp - processors: - - resourcedetection - - routing - exporters: - - logging diff --git a/builder/test/test.sh b/builder/test/test.sh deleted file mode 100755 index bc4d598a8dc..00000000000 --- a/builder/test/test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash - -GOBIN=$(go env GOBIN) -if [[ "$GO" == "" ]]; then - GOBIN=$(which go) -fi - -if [[ "$GOBIN" == "" ]]; then - echo "Could not determine which Go binary to use." - exit 1 -fi - -echo "Using ${GOBIN} to compile the distributions." - -# each attempt pauses for 100ms before retrying -max_retries=50 - -tests="replaces nocore" - -base=`mktemp -d` -echo "Running the tests in ${base}" - -failed=false -for test in $tests -do - out="${base}/${test}" - mkdir -p "${out}" - if [ $? != 0 ]; then - echo "❌ FAIL ${test}. Failed to create test directory for the test. Aborting tests." - exit 2 - fi - - echo "Starting test '${test}' at `date`" >> "${out}/test.log" - - go run . --go "${GOBIN}" --config "./test/${test}.builder.yaml" --output-path "${out}" --name otelcol-built-test > "${out}/builder.log" 2>&1 - if [ $? != 0 ]; then - echo "❌ FAIL ${test}. Failed to compile the test ${test}. Build logs:" - cat "${out}/builder.log" - failed=true - continue - fi - - if [ ! -f "${out}/otelcol-built-test" ]; then - echo "❌ FAIL ${test}. Binary not found for ${test} at '${out}/otelcol-built-test'. Build logs:" - cat "${out}/builder.log" - failed=true - continue - fi - - # start the distribution - "${out}/otelcol-built-test" --config "./test/${test}.otel.yaml" > "${out}/otelcol.log" 2>&1 & - pid=$! - - retries=0 - while true - do - kill -0 "${pid}" >/dev/null 2>&1 - if [ $? != 0 ]; then - echo "❌ FAIL ${test}. The OpenTelemetry Collector isn't running. Startup log:" - cat "${out}/otelcol.log" - failed=true - break - fi - - curl -s http://localhost:55679/debug/servicez | grep Uptime > /dev/null - if [ $? == 0 ]; then - echo "✅ PASS ${test}" - - kill "${pid}" - if [ $? != 0 ]; then - echo "Failed to stop the running instance for test ${test}. Return code: $? . Skipping tests." - exit 4 - fi - break - fi - - echo "Server still unavailable for test '${test}'" >> "${out}/test.log" - - let "retries++" - if [ "$retries" -gt "$max_retries" ]; then - echo "❌ FAIL ${test}. Server wasn't up after about 5s." - failed=true - - kill "${pid}" - if [ $? != 0 ]; then - echo "Failed to stop the running instance for test ${test}. Return code: $? . Skipping tests." - exit 8 - fi - break - fi - sleep 0.1s - done - - echo "Stopping server for '${test}' (pid: ${pid})" >> "${out}/test.log" - wait ${pid} -done - -if [[ "$failed" == "true" ]]; then - exit 1 -fi From 9a3d0f543cd77dae5018171c67199a2a71d0001e Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 28 Oct 2021 15:02:40 -0700 Subject: [PATCH 105/149] Integrate builder as module in core, enable majority of the checks (#4292) Signed-off-by: Bogdan Drutu --- .github/dependabot.yml | 4 ++++ .github/workflows/build-and-test-windows.yaml | 2 -- .github/workflows/build-and-test.yml | 4 ---- .github/workflows/contrib-tests.yml | 4 ---- .github/workflows/dependabot.yml | 2 -- builder/.golangci.yaml | 18 ------------------ builder/.goreleaser.yml | 2 +- builder/Makefile | 1 + builder/cmd/root.go | 6 +++--- builder/go.mod | 2 +- builder/internal/builder/config.go | 2 +- builder/internal/builder/main.go | 6 +++--- builder/internal/scaffold/components.go | 2 +- builder/internal/scaffold/gomod.go | 2 +- builder/internal/scaffold/main.go | 2 +- builder/main.go | 2 +- builder/test/nocore.builder.yaml | 2 +- builder/test/replaces.builder.yaml | 2 +- versions.yaml | 1 + 19 files changed, 21 insertions(+), 45 deletions(-) delete mode 100644 builder/.golangci.yaml create mode 100644 builder/Makefile diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 78d47978b6c..d25ddb00ffd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,6 +14,10 @@ updates: directory: "/" schedule: interval: "weekly" + - package-ecosystem: "gomod" + directory: "/builder" + schedule: + interval: "weekly" - package-ecosystem: "gomod" directory: "/internal/tools" schedule: diff --git a/.github/workflows/build-and-test-windows.yaml b/.github/workflows/build-and-test-windows.yaml index ef921e667e0..b7da215cdd6 100644 --- a/.github/workflows/build-and-test-windows.yaml +++ b/.github/workflows/build-and-test-windows.yaml @@ -7,8 +7,6 @@ on: tags: - 'v[0-9]+.[0-9]+.[0-9]+*' pull_request: - paths-ignore: - - 'builder/**' jobs: windows-unittest: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b6443b26805..0e6179506f4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,13 +2,9 @@ name: build-and-test on: push: branches: [main] - paths-ignore: - - 'builder/**' tags: - "v[0-9]+.[0-9]+.[0-9]+*" pull_request: - paths-ignore: - - 'builder/**' jobs: setup-environment: diff --git a/.github/workflows/contrib-tests.yml b/.github/workflows/contrib-tests.yml index 547e5e42015..2473041bd12 100644 --- a/.github/workflows/contrib-tests.yml +++ b/.github/workflows/contrib-tests.yml @@ -2,13 +2,9 @@ name: contrib-tests on: push: branches: [ main ] - paths-ignore: - - 'builder/**' tags: - v[0-9]+.[0-9]+.[0-9]+.* pull_request: - paths-ignore: - - 'builder/**' jobs: contrib_tests: diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 5df9ac56ed6..8460dc731fc 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -3,8 +3,6 @@ name: Dependabot-Tidier on: pull_request: types: [ labeled ] - paths-ignore: - - 'builder/**' jobs: mod_tidier: diff --git a/builder/.golangci.yaml b/builder/.golangci.yaml deleted file mode 100644 index 7a659b2ad8b..00000000000 --- a/builder/.golangci.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# all available settings of specific linters -linters-settings: - goheader: - template-path: header.txt - goimports: - local-prefixes: github.com/open-telemetry/opentelemetry-collector-builder - maligned: - suggest-new: true - misspell: - locale: US - -linters: - enable: - - goheader - - goimports - - maligned - - misspell - - gosec diff --git a/builder/.goreleaser.yml b/builder/.goreleaser.yml index 1c068ac733f..ee05a0b2e47 100644 --- a/builder/.goreleaser.yml +++ b/builder/.goreleaser.yml @@ -5,7 +5,7 @@ builds: - flags: - -trimpath ldflags: - - -s -w -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.version={{.Version}} -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.date={{.Date}} + - -s -w -X go.opentelemetry.io/collector/builder/cmd.version={{.Version}} -X go.opentelemetry.io/collector/builder/cmd.date={{.Date}} env: - CGO_ENABLED=0 goos: diff --git a/builder/Makefile b/builder/Makefile new file mode 100644 index 00000000000..39734bfaebb --- /dev/null +++ b/builder/Makefile @@ -0,0 +1 @@ +include ../Makefile.Common diff --git a/builder/cmd/root.go b/builder/cmd/root.go index 229853ff798..9bfde9129d9 100644 --- a/builder/cmd/root.go +++ b/builder/cmd/root.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd +package cmd // import "go.opentelemetry.io/collector/builder/cmd" import ( "fmt" @@ -21,7 +21,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/open-telemetry/opentelemetry-collector-builder/internal/builder" + "go.opentelemetry.io/collector/builder/internal/builder" ) var ( @@ -76,7 +76,7 @@ func Execute() error { cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files") cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "", "The Go binary to use during the compilation phase. Default: go from the PATH") - cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "github.com/open-telemetry/opentelemetry-collector-builder", "The Go module for the new distribution") + cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "go.opentelemetry.io/collector/builder", "The Go module for the new distribution") // version of this binary cmd.AddCommand(versionCmd) diff --git a/builder/go.mod b/builder/go.mod index a6374f62af0..5838c4f1099 100644 --- a/builder/go.mod +++ b/builder/go.mod @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -module github.com/open-telemetry/opentelemetry-collector-builder +module go.opentelemetry.io/collector/builder go 1.17 diff --git a/builder/internal/builder/config.go b/builder/internal/builder/config.go index 059fea92f92..2dcf7cbecf9 100644 --- a/builder/internal/builder/config.go +++ b/builder/internal/builder/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package builder // import "go.opentelemetry.io/collector/builder/internal/builder" import ( "errors" diff --git a/builder/internal/builder/main.go b/builder/internal/builder/main.go index 8cc9c9f784c..0a73453bccd 100644 --- a/builder/internal/builder/main.go +++ b/builder/internal/builder/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder +package builder // import "go.opentelemetry.io/collector/builder/internal/builder" import ( "errors" @@ -23,7 +23,7 @@ import ( "text/template" "time" - "github.com/open-telemetry/opentelemetry-collector-builder/internal/scaffold" + "go.opentelemetry.io/collector/builder/internal/scaffold" ) var ( @@ -53,7 +53,7 @@ func Generate(cfg Config) error { } // if the file does not exist, try to create it if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) { - if err := os.Mkdir(cfg.Distribution.OutputPath, 0755); err != nil { + if err = os.Mkdir(cfg.Distribution.OutputPath, 0750); err != nil { return fmt.Errorf("failed to create output path: %w", err) } } else if err != nil { diff --git a/builder/internal/scaffold/components.go b/builder/internal/scaffold/components.go index 4173576ee48..8a2c6436fc2 100644 --- a/builder/internal/scaffold/components.go +++ b/builder/internal/scaffold/components.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scaffold +package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold" const Components = ` // Copyright 2020 OpenTelemetry Authors diff --git a/builder/internal/scaffold/gomod.go b/builder/internal/scaffold/gomod.go index 275f5c92a15..46765c30ba5 100644 --- a/builder/internal/scaffold/gomod.go +++ b/builder/internal/scaffold/gomod.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scaffold +package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold" const Gomod = ` module {{.Distribution.Module}} diff --git a/builder/internal/scaffold/main.go b/builder/internal/scaffold/main.go index 3fbaed58963..c08641c2d96 100644 --- a/builder/internal/scaffold/main.go +++ b/builder/internal/scaffold/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scaffold +package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold" const Main = ` // Copyright 2020 OpenTelemetry Authors diff --git a/builder/main.go b/builder/main.go index 0ef002a58d7..1808f4b46f1 100644 --- a/builder/main.go +++ b/builder/main.go @@ -18,7 +18,7 @@ import ( "fmt" "os" - "github.com/open-telemetry/opentelemetry-collector-builder/cmd" + "go.opentelemetry.io/collector/builder/cmd" ) func main() { diff --git a/builder/test/nocore.builder.yaml b/builder/test/nocore.builder.yaml index abebfad3d7c..a5899cadf9c 100644 --- a/builder/test/nocore.builder.yaml +++ b/builder/test/nocore.builder.yaml @@ -1,5 +1,5 @@ dist: - module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore + module: go.opentelemetry.io/collector/builder/test/nocore otelcol_version: 0.37.0 include_core: false diff --git a/builder/test/replaces.builder.yaml b/builder/test/replaces.builder.yaml index aead637b646..3a02d435df2 100644 --- a/builder/test/replaces.builder.yaml +++ b/builder/test/replaces.builder.yaml @@ -1,5 +1,5 @@ dist: - module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces + module: go.opentelemetry.io/collector/builder/test/replaces otelcol_version: 0.37.0 processors: diff --git a/versions.yaml b/versions.yaml index f6d6298764d..54980d66b46 100644 --- a/versions.yaml +++ b/versions.yaml @@ -18,5 +18,6 @@ module-sets: modules: - go.opentelemetry.io/collector - go.opentelemetry.io/collector/model + - go.opentelemetry.io/collector/builder excluded-modules: - go.opentelemetry.io/collector/internal/tools From bc93e54d34e7f88b503f957213758c6114588261 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:13:25 -0700 Subject: [PATCH 106/149] Bump github.com/spf13/viper from 1.7.1 to 1.9.0 in /builder (#4293) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.7.1 to 1.9.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.7.1...v1.9.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper 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> --- builder/go.mod | 32 ++-- builder/go.sum | 485 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 477 insertions(+), 40 deletions(-) diff --git a/builder/go.mod b/builder/go.mod index 5838c4f1099..39d1a4f9346 100644 --- a/builder/go.mod +++ b/builder/go.mod @@ -20,30 +20,30 @@ require ( github.com/go-logr/logr v0.2.1 github.com/go-logr/zapr v0.2.0 github.com/spf13/cobra v1.1.3 - github.com/spf13/viper v1.7.1 - github.com/stretchr/testify v1.6.1 - go.uber.org/zap v1.10.0 + github.com/spf13/viper v1.9.0 + github.com/stretchr/testify v1.7.0 + go.uber.org/zap v1.17.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/magiconair/properties v1.8.1 // indirect - github.com/mitchellh/mapstructure v1.1.2 // indirect - github.com/pelletier/go-toml v1.2.0 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mitchellh/mapstructure v1.4.2 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/spf13/afero v1.1.2 // indirect - github.com/spf13/cast v1.3.0 // indirect - github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect - go.uber.org/atomic v1.4.0 // indirect - go.uber.org/multierr v1.1.0 // indirect - golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect - golang.org/x/text v0.3.2 // indirect - gopkg.in/ini.v1 v1.51.0 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect + golang.org/x/text v0.3.6 // indirect + gopkg.in/ini.v1 v1.63.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/builder/go.sum b/builder/go.sum index a8b2e2225e9..22b0612f3ba 100644 --- a/builder/go.sum +++ b/builder/go.sum @@ -5,31 +5,73 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go 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= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/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= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/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/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/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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -37,11 +79,23 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -51,40 +105,99 @@ github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/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.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/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= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/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/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.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/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-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= @@ -96,120 +209,178 @@ 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/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +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/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/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/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= 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/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +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/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +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/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +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_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 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/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= 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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +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.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= +github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +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 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-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-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/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= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -219,10 +390,22 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -237,14 +420,58 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-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/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= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -252,19 +479,71 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-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-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-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-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 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/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -275,23 +554,91 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.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/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.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= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -301,26 +648,116 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-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.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.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= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.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/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +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 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.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/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From fd3339aa4d37045ef105966afd3429cf789282b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:18:25 -0700 Subject: [PATCH 107/149] Bump go.opentelemetry.io/contrib/zpages from 0.25.0 to 0.26.0 (#4300) Bumps [go.opentelemetry.io/contrib/zpages](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.25.0 to 0.26.0. - [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.25.0...zpages/v0.26.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/zpages dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 13 ++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 1cc52315318..d1aea11725c 100644 --- a/go.mod +++ b/go.mod @@ -21,14 +21,14 @@ require ( go.opentelemetry.io/collector/model v0.38.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 - go.opentelemetry.io/contrib/zpages v0.25.0 - go.opentelemetry.io/otel v1.0.1 + go.opentelemetry.io/contrib/zpages v0.26.0 + 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.0.1 + 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.0.1 + go.opentelemetry.io/otel/trace v1.1.0 go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.7.0 go.uber.org/zap v1.19.1 diff --git a/go.sum b/go.sum index 2117f03c13d..86a3327bd69 100644 --- a/go.sum +++ b/go.sum @@ -415,24 +415,27 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.2 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 h1:FIbb8m2PtTWjvXLHOEnXAoSmkaiXbg3fuvoZAjsAT3Q= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0/go.mod h1:NyB05cd+yPX6W5SiRNuJ90w7PV2+g2cgRbsPL7MvpME= -go.opentelemetry.io/contrib/zpages v0.25.0 h1:o5aRS429e3fJmxKo32badDmCYzzRoaqHW+6XJBql9OU= -go.opentelemetry.io/contrib/zpages v0.25.0/go.mod h1:cXBK0CNcIBD9Iiw1Hv3DvS+E8N2rtr+k+OoPs+sP0T4= -go.opentelemetry.io/otel v1.0.1 h1:4XKyXmfqJLOQ7feyV5DB6gsBFZ0ltB8vLtp6pj4JIcc= +go.opentelemetry.io/contrib/zpages v0.26.0 h1:qlhOM4R5izfJXKheW7fTjhg5aQzPbIs4+DSV8RfLatA= +go.opentelemetry.io/contrib/zpages v0.26.0/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/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/metric v0.24.0/go.mod h1:tpMFnCD9t+BEGiWY2bWF5+AwjuAdM0lSowQ4SBA3/K4= -go.opentelemetry.io/otel/sdk v1.0.1 h1:wXxFEWGo7XfXupPwVJvTBOaPBC9FEg0wB8hMNrKk+cA= 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/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/trace v1.0.1 h1:StTeIH6Q3G4r0Fiw34LTokUFESZgIDUr0qIJ7mKmAfw= 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/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= From 33974d7d0ade9f7195048ecd35249ef5d518d5e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:26:48 -0700 Subject: [PATCH 108/149] Bump github.com/jcchavezs/porto from 0.3.0 to 0.4.0 in /internal/tools (#4303) Bumps [github.com/jcchavezs/porto](https://github.com/jcchavezs/porto) from 0.3.0 to 0.4.0. - [Release notes](https://github.com/jcchavezs/porto/releases) - [Commits](https://github.com/jcchavezs/porto/compare/v0.3.0...v0.4.0) --- updated-dependencies: - dependency-name: github.com/jcchavezs/porto 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> --- internal/tools/go.mod | 2 +- internal/tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/tools/go.mod b/internal/tools/go.mod index e920874bc62..2e12265dfcc 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -6,7 +6,7 @@ require ( github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.42.1 github.com/google/addlicense v1.0.0 - github.com/jcchavezs/porto v0.3.0 + github.com/jcchavezs/porto v0.4.0 github.com/mjibson/esc v0.2.0 github.com/ory/go-acc v0.2.6 github.com/pavius/impi v0.0.3 diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 541b894aba5..acfb7b01e90 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -421,8 +421,8 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jcchavezs/porto v0.3.0 h1:JSKeMsqexngzHUpiv4NPPADSNBF9bDyavGRDWedzNeM= -github.com/jcchavezs/porto v0.3.0/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A= +github.com/jcchavezs/porto v0.4.0 h1:Zj7RligrxmDdKGo6fBO2xYAHxEgrVBfs1YAja20WbV4= +github.com/jcchavezs/porto v0.4.0/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= From b4432cb010c543c287acd3ce72fffe3794bbb992 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 28 Oct 2021 15:31:08 -0700 Subject: [PATCH 109/149] Upgrade all dependabot deps (#4304) Signed-off-by: Bogdan Drutu --- builder/go.mod | 8 ++-- builder/go.sum | 111 ++++++++++++------------------------------------- go.mod | 4 +- go.sum | 15 ++----- 4 files changed, 37 insertions(+), 101 deletions(-) diff --git a/builder/go.mod b/builder/go.mod index 39d1a4f9346..351960409d1 100644 --- a/builder/go.mod +++ b/builder/go.mod @@ -17,12 +17,12 @@ module go.opentelemetry.io/collector/builder go 1.17 require ( - github.com/go-logr/logr v0.2.1 - github.com/go-logr/zapr v0.2.0 - github.com/spf13/cobra v1.1.3 + github.com/go-logr/logr v1.2.0 + github.com/go-logr/zapr v1.2.0 + github.com/spf13/cobra v1.2.1 github.com/spf13/viper v1.9.0 github.com/stretchr/testify v1.7.0 - go.uber.org/zap v1.17.0 + go.uber.org/zap v1.19.1 ) require ( diff --git a/builder/go.sum b/builder/go.sum index 22b0612f3ba..13399c44160 100644 --- a/builder/go.sum +++ b/builder/go.sum @@ -46,17 +46,15 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/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/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/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -67,18 +65,12 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX 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/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -89,28 +81,20 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +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/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-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-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= -github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= -github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= +github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -180,10 +164,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ 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/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.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= @@ -218,26 +198,19 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 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/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -248,7 +221,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd 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/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/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -260,37 +232,25 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 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.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/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +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/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 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_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -298,30 +258,24 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 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/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 v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -331,14 +285,11 @@ 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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= @@ -350,18 +301,17 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.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.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -409,9 +359,7 @@ 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-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= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -457,6 +405,7 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/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= @@ -474,10 +423,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -490,6 +436,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -544,7 +491,6 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -562,6 +508,7 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -626,6 +573,7 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/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= @@ -730,21 +678,16 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -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= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +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/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/go.mod b/go.mod index d1aea11725c..5e1363e94d9 100644 --- a/go.mod +++ b/go.mod @@ -19,8 +19,8 @@ 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.25.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.26.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.26.0 go.opentelemetry.io/contrib/zpages v0.26.0 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 86a3327bd69..eb23bea7257 100644 --- a/go.sum +++ b/go.sum @@ -42,7 +42,6 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.0/go.mod h1:o7cosnyfuPVK0tB8q0 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -75,8 +74,6 @@ github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqO 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/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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -86,7 +83,6 @@ 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/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -101,7 +97,6 @@ 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/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -368,7 +363,6 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= @@ -411,10 +405,10 @@ 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.25.0 h1:Wx7nFnvCaissIUZxPkBqDz2963Z+Cl+PkYbDKzTxDqQ= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0 h1:FIbb8m2PtTWjvXLHOEnXAoSmkaiXbg3fuvoZAjsAT3Q= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.25.0/go.mod h1:NyB05cd+yPX6W5SiRNuJ90w7PV2+g2cgRbsPL7MvpME= +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/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.0 h1:qlhOM4R5izfJXKheW7fTjhg5aQzPbIs4+DSV8RfLatA= go.opentelemetry.io/contrib/zpages v0.26.0/go.mod h1:NGd/Gf9T4Wn4LsUjTB1rPfKYWZefNNrXYoSWJLvu/rY= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= @@ -783,7 +777,6 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= 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/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= From 2981b3c8e94294e49b31a083b052fa5bd9c8e329 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 28 Oct 2021 15:57:19 -0700 Subject: [PATCH 110/149] Change ParserProvider to use Retrieve and Retrieved as ConfigSource (#4270) * Change ParserProvider to use Retrieve and Retrieved as ConfigSource Return one instance per "Retrieve" call that is capable of "watching" the retrieved value. This is important because the collector needs to close the watcher after an update is received, and also the "merger" provider needs to close all the other watcher that did not trigger. When Start: * Collector retrieves config and starts watching; When watch update: * Collector closes all watchers (retrieved watching values). * Collector retrieves a new config and starts watching. When Shutdown: * Collector closes all watchers (retrieved watching values). * Collector "Shutdown" the provider. Signed-off-by: Bogdan Drutu * Update config/provider.go Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> * Update provider.go * Update provider.go * Update simple.go * Update simple.go Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> --- config/configtest/configtest.go | 4 ++-- config/provider.go | 27 ++++++++++++++++++---- service/collector.go | 27 +++++++++++----------- service/collector_test.go | 2 +- service/parserprovider/default_test.go | 16 ++++++------- service/parserprovider/expand.go | 7 +++--- service/parserprovider/expand_test.go | 8 +++---- service/parserprovider/file.go | 4 ++-- service/parserprovider/inmemory.go | 8 +++++-- service/parserprovider/merge.go | 10 ++++---- service/parserprovider/merge_test.go | 6 ++--- service/parserprovider/properties.go | 6 ++--- service/parserprovider/properties_test.go | 18 ++++++++------- service/parserprovider/simple.go | 28 +++++++++++++++++++++++ service/settings.go | 2 +- 15 files changed, 112 insertions(+), 61 deletions(-) create mode 100644 service/parserprovider/simple.go diff --git a/config/configtest/configtest.go b/config/configtest/configtest.go index 34a911c8e8e..99ffb79c983 100644 --- a/config/configtest/configtest.go +++ b/config/configtest/configtest.go @@ -35,12 +35,12 @@ 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 := parserprovider.NewExpandMapProvider(parserprovider.NewFileMapProvider(fileName)).Get(context.Background()) + cp, err := parserprovider.NewExpandMapProvider(parserprovider.NewFileMapProvider(fileName)).Retrieve(context.Background()) if err != nil { return nil, err } // Unmarshal the config using the given factories. - return configunmarshaler.NewDefault().Unmarshal(cp, factories) + return configunmarshaler.NewDefault().Unmarshal(cp.Get(), factories) } // LoadConfigAndValidate loads a config from the file, and validates the configuration. diff --git a/config/provider.go b/config/provider.go index 5e0d28725e9..bfb1a4b9740 100644 --- a/config/provider.go +++ b/config/provider.go @@ -21,8 +21,10 @@ import ( // MapProvider 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 { - // Get returns the Map if succeed or error otherwise. - Get(ctx context.Context) (*Map, error) + // 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) // 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. @@ -30,13 +32,28 @@ type MapProvider interface { Close(ctx context.Context) error } -// WatchableMapProvider is an extension for MapProvider that is implemented if the given provider -// supports monitoring of configuration updates. -type WatchableMapProvider 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 +} + +// 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. + // 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. + Close(ctx context.Context) error } diff --git a/service/collector.go b/service/collector.go index 9a8af3cc68a..0234be975f4 100644 --- a/service/collector.go +++ b/service/collector.go @@ -153,14 +153,14 @@ func (col *Collector) runAndWaitForShutdownEvent() { // 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 { - cp, err := col.set.ConfigMapProvider.Get(ctx) + ret, err := col.set.ConfigMapProvider.Retrieve(ctx) if err != nil { - return fmt.Errorf("cannot load configuration's parser: %w", err) + return fmt.Errorf("cannot retrieve the configuration: %w", err) } - cfg, err := col.set.ConfigUnmarshaler.Unmarshal(cp, col.set.Factories) - if err != nil { - return fmt.Errorf("cannot load 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) } if err = cfg.Validate(); err != nil { @@ -193,9 +193,9 @@ func (col *Collector) setupConfigurationComponents(ctx context.Context) error { return err } - // If provider is watchable start a goroutine watching for updates. - if watchable, ok := col.set.ConfigMapProvider.(config.WatchableMapProvider); ok { - go col.watchForConfigUpdates(watchable) + // If the retrieved value is watchable start a goroutine watching for updates. + if watchable, ok := ret.(config.WatchableRetrieved); ok { + go col.watchForConfigUpdates(ctx, watchable) } return nil @@ -266,10 +266,6 @@ func (col *Collector) Run(ctx context.Context) error { // 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 err := col.set.ConfigMapProvider.Close(ctx); err != nil { - return fmt.Errorf("failed close current config provider: %w", err) - } - if col.service != nil { retiringService := col.service col.service = nil @@ -285,7 +281,7 @@ func (col *Collector) reloadService(ctx context.Context) error { return nil } -func (col *Collector) watchForConfigUpdates(watchable config.WatchableMapProvider) { +func (col *Collector) watchForConfigUpdates(ctx context.Context, watchable config.WatchableRetrieved) { err := watchable.WatchForUpdate() if errors.Is(err, configsource.ErrSessionClosed) { // This is the case of shutdown of the whole collector server, nothing to do. @@ -293,7 +289,10 @@ func (col *Collector) watchForConfigUpdates(watchable config.WatchableMapProvide return } col.logger.Warn("Config WatchForUpdated exited", zap.Error(err)) - if err = col.reloadService(context.Background()); err != nil { + if err = watchable.Close(ctx); err != nil { + col.asyncErrorChannel <- err + } + if err = col.reloadService(ctx); err != nil { col.asyncErrorChannel <- err } } diff --git a/service/collector_test.go b/service/collector_test.go index 68934b63c61..401461ccf47 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -266,7 +266,7 @@ type errParserLoader struct { err error } -func (epl *errParserLoader) Get(context.Context) (*config.Map, error) { +func (epl *errParserLoader) Retrieve(_ context.Context) (config.Retrieved, error) { return nil, epl.err } diff --git a/service/parserprovider/default_test.go b/service/parserprovider/default_test.go index d0b1de8c3c7..2e66ff97a89 100644 --- a/service/parserprovider/default_test.go +++ b/service/parserprovider/default_test.go @@ -27,7 +27,7 @@ import ( func TestDefaultMapProvider(t *testing.T) { mp := NewDefaultMapProvider("testdata/default-config.yaml", nil) - cm, err := mp.Get(context.Background()) + retr, err := mp.Retrieve(context.Background()) require.NoError(t, err) expectedMap, err := config.NewMapFromBuffer(strings.NewReader(` @@ -37,14 +37,14 @@ exporters: otlp: endpoint: "localhost:4317"`)) require.NoError(t, err) - assert.Equal(t, expectedMap, cm) + assert.Equal(t, expectedMap, retr.Get()) assert.NoError(t, mp.Close(context.Background())) } func TestDefaultMapProvider_AddNewConfig(t *testing.T) { mp := NewDefaultMapProvider("testdata/default-config.yaml", []string{"processors.batch.timeout=2s"}) - cm, err := mp.Get(context.Background()) + cp, err := mp.Retrieve(context.Background()) require.NoError(t, err) expectedMap, err := config.NewMapFromBuffer(strings.NewReader(` @@ -55,7 +55,7 @@ exporters: otlp: endpoint: "localhost:4317"`)) require.NoError(t, err) - assert.Equal(t, expectedMap, cm) + assert.Equal(t, expectedMap, cp.Get()) assert.NoError(t, mp.Close(context.Background())) } @@ -64,7 +64,7 @@ func TestDefaultMapProvider_OverwriteConfig(t *testing.T) { mp := NewDefaultMapProvider( "testdata/default-config.yaml", []string{"processors.batch.timeout=2s", "exporters.otlp.endpoint=localhost:1234"}) - cm, err := mp.Get(context.Background()) + cp, err := mp.Retrieve(context.Background()) require.NoError(t, err) expectedMap, err := config.NewMapFromBuffer(strings.NewReader(` @@ -75,7 +75,7 @@ exporters: otlp: endpoint: "localhost:1234"`)) require.NoError(t, err) - assert.Equal(t, expectedMap, cm) + assert.Equal(t, expectedMap, cp.Get()) assert.NoError(t, mp.Close(context.Background())) } @@ -83,7 +83,7 @@ exporters: func TestDefaultMapProvider_InexistentFile(t *testing.T) { mp := NewDefaultMapProvider("testdata/otelcol-config.yaml", nil) require.NotNil(t, mp) - _, err := mp.Get(context.Background()) + _, err := mp.Retrieve(context.Background()) require.Error(t, err) assert.NoError(t, mp.Close(context.Background())) @@ -91,7 +91,7 @@ func TestDefaultMapProvider_InexistentFile(t *testing.T) { func TestDefaultMapProvider_EmptyFileName(t *testing.T) { mp := NewDefaultMapProvider("", nil) - _, err := mp.Get(context.Background()) + _, err := mp.Retrieve(context.Background()) require.Error(t, err) assert.NoError(t, mp.Close(context.Background())) diff --git a/service/parserprovider/expand.go b/service/parserprovider/expand.go index a787b7ddfda..ff1351796f1 100644 --- a/service/parserprovider/expand.go +++ b/service/parserprovider/expand.go @@ -33,15 +33,16 @@ func NewExpandMapProvider(base config.MapProvider) config.MapProvider { } } -func (emp *expandMapProvider) Get(ctx context.Context) (*config.Map, error) { - cfgMap, err := emp.base.Get(ctx) +func (emp *expandMapProvider) Retrieve(ctx context.Context) (config.Retrieved, error) { + retr, err := emp.base.Retrieve(ctx) if err != nil { return nil, err } + cfgMap := retr.Get() for _, k := range cfgMap.AllKeys() { cfgMap.Set(k, expandStringValues(cfgMap.Get(k))) } - return cfgMap, nil + return &simpleRetrieved{confMap: cfgMap}, nil } func (emp *expandMapProvider) Close(ctx context.Context) error { diff --git a/service/parserprovider/expand_test.go b/service/parserprovider/expand_test.go index 1903eb0bd12..584516b3795 100644 --- a/service/parserprovider/expand_test.go +++ b/service/parserprovider/expand_test.go @@ -57,11 +57,11 @@ func TestExpand(t *testing.T) { t.Run(test.name, func(t *testing.T) { // Retrieve the config emp := NewExpandMapProvider(NewFileMapProvider(path.Join("testdata", test.name))) - cfgMap, err := emp.Get(context.Background()) + cp, err := emp.Retrieve(context.Background()) 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(), cfgMap.ToStringMap()) + assert.Equal(t, expectedCfgMap.ToStringMap(), cp.Get().ToStringMap()) }) } } @@ -75,7 +75,7 @@ func TestExpand_EscapedEnvVars(t *testing.T) { // Retrieve the config emp := NewExpandMapProvider(NewFileMapProvider(path.Join("testdata", "expand-escaped-env.yaml"))) - cfgMap, err := emp.Get(context.Background()) + cp, err := emp.Retrieve(context.Background()) require.NoError(t, err, "Unable to get config") expectedMap := map[string]interface{}{ @@ -95,5 +95,5 @@ func TestExpand_EscapedEnvVars(t *testing.T) { // escaped $ alone "recv.7": "$", }} - assert.Equal(t, expectedMap, cfgMap.ToStringMap()) + assert.Equal(t, expectedMap, cp.Get().ToStringMap()) } diff --git a/service/parserprovider/file.go b/service/parserprovider/file.go index b676eb32164..90b76c107fc 100644 --- a/service/parserprovider/file.go +++ b/service/parserprovider/file.go @@ -33,7 +33,7 @@ func NewFileMapProvider(fileName string) config.MapProvider { } } -func (fmp *fileMapProvider) Get(context.Context) (*config.Map, error) { +func (fmp *fileMapProvider) Retrieve(context.Context) (config.Retrieved, error) { if fmp.fileName == "" { return nil, errors.New("config file not specified") } @@ -43,7 +43,7 @@ func (fmp *fileMapProvider) Get(context.Context) (*config.Map, error) { return nil, fmt.Errorf("error loading config file %q: %w", fmp.fileName, err) } - return cp, nil + return &simpleRetrieved{confMap: cp}, nil } func (*fileMapProvider) Close(context.Context) error { diff --git a/service/parserprovider/inmemory.go b/service/parserprovider/inmemory.go index edaec45f653..53ffdf43846 100644 --- a/service/parserprovider/inmemory.go +++ b/service/parserprovider/inmemory.go @@ -30,8 +30,12 @@ func NewInMemoryMapProvider(buf io.Reader) config.MapProvider { return &inMemoryMapProvider{buf: buf} } -func (inp *inMemoryMapProvider) Get(context.Context) (*config.Map, error) { - return config.NewMapFromBuffer(inp.buf) +func (inp *inMemoryMapProvider) Retrieve(context.Context) (config.Retrieved, error) { + cfg, err := config.NewMapFromBuffer(inp.buf) + if err != nil { + return nil, err + } + return &simpleRetrieved{confMap: cfg}, nil } func (inp *inMemoryMapProvider) Close(context.Context) error { diff --git a/service/parserprovider/merge.go b/service/parserprovider/merge.go index f59d643dd76..7fe767e4a29 100644 --- a/service/parserprovider/merge.go +++ b/service/parserprovider/merge.go @@ -35,18 +35,18 @@ func NewMergeMapProvider(ps ...config.MapProvider) config.MapProvider { return &mergeMapProvider{providers: ps} } -func (mp *mergeMapProvider) Get(ctx context.Context) (*config.Map, error) { - ret := config.NewMap() +func (mp *mergeMapProvider) Retrieve(ctx context.Context) (config.Retrieved, error) { + retCfgMap := config.NewMap() for _, p := range mp.providers { - cfgMap, err := p.Get(ctx) + retr, err := p.Retrieve(ctx) if err != nil { return nil, err } - if err = ret.Merge(cfgMap); err != nil { + if err = retCfgMap.Merge(retr.Get()); err != nil { return nil, err } } - return ret, nil + return &simpleRetrieved{confMap: retCfgMap}, nil } func (mp *mergeMapProvider) Close(ctx context.Context) error { diff --git a/service/parserprovider/merge_test.go b/service/parserprovider/merge_test.go index b4cb113d539..c8d08341c9f 100644 --- a/service/parserprovider/merge_test.go +++ b/service/parserprovider/merge_test.go @@ -28,7 +28,7 @@ import ( func TestMerge_GetError(t *testing.T) { pl := NewMergeMapProvider(&errProvider{err: nil}, &errProvider{errors.New("my error")}) require.NotNil(t, pl) - cp, err := pl.Get(context.Background()) + cp, err := pl.Retrieve(context.Background()) assert.Error(t, err) assert.Nil(t, cp) } @@ -43,9 +43,9 @@ type errProvider struct { err error } -func (epl *errProvider) Get(context.Context) (*config.Map, error) { +func (epl *errProvider) Retrieve(context.Context) (config.Retrieved, error) { if epl.err == nil { - return config.NewMap(), nil + return &simpleRetrieved{confMap: config.NewMap()}, nil } return nil, epl.err } diff --git a/service/parserprovider/properties.go b/service/parserprovider/properties.go index 2b202da7dda..6072f344130 100644 --- a/service/parserprovider/properties.go +++ b/service/parserprovider/properties.go @@ -40,9 +40,9 @@ func NewPropertiesMapProvider(properties []string) config.MapProvider { } } -func (pmp *propertiesMapProvider) Get(context.Context) (*config.Map, error) { +func (pmp *propertiesMapProvider) Retrieve(context.Context) (config.Retrieved, error) { if len(pmp.properties) == 0 { - return config.NewMap(), nil + return &simpleRetrieved{confMap: config.NewMap()}, nil } b := &bytes.Buffer{} @@ -67,7 +67,7 @@ func (pmp *propertiesMapProvider) Get(context.Context) (*config.Map, error) { } prop := maps.Unflatten(parsed, ".") - return config.NewMapFromStringMap(prop), nil + return &simpleRetrieved{confMap: config.NewMapFromStringMap(prop)}, nil } func (*propertiesMapProvider) Close(context.Context) error { diff --git a/service/parserprovider/properties_test.go b/service/parserprovider/properties_test.go index 965b574a78f..8724e1d3395 100644 --- a/service/parserprovider/properties_test.go +++ b/service/parserprovider/properties_test.go @@ -31,21 +31,23 @@ func TestPropertiesProvider(t *testing.T) { } pmp := NewPropertiesMapProvider(setFlagStr) - cp, err := pmp.Get(context.Background()) + retr, err := pmp.Retrieve(context.Background()) require.NoError(t, err) - keys := cp.AllKeys() + cfgMap := retr.Get() + keys := cfgMap.AllKeys() assert.Len(t, keys, 4) - assert.Equal(t, "2s", cp.Get("processors::batch::timeout")) - assert.Equal(t, "3s", cp.Get("processors::batch/foo::timeout")) - assert.Equal(t, "foo:9200,foo2:9200", cp.Get("exporters::kafka::brokers")) - assert.Equal(t, "localhost:1818", cp.Get("receivers::otlp::protocols::grpc::endpoint")) + 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())) } func TestPropertiesProvider_empty(t *testing.T) { pmp := NewPropertiesMapProvider(nil) - cp, err := pmp.Get(context.Background()) + retr, err := pmp.Retrieve(context.Background()) require.NoError(t, err) - assert.Equal(t, 0, len(cp.AllKeys())) + cfgMap := retr.Get() + assert.Equal(t, 0, len(cfgMap.AllKeys())) require.NoError(t, pmp.Close(context.Background())) } diff --git a/service/parserprovider/simple.go b/service/parserprovider/simple.go new file mode 100644 index 00000000000..3b553a33435 --- /dev/null +++ b/service/parserprovider/simple.go @@ -0,0 +1,28 @@ +// 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 parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" + +import ( + "go.opentelemetry.io/collector/config" +) + +// TODO: This probably will make sense to be exported, but needs better name and documentation. +type simpleRetrieved struct { + confMap *config.Map +} + +func (sr *simpleRetrieved) Get() *config.Map { + return sr.confMap +} diff --git a/service/settings.go b/service/settings.go index 11f5b0d3551..756899720ee 100644 --- a/service/settings.go +++ b/service/settings.go @@ -62,7 +62,7 @@ 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.WatchableMapProvider, collector may reload the configuration upon error. + // If the provider is config.WatchableRetrieved, collector may reload the configuration upon error. ConfigMapProvider config.MapProvider // ConfigUnmarshaler unmarshalls the configuration's Parser into the service configuration. From e168df568418e1f8e4eb47fdac4c6dfad0c4a7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Fri, 29 Oct 2021 17:52:08 +0200 Subject: [PATCH 111/149] Move builder to cmd/builder (#4307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move builder to cmd/builder Signed-off-by: Juraci Paixão Kröhling * Fix path to Makefile.Common Signed-off-by: Juraci Paixão Kröhling * Fix versions.yaml entry for the builder Signed-off-by: Juraci Paixão Kröhling --- .github/dependabot.yml | 2 +- .github/workflows/api-compatibility.yml | 2 +- .github/workflows/build-and-test-windows.yaml | 2 -- .github/workflows/check-links.yaml | 4 ++-- builder/Makefile | 1 - {builder => cmd/builder}/.github/CODEOWNERS | 0 {builder => cmd/builder}/.github/mergify.yml | 0 {builder => cmd/builder}/.github/workflows/go.yaml | 0 .../builder}/.github/workflows/integration-test.yaml | 0 {builder => cmd/builder}/.github/workflows/release.yml | 1 + {builder => cmd/builder}/.gitignore | 0 {builder => cmd/builder}/.goreleaser.yml | 0 {builder => cmd/builder}/LICENSE | 0 cmd/builder/Makefile | 1 + {builder => cmd/builder}/README.md | 0 {builder => cmd/builder}/RELEASE.md | 0 {builder => cmd/builder}/cmd/root.go | 6 +++--- {builder => cmd/builder}/go.mod | 2 +- {builder => cmd/builder}/go.sum | 0 {builder => cmd/builder}/header.txt | 0 {builder => cmd/builder}/internal/builder/config.go | 2 +- {builder => cmd/builder}/internal/builder/config_test.go | 0 {builder => cmd/builder}/internal/builder/main.go | 4 ++-- {builder => cmd/builder}/internal/scaffold/components.go | 2 +- {builder => cmd/builder}/internal/scaffold/gomod.go | 2 +- {builder => cmd/builder}/internal/scaffold/main.go | 2 +- {builder => cmd/builder}/main.go | 2 +- {builder => cmd/builder}/test/README.md | 0 {builder => cmd/builder}/test/nocore.builder.yaml | 0 {builder => cmd/builder}/test/nocore.otel.yaml | 0 {builder => cmd/builder}/test/replaces.builder.yaml | 0 {builder => cmd/builder}/test/replaces.otel.yaml | 0 {builder => cmd/builder}/test/test.sh | 0 versions.yaml | 2 +- 34 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 builder/Makefile rename {builder => cmd/builder}/.github/CODEOWNERS (100%) rename {builder => cmd/builder}/.github/mergify.yml (100%) rename {builder => cmd/builder}/.github/workflows/go.yaml (100%) rename {builder => cmd/builder}/.github/workflows/integration-test.yaml (100%) rename {builder => cmd/builder}/.github/workflows/release.yml (94%) rename {builder => cmd/builder}/.gitignore (100%) rename {builder => cmd/builder}/.goreleaser.yml (100%) rename {builder => cmd/builder}/LICENSE (100%) create mode 100644 cmd/builder/Makefile rename {builder => cmd/builder}/README.md (100%) rename {builder => cmd/builder}/RELEASE.md (100%) rename {builder => cmd/builder}/cmd/root.go (95%) rename {builder => cmd/builder}/go.mod (97%) rename {builder => cmd/builder}/go.sum (100%) rename {builder => cmd/builder}/header.txt (100%) rename {builder => cmd/builder}/internal/builder/config.go (98%) rename {builder => cmd/builder}/internal/builder/config_test.go (100%) rename {builder => cmd/builder}/internal/builder/main.go (96%) rename {builder => cmd/builder}/internal/scaffold/components.go (97%) rename {builder => cmd/builder}/internal/scaffold/gomod.go (94%) rename {builder => cmd/builder}/internal/scaffold/main.go (98%) rename {builder => cmd/builder}/main.go (93%) rename {builder => cmd/builder}/test/README.md (100%) rename {builder => cmd/builder}/test/nocore.builder.yaml (100%) rename {builder => cmd/builder}/test/nocore.otel.yaml (100%) rename {builder => cmd/builder}/test/replaces.builder.yaml (100%) rename {builder => cmd/builder}/test/replaces.otel.yaml (100%) rename {builder => cmd/builder}/test/test.sh (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d25ddb00ffd..c30e6576c82 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,7 +15,7 @@ updates: schedule: interval: "weekly" - package-ecosystem: "gomod" - directory: "/builder" + directory: "/cmd/builder" schedule: interval: "weekly" - package-ecosystem: "gomod" diff --git a/.github/workflows/api-compatibility.yml b/.github/workflows/api-compatibility.yml index 0d496abc0fd..379b7c76a02 100644 --- a/.github/workflows/api-compatibility.yml +++ b/.github/workflows/api-compatibility.yml @@ -8,7 +8,7 @@ name: "Inform Incompatible PRs" on: pull_request: paths-ignore: - - 'builder/**' + - 'cmd/builder/**' branches: - main diff --git a/.github/workflows/build-and-test-windows.yaml b/.github/workflows/build-and-test-windows.yaml index b7da215cdd6..308fd0c3b06 100644 --- a/.github/workflows/build-and-test-windows.yaml +++ b/.github/workflows/build-and-test-windows.yaml @@ -2,8 +2,6 @@ name: build-and-test-windows on: push: branches: [ main ] - paths-ignore: - - 'builder/**' tags: - 'v[0-9]+.[0-9]+.[0-9]+*' pull_request: diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index 62b026dc9d8..5060fd2a38c 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -3,10 +3,10 @@ on: push: branches: [ main ] paths-ignore: - - 'builder/**' + - 'cmd/builder/**' pull_request: paths-ignore: - - 'builder/**' + - 'cmd/builder/**' jobs: check-links: diff --git a/builder/Makefile b/builder/Makefile deleted file mode 100644 index 39734bfaebb..00000000000 --- a/builder/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../Makefile.Common diff --git a/builder/.github/CODEOWNERS b/cmd/builder/.github/CODEOWNERS similarity index 100% rename from builder/.github/CODEOWNERS rename to cmd/builder/.github/CODEOWNERS diff --git a/builder/.github/mergify.yml b/cmd/builder/.github/mergify.yml similarity index 100% rename from builder/.github/mergify.yml rename to cmd/builder/.github/mergify.yml diff --git a/builder/.github/workflows/go.yaml b/cmd/builder/.github/workflows/go.yaml similarity index 100% rename from builder/.github/workflows/go.yaml rename to cmd/builder/.github/workflows/go.yaml diff --git a/builder/.github/workflows/integration-test.yaml b/cmd/builder/.github/workflows/integration-test.yaml similarity index 100% rename from builder/.github/workflows/integration-test.yaml rename to cmd/builder/.github/workflows/integration-test.yaml diff --git a/builder/.github/workflows/release.yml b/cmd/builder/.github/workflows/release.yml similarity index 94% rename from builder/.github/workflows/release.yml rename to cmd/builder/.github/workflows/release.yml index 8cb55ebb47a..55fcb0f340f 100644 --- a/builder/.github/workflows/release.yml +++ b/cmd/builder/.github/workflows/release.yml @@ -25,5 +25,6 @@ jobs: with: version: latest args: release --rm-dist + workdir: cmd/builder env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/builder/.gitignore b/cmd/builder/.gitignore similarity index 100% rename from builder/.gitignore rename to cmd/builder/.gitignore diff --git a/builder/.goreleaser.yml b/cmd/builder/.goreleaser.yml similarity index 100% rename from builder/.goreleaser.yml rename to cmd/builder/.goreleaser.yml diff --git a/builder/LICENSE b/cmd/builder/LICENSE similarity index 100% rename from builder/LICENSE rename to cmd/builder/LICENSE diff --git a/cmd/builder/Makefile b/cmd/builder/Makefile new file mode 100644 index 00000000000..ded7a36092d --- /dev/null +++ b/cmd/builder/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/builder/README.md b/cmd/builder/README.md similarity index 100% rename from builder/README.md rename to cmd/builder/README.md diff --git a/builder/RELEASE.md b/cmd/builder/RELEASE.md similarity index 100% rename from builder/RELEASE.md rename to cmd/builder/RELEASE.md diff --git a/builder/cmd/root.go b/cmd/builder/cmd/root.go similarity index 95% rename from builder/cmd/root.go rename to cmd/builder/cmd/root.go index 9bfde9129d9..e09c5354937 100644 --- a/builder/cmd/root.go +++ b/cmd/builder/cmd/root.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd // import "go.opentelemetry.io/collector/builder/cmd" +package cmd // import "go.opentelemetry.io/collector/cmd/builder/cmd" import ( "fmt" @@ -21,7 +21,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "go.opentelemetry.io/collector/builder/internal/builder" + "go.opentelemetry.io/collector/cmd/builder/internal/builder" ) var ( @@ -76,7 +76,7 @@ func Execute() error { cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") cmd.Flags().StringVar(&cfg.Distribution.OutputPath, "output-path", cfg.Distribution.OutputPath, "Where to write the resulting files") cmd.Flags().StringVar(&cfg.Distribution.Go, "go", "", "The Go binary to use during the compilation phase. Default: go from the PATH") - cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "go.opentelemetry.io/collector/builder", "The Go module for the new distribution") + cmd.Flags().StringVar(&cfg.Distribution.Module, "module", "go.opentelemetry.io/collector/cmd/builder", "The Go module for the new distribution") // version of this binary cmd.AddCommand(versionCmd) diff --git a/builder/go.mod b/cmd/builder/go.mod similarity index 97% rename from builder/go.mod rename to cmd/builder/go.mod index 351960409d1..1978434dcfc 100644 --- a/builder/go.mod +++ b/cmd/builder/go.mod @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -module go.opentelemetry.io/collector/builder +module go.opentelemetry.io/collector/cmd/builder go 1.17 diff --git a/builder/go.sum b/cmd/builder/go.sum similarity index 100% rename from builder/go.sum rename to cmd/builder/go.sum diff --git a/builder/header.txt b/cmd/builder/header.txt similarity index 100% rename from builder/header.txt rename to cmd/builder/header.txt diff --git a/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go similarity index 98% rename from builder/internal/builder/config.go rename to cmd/builder/internal/builder/config.go index 2dcf7cbecf9..8c5a08ff734 100644 --- a/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder // import "go.opentelemetry.io/collector/builder/internal/builder" +package builder // import "go.opentelemetry.io/collector/cmd/builder/internal/builder" import ( "errors" diff --git a/builder/internal/builder/config_test.go b/cmd/builder/internal/builder/config_test.go similarity index 100% rename from builder/internal/builder/config_test.go rename to cmd/builder/internal/builder/config_test.go diff --git a/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go similarity index 96% rename from builder/internal/builder/main.go rename to cmd/builder/internal/builder/main.go index 0a73453bccd..2e1e88b53a4 100644 --- a/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package builder // import "go.opentelemetry.io/collector/builder/internal/builder" +package builder // import "go.opentelemetry.io/collector/cmd/builder/internal/builder" import ( "errors" @@ -23,7 +23,7 @@ import ( "text/template" "time" - "go.opentelemetry.io/collector/builder/internal/scaffold" + "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" ) var ( diff --git a/builder/internal/scaffold/components.go b/cmd/builder/internal/scaffold/components.go similarity index 97% rename from builder/internal/scaffold/components.go rename to cmd/builder/internal/scaffold/components.go index 8a2c6436fc2..2c099c3fc12 100644 --- a/builder/internal/scaffold/components.go +++ b/cmd/builder/internal/scaffold/components.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold" +package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" const Components = ` // Copyright 2020 OpenTelemetry Authors diff --git a/builder/internal/scaffold/gomod.go b/cmd/builder/internal/scaffold/gomod.go similarity index 94% rename from builder/internal/scaffold/gomod.go rename to cmd/builder/internal/scaffold/gomod.go index 46765c30ba5..380a843c17b 100644 --- a/builder/internal/scaffold/gomod.go +++ b/cmd/builder/internal/scaffold/gomod.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold" +package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" const Gomod = ` module {{.Distribution.Module}} diff --git a/builder/internal/scaffold/main.go b/cmd/builder/internal/scaffold/main.go similarity index 98% rename from builder/internal/scaffold/main.go rename to cmd/builder/internal/scaffold/main.go index c08641c2d96..0cccee5da53 100644 --- a/builder/internal/scaffold/main.go +++ b/cmd/builder/internal/scaffold/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package scaffold // import "go.opentelemetry.io/collector/builder/internal/scaffold" +package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" const Main = ` // Copyright 2020 OpenTelemetry Authors diff --git a/builder/main.go b/cmd/builder/main.go similarity index 93% rename from builder/main.go rename to cmd/builder/main.go index 1808f4b46f1..f3aceeec446 100644 --- a/builder/main.go +++ b/cmd/builder/main.go @@ -18,7 +18,7 @@ import ( "fmt" "os" - "go.opentelemetry.io/collector/builder/cmd" + "go.opentelemetry.io/collector/cmd/builder/cmd" ) func main() { diff --git a/builder/test/README.md b/cmd/builder/test/README.md similarity index 100% rename from builder/test/README.md rename to cmd/builder/test/README.md diff --git a/builder/test/nocore.builder.yaml b/cmd/builder/test/nocore.builder.yaml similarity index 100% rename from builder/test/nocore.builder.yaml rename to cmd/builder/test/nocore.builder.yaml diff --git a/builder/test/nocore.otel.yaml b/cmd/builder/test/nocore.otel.yaml similarity index 100% rename from builder/test/nocore.otel.yaml rename to cmd/builder/test/nocore.otel.yaml diff --git a/builder/test/replaces.builder.yaml b/cmd/builder/test/replaces.builder.yaml similarity index 100% rename from builder/test/replaces.builder.yaml rename to cmd/builder/test/replaces.builder.yaml diff --git a/builder/test/replaces.otel.yaml b/cmd/builder/test/replaces.otel.yaml similarity index 100% rename from builder/test/replaces.otel.yaml rename to cmd/builder/test/replaces.otel.yaml diff --git a/builder/test/test.sh b/cmd/builder/test/test.sh similarity index 100% rename from builder/test/test.sh rename to cmd/builder/test/test.sh diff --git a/versions.yaml b/versions.yaml index 54980d66b46..e525790af94 100644 --- a/versions.yaml +++ b/versions.yaml @@ -17,7 +17,7 @@ module-sets: version: v0.38.0 modules: - go.opentelemetry.io/collector + - go.opentelemetry.io/collector/cmd/builder - go.opentelemetry.io/collector/model - - go.opentelemetry.io/collector/builder excluded-modules: - go.opentelemetry.io/collector/internal/tools From efc5bcfdf598981fb1d5d4a5fb478f139b9b60d4 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 29 Oct 2021 11:56:05 -0700 Subject: [PATCH 112/149] Remove unnecessary license and gitignore from builder (#4321) Signed-off-by: Bogdan Drutu --- cmd/builder/.gitignore | 40 -------- cmd/builder/LICENSE | 202 ----------------------------------------- 2 files changed, 242 deletions(-) delete mode 100644 cmd/builder/.gitignore delete mode 100644 cmd/builder/LICENSE diff --git a/cmd/builder/.gitignore b/cmd/builder/.gitignore deleted file mode 100644 index 011870efb61..00000000000 --- a/cmd/builder/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ - -# Created by https://www.toptal.com/developers/gitignore/api/go,vscode -# Edit at https://www.toptal.com/developers/gitignore?templates=go,vscode - -### Go ### -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -### Go Patch ### -/vendor/ -/Godeps/ - -### vscode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -### goland ### -.idea - -# End of https://www.toptal.com/developers/gitignore/api/go,vscode - -/dist/ -opentelemetry-collector-builder diff --git a/cmd/builder/LICENSE b/cmd/builder/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/cmd/builder/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. From caf69e602c196d1959d9af82e761a5eb31df4daa Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 29 Oct 2021 11:56:16 -0700 Subject: [PATCH 113/149] Use zap for logging in builder (#4305) Signed-off-by: Bogdan Drutu --- cmd/builder/cmd/root.go | 15 ++++++++------- cmd/builder/go.mod | 3 +-- cmd/builder/go.sum | 7 ------- cmd/builder/internal/builder/config.go | 11 ++++------- cmd/builder/internal/builder/main.go | 10 ++++++---- 5 files changed, 19 insertions(+), 27 deletions(-) diff --git a/cmd/builder/cmd/root.go b/cmd/builder/cmd/root.go index e09c5354937..6c8c1ad3e59 100644 --- a/cmd/builder/cmd/root.go +++ b/cmd/builder/cmd/root.go @@ -20,6 +20,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" + "go.uber.org/zap" "go.opentelemetry.io/collector/cmd/builder/internal/builder" ) @@ -51,12 +52,12 @@ func Execute() error { RunE: func(cmd *cobra.Command, args []string) error { if err := cfg.Validate(); err != nil { - cfg.Logger.Error(err, "invalid configuration") + cfg.Logger.Error("invalid configuration", zap.Error(err)) return err } if err := cfg.ParseModules(); err != nil { - cfg.Logger.Error(err, "invalid module configuration") + cfg.Logger.Error("invalid module configuration", zap.Error(err)) return err } @@ -83,12 +84,12 @@ func Execute() error { // tie Viper to flags if err := viper.BindPFlags(cmd.Flags()); err != nil { - cfg.Logger.Error(err, "failed to bind flags") + cfg.Logger.Error("failed to bind flags", zap.Error(err)) return err } if err := cmd.Execute(); err != nil { - cfg.Logger.Error(err, "failed to run") + cfg.Logger.Error("failed to run", zap.Error(err)) return err } @@ -96,7 +97,7 @@ func Execute() error { } func initConfig() { - cfg.Logger.Info("OpenTelemetry Collector distribution builder", "version", version, "date", date) + cfg.Logger.Info("OpenTelemetry Collector distribution builder", zap.String("version", version), zap.String("date", date)) // a couple of Viper goodies, to make it easier to use env vars when flags are not desirable viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) @@ -112,12 +113,12 @@ func initConfig() { // load the config file if err := viper.ReadInConfig(); err == nil { - cfg.Logger.Info("Using config file", "path", viper.ConfigFileUsed()) + cfg.Logger.Info("Using config file", zap.String("path", viper.ConfigFileUsed())) } // convert Viper's internal state into our configuration object if err := viper.Unmarshal(&cfg); err != nil { - cfg.Logger.Error(err, "failed to parse the config") + cfg.Logger.Error("failed to parse the config", zap.Error(err)) cobra.CheckErr(err) return } diff --git a/cmd/builder/go.mod b/cmd/builder/go.mod index 1978434dcfc..85df4494fb8 100644 --- a/cmd/builder/go.mod +++ b/cmd/builder/go.mod @@ -17,8 +17,6 @@ module go.opentelemetry.io/collector/cmd/builder go 1.17 require ( - github.com/go-logr/logr v1.2.0 - github.com/go-logr/zapr v1.2.0 github.com/spf13/cobra v1.2.1 github.com/spf13/viper v1.9.0 github.com/stretchr/testify v1.7.0 @@ -33,6 +31,7 @@ require ( github.com/magiconair/properties v1.8.5 // indirect github.com/mitchellh/mapstructure v1.4.2 // indirect github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/afero v1.6.0 // indirect github.com/spf13/cast v1.4.1 // indirect diff --git a/cmd/builder/go.sum b/cmd/builder/go.sum index 13399c44160..a8c383d6f0d 100644 --- a/cmd/builder/go.sum +++ b/cmd/builder/go.sum @@ -88,10 +88,6 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= -github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -303,13 +299,11 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -508,7 +502,6 @@ golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index 8c5a08ff734..385941b55ef 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -22,8 +22,6 @@ import ( "os/exec" "strings" - "github.com/go-logr/logr" - "github.com/go-logr/zapr" "go.uber.org/zap" ) @@ -37,7 +35,7 @@ var ErrDeprecatedCore = errors.New("mod.Core has deprecated, you should not be u // Config holds the builder's configuration type Config struct { - Logger logr.Logger + Logger *zap.Logger SkipCompilation bool Distribution Distribution `mapstructure:"dist"` @@ -73,15 +71,14 @@ type Module struct { // DefaultConfig creates a new config, with default values func DefaultConfig() Config { - zapLog, err := zap.NewDevelopment() + log, err := zap.NewDevelopment() if err != nil { panic(fmt.Sprintf("failed to obtain a logger instance: %v", err)) } - log := zapr.NewLogger(zapLog) outputDir, err := ioutil.TempDir("", "otelcol-distribution") if err != nil { - log.Error(err, "failed to obtain a temporary directory") + log.Error("failed to obtain a temporary directory", zap.Error(err)) } return Config{ @@ -103,7 +100,7 @@ func (c *Config) Validate() error { } c.Distribution.Go = path } - c.Logger.Info("Using go", "Go executable", c.Distribution.Go) + c.Logger.Info("Using go", zap.String("go-executable", c.Distribution.Go)) return nil } diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go index 2e1e88b53a4..c146e01f796 100644 --- a/cmd/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -23,6 +23,8 @@ import ( "text/template" "time" + "go.uber.org/zap" + "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" ) @@ -49,7 +51,7 @@ func GenerateAndCompile(cfg Config) error { func Generate(cfg Config) error { // create a warning message for non-aligned builder and collector base if cfg.Distribution.OtelColVersion != defaultOtelColVersion { - cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", "builder-version", defaultOtelColVersion) + cfg.Logger.Info("You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API", zap.String("builder-version", defaultOtelColVersion)) } // if the file does not exist, try to create it if _, err := os.Stat(cfg.Distribution.OutputPath); os.IsNotExist(err) { @@ -92,7 +94,7 @@ func Generate(cfg Config) error { } } - cfg.Logger.Info("Sources created", "path", cfg.Distribution.OutputPath) + cfg.Logger.Info("Sources created", zap.String("path", cfg.Distribution.OutputPath)) return nil } @@ -110,7 +112,7 @@ func Compile(cfg Config) error { if out, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("failed to compile the OpenTelemetry Collector distribution: %w. Output: %q", err, out) } - cfg.Logger.Info("Compiled", "binary", fmt.Sprintf("%s/%s", cfg.Distribution.OutputPath, cfg.Distribution.ExeName)) + cfg.Logger.Info("Compiled", zap.String("binary", fmt.Sprintf("%s/%s", cfg.Distribution.OutputPath, cfg.Distribution.ExeName))) return nil } @@ -135,7 +137,7 @@ func GetModules(cfg Config) error { cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { failReason = fmt.Sprintf("%s. Output: %q", err, out) - cfg.Logger.Info("Failed modules download", "retry", fmt.Sprintf("%d/%d", i, retries)) + cfg.Logger.Info("Failed modules download", zap.String("retry", fmt.Sprintf("%d/%d", i, retries))) time.Sleep(5 * time.Second) continue } From ac6f16fa13f152e3bd0cb5f0d450f9c99ffcbdf8 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Fri, 29 Oct 2021 23:04:33 +0200 Subject: [PATCH 114/149] Move service/parserprovider package to config/configmapprovider (#4206) --- CHANGELOG.md | 4 ++++ .../configmapprovider}/default.go | 2 +- .../configmapprovider}/default_test.go | 2 +- .../configmapprovider}/expand.go | 2 +- .../configmapprovider}/expand_test.go | 2 +- .../configmapprovider}/file.go | 2 +- .../configmapprovider}/inmemory.go | 2 +- .../configmapprovider}/merge.go | 2 +- .../configmapprovider}/merge_test.go | 2 +- .../configmapprovider}/properties.go | 2 +- .../configmapprovider}/properties_test.go | 2 +- .../configmapprovider}/simple.go | 2 +- .../configmapprovider}/testdata/default-config.yaml | 0 .../testdata/expand-escaped-env.yaml | 0 .../testdata/expand-with-all-env.yaml | 0 .../testdata/expand-with-no-env.yaml | 0 .../testdata/expand-with-partial-env.yaml | 0 config/configtest/configtest.go | 4 ++-- service/collector_test.go | 10 +++++----- service/collector_windows.go | 4 ++-- service/command.go | 4 ++-- 21 files changed, 26 insertions(+), 22 deletions(-) rename {service/parserprovider => config/configmapprovider}/default.go (91%) rename {service/parserprovider => config/configmapprovider}/default_test.go (99%) rename {service/parserprovider => config/configmapprovider}/expand.go (96%) rename {service/parserprovider => config/configmapprovider}/expand_test.go (99%) rename {service/parserprovider => config/configmapprovider}/file.go (93%) rename {service/parserprovider => config/configmapprovider}/inmemory.go (93%) rename {service/parserprovider => config/configmapprovider}/merge.go (94%) rename {service/parserprovider => config/configmapprovider}/merge_test.go (98%) rename {service/parserprovider => config/configmapprovider}/properties.go (95%) rename {service/parserprovider => config/configmapprovider}/properties_test.go (98%) rename {service/parserprovider => config/configmapprovider}/simple.go (90%) rename {service/parserprovider => config/configmapprovider}/testdata/default-config.yaml (100%) rename {service/parserprovider => config/configmapprovider}/testdata/expand-escaped-env.yaml (100%) rename {service/parserprovider => config/configmapprovider}/testdata/expand-with-all-env.yaml (100%) rename {service/parserprovider => config/configmapprovider}/testdata/expand-with-no-env.yaml (100%) rename {service/parserprovider => config/configmapprovider}/testdata/expand-with-partial-env.yaml (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1211ba37c2e..0609aab1376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## 🛑 Breaking changes 🛑 + +- Move `service/parserprovider` package to `config/configmapprovider` (#4206) + ## v0.38.0 Beta ## 🛑 Breaking changes 🛑 diff --git a/service/parserprovider/default.go b/config/configmapprovider/default.go similarity index 91% rename from service/parserprovider/default.go rename to config/configmapprovider/default.go index 5796460ab1d..ec498bdbe07 100644 --- a/service/parserprovider/default.go +++ b/config/configmapprovider/default.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import "go.opentelemetry.io/collector/config" diff --git a/service/parserprovider/default_test.go b/config/configmapprovider/default_test.go similarity index 99% rename from service/parserprovider/default_test.go rename to config/configmapprovider/default_test.go index 2e66ff97a89..10013c69e8f 100644 --- a/service/parserprovider/default_test.go +++ b/config/configmapprovider/default_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package configmapprovider import ( "context" diff --git a/service/parserprovider/expand.go b/config/configmapprovider/expand.go similarity index 96% rename from service/parserprovider/expand.go rename to config/configmapprovider/expand.go index ff1351796f1..027abfaf70b 100644 --- a/service/parserprovider/expand.go +++ b/config/configmapprovider/expand.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( "context" diff --git a/service/parserprovider/expand_test.go b/config/configmapprovider/expand_test.go similarity index 99% rename from service/parserprovider/expand_test.go rename to config/configmapprovider/expand_test.go index 584516b3795..2dac55ab1bc 100644 --- a/service/parserprovider/expand_test.go +++ b/config/configmapprovider/expand_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package configmapprovider import ( "context" diff --git a/service/parserprovider/file.go b/config/configmapprovider/file.go similarity index 93% rename from service/parserprovider/file.go rename to config/configmapprovider/file.go index 90b76c107fc..0d2079a8a88 100644 --- a/service/parserprovider/file.go +++ b/config/configmapprovider/file.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( "context" diff --git a/service/parserprovider/inmemory.go b/config/configmapprovider/inmemory.go similarity index 93% rename from service/parserprovider/inmemory.go rename to config/configmapprovider/inmemory.go index 53ffdf43846..5c8e0b07fd0 100644 --- a/service/parserprovider/inmemory.go +++ b/config/configmapprovider/inmemory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( "context" diff --git a/service/parserprovider/merge.go b/config/configmapprovider/merge.go similarity index 94% rename from service/parserprovider/merge.go rename to config/configmapprovider/merge.go index 7fe767e4a29..d6f911465e8 100644 --- a/service/parserprovider/merge.go +++ b/config/configmapprovider/merge.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( "context" diff --git a/service/parserprovider/merge_test.go b/config/configmapprovider/merge_test.go similarity index 98% rename from service/parserprovider/merge_test.go rename to config/configmapprovider/merge_test.go index c8d08341c9f..b61fc40c691 100644 --- a/service/parserprovider/merge_test.go +++ b/config/configmapprovider/merge_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package configmapprovider import ( "context" diff --git a/service/parserprovider/properties.go b/config/configmapprovider/properties.go similarity index 95% rename from service/parserprovider/properties.go rename to config/configmapprovider/properties.go index 6072f344130..3a57d101f5d 100644 --- a/service/parserprovider/properties.go +++ b/config/configmapprovider/properties.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( "bytes" diff --git a/service/parserprovider/properties_test.go b/config/configmapprovider/properties_test.go similarity index 98% rename from service/parserprovider/properties_test.go rename to config/configmapprovider/properties_test.go index 8724e1d3395..39e560e37e3 100644 --- a/service/parserprovider/properties_test.go +++ b/config/configmapprovider/properties_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider +package configmapprovider import ( "context" diff --git a/service/parserprovider/simple.go b/config/configmapprovider/simple.go similarity index 90% rename from service/parserprovider/simple.go rename to config/configmapprovider/simple.go index 3b553a33435..383313533b3 100644 --- a/service/parserprovider/simple.go +++ b/config/configmapprovider/simple.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package parserprovider // import "go.opentelemetry.io/collector/service/parserprovider" +package configmapprovider // import "go.opentelemetry.io/collector/config/configmapprovider" import ( "go.opentelemetry.io/collector/config" diff --git a/service/parserprovider/testdata/default-config.yaml b/config/configmapprovider/testdata/default-config.yaml similarity index 100% rename from service/parserprovider/testdata/default-config.yaml rename to config/configmapprovider/testdata/default-config.yaml diff --git a/service/parserprovider/testdata/expand-escaped-env.yaml b/config/configmapprovider/testdata/expand-escaped-env.yaml similarity index 100% rename from service/parserprovider/testdata/expand-escaped-env.yaml rename to config/configmapprovider/testdata/expand-escaped-env.yaml diff --git a/service/parserprovider/testdata/expand-with-all-env.yaml b/config/configmapprovider/testdata/expand-with-all-env.yaml similarity index 100% rename from service/parserprovider/testdata/expand-with-all-env.yaml rename to config/configmapprovider/testdata/expand-with-all-env.yaml diff --git a/service/parserprovider/testdata/expand-with-no-env.yaml b/config/configmapprovider/testdata/expand-with-no-env.yaml similarity index 100% rename from service/parserprovider/testdata/expand-with-no-env.yaml rename to config/configmapprovider/testdata/expand-with-no-env.yaml diff --git a/service/parserprovider/testdata/expand-with-partial-env.yaml b/config/configmapprovider/testdata/expand-with-partial-env.yaml similarity index 100% rename from service/parserprovider/testdata/expand-with-partial-env.yaml rename to config/configmapprovider/testdata/expand-with-partial-env.yaml diff --git a/config/configtest/configtest.go b/config/configtest/configtest.go index 99ffb79c983..6018bdc93d9 100644 --- a/config/configtest/configtest.go +++ b/config/configtest/configtest.go @@ -25,8 +25,8 @@ 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/service/parserprovider" ) // The regular expression for valid config field tag. @@ -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 := parserprovider.NewExpandMapProvider(parserprovider.NewFileMapProvider(fileName)).Retrieve(context.Background()) + cp, err := configmapprovider.NewExpandMapProvider(configmapprovider.NewFileMapProvider(fileName)).Retrieve(context.Background()) if err != nil { return nil, err } diff --git a/service/collector_test.go b/service/collector_test.go index 401461ccf47..ab502472dbc 100644 --- a/service/collector_test.go +++ b/service/collector_test.go @@ -36,12 +36,12 @@ 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" "go.opentelemetry.io/collector/service/defaultcomponents" "go.opentelemetry.io/collector/service/internal/builder" "go.opentelemetry.io/collector/service/internal/extensions" - "go.opentelemetry.io/collector/service/parserprovider" ) const configStr = ` @@ -78,7 +78,7 @@ func TestCollector_StartAsGoRoutine(t *testing.T) { set := CollectorSettings{ BuildInfo: component.NewDefaultBuildInfo(), Factories: factories, - ConfigMapProvider: parserprovider.NewInMemoryMapProvider(strings.NewReader(configStr)), + ConfigMapProvider: configmapprovider.NewInMemoryMapProvider(strings.NewReader(configStr)), } col, err := New(set) require.NoError(t, err) @@ -115,7 +115,7 @@ func TestCollector_Start(t *testing.T) { col, err := New(CollectorSettings{ BuildInfo: component.NewDefaultBuildInfo(), Factories: factories, - ConfigMapProvider: parserprovider.NewFileMapProvider("testdata/otelcol-config.yaml"), + ConfigMapProvider: configmapprovider.NewFileMapProvider("testdata/otelcol-config.yaml"), LoggingOptions: []zap.Option{zap.Hooks(hook)}, }) require.NoError(t, err) @@ -182,7 +182,7 @@ func TestCollector_ReportError(t *testing.T) { col, err := New(CollectorSettings{ BuildInfo: component.NewDefaultBuildInfo(), Factories: factories, - ConfigMapProvider: parserprovider.NewFileMapProvider("testdata/otelcol-config.yaml"), + ConfigMapProvider: configmapprovider.NewFileMapProvider("testdata/otelcol-config.yaml"), }) require.NoError(t, err) @@ -302,7 +302,7 @@ func TestCollector_reloadService(t *testing.T) { }, { name: "retire_service_ok_load_ok", - parserProvider: parserprovider.NewInMemoryMapProvider(strings.NewReader(configStr)), + parserProvider: configmapprovider.NewInMemoryMapProvider(strings.NewReader(configStr)), service: &service{ telemetry: componenttest.NewNopTelemetrySettings(), builtExporters: builder.Exporters{}, diff --git a/service/collector_windows.go b/service/collector_windows.go index 96149855cef..6b1c68b5a8d 100644 --- a/service/collector_windows.go +++ b/service/collector_windows.go @@ -28,7 +28,7 @@ import ( "golang.org/x/sys/windows/svc" "golang.org/x/sys/windows/svc/eventlog" - "go.opentelemetry.io/collector/service/parserprovider" + "go.opentelemetry.io/collector/config/configmapprovider" ) type WindowsService struct { @@ -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 = parserprovider.NewDefaultMapProvider(getConfigFlag(), getSetFlag()) + set.ConfigMapProvider = configmapprovider.NewDefaultMapProvider(getConfigFlag(), getSetFlag()) } set.LoggingOptions = append( set.LoggingOptions, diff --git a/service/command.go b/service/command.go index 9adebb16f60..2fcdc0a17c9 100644 --- a/service/command.go +++ b/service/command.go @@ -17,7 +17,7 @@ package service // import "go.opentelemetry.io/collector/service" import ( "github.com/spf13/cobra" - "go.opentelemetry.io/collector/service/parserprovider" + "go.opentelemetry.io/collector/config/configmapprovider" ) // NewCommand constructs a new cobra.Command using the given Collector. @@ -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 = parserprovider.NewDefaultMapProvider(getConfigFlag(), getSetFlag()) + set.ConfigMapProvider = configmapprovider.NewDefaultMapProvider(getConfigFlag(), getSetFlag()) } col, err := New(set) if err != nil { From 09f1cf28f26317931cf6315d2c0322be4c0e95b5 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 29 Oct 2021 14:34:40 -0700 Subject: [PATCH 115/149] Use ComponentID to identify Pipelines as well (#4323) Signed-off-by: Bogdan Drutu --- config/config.go | 2 +- config/config_test.go | 14 +++++++------- config/configtest/configtest_test.go | 2 +- .../configunmarshaler/defaultunmarshaler.go | 7 ++----- .../defaultunmarshaler_test.go | 2 +- .../builder/exporters_builder_test.go | 17 ++++++++--------- .../builder/pipelines_builder_test.go | 19 +++++++++---------- 7 files changed, 29 insertions(+), 34 deletions(-) diff --git a/config/config.go b/config/config.go index 00e7b87e6fc..52ff6252205 100644 --- a/config/config.go +++ b/config/config.go @@ -232,4 +232,4 @@ type Pipeline struct { } // Pipelines is a map of names to Pipelines. -type Pipelines map[string]*Pipeline +type Pipelines map[ComponentID]*Pipeline diff --git a/config/config_test.go b/config/config_test.go index 233c640f09b..c3768b773a6 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -114,7 +114,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-receiver-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines["traces"] + pipe := cfg.Service.Pipelines[NewComponentID("traces")] pipe.Receivers = append(pipe.Receivers, NewComponentIDWithName("nop", "2")) return cfg }, @@ -124,7 +124,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-processor-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines["traces"] + pipe := cfg.Service.Pipelines[NewComponentID("traces")] pipe.Processors = append(pipe.Processors, NewComponentIDWithName("nop", "2")) return cfg }, @@ -134,7 +134,7 @@ func TestConfigValidate(t *testing.T) { name: "invalid-exporter-reference", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines["traces"] + pipe := cfg.Service.Pipelines[NewComponentID("traces")] pipe.Exporters = append(pipe.Exporters, NewComponentIDWithName("nop", "2")) return cfg }, @@ -144,7 +144,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-receivers", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines["traces"] + pipe := cfg.Service.Pipelines[NewComponentID("traces")] pipe.Receivers = nil return cfg }, @@ -154,7 +154,7 @@ func TestConfigValidate(t *testing.T) { name: "missing-pipeline-exporters", cfgFn: func() *Config { cfg := generateConfig() - pipe := cfg.Service.Pipelines["traces"] + pipe := cfg.Service.Pipelines[NewComponentID("traces")] pipe.Exporters = nil return cfg }, @@ -257,8 +257,8 @@ func generateConfig() *Config { Service: Service{ Telemetry: ServiceTelemetry{Logs: ServiceTelemetryLogs{Level: zapcore.DebugLevel, Development: true, Encoding: "console"}}, Extensions: []ComponentID{NewComponentID("nop")}, - Pipelines: map[string]*Pipeline{ - "traces": { + Pipelines: map[ComponentID]*Pipeline{ + NewComponentID("traces"): { Name: "traces", InputType: TracesDataType, Receivers: []ComponentID{NewComponentID("nop")}, diff --git a/config/configtest/configtest_test.go b/config/configtest/configtest_test.go index bc0dc3fd165..acef16e3916 100644 --- a/config/configtest/configtest_test.go +++ b/config/configtest/configtest_test.go @@ -65,7 +65,7 @@ func TestLoadConfig(t *testing.T) { Processors: []config.ComponentID{config.NewComponentID("nop")}, Exporters: []config.ComponentID{config.NewComponentID("nop")}, }, - cfg.Service.Pipelines["traces"], + cfg.Service.Pipelines[config.NewComponentID("traces")], "Did not load pipeline config correctly") } diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index e1c788a0197..4c5c09afb8f 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -319,10 +319,9 @@ func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, fa return processors, nil } -func unmarshalPipelines(rawPipelines map[config.ComponentID]*config.Pipeline) (config.Pipelines, error) { - pipelines := make(map[string]*config.Pipeline) +func unmarshalPipelines(pipelines map[config.ComponentID]*config.Pipeline) (config.Pipelines, error) { // Iterate over input map and create a config for each. - for id, pipeline := range rawPipelines { + for id, pipeline := range pipelines { pipeline.Name = id.String() pipeline.InputType = config.DataType(id.Type()) switch pipeline.InputType { @@ -332,8 +331,6 @@ func unmarshalPipelines(rawPipelines map[config.ComponentID]*config.Pipeline) (c default: return nil, errorUnknownType(pipelinesKeyName, id) } - - pipelines[pipeline.Name] = pipeline } return pipelines, nil diff --git a/config/configunmarshaler/defaultunmarshaler_test.go b/config/configunmarshaler/defaultunmarshaler_test.go index 04a9ee728a0..20ccf5dd035 100644 --- a/config/configunmarshaler/defaultunmarshaler_test.go +++ b/config/configunmarshaler/defaultunmarshaler_test.go @@ -115,7 +115,7 @@ func TestDecodeConfig(t *testing.T) { Processors: []config.ComponentID{config.NewComponentID("exampleprocessor")}, Exporters: []config.ComponentID{config.NewComponentID("exampleexporter")}, }, - cfg.Service.Pipelines["traces"], + cfg.Service.Pipelines[config.NewComponentID("traces")], "Did not load pipeline config correctly") } diff --git a/service/internal/builder/exporters_builder_test.go b/service/internal/builder/exporters_builder_test.go index 4a05595db2d..20d8c9c7c89 100644 --- a/service/internal/builder/exporters_builder_test.go +++ b/service/internal/builder/exporters_builder_test.go @@ -49,9 +49,9 @@ func TestBuildExporters(t *testing.T) { }, Service: config.Service{ - Pipelines: map[string]*config.Pipeline{ - "trace": { - Name: "trace", + Pipelines: map[config.ComponentID]*config.Pipeline{ + config.NewComponentID("traces"): { + Name: "traces", InputType: config.TracesDataType, Exporters: []config.ComponentID{config.NewComponentID("otlp")}, }, @@ -87,15 +87,14 @@ func TestBuildExporters(t *testing.T) { // Remove the pipeline so that the exporter is not attached to any pipeline. // This should result in creating an exporter that has none of consumption // functions set. - delete(cfg.Service.Pipelines, "trace") + delete(cfg.Service.Pipelines, config.NewComponentID("traces")) exporters, err = BuildExporters(componenttest.NewNopTelemetrySettings(), component.NewDefaultBuildInfo(), cfg, factories.Exporters) assert.NotNil(t, exporters) assert.NoError(t, err) e1 = exporters[config.NewComponentID("otlp")] - // Ensure exporter has its fields correctly populated, ie Trace Exporter and - // Metrics Exporter are nil. + // Ensure exporter has its fields correctly populated, ie TracesExporter and MetricsExporter are nil. require.NotNil(t, e1) assert.Nil(t, e1.getTracesExporter()) assert.Nil(t, e1.getMetricExporter()) @@ -116,8 +115,8 @@ func TestBuildExporters_BuildLogs(t *testing.T) { }, Service: config.Service{ - Pipelines: map[string]*config.Pipeline{ - "logs": { + Pipelines: map[config.ComponentID]*config.Pipeline{ + config.NewComponentID("logs"): { Name: "logs", InputType: "logs", Exporters: []config.ComponentID{config.NewComponentID("exampleexporter")}, @@ -150,7 +149,7 @@ func TestBuildExporters_BuildLogs(t *testing.T) { // Remove the pipeline so that the exporter is not attached to any pipeline. // This should result in creating an exporter that has none of consumption // functions set. - delete(cfg.Service.Pipelines, "logs") + delete(cfg.Service.Pipelines, config.NewComponentID("logs")) exporters, err = BuildExporters(componenttest.NewNopTelemetrySettings(), component.NewDefaultBuildInfo(), cfg, factories.Exporters) assert.NotNil(t, exporters) assert.Nil(t, err) diff --git a/service/internal/builder/pipelines_builder_test.go b/service/internal/builder/pipelines_builder_test.go index f7ae7808fd5..22dd00300e9 100644 --- a/service/internal/builder/pipelines_builder_test.go +++ b/service/internal/builder/pipelines_builder_test.go @@ -34,24 +34,24 @@ import ( func TestBuildPipelines(t *testing.T) { tests := []struct { name string - pipelineName string + pipelineID config.ComponentID exporterNames []config.ComponentID }{ { name: "one-exporter", - pipelineName: "traces", + pipelineID: config.NewComponentID("traces"), exporterNames: []config.ComponentID{config.NewComponentID("exampleexporter")}, }, { name: "multi-exporter", - pipelineName: "traces/2", + pipelineID: config.NewComponentIDWithName("traces", "2"), exporterNames: []config.ComponentID{config.NewComponentID("exampleexporter"), config.NewComponentIDWithName("exampleexporter", "2")}, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - testPipeline(t, test.pipelineName, test.exporterNames) + testPipeline(t, test.pipelineID, test.exporterNames) }) } } @@ -72,8 +72,8 @@ func createExampleConfig(dataType string) *config.Config { config.NewComponentID(exampleExporterFactory.Type()): exampleExporterFactory.CreateDefaultConfig(), }, Service: config.Service{ - Pipelines: map[string]*config.Pipeline{ - dataType: { + Pipelines: map[config.ComponentID]*config.Pipeline{ + config.NewComponentID(config.Type(dataType)): { Name: dataType, InputType: config.DataType(dataType), Receivers: []config.ComponentID{config.NewComponentID(exampleReceiverFactory.Type())}, @@ -127,8 +127,7 @@ func TestBuildPipelines_BuildVarious(t *testing.T) { err = pipelineProcessors.StartProcessors(context.Background(), componenttest.NewNopHost()) assert.NoError(t, err) - pipelineName := dataType - processor := pipelineProcessors[cfg.Service.Pipelines[pipelineName]] + processor := pipelineProcessors[cfg.Service.Pipelines[config.NewComponentID(config.Type(dataType))]] // Ensure pipeline has its fields correctly populated. require.NotNil(t, processor) @@ -175,7 +174,7 @@ func TestBuildPipelines_BuildVarious(t *testing.T) { } } -func testPipeline(t *testing.T, pipelineName string, exporterIDs []config.ComponentID) { +func testPipeline(t *testing.T, pipelineID config.ComponentID, exporterIDs []config.ComponentID) { factories, err := testcomponents.ExampleComponents() assert.NoError(t, err) cfg, err := configtest.LoadConfigAndValidate("testdata/pipelines_builder.yaml", factories) @@ -192,7 +191,7 @@ func testPipeline(t *testing.T, pipelineName string, exporterIDs []config.Compon assert.NoError(t, pipelineProcessors.StartProcessors(context.Background(), componenttest.NewNopHost())) - processor := pipelineProcessors[cfg.Service.Pipelines[pipelineName]] + processor := pipelineProcessors[cfg.Service.Pipelines[pipelineID]] // Ensure pipeline has its fields correctly populated. require.NotNil(t, processor) From ac25e4e0d29bbe010a98616a18b6fdd1bb223c7c Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 29 Oct 2021 17:13:43 -0700 Subject: [PATCH 116/149] Fix small nits in service/internal/builder (#4324) Signed-off-by: Bogdan Drutu --- service/internal/builder/exporters_builder.go | 6 +++--- .../internal/builder/exporters_builder_test.go | 16 ++++++++-------- service/internal/builder/pipelines_builder.go | 4 ++-- .../internal/builder/pipelines_builder_test.go | 2 +- .../internal/builder/receivers_builder_test.go | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/service/internal/builder/exporters_builder.go b/service/internal/builder/exporters_builder.go index 0ddd28684ce..a1391338560 100644 --- a/service/internal/builder/exporters_builder.go +++ b/service/internal/builder/exporters_builder.go @@ -67,7 +67,7 @@ func (bexp *builtExporter) getTracesExporter() component.TracesExporter { return exp.(component.TracesExporter) } -func (bexp *builtExporter) getMetricExporter() component.MetricsExporter { +func (bexp *builtExporter) getMetricsExporter() component.MetricsExporter { exp := bexp.expByDataType[config.MetricsDataType] if exp == nil { return nil @@ -75,7 +75,7 @@ func (bexp *builtExporter) getMetricExporter() component.MetricsExporter { return exp.(component.MetricsExporter) } -func (bexp *builtExporter) getLogExporter() component.LogsExporter { +func (bexp *builtExporter) getLogsExporter() component.LogsExporter { exp := bexp.expByDataType[config.LogsDataType] if exp == nil { return nil @@ -149,7 +149,7 @@ func BuildExporters( exporters := make(Exporters) - // Build exporters exporters based on configuration and required input data types. + // Build exporters based on configuration and required input data types. for expID, expCfg := range cfg.Exporters { set := component.ExporterCreateSettings{ TelemetrySettings: component.TelemetrySettings{ diff --git a/service/internal/builder/exporters_builder_test.go b/service/internal/builder/exporters_builder_test.go index 20d8c9c7c89..282d25c915c 100644 --- a/service/internal/builder/exporters_builder_test.go +++ b/service/internal/builder/exporters_builder_test.go @@ -69,8 +69,8 @@ func TestBuildExporters(t *testing.T) { // Ensure exporter has its fields correctly populated. require.NotNil(t, e1) assert.NotNil(t, e1.getTracesExporter()) - assert.Nil(t, e1.getMetricExporter()) - assert.Nil(t, e1.getLogExporter()) + assert.Nil(t, e1.getMetricsExporter()) + assert.Nil(t, e1.getLogsExporter()) // Ensure it can be started. assert.NoError(t, exporters.StartAll(context.Background(), componenttest.NewNopHost())) @@ -97,8 +97,8 @@ func TestBuildExporters(t *testing.T) { // Ensure exporter has its fields correctly populated, ie TracesExporter and MetricsExporter are nil. require.NotNil(t, e1) assert.Nil(t, e1.getTracesExporter()) - assert.Nil(t, e1.getMetricExporter()) - assert.Nil(t, e1.getLogExporter()) + assert.Nil(t, e1.getMetricsExporter()) + assert.Nil(t, e1.getLogsExporter()) // TODO: once we have an exporter that supports metrics data type test it too. } @@ -134,9 +134,9 @@ func TestBuildExporters_BuildLogs(t *testing.T) { // Ensure exporter has its fields correctly populated. require.NotNil(t, e1) - assert.NotNil(t, e1.getLogExporter()) + assert.NotNil(t, e1.getLogsExporter()) assert.Nil(t, e1.getTracesExporter()) - assert.Nil(t, e1.getMetricExporter()) + assert.Nil(t, e1.getMetricsExporter()) // Ensure it can be started. err = exporters.StartAll(context.Background(), componenttest.NewNopHost()) @@ -160,8 +160,8 @@ func TestBuildExporters_BuildLogs(t *testing.T) { // Metrics Exporter are nil. require.NotNil(t, e1) assert.Nil(t, e1.getTracesExporter()) - assert.Nil(t, e1.getMetricExporter()) - assert.Nil(t, e1.getLogExporter()) + assert.Nil(t, e1.getMetricsExporter()) + assert.Nil(t, e1.getLogsExporter()) } func TestBuildExporters_StartStopAll(t *testing.T) { diff --git a/service/internal/builder/pipelines_builder.go b/service/internal/builder/pipelines_builder.go index 9c40a5294d9..c13275ca20e 100644 --- a/service/internal/builder/pipelines_builder.go +++ b/service/internal/builder/pipelines_builder.go @@ -259,7 +259,7 @@ func (pb *pipelinesBuilder) buildFanoutExportersMetricsConsumer(exporterIDs []co var exporters []consumer.Metrics for _, builtExp := range builtExporters { - exporters = append(exporters, builtExp.getMetricExporter()) + exporters = append(exporters, builtExp.getMetricsExporter()) } // Create a junction point that fans out to all exporters. @@ -271,7 +271,7 @@ func (pb *pipelinesBuilder) buildFanoutExportersLogsConsumer(exporterIDs []confi exporters := make([]consumer.Logs, len(builtExporters)) for i, builtExp := range builtExporters { - exporters[i] = builtExp.getLogExporter() + exporters[i] = builtExp.getLogsExporter() } // Create a junction point that fans out to all exporters. diff --git a/service/internal/builder/pipelines_builder_test.go b/service/internal/builder/pipelines_builder_test.go index 22dd00300e9..c8aa97669f5 100644 --- a/service/internal/builder/pipelines_builder_test.go +++ b/service/internal/builder/pipelines_builder_test.go @@ -150,7 +150,7 @@ func TestBuildPipelines_BuildVarious(t *testing.T) { // First check that there are no logs in the exporters yet. var exporterConsumers []*testcomponents.ExampleExporterConsumer for _, exporter := range exporters { - expConsumer := exporter.getLogExporter().(*testcomponents.ExampleExporterConsumer) + expConsumer := exporter.getLogsExporter().(*testcomponents.ExampleExporterConsumer) exporterConsumers = append(exporterConsumers, expConsumer) require.Equal(t, len(expConsumer.Logs), 0) } diff --git a/service/internal/builder/receivers_builder_test.go b/service/internal/builder/receivers_builder_test.go index bfbd78b19a2..7094fdd0262 100644 --- a/service/internal/builder/receivers_builder_test.go +++ b/service/internal/builder/receivers_builder_test.go @@ -164,7 +164,7 @@ func testReceivers(t *testing.T, test testCase) { // Validate metrics. if test.hasMetrics { - metricsConsumer := exporter.getMetricExporter().(*testcomponents.ExampleExporterConsumer) + metricsConsumer := exporter.getMetricsExporter().(*testcomponents.ExampleExporterConsumer) require.Equal(t, 1, len(metricsConsumer.Metrics)) assert.EqualValues(t, md, metricsConsumer.Metrics[0]) } @@ -230,7 +230,7 @@ func TestBuildReceivers_BuildCustom(t *testing.T) { // First check that there are no traces in the exporters yet. for _, exporter := range exporters { - consumer := exporter.getLogExporter().(*testcomponents.ExampleExporterConsumer) + consumer := exporter.getLogsExporter().(*testcomponents.ExampleExporterConsumer) require.Equal(t, len(consumer.Logs), 0) } @@ -245,7 +245,7 @@ func TestBuildReceivers_BuildCustom(t *testing.T) { exporter := allExporters[expID] // Validate exported data. - consumer := exporter.getLogExporter().(*testcomponents.ExampleExporterConsumer) + consumer := exporter.getLogsExporter().(*testcomponents.ExampleExporterConsumer) require.Equal(t, 1, len(consumer.Logs)) assert.EqualValues(t, log, consumer.Logs[0]) } From 1636b2ec4f9da27d704b700ff6a0d235408106b2 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Date: Mon, 1 Nov 2021 13:37:45 -0400 Subject: [PATCH 117/149] Clarify how Receivers must handle errors returned by Consume*() functions (#4267) This is important to make sure failed Consume*() calls are correctly handled by Receivers and that the Receives in turn correctly respond back to the senders from which they received data. We may need to audit all receivers to make sure they work according to these requirements. --- component/receiver.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/component/receiver.go b/component/receiver.go index 6e0b1cfcbd6..3f5511c4d17 100644 --- a/component/receiver.go +++ b/component/receiver.go @@ -23,7 +23,34 @@ import ( // Receiver allows the collector to receive metrics, traces and logs. // -// The receivers that receive data via a protocol that support acknowledgements +// Receiver receives data from a source (either from a remote source via network +// or scrapes from a local host) and pushes the data to the pipelines it is attached +// to by calling the nextConsumer.Consume*() function. +// +// Error Handling +// ============== +// The nextConsumer.Consume*() function may return an error to indicate that the data +// was not accepted. There are 2 types of possible errors: Permanent and non-Permanent. +// The receiver must check the type of the error using IsPermanent() helper. +// +// If the error is Permanent than the nextConsumer.Consume*() call should not be +// retried with the same data. This typically happens when the data cannot be +// serialized by the exporter that is attached to the pipeline or when the destination +// refuses the data because it cannot decode it. The receiver must indicate to +// the source from which it received the data that the received data was bad, if the +// receiving protocol allows to do that. In case of OTLP/HTTP for example, this means +// that HTTP 400 response is returned to the sender. +// +// If the error is non-Permanent then the nextConsumer.Consume*() call may be retried +// with the same data. This may be done by the receiver itself, however typically it is +// done by the original sender, after the receiver returns a response to the sender +// indicating that the Collector is currently overloaded and the request must be +// retried. In case of OTLP/HTTP for example, this means that HTTP 429 or 503 response +// is returned. +// +// Acknowledgment Handling +// ======================= +// The receivers that receive data via a network protocol that support acknowledgments // MUST follow this order of operations: // - Receive data from some sender (typically from a network). // - Push received data to the pipeline by calling nextConsumer.Consume*() function. From 5c921501f2c0eabab34c6a51c38329e10964efae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Mon, 1 Nov 2021 19:05:12 +0100 Subject: [PATCH 118/149] Enable integration tests for the builder (#4316) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enable integration tests for the builder Fixes #4315 Signed-off-by: Juraci Paixão Kröhling * Fix builder integration test workflow Signed-off-by: Juraci Paixão Kröhling --- .../workflows/builder-integration-test.yaml | 8 ++- cmd/builder/.github/CODEOWNERS | 15 ----- cmd/builder/.github/mergify.yml | 19 ------- cmd/builder/.github/workflows/go.yaml | 56 ------------------- 4 files changed, 6 insertions(+), 92 deletions(-) rename cmd/builder/.github/workflows/integration-test.yaml => .github/workflows/builder-integration-test.yaml (70%) delete mode 100644 cmd/builder/.github/CODEOWNERS delete mode 100644 cmd/builder/.github/mergify.yml delete mode 100644 cmd/builder/.github/workflows/go.yaml diff --git a/cmd/builder/.github/workflows/integration-test.yaml b/.github/workflows/builder-integration-test.yaml similarity index 70% rename from cmd/builder/.github/workflows/integration-test.yaml rename to .github/workflows/builder-integration-test.yaml index 7fbe81bcbac..372d9514b62 100644 --- a/cmd/builder/.github/workflows/integration-test.yaml +++ b/.github/workflows/builder-integration-test.yaml @@ -1,10 +1,14 @@ -name: Integration tests +name: Builder - Integration tests on: push: branches: [ main ] + paths: + - 'cmd/builder/**' pull_request: branches: [ main ] + paths: + - 'cmd/builder/**' jobs: integration-test: @@ -21,4 +25,4 @@ jobs: uses: actions/checkout@v2 - name: Test - run: ./test/test.sh + run: cd ./cmd/builder && ./test/test.sh diff --git a/cmd/builder/.github/CODEOWNERS b/cmd/builder/.github/CODEOWNERS deleted file mode 100644 index 09c8dc2a8f8..00000000000 --- a/cmd/builder/.github/CODEOWNERS +++ /dev/null @@ -1,15 +0,0 @@ -##################################################### -# -# List of approvers for OpenTelemetry Collector Builder -# -##################################################### -# -# Learn about membership in OpenTelemetry community: -# https://github.com/open-telemetry/community/blob/master/community-membership.md -# -# -# Learn about CODEOWNERS file format: -# https://help.github.com/en/articles/about-code-owners -# - -* @open-telemetry/collector-approvers @open-telemetry/collector-builder-approvers diff --git a/cmd/builder/.github/mergify.yml b/cmd/builder/.github/mergify.yml deleted file mode 100644 index ca5b7649f62..00000000000 --- a/cmd/builder/.github/mergify.yml +++ /dev/null @@ -1,19 +0,0 @@ -pull_request_rules: - - name: remove outdated reviews - conditions: - - base=main - actions: - dismiss_reviews: {} - - - name: Automatic merge when all checks pass and the PR is approved - conditions: - - "#approved-reviews-by>=1" - - "-draft" - - "status-success=Unit tests" - - "status-success=Code standards (linting)" - - "status-success=Security" - - "status-success=Integration test" - actions: - merge: - method: squash - commit_message: title+body diff --git a/cmd/builder/.github/workflows/go.yaml b/cmd/builder/.github/workflows/go.yaml deleted file mode 100644 index f7893d6fb4f..00000000000 --- a/cmd/builder/.github/workflows/go.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: "Continuous Integration" - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - unit-tests: - name: Unit tests - runs-on: ubuntu-20.04 - steps: - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Test - run: go test -v ./... - - lint: - name: Code standards (linting) - runs-on: ubuntu-20.04 - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.29 - args: --enable=gosec,maligned,misspell - only-new-issues: true - - security: - name: Security - runs-on: ubuntu-20.04 - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: go - - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 From 073dee3e99f4536065f6c877b0a6044e303ca151 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Mon, 1 Nov 2021 16:47:49 -0700 Subject: [PATCH 119/149] Update Builder README with new module paths (#4330) --- cmd/builder/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/builder/README.md b/cmd/builder/README.md index c13c5b020a2..bb3cc6239fb 100644 --- a/cmd/builder/README.md +++ b/cmd/builder/README.md @@ -5,12 +5,12 @@ This program generates a custom OpenTelemetry Collector binary based on a given ## TL;DR ```console -$ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder +$ GO111MODULE=on go install go.opentelemetry.io/collector/cmd/builder $ cat > ~/.otelcol-builder.yaml < /tmp/otelcol.yaml < Date: Mon, 1 Nov 2021 17:05:13 -0700 Subject: [PATCH 120/149] Fix small nits in service/internal/builder (#4333) Signed-off-by: Bogdan Drutu --- service/internal/builder/exporters_builder_test.go | 2 +- service/internal/builder/receivers_builder.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/service/internal/builder/exporters_builder_test.go b/service/internal/builder/exporters_builder_test.go index 282d25c915c..092317798a7 100644 --- a/service/internal/builder/exporters_builder_test.go +++ b/service/internal/builder/exporters_builder_test.go @@ -118,7 +118,7 @@ func TestBuildExporters_BuildLogs(t *testing.T) { Pipelines: map[config.ComponentID]*config.Pipeline{ config.NewComponentID("logs"): { Name: "logs", - InputType: "logs", + InputType: config.LogsDataType, Exporters: []config.ComponentID{config.NewComponentID("exampleexporter")}, }, }, diff --git a/service/internal/builder/receivers_builder.go b/service/internal/builder/receivers_builder.go index 4c15e92ba8a..e6a1e377462 100644 --- a/service/internal/builder/receivers_builder.go +++ b/service/internal/builder/receivers_builder.go @@ -137,8 +137,6 @@ func (rb *receiversBuilder) findPipelinesToAttach(receiverID config.ComponentID) // attached to this receiver according to configuration. pipelinesToAttach := make(attachedPipelines) - pipelinesToAttach[config.TracesDataType] = make([]*builtPipeline, 0) - pipelinesToAttach[config.MetricsDataType] = make([]*builtPipeline, 0) // Iterate over all pipelines. for _, pipelineCfg := range rb.config.Service.Pipelines { From 8edb16d54bce660d89544a0bc145b8d105276808 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Mon, 1 Nov 2021 17:19:08 -0700 Subject: [PATCH 121/149] Update Check* functions to support TestTelemetry (#4283) The following change updates various obsreporttest methods to support TestTelemetry: * CheckExporterMetrics, CheckExporterTraces, CheckExporterLogs * CheckProcessorTraces, CheckProcessorMetrics, CheckProcessorLogs * CheckReceiverLogs, CheckReceiverTraces, CheckReceiverMetrics * CheckScraperMetrics --- exporter/exporterhelper/logs_test.go | 4 ++-- exporter/exporterhelper/metrics_test.go | 4 ++-- exporter/exporterhelper/traces_test.go | 4 ++-- obsreport/obsreport_test.go | 20 +++++++++---------- obsreport/obsreporttest/obsreporttest.go | 20 +++++++++---------- obsreport/obsreporttest/obsreporttest_test.go | 12 +++++------ receiver/otlpreceiver/otlp_test.go | 2 +- .../scraperhelper/scrapercontroller_test.go | 12 +++++------ 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/exporter/exporterhelper/logs_test.go b/exporter/exporterhelper/logs_test.go index baa3e894bf2..ee492f768d1 100644 --- a/exporter/exporterhelper/logs_test.go +++ b/exporter/exporterhelper/logs_test.go @@ -217,9 +217,9 @@ func checkRecordedMetricsForLogsExporter(t *testing.T, le component.LogsExporter // TODO: When the new metrics correctly count partial dropped fix this. if wantError != nil { - require.NoError(t, obsreporttest.CheckExporterLogs(fakeLogsExporterName, 0, int64(numBatches*ld.LogRecordCount()))) + require.NoError(t, obsreporttest.CheckExporterLogs(tt, fakeLogsExporterName, 0, int64(numBatches*ld.LogRecordCount()))) } else { - require.NoError(t, obsreporttest.CheckExporterLogs(fakeLogsExporterName, int64(numBatches*ld.LogRecordCount()), 0)) + require.NoError(t, obsreporttest.CheckExporterLogs(tt, fakeLogsExporterName, int64(numBatches*ld.LogRecordCount()), 0)) } } diff --git a/exporter/exporterhelper/metrics_test.go b/exporter/exporterhelper/metrics_test.go index a4ea5ee3cb8..287d7ac2b91 100644 --- a/exporter/exporterhelper/metrics_test.go +++ b/exporter/exporterhelper/metrics_test.go @@ -219,9 +219,9 @@ func checkRecordedMetricsForMetricsExporter(t *testing.T, me component.MetricsEx // TODO: When the new metrics correctly count partial dropped fix this. numPoints := int64(numBatches * md.MetricCount() * 2) /* 2 points per metric*/ if wantError != nil { - require.NoError(t, obsreporttest.CheckExporterMetrics(fakeMetricsExporterName, 0, numPoints)) + require.NoError(t, obsreporttest.CheckExporterMetrics(tt, fakeMetricsExporterName, 0, numPoints)) } else { - require.NoError(t, obsreporttest.CheckExporterMetrics(fakeMetricsExporterName, numPoints, 0)) + require.NoError(t, obsreporttest.CheckExporterMetrics(tt, fakeMetricsExporterName, numPoints, 0)) } } diff --git a/exporter/exporterhelper/traces_test.go b/exporter/exporterhelper/traces_test.go index 4d8e26f2275..a2767260252 100644 --- a/exporter/exporterhelper/traces_test.go +++ b/exporter/exporterhelper/traces_test.go @@ -218,9 +218,9 @@ func checkRecordedMetricsForTracesExporter(t *testing.T, te component.TracesExpo // TODO: When the new metrics correctly count partial dropped fix this. if wantError != nil { - require.NoError(t, obsreporttest.CheckExporterTraces(fakeTracesExporterName, 0, int64(numBatches*td.SpanCount()))) + require.NoError(t, obsreporttest.CheckExporterTraces(tt, fakeTracesExporterName, 0, int64(numBatches*td.SpanCount()))) } else { - require.NoError(t, obsreporttest.CheckExporterTraces(fakeTracesExporterName, int64(numBatches*td.SpanCount()), 0)) + require.NoError(t, obsreporttest.CheckExporterTraces(tt, fakeTracesExporterName, int64(numBatches*td.SpanCount()), 0)) } } diff --git a/obsreport/obsreport_test.go b/obsreport/obsreport_test.go index 78c7fe46b36..a14c05cc2da 100644 --- a/obsreport/obsreport_test.go +++ b/obsreport/obsreport_test.go @@ -96,7 +96,7 @@ func TestReceiveTraceDataOp(t *testing.T) { t.Fatalf("unexpected param: %v", params[i]) } } - require.NoError(t, obsreporttest.CheckReceiverTraces(receiver, transport, int64(acceptedSpans), int64(refusedSpans))) + require.NoError(t, obsreporttest.CheckReceiverTraces(tt, receiver, transport, int64(acceptedSpans), int64(refusedSpans))) } func TestReceiveLogsOp(t *testing.T) { @@ -144,7 +144,7 @@ func TestReceiveLogsOp(t *testing.T) { t.Fatalf("unexpected param: %v", params[i]) } } - require.NoError(t, obsreporttest.CheckReceiverLogs(receiver, transport, int64(acceptedLogRecords), int64(refusedLogRecords))) + require.NoError(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, int64(acceptedLogRecords), int64(refusedLogRecords))) } func TestReceiveMetricsOp(t *testing.T) { @@ -193,7 +193,7 @@ func TestReceiveMetricsOp(t *testing.T) { } } - require.NoError(t, obsreporttest.CheckReceiverMetrics(receiver, transport, int64(acceptedMetricPoints), int64(refusedMetricPoints))) + require.NoError(t, obsreporttest.CheckReceiverMetrics(tt, receiver, transport, int64(acceptedMetricPoints), int64(refusedMetricPoints))) } func TestScrapeMetricsDataOp(t *testing.T) { @@ -251,7 +251,7 @@ func TestScrapeMetricsDataOp(t *testing.T) { } } - require.NoError(t, obsreporttest.CheckScraperMetrics(receiver, scraper, int64(scrapedMetricPoints), int64(erroredMetricPoints))) + require.NoError(t, obsreporttest.CheckScraperMetrics(tt, receiver, scraper, int64(scrapedMetricPoints), int64(erroredMetricPoints))) } func TestExportTraceDataOp(t *testing.T) { @@ -301,7 +301,7 @@ func TestExportTraceDataOp(t *testing.T) { } } - require.NoError(t, obsreporttest.CheckExporterTraces(exporter, int64(sentSpans), int64(failedToSendSpans))) + require.NoError(t, obsreporttest.CheckExporterTraces(tt, exporter, int64(sentSpans), int64(failedToSendSpans))) } func TestExportMetricsOp(t *testing.T) { @@ -352,7 +352,7 @@ func TestExportMetricsOp(t *testing.T) { } } - require.NoError(t, obsreporttest.CheckExporterMetrics(exporter, int64(sentMetricPoints), int64(failedToSendMetricPoints))) + require.NoError(t, obsreporttest.CheckExporterMetrics(tt, exporter, int64(sentMetricPoints), int64(failedToSendMetricPoints))) } func TestExportLogsOp(t *testing.T) { @@ -403,7 +403,7 @@ func TestExportLogsOp(t *testing.T) { } } - require.NoError(t, obsreporttest.CheckExporterLogs(exporter, int64(sentLogRecords), int64(failedToSendLogRecords))) + require.NoError(t, obsreporttest.CheckExporterLogs(tt, exporter, int64(sentLogRecords), int64(failedToSendLogRecords))) } func TestReceiveWithLongLivedCtx(t *testing.T) { @@ -477,7 +477,7 @@ func TestProcessorTraceData(t *testing.T) { obsrep.TracesRefused(context.Background(), refusedSpans) obsrep.TracesDropped(context.Background(), droppedSpans) - require.NoError(t, obsreporttest.CheckProcessorTraces(processor, acceptedSpans, refusedSpans, droppedSpans)) + require.NoError(t, obsreporttest.CheckProcessorTraces(tt, processor, acceptedSpans, refusedSpans, droppedSpans)) } func TestProcessorMetricsData(t *testing.T) { @@ -498,7 +498,7 @@ func TestProcessorMetricsData(t *testing.T) { obsrep.MetricsRefused(context.Background(), refusedPoints) obsrep.MetricsDropped(context.Background(), droppedPoints) - require.NoError(t, obsreporttest.CheckProcessorMetrics(processor, acceptedPoints, refusedPoints, droppedPoints)) + require.NoError(t, obsreporttest.CheckProcessorMetrics(tt, processor, acceptedPoints, refusedPoints, droppedPoints)) } func TestBuildProcessorCustomMetricName(t *testing.T) { @@ -541,5 +541,5 @@ func TestProcessorLogRecords(t *testing.T) { obsrep.LogsRefused(context.Background(), refusedRecords) obsrep.LogsDropped(context.Background(), droppedRecords) - require.NoError(t, obsreporttest.CheckProcessorLogs(processor, acceptedRecords, refusedRecords, droppedRecords)) + require.NoError(t, obsreporttest.CheckProcessorLogs(tt, processor, acceptedRecords, refusedRecords, droppedRecords)) } diff --git a/obsreport/obsreporttest/obsreporttest.go b/obsreport/obsreporttest/obsreporttest.go index 536c3f84dae..b79a6338016 100644 --- a/obsreport/obsreporttest/obsreporttest.go +++ b/obsreport/obsreporttest/obsreporttest.go @@ -102,7 +102,7 @@ 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(exporter config.ComponentID, acceptedSpans, droppedSpans int64) error { +func CheckExporterTraces(_ TestTelemetry, exporter config.ComponentID, acceptedSpans, droppedSpans int64) error { exporterTags := tagsForExporterView(exporter) if err := checkValueForView(exporterTags, acceptedSpans, "exporter/sent_spans"); err != nil { return err @@ -112,7 +112,7 @@ func CheckExporterTraces(exporter config.ComponentID, acceptedSpans, droppedSpan // 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(exporter config.ComponentID, acceptedMetricsPoints, droppedMetricsPoints int64) error { +func CheckExporterMetrics(_ TestTelemetry, exporter config.ComponentID, acceptedMetricsPoints, droppedMetricsPoints int64) error { exporterTags := tagsForExporterView(exporter) if err := checkValueForView(exporterTags, acceptedMetricsPoints, "exporter/sent_metric_points"); err != nil { return err @@ -122,7 +122,7 @@ func CheckExporterMetrics(exporter config.ComponentID, acceptedMetricsPoints, dr // 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(exporter config.ComponentID, acceptedLogRecords, droppedLogRecords int64) error { +func CheckExporterLogs(_ TestTelemetry, exporter config.ComponentID, acceptedLogRecords, droppedLogRecords int64) error { exporterTags := tagsForExporterView(exporter) if err := checkValueForView(exporterTags, acceptedLogRecords, "exporter/sent_log_records"); err != nil { return err @@ -132,7 +132,7 @@ func CheckExporterLogs(exporter config.ComponentID, acceptedLogRecords, droppedL // 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(processor config.ComponentID, acceptedSpans, refusedSpans, droppedSpans int64) error { +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 @@ -145,7 +145,7 @@ func CheckProcessorTraces(processor config.ComponentID, acceptedSpans, refusedSp // 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(processor config.ComponentID, acceptedMetricPoints, refusedMetricPoints, droppedMetricPoints int64) error { +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 @@ -158,7 +158,7 @@ func CheckProcessorMetrics(processor config.ComponentID, acceptedMetricPoints, r // 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(processor config.ComponentID, acceptedLogRecords, refusedLogRecords, droppedLogRecords int64) error { +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 @@ -171,7 +171,7 @@ func CheckProcessorLogs(processor config.ComponentID, acceptedLogRecords, refuse // 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(receiver config.ComponentID, protocol string, acceptedSpans, droppedSpans int64) error { +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 @@ -181,7 +181,7 @@ func CheckReceiverTraces(receiver config.ComponentID, protocol string, acceptedS // 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(receiver config.ComponentID, protocol string, acceptedLogRecords, droppedLogRecords int64) error { +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 @@ -191,7 +191,7 @@ func CheckReceiverLogs(receiver config.ComponentID, protocol string, acceptedLog // 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(receiver config.ComponentID, protocol string, acceptedMetricPoints, droppedMetricPoints int64) error { +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 @@ -201,7 +201,7 @@ func CheckReceiverMetrics(receiver config.ComponentID, protocol string, accepted // 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(receiver config.ComponentID, scraper config.ComponentID, scrapedMetricPoints, erroredMetricPoints int64) error { +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 diff --git a/obsreport/obsreporttest/obsreporttest_test.go b/obsreport/obsreporttest/obsreporttest_test.go index 049b61b747b..ac01909ad36 100644 --- a/obsreport/obsreporttest/obsreporttest_test.go +++ b/obsreport/obsreporttest/obsreporttest_test.go @@ -55,7 +55,7 @@ func TestCheckReceiverTracesViews(t *testing.T) { 7, nil) - require.NoError(t, obsreporttest.CheckReceiverTraces(receiver, transport, 7, 0)) + require.NoError(t, obsreporttest.CheckReceiverTraces(tt, receiver, transport, 7, 0)) } func TestCheckReceiverMetricsViews(t *testing.T) { @@ -72,7 +72,7 @@ func TestCheckReceiverMetricsViews(t *testing.T) { assert.NotNil(t, ctx) rec.EndMetricsOp(ctx, format, 7, nil) - require.NoError(t, obsreporttest.CheckReceiverMetrics(receiver, transport, 7, 0)) + require.NoError(t, obsreporttest.CheckReceiverMetrics(tt, receiver, transport, 7, 0)) } func TestCheckReceiverLogsViews(t *testing.T) { @@ -89,7 +89,7 @@ func TestCheckReceiverLogsViews(t *testing.T) { assert.NotNil(t, ctx) rec.EndLogsOp(ctx, format, 7, nil) - require.NoError(t, obsreporttest.CheckReceiverLogs(receiver, transport, 7, 0)) + require.NoError(t, obsreporttest.CheckReceiverLogs(tt, receiver, transport, 7, 0)) } func TestCheckExporterTracesViews(t *testing.T) { @@ -107,7 +107,7 @@ func TestCheckExporterTracesViews(t *testing.T) { obsrep.EndTracesOp(ctx, 7, nil) - require.NoError(t, obsreporttest.CheckExporterTraces(exporter, 7, 0)) + require.NoError(t, obsreporttest.CheckExporterTraces(tt, exporter, 7, 0)) } func TestCheckExporterMetricsViews(t *testing.T) { @@ -125,7 +125,7 @@ func TestCheckExporterMetricsViews(t *testing.T) { obsrep.EndMetricsOp(ctx, 7, nil) - require.NoError(t, obsreporttest.CheckExporterMetrics(exporter, 7, 0)) + require.NoError(t, obsreporttest.CheckExporterMetrics(tt, exporter, 7, 0)) } func TestCheckExporterLogsViews(t *testing.T) { @@ -142,5 +142,5 @@ func TestCheckExporterLogsViews(t *testing.T) { assert.NotNil(t, ctx) obsrep.EndLogsOp(ctx, 7, nil) - require.NoError(t, obsreporttest.CheckExporterLogs(exporter, 7, 0)) + require.NoError(t, obsreporttest.CheckExporterLogs(tt, exporter, 7, 0)) } diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index 62db332d2e3..25c4822671d 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -530,7 +530,7 @@ func TestOTLPReceiverTrace_HandleNextConsumerResponse(t *testing.T) { require.Equal(t, test.expectedReceivedBatches, len(sink.AllTraces())) - require.NoError(t, obsreporttest.CheckReceiverTraces(config.NewComponentIDWithName(typeStr, exporter.receiverTag), "grpc", int64(test.expectedReceivedBatches), int64(test.expectedIngestionBlockedRPCs))) + require.NoError(t, obsreporttest.CheckReceiverTraces(tt, config.NewComponentIDWithName(typeStr, exporter.receiverTag), "grpc", int64(test.expectedReceivedBatches), int64(test.expectedIngestionBlockedRPCs))) }) } } diff --git a/receiver/scraperhelper/scrapercontroller_test.go b/receiver/scraperhelper/scrapercontroller_test.go index d4c4872466d..78aaa1e6d64 100644 --- a/receiver/scraperhelper/scrapercontroller_test.go +++ b/receiver/scraperhelper/scrapercontroller_test.go @@ -201,9 +201,9 @@ func TestScrapeController(t *testing.T) { spans := tt.SpanRecorder.Ended() assertReceiverSpan(t, spans) - assertReceiverViews(t, sink) + assertReceiverViews(t, tt, sink) assertScraperSpan(t, test.scrapeErr, spans) - assertScraperViews(t, test.scrapeErr, sink) + assertScraperViews(t, tt, test.scrapeErr, sink) } err = mr.Shutdown(context.Background()) @@ -285,12 +285,12 @@ func assertReceiverSpan(t *testing.T, spans []sdktrace.ReadOnlySpan) { assert.True(t, receiverSpan) } -func assertReceiverViews(t *testing.T, sink *consumertest.MetricsSink) { +func assertReceiverViews(t *testing.T, tt obsreporttest.TestTelemetry, sink *consumertest.MetricsSink) { dataPointCount := 0 for _, md := range sink.AllMetrics() { dataPointCount += md.DataPointCount() } - require.NoError(t, obsreporttest.CheckReceiverMetrics(config.NewComponentID("receiver"), "", int64(dataPointCount), 0)) + require.NoError(t, obsreporttest.CheckReceiverMetrics(tt, config.NewComponentID("receiver"), "", int64(dataPointCount), 0)) } func assertScraperSpan(t *testing.T, expectedErr error, spans []sdktrace.ReadOnlySpan) { @@ -313,7 +313,7 @@ func assertScraperSpan(t *testing.T, expectedErr error, spans []sdktrace.ReadOnl assert.True(t, scraperSpan) } -func assertScraperViews(t *testing.T, expectedErr error, sink *consumertest.MetricsSink) { +func assertScraperViews(t *testing.T, tt obsreporttest.TestTelemetry, expectedErr error, sink *consumertest.MetricsSink) { expectedScraped := int64(sink.DataPointCount()) expectedErrored := int64(0) if expectedErr != nil { @@ -325,7 +325,7 @@ func assertScraperViews(t *testing.T, expectedErr error, sink *consumertest.Metr } } - require.NoError(t, obsreporttest.CheckScraperMetrics(config.NewComponentID("receiver"), config.NewComponentID("scraper"), expectedScraped, expectedErrored)) + require.NoError(t, obsreporttest.CheckScraperMetrics(tt, config.NewComponentID("receiver"), config.NewComponentID("scraper"), expectedScraped, expectedErrored)) } func TestSingleScrapePerTick(t *testing.T) { From 05c56d5fe539e1a97a12f80288a375a62a0f7aec Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 1 Nov 2021 17:43:59 -0700 Subject: [PATCH 122/149] Update copyright in builder to be consistent with collector (#4320) Signed-off-by: Bogdan Drutu --- cmd/builder/cmd/root.go | 2 +- cmd/builder/go.mod | 2 +- cmd/builder/header.txt | 2 +- cmd/builder/internal/builder/config.go | 2 +- cmd/builder/internal/builder/config_test.go | 2 +- cmd/builder/internal/builder/main.go | 2 +- cmd/builder/internal/scaffold/components.go | 4 ++-- cmd/builder/internal/scaffold/gomod.go | 2 +- cmd/builder/internal/scaffold/main.go | 4 ++-- cmd/builder/main.go | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/builder/cmd/root.go b/cmd/builder/cmd/root.go index 6c8c1ad3e59..2be34e7ef5a 100644 --- a/cmd/builder/cmd/root.go +++ b/cmd/builder/cmd/root.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/go.mod b/cmd/builder/go.mod index 85df4494fb8..bb517a8c9d8 100644 --- a/cmd/builder/go.mod +++ b/cmd/builder/go.mod @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/header.txt b/cmd/builder/header.txt index 1038a144623..3881885f31b 100644 --- a/cmd/builder/header.txt +++ b/cmd/builder/header.txt @@ -1,4 +1,4 @@ -Copyright 2020 OpenTelemetry Authors +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. diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index 385941b55ef..fd115252ed7 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/internal/builder/config_test.go b/cmd/builder/internal/builder/config_test.go index 1528ae30d28..8cc2a56ca87 100644 --- a/cmd/builder/internal/builder/config_test.go +++ b/cmd/builder/internal/builder/config_test.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go index c146e01f796..91040178e92 100644 --- a/cmd/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/internal/scaffold/components.go b/cmd/builder/internal/scaffold/components.go index 2c099c3fc12..78103e806ea 100644 --- a/cmd/builder/internal/scaffold/components.go +++ b/cmd/builder/internal/scaffold/components.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. @@ -15,7 +15,7 @@ package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" const Components = ` -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/internal/scaffold/gomod.go b/cmd/builder/internal/scaffold/gomod.go index 380a843c17b..80b86738e48 100644 --- a/cmd/builder/internal/scaffold/gomod.go +++ b/cmd/builder/internal/scaffold/gomod.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/internal/scaffold/main.go b/cmd/builder/internal/scaffold/main.go index 0cccee5da53..22394c264db 100644 --- a/cmd/builder/internal/scaffold/main.go +++ b/cmd/builder/internal/scaffold/main.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. @@ -15,7 +15,7 @@ package scaffold // import "go.opentelemetry.io/collector/cmd/builder/internal/scaffold" const Main = ` -// Copyright 2020 OpenTelemetry Authors +// 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. diff --git a/cmd/builder/main.go b/cmd/builder/main.go index f3aceeec446..c3d1f436995 100644 --- a/cmd/builder/main.go +++ b/cmd/builder/main.go @@ -1,4 +1,4 @@ -// Copyright 2020 OpenTelemetry Authors +// 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. From 883afc505d45e0c86814330a95d8a163ddb51a63 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 2 Nov 2021 01:54:12 +0100 Subject: [PATCH 123/149] Remove BaseProcessorFactory, force using helper (#4175) * Add internalinterface package This adds a general InternalInterface to make an interface impossible to implement. * Use internalinterface.InternalInterface for Processor as a test * Add Changelog note * need to use -> must use * Add small unit test Co-authored-by: Bogdan Drutu --- CHANGELOG.md | 1 + component/componenttest/nop_processor.go | 3 +- component/processor.go | 42 ++----------------- component/processor_test.go | 40 +++++++++--------- .../internalinterface/internalinterface.go | 30 +++++++++++++ .../internalinterface_test.go | 26 ++++++++++++ processor/processorhelper/factory.go | 10 +++-- 7 files changed, 89 insertions(+), 63 deletions(-) create mode 100644 internal/internalinterface/internalinterface.go create mode 100644 internal/internalinterface/internalinterface_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 0609aab1376..d9fd591437a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## 🛑 Breaking changes 🛑 +- Remove `component.BaseProcessorFactory`, use `processorhelper.NewFactory` instead (#4175) - Move `service/parserprovider` package to `config/configmapprovider` (#4206) ## v0.38.0 Beta diff --git a/component/componenttest/nop_processor.go b/component/componenttest/nop_processor.go index 8a19a22c1fc..72b2dfcb073 100644 --- a/component/componenttest/nop_processor.go +++ b/component/componenttest/nop_processor.go @@ -22,6 +22,7 @@ import ( "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/internal/internalinterface" ) // NewNopProcessorCreateSettings returns a new nop settings for Create*Processor functions. @@ -38,7 +39,7 @@ type nopProcessorConfig struct { // nopProcessorFactory is factory for nopProcessor. type nopProcessorFactory struct { - component.BaseProcessorFactory + internalinterface.BaseInternal } var nopProcessorFactoryInstance = &nopProcessorFactory{} diff --git a/component/processor.go b/component/processor.go index ee8682ddd1b..fc684073078 100644 --- a/component/processor.go +++ b/component/processor.go @@ -17,9 +17,9 @@ package component // import "go.opentelemetry.io/collector/component" import ( "context" - "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/internal/internalinterface" ) // Processor defines the common functions that must be implemented by TracesProcessor @@ -57,9 +57,10 @@ type ProcessorCreateSettings struct { // ProcessorFactory is factory interface for processors. This is the // new factory type that can create new style processors. // -// This interface cannot be directly implemented. Implementations need to embed -// the BaseProcessorFactory or use the processorhelper.NewFactory to implement it. +// This interface cannot be directly implemented. Implementations must +// use the processorhelper.NewFactory to implement it. type ProcessorFactory interface { + internalinterface.InternalInterface Factory // CreateDefaultConfig creates the default configuration for the Processor. @@ -100,39 +101,4 @@ type ProcessorFactory interface { cfg config.Processor, nextConsumer consumer.Logs, ) (LogsProcessor, error) - - // unexportedProcessor is a dummy method to force this interface to not be implemented. - unexportedProcessor() -} - -// BaseProcessorFactory is the interface that must be embedded by all ProcessorFactory implementations. -type BaseProcessorFactory struct{} - -var _ ProcessorFactory = (*BaseProcessorFactory)(nil) - -// Type must be overridden. -func (b BaseProcessorFactory) Type() config.Type { - panic("implement me") -} - -// CreateDefaultConfig must be overridden. -func (b BaseProcessorFactory) CreateDefaultConfig() config.Processor { - panic("implement me") } - -// CreateTracesProcessor default implemented as not supported data type. -func (b BaseProcessorFactory) CreateTracesProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Traces) (TracesProcessor, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateMetricsProcessor default implemented as not supported data type. -func (b BaseProcessorFactory) CreateMetricsProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Metrics) (MetricsProcessor, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateLogsProcessor default implemented as not supported data type. -func (b BaseProcessorFactory) CreateLogsProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Logs) (LogsProcessor, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -func (b BaseProcessorFactory) unexportedProcessor() {} diff --git a/component/processor_test.go b/component/processor_test.go index 48079bae705..f11e2ab38b9 100644 --- a/component/processor_test.go +++ b/component/processor_test.go @@ -22,11 +22,14 @@ import ( "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/internal/internalinterface" ) +var _ ProcessorFactory = (*TestProcessorFactory)(nil) + type TestProcessorFactory struct { - BaseProcessorFactory + internalinterface.BaseInternal name string } @@ -40,6 +43,21 @@ func (f *TestProcessorFactory) CreateDefaultConfig() config.Processor { return nil } +// CreateTracesProcessor default implemented as not supported data type. +func (f *TestProcessorFactory) CreateTracesProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Traces) (TracesProcessor, error) { + return nil, componenterror.ErrDataTypeIsNotSupported +} + +// CreateMetricsProcessor default implemented as not supported data type. +func (f *TestProcessorFactory) CreateMetricsProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Metrics) (MetricsProcessor, error) { + return nil, componenterror.ErrDataTypeIsNotSupported +} + +// CreateLogsProcessor default implemented as not supported data type. +func (f *TestProcessorFactory) CreateLogsProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Logs) (LogsProcessor, error) { + return nil, componenterror.ErrDataTypeIsNotSupported +} + func TestMakeProcessorFactoryMap(t *testing.T) { type testCase struct { in []ProcessorFactory @@ -75,21 +93,3 @@ func TestMakeProcessorFactoryMap(t *testing.T) { assert.Equal(t, c.out, out) } } - -func TestBaseProcessorFactory(t *testing.T) { - bpf := BaseProcessorFactory{} - assert.Panics(t, func() { - bpf.Type() - }) - assert.Panics(t, func() { - bpf.CreateDefaultConfig() - }) - assert.NotPanics(t, bpf.unexportedProcessor) - defaultCfg := config.NewProcessorSettings(config.NewComponentID("nop")) - _, err := bpf.CreateTracesProcessor(context.Background(), ProcessorCreateSettings{}, &defaultCfg, consumertest.NewNop()) - assert.ErrorIs(t, err, componenterror.ErrDataTypeIsNotSupported) - _, err = bpf.CreateMetricsProcessor(context.Background(), ProcessorCreateSettings{}, &defaultCfg, consumertest.NewNop()) - assert.ErrorIs(t, err, componenterror.ErrDataTypeIsNotSupported) - _, err = bpf.CreateLogsProcessor(context.Background(), ProcessorCreateSettings{}, &defaultCfg, consumertest.NewNop()) - assert.ErrorIs(t, err, componenterror.ErrDataTypeIsNotSupported) -} diff --git a/internal/internalinterface/internalinterface.go b/internal/internalinterface/internalinterface.go new file mode 100644 index 00000000000..b6f24aa7231 --- /dev/null +++ b/internal/internalinterface/internalinterface.go @@ -0,0 +1,30 @@ +// 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 internalinterface // import "go.opentelemetry.io/collector/internal/internalinterface" + +// InternalInterface is an interface used to prevent library consumers +// to implement a given interface. +type InternalInterface interface { + // unexportedMethod is a dummy method to force this interface to not be implemented. + unexportedMethod() +} + +var _ InternalInterface = (*BaseInternal)(nil) + +// BaseInternal must be embedded on structs implementing InternalInterface. +type BaseInternal struct{} + +// unexportedMethod implements the internal interface. +func (*BaseInternal) unexportedMethod() {} diff --git a/internal/internalinterface/internalinterface_test.go b/internal/internalinterface/internalinterface_test.go new file mode 100644 index 00000000000..f7680dca9bd --- /dev/null +++ b/internal/internalinterface/internalinterface_test.go @@ -0,0 +1,26 @@ +// 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 internalinterface // import "go.opentelemetry.io/collector/internal/internalinterface" + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestBaseInternal(t *testing.T) { + base := BaseInternal{} + assert.NotPanics(t, base.unexportedMethod) +} diff --git a/processor/processorhelper/factory.go b/processor/processorhelper/factory.go index 5465055f4c0..f0eb72a6d3c 100644 --- a/processor/processorhelper/factory.go +++ b/processor/processorhelper/factory.go @@ -18,8 +18,10 @@ import ( "context" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/internal/internalinterface" ) // FactoryOption apply changes to ProcessorOptions. @@ -38,7 +40,7 @@ type CreateMetricsProcessor func(context.Context, component.ProcessorCreateSetti type CreateLogsProcessor func(context.Context, component.ProcessorCreateSettings, config.Processor, consumer.Logs) (component.LogsProcessor, error) type factory struct { - component.BaseProcessorFactory + internalinterface.BaseInternal cfgType config.Type createDefaultConfig CreateDefaultConfig createTracesProcessor CreateTracesProcessor @@ -100,7 +102,7 @@ func (f *factory) CreateTracesProcessor( nextConsumer consumer.Traces, ) (component.TracesProcessor, error) { if f.createTracesProcessor == nil { - return f.BaseProcessorFactory.CreateTracesProcessor(ctx, set, cfg, nextConsumer) + return nil, componenterror.ErrDataTypeIsNotSupported } return f.createTracesProcessor(ctx, set, cfg, nextConsumer) } @@ -113,7 +115,7 @@ func (f *factory) CreateMetricsProcessor( nextConsumer consumer.Metrics, ) (component.MetricsProcessor, error) { if f.createMetricsProcessor == nil { - return f.BaseProcessorFactory.CreateMetricsProcessor(ctx, set, cfg, nextConsumer) + return nil, componenterror.ErrDataTypeIsNotSupported } return f.createMetricsProcessor(ctx, set, cfg, nextConsumer) } @@ -126,7 +128,7 @@ func (f *factory) CreateLogsProcessor( nextConsumer consumer.Logs, ) (component.LogsProcessor, error) { if f.createLogsProcessor == nil { - return f.BaseProcessorFactory.CreateLogsProcessor(ctx, set, cfg, nextConsumer) + return nil, componenterror.ErrDataTypeIsNotSupported } return f.createLogsProcessor(ctx, set, cfg, nextConsumer) } From a81963fed9b16e8b94f6119b68f5d4143adba32b Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 1 Nov 2021 17:56:08 -0700 Subject: [PATCH 124/149] Move service config to separate file, unmarshal service as any other component (#4334) Signed-off-by: Bogdan Drutu --- config/config.go | 73 --------- .../configunmarshaler/defaultunmarshaler.go | 155 ++++++++---------- .../defaultunmarshaler_test.go | 82 ++++----- config/service.go | 93 +++++++++++ 4 files changed, 202 insertions(+), 201 deletions(-) create mode 100644 config/service.go diff --git a/config/config.go b/config/config.go index 52ff6252205..755c84917b4 100644 --- a/config/config.go +++ b/config/config.go @@ -17,8 +17,6 @@ package config // import "go.opentelemetry.io/collector/config" import ( "errors" "fmt" - - "go.uber.org/zap/zapcore" ) var ( @@ -146,49 +144,6 @@ func (cfg *Config) validateService() error { return nil } -// Service defines the configurable components of the service. -type Service struct { - Telemetry ServiceTelemetry - - // Extensions are the ordered list of extensions configured for the service. - Extensions []ComponentID - - // Pipelines are the set of data pipelines configured for the service. - Pipelines Pipelines -} - -// ServiceTelemetry defines the configurable settings for service telemetry. -type ServiceTelemetry struct { - Logs ServiceTelemetryLogs `mapstructure:"logs"` -} - -func (srvT *ServiceTelemetry) validate() error { - return srvT.Logs.validate() -} - -// ServiceTelemetryLogs defines the configurable settings for service telemetry logs. -// This MUST be compatible with zap.Config. Cannot use directly zap.Config because -// the collector uses mapstructure and not yaml tags. -type ServiceTelemetryLogs struct { - // Level is the minimum enabled logging level. - Level zapcore.Level `mapstructure:"level"` - - // Development puts the logger in development mode, which changes the - // behavior of DPanicLevel and takes stacktraces more liberally. - Development bool `mapstructure:"development"` - - // Encoding sets the logger's encoding. - // Valid values are "json" and "console". - Encoding string `mapstructure:"encoding"` -} - -func (srvTL *ServiceTelemetryLogs) validate() error { - if srvTL.Encoding != "json" && srvTL.Encoding != "console" { - return fmt.Errorf(`service telemetry logs invalid encoding: %q, valid values are "json" and "console"`, srvTL.Encoding) - } - return nil -} - // Type is the component type as it is used in the config. type Type string @@ -205,31 +160,3 @@ type Unmarshallable interface { // The config.Map for this specific component may be nil or empty if no config available. Unmarshal(component *Map) error } - -// DataType is the data type that is supported for collection. We currently support -// collecting metrics, traces and logs, this can expand in the future. -type DataType string - -// Currently supported data types. Add new data types here when new types are supported in the future. -const ( - // TracesDataType is the data type tag for traces. - TracesDataType DataType = "traces" - - // MetricsDataType is the data type tag for metrics. - MetricsDataType DataType = "metrics" - - // LogsDataType is the data type tag for logs. - LogsDataType DataType = "logs" -) - -// Pipeline defines a single pipeline. -type Pipeline struct { - Name string - InputType DataType - Receivers []ComponentID `mapstructure:"receivers"` - Processors []ComponentID `mapstructure:"processors"` - Exporters []ComponentID `mapstructure:"exporters"` -} - -// Pipelines is a map of names to Pipelines. -type Pipelines map[ComponentID]*Pipeline diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index 4c5c09afb8f..967208b6973 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -33,22 +33,22 @@ const ( // Skip 0, start errors codes from 1. _ configErrorCode = iota - errUnknownType - errUnmarshalTopLevelStructureError + errUnmarshalTopLevelStructure + errUnmarshalExtension + errUnmarshalReceiver + errUnmarshalProcessor + errUnmarshalExporter + errUnmarshalService ) type configError struct { - // Human readable error message. - msg string + // the original error. + error - // Internal error code. + // internal error code. code configErrorCode } -func (e *configError) Error() string { - return e.msg -} - // YAML top-level configuration keys. const ( // extensionsKeyName is the configuration key name for extensions section. @@ -72,13 +72,7 @@ type configSettings struct { Processors map[config.ComponentID]map[string]interface{} `mapstructure:"processors"` Exporters map[config.ComponentID]map[string]interface{} `mapstructure:"exporters"` Extensions map[config.ComponentID]map[string]interface{} `mapstructure:"extensions"` - Service serviceSettings `mapstructure:"service"` -} - -type serviceSettings struct { - Telemetry config.ServiceTelemetry `mapstructure:"telemetry"` - Extensions []config.ComponentID `mapstructure:"extensions"` - Pipelines map[config.ComponentID]*config.Pipeline `mapstructure:"pipelines"` + Service map[string]interface{} `mapstructure:"service"` } type defaultUnmarshaler struct{} @@ -97,76 +91,63 @@ func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factorie // Unmarshal the config. // Struct to validate top level sections. - rawCfg := configSettings{ - // Setup default telemetry values as in service/logger.go. - // TODO: Add a component.ServiceFactory to allow this to be defined by the Service. - Service: serviceSettings{ - Telemetry: config.ServiceTelemetry{ - Logs: config.ServiceTelemetryLogs{ - Level: zapcore.InfoLevel, - Development: false, - Encoding: "console", - }, - }, - }, - } + rawCfg := configSettings{} if err := v.UnmarshalExact(&rawCfg); err != nil { return nil, &configError{ - code: errUnmarshalTopLevelStructureError, - msg: fmt.Sprintf("error reading top level configuration sections: %s", err.Error()), + error: fmt.Errorf("error reading top level configuration sections: %w", err), + code: errUnmarshalTopLevelStructure, } } // Start with the service extensions. - - extensions, err := unmarshalExtensions(rawCfg.Extensions, factories.Extensions) - if err != nil { - return nil, err + var err error + if cfg.Extensions, err = unmarshalExtensions(rawCfg.Extensions, factories.Extensions); err != nil { + return nil, &configError{ + error: err, + code: errUnmarshalExtension, + } } - cfg.Extensions = extensions // Unmarshal data components (receivers, exporters, and processors). - receivers, err := unmarshalReceivers(rawCfg.Receivers, factories.Receivers) - if err != nil { - return nil, err + if cfg.Receivers, err = unmarshalReceivers(rawCfg.Receivers, factories.Receivers); err != nil { + return nil, &configError{ + error: err, + code: errUnmarshalReceiver, + } } - cfg.Receivers = receivers - exporters, err := unmarshalExporters(rawCfg.Exporters, factories.Exporters) - if err != nil { - return nil, err + if cfg.Processors, err = unmarshalProcessors(rawCfg.Processors, factories.Processors); err != nil { + return nil, &configError{ + error: err, + code: errUnmarshalProcessor, + } } - cfg.Exporters = exporters - processors, err := unmarshalProcessors(rawCfg.Processors, factories.Processors) - if err != nil { - return nil, err + if cfg.Exporters, err = unmarshalExporters(rawCfg.Exporters, factories.Exporters); err != nil { + return nil, &configError{ + error: err, + code: errUnmarshalExporter, + } } - cfg.Processors = processors // Unmarshal the service and its data pipelines. - service, err := unmarshalService(rawCfg.Service) - if err != nil { - return nil, err + if cfg.Service, err = unmarshalService(rawCfg.Service); err != nil { + return nil, &configError{ + error: err, + code: errUnmarshalService, + } } - cfg.Service = service return &cfg, nil } func errorUnknownType(component string, id config.ComponentID) error { - return &configError{ - code: errUnknownType, - msg: fmt.Sprintf("unknown %s type %q for %v", component, id.Type(), id), - } + return fmt.Errorf("unknown %s type %q for %v", component, id.Type(), id) } func errorUnmarshalError(component string, id config.ComponentID, err error) error { - return &configError{ - code: errUnmarshalTopLevelStructureError, - msg: fmt.Sprintf("error reading %s configuration for %v: %v", component, id, err), - } + return fmt.Errorf("error reading %s configuration for %v: %w", component, id, err) } func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExtensionFactory) (config.Extensions, error) { @@ -200,18 +181,35 @@ func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, fac return extensions, nil } -func unmarshalService(rawService serviceSettings) (config.Service, error) { - var ret config.Service - - ret.Telemetry = rawService.Telemetry - ret.Extensions = rawService.Extensions +func unmarshalService(srvRaw map[string]interface{}) (config.Service, error) { + // Setup default telemetry values as in service/logger.go. + // TODO: Add a component.ServiceFactory to allow this to be defined by the Service. + srv := config.Service{ + Telemetry: config.ServiceTelemetry{ + Logs: config.ServiceTelemetryLogs{ + Level: zapcore.InfoLevel, + Development: false, + Encoding: "console", + }, + }, + } - // Process the pipelines first so in case of error on them it can be properly - // reported. - pipelines, err := unmarshalPipelines(rawService.Pipelines) - ret.Pipelines = pipelines + if err := unmarshal(config.NewMapFromStringMap(srvRaw), &srv); err != nil { + return srv, fmt.Errorf("error reading service configuration for: %w", err) + } - return ret, err + for id, pipeline := range srv.Pipelines { + pipeline.Name = id.String() + pipeline.InputType = config.DataType(id.Type()) + switch pipeline.InputType { + case config.TracesDataType: + case config.MetricsDataType: + case config.LogsDataType: + default: + return srv, fmt.Errorf("unknown %s datatype %q for %v", pipelinesKeyName, id.Type(), id) + } + } + return srv, nil } // LoadReceiver loads a receiver config from componentConfig using the provided factories. @@ -319,23 +317,6 @@ func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, fa return processors, nil } -func unmarshalPipelines(pipelines map[config.ComponentID]*config.Pipeline) (config.Pipelines, error) { - // Iterate over input map and create a config for each. - for id, pipeline := range pipelines { - pipeline.Name = id.String() - pipeline.InputType = config.DataType(id.Type()) - switch pipeline.InputType { - case config.TracesDataType: - case config.MetricsDataType: - case config.LogsDataType: - default: - return nil, errorUnknownType(pipelinesKeyName, id) - } - } - - return pipelines, 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{}) { diff --git a/config/configunmarshaler/defaultunmarshaler_test.go b/config/configunmarshaler/defaultunmarshaler_test.go index 20ccf5dd035..219f8659acb 100644 --- a/config/configunmarshaler/defaultunmarshaler_test.go +++ b/config/configunmarshaler/defaultunmarshaler_test.go @@ -126,47 +126,47 @@ func TestDecodeConfig_Invalid(t *testing.T) { expected configErrorCode // expected error (if nil any error is acceptable) expectedMessage string // string that the error must contain }{ - {name: "invalid-extension-type", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-receiver-type", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-exporter-type", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-processor-type", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-pipeline-type", expected: errUnmarshalTopLevelStructureError}, - - {name: "invalid-extension-name-after-slash", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-receiver-name-after-slash", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-exporter-name-after-slash", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-processor-name-after-slash", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-pipeline-name-after-slash", expected: errUnmarshalTopLevelStructureError}, - - {name: "unknown-extension-type", expected: errUnknownType, expectedMessage: "extensions"}, - {name: "unknown-receiver-type", expected: errUnknownType, expectedMessage: "receivers"}, - {name: "unknown-exporter-type", expected: errUnknownType, expectedMessage: "exporters"}, - {name: "unknown-processor-type", expected: errUnknownType, expectedMessage: "processors"}, - {name: "unknown-pipeline-type", expected: errUnknownType, expectedMessage: "pipelines"}, - - {name: "duplicate-extension", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, - {name: "duplicate-receiver", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, - {name: "duplicate-exporter", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, - {name: "duplicate-processor", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, - {name: "duplicate-pipeline", expected: errUnmarshalTopLevelStructureError, expectedMessage: "duplicate name"}, - - {name: "invalid-top-level-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "top level"}, - {name: "invalid-extension-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "extensions"}, - {name: "invalid-receiver-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "receivers"}, - {name: "invalid-processor-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "processors"}, - {name: "invalid-exporter-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "exporters"}, - {name: "invalid-service-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "service"}, - {name: "invalid-service-extensions-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "service"}, - {name: "invalid-pipeline-section", expected: errUnmarshalTopLevelStructureError, expectedMessage: "pipelines"}, - {name: "invalid-sequence-value", expected: errUnmarshalTopLevelStructureError, expectedMessage: "pipelines"}, - - {name: "invalid-extension-sub-config", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-exporter-sub-config", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-processor-sub-config", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-receiver-sub-config", expected: errUnmarshalTopLevelStructureError}, - {name: "invalid-pipeline-sub-config", expected: errUnmarshalTopLevelStructureError}, - - {name: "invalid-logs-level", expected: errUnmarshalTopLevelStructureError}, + {name: "invalid-extension-type", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-receiver-type", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-processor-type", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-exporter-type", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-pipeline-type", expected: errUnmarshalService}, + + {name: "invalid-extension-name-after-slash", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-receiver-name-after-slash", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-processor-name-after-slash", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-exporter-name-after-slash", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-pipeline-name-after-slash", expected: errUnmarshalService}, + + {name: "unknown-extension-type", expected: errUnmarshalExtension, expectedMessage: "extensions"}, + {name: "unknown-receiver-type", expected: errUnmarshalReceiver, expectedMessage: "receivers"}, + {name: "unknown-processor-type", expected: errUnmarshalProcessor, expectedMessage: "processors"}, + {name: "unknown-exporter-type", expected: errUnmarshalExporter, expectedMessage: "exporters"}, + {name: "unknown-pipeline-type", expected: errUnmarshalService, expectedMessage: "pipelines"}, + + {name: "duplicate-extension", expected: errUnmarshalTopLevelStructure, expectedMessage: "duplicate name"}, + {name: "duplicate-receiver", expected: errUnmarshalTopLevelStructure, expectedMessage: "duplicate name"}, + {name: "duplicate-processor", expected: errUnmarshalTopLevelStructure, expectedMessage: "duplicate name"}, + {name: "duplicate-exporter", expected: errUnmarshalTopLevelStructure, expectedMessage: "duplicate name"}, + {name: "duplicate-pipeline", expected: errUnmarshalService, expectedMessage: "duplicate name"}, + + {name: "invalid-top-level-section", expected: errUnmarshalTopLevelStructure, expectedMessage: "top level"}, + {name: "invalid-extension-section", expected: errUnmarshalExtension, expectedMessage: "extensions"}, + {name: "invalid-receiver-section", expected: errUnmarshalReceiver, expectedMessage: "receivers"}, + {name: "invalid-processor-section", expected: errUnmarshalProcessor, expectedMessage: "processors"}, + {name: "invalid-exporter-section", expected: errUnmarshalExporter, expectedMessage: "exporters"}, + {name: "invalid-service-section", expected: errUnmarshalService}, + {name: "invalid-service-extensions-section", expected: errUnmarshalService}, + {name: "invalid-pipeline-section", expected: errUnmarshalService, expectedMessage: "pipelines"}, + {name: "invalid-sequence-value", expected: errUnmarshalService, expectedMessage: "pipelines"}, + + {name: "invalid-extension-sub-config", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-receiver-sub-config", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-processor-sub-config", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-exporter-sub-config", expected: errUnmarshalTopLevelStructure}, + {name: "invalid-pipeline-sub-config", expected: errUnmarshalService}, + + {name: "invalid-logs-level", expected: errUnmarshalService}, } factories, err := testcomponents.ExampleComponents() diff --git a/config/service.go b/config/service.go new file mode 100644 index 00000000000..9d149baedab --- /dev/null +++ b/config/service.go @@ -0,0 +1,93 @@ +// 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 config // import "go.opentelemetry.io/collector/config" + +import ( + "fmt" + + "go.uber.org/zap/zapcore" +) + +// Service defines the configurable components of the service. +type Service struct { + // Telemetry is the configuration for collector's own telemetry. + Telemetry ServiceTelemetry `mapstructure:"telemetry"` + + // Extensions are the ordered list of extensions configured for the service. + Extensions []ComponentID `mapstructure:"extensions"` + + // Pipelines are the set of data pipelines configured for the service. + Pipelines Pipelines `mapstructure:"pipelines"` +} + +// ServiceTelemetry defines the configurable settings for service telemetry. +type ServiceTelemetry struct { + Logs ServiceTelemetryLogs `mapstructure:"logs"` +} + +func (srvT *ServiceTelemetry) validate() error { + return srvT.Logs.validate() +} + +// ServiceTelemetryLogs defines the configurable settings for service telemetry logs. +// This MUST be compatible with zap.Config. Cannot use directly zap.Config because +// the collector uses mapstructure and not yaml tags. +type ServiceTelemetryLogs struct { + // Level is the minimum enabled logging level. + Level zapcore.Level `mapstructure:"level"` + + // Development puts the logger in development mode, which changes the + // behavior of DPanicLevel and takes stacktraces more liberally. + Development bool `mapstructure:"development"` + + // Encoding sets the logger's encoding. + // Valid values are "json" and "console". + Encoding string `mapstructure:"encoding"` +} + +func (srvTL *ServiceTelemetryLogs) validate() error { + if srvTL.Encoding != "json" && srvTL.Encoding != "console" { + return fmt.Errorf(`service telemetry logs invalid encoding: %q, valid values are "json" and "console"`, srvTL.Encoding) + } + return nil +} + +// DataType is the data type that is supported for collection. We currently support +// collecting metrics, traces and logs, this can expand in the future. +type DataType string + +// Currently supported data types. Add new data types here when new types are supported in the future. +const ( + // TracesDataType is the data type tag for traces. + TracesDataType DataType = "traces" + + // MetricsDataType is the data type tag for metrics. + MetricsDataType DataType = "metrics" + + // LogsDataType is the data type tag for logs. + LogsDataType DataType = "logs" +) + +// Pipeline defines a single pipeline. +type Pipeline struct { + Name string + InputType DataType + Receivers []ComponentID `mapstructure:"receivers"` + Processors []ComponentID `mapstructure:"processors"` + Exporters []ComponentID `mapstructure:"exporters"` +} + +// Pipelines is a map of names to Pipelines. +type Pipelines map[ComponentID]*Pipeline From d3e1f126eea22b2fd33631e4197bca48ac41e334 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 2 Nov 2021 17:18:05 +0100 Subject: [PATCH 125/149] [component] Embed nil ProcessorFactory (#4336) --- component/processor_test.go | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/component/processor_test.go b/component/processor_test.go index f11e2ab38b9..e46825cd1de 100644 --- a/component/processor_test.go +++ b/component/processor_test.go @@ -15,21 +15,17 @@ package component import ( - "context" "testing" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/internal/internalinterface" ) var _ ProcessorFactory = (*TestProcessorFactory)(nil) type TestProcessorFactory struct { - internalinterface.BaseInternal + ProcessorFactory name string } @@ -38,26 +34,6 @@ func (f *TestProcessorFactory) Type() config.Type { return config.Type(f.name) } -// CreateDefaultConfig creates the default configuration for the Processor. -func (f *TestProcessorFactory) CreateDefaultConfig() config.Processor { - return nil -} - -// CreateTracesProcessor default implemented as not supported data type. -func (f *TestProcessorFactory) CreateTracesProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Traces) (TracesProcessor, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateMetricsProcessor default implemented as not supported data type. -func (f *TestProcessorFactory) CreateMetricsProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Metrics) (MetricsProcessor, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateLogsProcessor default implemented as not supported data type. -func (f *TestProcessorFactory) CreateLogsProcessor(context.Context, ProcessorCreateSettings, config.Processor, consumer.Logs) (LogsProcessor, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - func TestMakeProcessorFactoryMap(t *testing.T) { type testCase struct { in []ProcessorFactory From c32554a0e6057aef856ee5ea7034a820d83a1e34 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 09:32:43 -0700 Subject: [PATCH 126/149] Remove config.Pipeline.Name, already in the Piplines map key (#4326) Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 1 + config/config.go | 12 +++---- config/config_test.go | 1 - config/configtest/configtest_test.go | 1 - .../configunmarshaler/defaultunmarshaler.go | 1 - .../defaultunmarshaler_test.go | 1 - config/service.go | 1 - service/internal/builder/exporters_builder.go | 23 +++++------- .../builder/exporters_builder_test.go | 2 -- service/internal/builder/pipelines_builder.go | 35 ++++++++++--------- .../builder/pipelines_builder_test.go | 5 ++- service/internal/builder/receivers_builder.go | 7 ++-- service/zpages.go | 10 +++--- 13 files changed, 45 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9fd591437a..aab67c6ce39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Remove `component.BaseProcessorFactory`, use `processorhelper.NewFactory` instead (#4175) - Move `service/parserprovider` package to `config/configmapprovider` (#4206) +- Remove `config.Pipeline.Name` (#4326) ## v0.38.0 Beta diff --git a/config/config.go b/config/config.go index 755c84917b4..5574968a99b 100644 --- a/config/config.go +++ b/config/config.go @@ -106,17 +106,17 @@ func (cfg *Config) validateService() error { // Check that all pipelines have at least one receiver and one exporter, and they reference // only configured components. - for _, pipeline := range cfg.Service.Pipelines { + for pipelineID, pipeline := range cfg.Service.Pipelines { // Validate pipeline has at least one receiver. if len(pipeline.Receivers) == 0 { - return fmt.Errorf("pipeline %q must have at least one receiver", pipeline.Name) + return fmt.Errorf("pipeline %q must have at least one receiver", pipelineID) } // Validate pipeline receiver name references. for _, ref := range pipeline.Receivers { // Check that the name referenced in the pipeline's receivers exists in the top-level receivers. if cfg.Receivers[ref] == nil { - return fmt.Errorf("pipeline %q references receiver %q which does not exist", pipeline.Name, ref) + return fmt.Errorf("pipeline %q references receiver %q which does not exist", pipelineID, ref) } } @@ -124,20 +124,20 @@ func (cfg *Config) validateService() error { for _, ref := range pipeline.Processors { // Check that the name referenced in the pipeline's processors exists in the top-level processors. if cfg.Processors[ref] == nil { - return fmt.Errorf("pipeline %q references processor %q which does not exist", pipeline.Name, ref) + return fmt.Errorf("pipeline %q references processor %q which does not exist", pipelineID, ref) } } // Validate pipeline has at least one exporter. if len(pipeline.Exporters) == 0 { - return fmt.Errorf("pipeline %q must have at least one exporter", pipeline.Name) + return fmt.Errorf("pipeline %q must have at least one exporter", pipelineID) } // Validate pipeline exporter name references. for _, ref := range pipeline.Exporters { // Check that the name referenced in the pipeline's Exporters exists in the top-level Exporters. if cfg.Exporters[ref] == nil { - return fmt.Errorf("pipeline %q references exporter %q which does not exist", pipeline.Name, ref) + return fmt.Errorf("pipeline %q references exporter %q which does not exist", pipelineID, ref) } } } diff --git a/config/config_test.go b/config/config_test.go index c3768b773a6..90240e71df7 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -259,7 +259,6 @@ func generateConfig() *Config { Extensions: []ComponentID{NewComponentID("nop")}, Pipelines: map[ComponentID]*Pipeline{ NewComponentID("traces"): { - Name: "traces", InputType: TracesDataType, Receivers: []ComponentID{NewComponentID("nop")}, Processors: []ComponentID{NewComponentID("nop")}, diff --git a/config/configtest/configtest_test.go b/config/configtest/configtest_test.go index acef16e3916..e672b1c950b 100644 --- a/config/configtest/configtest_test.go +++ b/config/configtest/configtest_test.go @@ -59,7 +59,6 @@ func TestLoadConfig(t *testing.T) { require.Len(t, cfg.Service.Pipelines, 1) assert.Equal(t, &config.Pipeline{ - Name: "traces", InputType: config.TracesDataType, Receivers: []config.ComponentID{config.NewComponentID("nop")}, Processors: []config.ComponentID{config.NewComponentID("nop")}, diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index 967208b6973..719af4445b9 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -199,7 +199,6 @@ func unmarshalService(srvRaw map[string]interface{}) (config.Service, error) { } for id, pipeline := range srv.Pipelines { - pipeline.Name = id.String() pipeline.InputType = config.DataType(id.Type()) switch pipeline.InputType { case config.TracesDataType: diff --git a/config/configunmarshaler/defaultunmarshaler_test.go b/config/configunmarshaler/defaultunmarshaler_test.go index 219f8659acb..5cedda9c8bc 100644 --- a/config/configunmarshaler/defaultunmarshaler_test.go +++ b/config/configunmarshaler/defaultunmarshaler_test.go @@ -109,7 +109,6 @@ func TestDecodeConfig(t *testing.T) { assert.Equal(t, &config.Pipeline{ - Name: "traces", InputType: config.TracesDataType, Receivers: []config.ComponentID{config.NewComponentID("examplereceiver")}, Processors: []config.ComponentID{config.NewComponentID("exampleprocessor")}, diff --git a/config/service.go b/config/service.go index 9d149baedab..6cf4098ac32 100644 --- a/config/service.go +++ b/config/service.go @@ -82,7 +82,6 @@ const ( // Pipeline defines a single pipeline. type Pipeline struct { - Name string InputType DataType Receivers []ComponentID `mapstructure:"receivers"` Processors []ComponentID `mapstructure:"processors"` diff --git a/service/internal/builder/exporters_builder.go b/service/internal/builder/exporters_builder.go index a1391338560..27fb081b1b4 100644 --- a/service/internal/builder/exporters_builder.go +++ b/service/internal/builder/exporters_builder.go @@ -123,13 +123,8 @@ func (exps Exporters) ToMapByDataType() map[config.DataType]map[config.Component return exportersMap } -type dataTypeRequirement struct { - // Pipeline that requires the data type. - requiredBy *config.Pipeline -} - -// Map of data type requirements. -type dataTypeRequirements map[config.DataType]dataTypeRequirement +// Map of config.DataType to the id of the Pipeline that requires the data type. +type dataTypeRequirements map[config.DataType]config.ComponentID // Data type requirements for all exporters. type exportersRequiredDataTypes map[config.ComponentID]dataTypeRequirements @@ -189,7 +184,7 @@ func calcExportersRequiredDataTypes(cfg *config.Config) exportersRequiredDataTyp result := make(exportersRequiredDataTypes) // Iterate over pipelines. - for _, pipeline := range cfg.Service.Pipelines { + for pipelineID, pipeline := range cfg.Service.Pipelines { // Iterate over all exporters for this pipeline. for _, expID := range pipeline.Exporters { // Create the data type requirement for the expCfg if it does not exist. @@ -199,7 +194,7 @@ func calcExportersRequiredDataTypes(cfg *config.Config) exportersRequiredDataTyp // Remember that this data type is required for the expCfg and also which // pipeline the requirement is coming from. - result[expID][pipeline.InputType] = dataTypeRequirement{pipeline} + result[expID][pipeline.InputType] = pipelineID } } return result @@ -224,7 +219,7 @@ func buildExporter( var err error var createdExporter component.Exporter - for dataType, requirement := range inputDataTypes { + for dataType, pipelineID := range inputDataTypes { switch dataType { case config.TracesDataType: createdExporter, err = factory.CreateTracesExporter(ctx, set, cfg) @@ -237,13 +232,13 @@ func buildExporter( default: // Could not create because this exporter does not support this data type. - return nil, exporterTypeMismatchErr(cfg, requirement.requiredBy, dataType) + return nil, exporterTypeMismatchErr(cfg, pipelineID, dataType) } if err != nil { if err == componenterror.ErrDataTypeIsNotSupported { // Could not create because this exporter does not support this data type. - return nil, exporterTypeMismatchErr(cfg, requirement.requiredBy, dataType) + return nil, exporterTypeMismatchErr(cfg, pipelineID, dataType) } return nil, fmt.Errorf("error creating %v exporter: %w", cfg.ID(), err) } @@ -263,11 +258,11 @@ func buildExporter( func exporterTypeMismatchErr( config config.Exporter, - requiredByPipeline *config.Pipeline, + pipelineID config.ComponentID, dataType config.DataType, ) error { return fmt.Errorf( "pipeline %q of data type %q has an exporter %v, which does not support that data type", - requiredByPipeline.Name, dataType, config.ID(), + pipelineID, dataType, config.ID(), ) } diff --git a/service/internal/builder/exporters_builder_test.go b/service/internal/builder/exporters_builder_test.go index 092317798a7..56496691cd9 100644 --- a/service/internal/builder/exporters_builder_test.go +++ b/service/internal/builder/exporters_builder_test.go @@ -51,7 +51,6 @@ func TestBuildExporters(t *testing.T) { Service: config.Service{ Pipelines: map[config.ComponentID]*config.Pipeline{ config.NewComponentID("traces"): { - Name: "traces", InputType: config.TracesDataType, Exporters: []config.ComponentID{config.NewComponentID("otlp")}, }, @@ -117,7 +116,6 @@ func TestBuildExporters_BuildLogs(t *testing.T) { Service: config.Service{ Pipelines: map[config.ComponentID]*config.Pipeline{ config.NewComponentID("logs"): { - Name: "logs", InputType: config.LogsDataType, Exporters: []config.ComponentID{config.NewComponentID("exampleexporter")}, }, diff --git a/service/internal/builder/pipelines_builder.go b/service/internal/builder/pipelines_builder.go index c13275ca20e..fd10bde2203 100644 --- a/service/internal/builder/pipelines_builder.go +++ b/service/internal/builder/pipelines_builder.go @@ -37,6 +37,8 @@ type builtPipeline struct { firstMC consumer.Metrics firstLC consumer.Logs + // Config is the configuration of this Pipeline. + Config *config.Pipeline // MutatesData is set to true if any processors in the pipeline // can mutate the TraceData or MetricsData input argument. MutatesData bool @@ -45,7 +47,7 @@ type builtPipeline struct { } // BuiltPipelines is a map of build pipelines created from pipeline configs. -type BuiltPipelines map[*config.Pipeline]*builtPipeline +type BuiltPipelines map[config.ComponentID]*builtPipeline func (bps BuiltPipelines) StartProcessors(ctx context.Context, host component.Host) error { for _, bp := range bps { @@ -99,12 +101,12 @@ func BuildPipelines( pb := &pipelinesBuilder{settings, buildInfo, config, exporters, factories} pipelineProcessors := make(BuiltPipelines) - for _, pipeline := range pb.config.Service.Pipelines { - firstProcessor, err := pb.buildPipeline(context.Background(), pipeline) + for pipelineID, pipeline := range pb.config.Service.Pipelines { + bp, err := pb.buildPipeline(context.Background(), pipelineID, pipeline) if err != nil { return nil, err } - pipelineProcessors[pipeline] = firstProcessor + pipelineProcessors[pipelineID] = bp } return pipelineProcessors, nil @@ -113,7 +115,7 @@ func BuildPipelines( // Builds a pipeline of processors. Returns the first processor in the pipeline. // The last processor in the pipeline will be plugged to fan out the data into exporters // that are configured for this pipeline. -func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineCfg *config.Pipeline) (*builtPipeline, error) { +func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineID config.ComponentID, pipelineCfg *config.Pipeline) (*builtPipeline, error) { // BuildProcessors the pipeline backwards. @@ -174,7 +176,7 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineCfg *conf case config.TracesDataType: var proc component.TracesProcessor if proc, err = factory.CreateTracesProcessor(ctx, set, procCfg, tc); err != nil { - return nil, fmt.Errorf("error creating processor %q in pipeline %q: %w", procID, pipelineCfg.Name, err) + return nil, fmt.Errorf("error creating processor %q in pipeline %q: %w", procID, pipelineID, err) } // Check if the factory really created the processor. if proc == nil { @@ -186,7 +188,7 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineCfg *conf case config.MetricsDataType: var proc component.MetricsProcessor if proc, err = factory.CreateMetricsProcessor(ctx, set, procCfg, mc); err != nil { - return nil, fmt.Errorf("error creating processor %q in pipeline %q: %w", procID, pipelineCfg.Name, err) + return nil, fmt.Errorf("error creating processor %q in pipeline %q: %w", procID, pipelineID, err) } // Check if the factory really created the processor. if proc == nil { @@ -199,7 +201,7 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineCfg *conf case config.LogsDataType: var proc component.LogsProcessor if proc, err = factory.CreateLogsProcessor(ctx, set, procCfg, lc); err != nil { - return nil, fmt.Errorf("error creating processor %q in pipeline %q: %w", procID, pipelineCfg.Name, err) + return nil, fmt.Errorf("error creating processor %q in pipeline %q: %w", procID, pipelineID, err) } // Check if the factory really created the processor. if proc == nil { @@ -211,21 +213,22 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineCfg *conf default: return nil, fmt.Errorf("error creating processor %q in pipeline %q, data type %s is not supported", - procID, pipelineCfg.Name, pipelineCfg.InputType) + procID, pipelineID, pipelineCfg.InputType) } } - pipelineLogger := pb.settings.Logger.With(zap.String("pipeline_name", pipelineCfg.Name), + pipelineLogger := pb.settings.Logger.With(zap.Stringer("pipeline_id", pipelineID), zap.String("pipeline_datatype", string(pipelineCfg.InputType))) pipelineLogger.Info("Pipeline was built.") bp := &builtPipeline{ - pipelineLogger, - tc, - mc, - lc, - mutatesConsumedData, - processors, + logger: pipelineLogger, + firstTC: tc, + firstMC: mc, + firstLC: lc, + Config: pipelineCfg, + MutatesData: mutatesConsumedData, + processors: processors, } return bp, nil diff --git a/service/internal/builder/pipelines_builder_test.go b/service/internal/builder/pipelines_builder_test.go index c8aa97669f5..27d35ad9b41 100644 --- a/service/internal/builder/pipelines_builder_test.go +++ b/service/internal/builder/pipelines_builder_test.go @@ -74,7 +74,6 @@ func createExampleConfig(dataType string) *config.Config { Service: config.Service{ Pipelines: map[config.ComponentID]*config.Pipeline{ config.NewComponentID(config.Type(dataType)): { - Name: dataType, InputType: config.DataType(dataType), Receivers: []config.ComponentID{config.NewComponentID(exampleReceiverFactory.Type())}, Processors: []config.ComponentID{config.NewComponentID(exampleProcessorFactory.Type())}, @@ -127,7 +126,7 @@ func TestBuildPipelines_BuildVarious(t *testing.T) { err = pipelineProcessors.StartProcessors(context.Background(), componenttest.NewNopHost()) assert.NoError(t, err) - processor := pipelineProcessors[cfg.Service.Pipelines[config.NewComponentID(config.Type(dataType))]] + processor := pipelineProcessors[config.NewComponentID(config.Type(dataType))] // Ensure pipeline has its fields correctly populated. require.NotNil(t, processor) @@ -191,7 +190,7 @@ func testPipeline(t *testing.T, pipelineID config.ComponentID, exporterIDs []con assert.NoError(t, pipelineProcessors.StartProcessors(context.Background(), componenttest.NewNopHost())) - processor := pipelineProcessors[cfg.Service.Pipelines[pipelineID]] + processor := pipelineProcessors[pipelineID] // Ensure pipeline has its fields correctly populated. require.NotNil(t, processor) diff --git a/service/internal/builder/receivers_builder.go b/service/internal/builder/receivers_builder.go index e6a1e377462..b94dbf10ae1 100644 --- a/service/internal/builder/receivers_builder.go +++ b/service/internal/builder/receivers_builder.go @@ -139,12 +139,11 @@ func (rb *receiversBuilder) findPipelinesToAttach(receiverID config.ComponentID) pipelinesToAttach := make(attachedPipelines) // Iterate over all pipelines. - for _, pipelineCfg := range rb.config.Service.Pipelines { + for pipelineID, pipelineCfg := range rb.config.Service.Pipelines { // Get the first processor of the pipeline. - pipelineProcessor := rb.builtPipelines[pipelineCfg] + pipelineProcessor := rb.builtPipelines[pipelineID] if pipelineProcessor == nil { - return nil, fmt.Errorf("cannot find pipeline processor for pipeline %s", - pipelineCfg.Name) + return nil, fmt.Errorf("cannot find pipeline %q", pipelineID) } // Is this receiver attached to the pipeline? diff --git a/service/zpages.go b/service/zpages.go index c9f8a355db3..3b03e20bec9 100644 --- a/service/zpages.go +++ b/service/zpages.go @@ -95,20 +95,20 @@ func (srv *service) getPipelinesSummaryTableData() zpages.SummaryPipelinesTableD for c, p := range srv.builtPipelines { // TODO: Change the template to use ID. var recvs []string - for _, recvID := range c.Receivers { + for _, recvID := range p.Config.Receivers { recvs = append(recvs, recvID.String()) } var procs []string - for _, procID := range c.Processors { + for _, procID := range p.Config.Processors { procs = append(procs, procID.String()) } var exps []string - for _, expID := range c.Exporters { + for _, expID := range p.Config.Exporters { exps = append(exps, expID.String()) } row := zpages.SummaryPipelinesTableRowData{ - FullName: c.Name, - InputType: string(c.InputType), + FullName: c.String(), + InputType: string(p.Config.InputType), MutatesData: p.MutatesData, Receivers: recvs, Processors: procs, From 9cdb1da1c45d8df52086ccf23f5bf03f9258851e Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 2 Nov 2021 09:41:32 -0700 Subject: [PATCH 127/149] [test] fixing flaky TestBatchMetricsProcessor_Timeout (#4339) The batch size was 100 and the number of datapoints being generated was also 100 so at times, the batch processor would be sending the data before the timeout was reached, which is what this particular test is trying to test. To fix this, I'm increasing the batch send size to 101. --- processor/batchprocessor/batch_processor_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processor/batchprocessor/batch_processor_test.go b/processor/batchprocessor/batch_processor_test.go index 1d1dc1dabd3..578baa6178a 100644 --- a/processor/batchprocessor/batch_processor_test.go +++ b/processor/batchprocessor/batch_processor_test.go @@ -395,7 +395,7 @@ func TestBatchMetricsProcessor_Timeout(t *testing.T) { cfg := Config{ ProcessorSettings: config.NewProcessorSettings(config.NewComponentID(typeStr)), Timeout: 100 * time.Millisecond, - SendBatchSize: 100, + SendBatchSize: 101, } requestCount := 5 metricsPerRequest := 10 From 9631ceabb7dc4ca5cc187bab26d8319783bcc562 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Tue, 2 Nov 2021 20:09:32 +0100 Subject: [PATCH 128/149] Make `component.Factory` inherit `internalinterface.InternalInterface` (#4338) * Make `component.Factory` inherit `internalinterface.InternalInterface` * Add changelog entry * Add comment on `component.Factory` --- CHANGELOG.md | 3 ++ component/component.go | 5 ++++ component/componenttest/nop_exporter.go | 5 +++- component/componenttest/nop_extension.go | 5 +++- component/componenttest/nop_receiver.go | 5 +++- component/exporter.go | 3 ++ component/exporter_test.go | 35 +++++------------------ component/extension.go | 3 ++ component/receiver.go | 3 ++ component/receiver_test.go | 36 +++++------------------- exporter/exporterhelper/factory.go | 2 ++ extension/extensionhelper/factory.go | 2 ++ receiver/receiverhelper/factory.go | 2 ++ service/configcheck_test.go | 5 +++- 14 files changed, 53 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aab67c6ce39..c1305f7a9e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ## 🛑 Breaking changes 🛑 - Remove `component.BaseProcessorFactory`, use `processorhelper.NewFactory` instead (#4175) +- Force usage of `exporterhelper.NewFactory` to implement `component.ExporterFactory` (#4338) +- 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) - Remove `config.Pipeline.Name` (#4326) diff --git a/component/component.go b/component/component.go index 39d7a77c443..4678f83f620 100644 --- a/component/component.go +++ b/component/component.go @@ -18,6 +18,7 @@ import ( "context" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/internal/internalinterface" ) // Component is either a receiver, exporter, processor, or an extension. @@ -72,7 +73,11 @@ const ( ) // Factory is implemented by all component factories. +// +// This interface cannot be directly implemented. Implementations must +// use the factory helpers for the appropriate component type. type Factory interface { + internalinterface.InternalInterface // Type gets the type of the component created by this factory. Type() config.Type } diff --git a/component/componenttest/nop_exporter.go b/component/componenttest/nop_exporter.go index 5641e987236..d133342fd68 100644 --- a/component/componenttest/nop_exporter.go +++ b/component/componenttest/nop_exporter.go @@ -21,6 +21,7 @@ import ( "go.opentelemetry.io/collector/component/componenthelper" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/internal/internalinterface" ) // NewNopExporterCreateSettings returns a new nop settings for Create*Exporter functions. @@ -36,7 +37,9 @@ type nopExporterConfig struct { } // nopExporterFactory is factory for nopExporter. -type nopExporterFactory struct{} +type nopExporterFactory struct { + internalinterface.BaseInternal +} var nopExporterFactoryInstance = &nopExporterFactory{} diff --git a/component/componenttest/nop_extension.go b/component/componenttest/nop_extension.go index b3999a9ea99..30c2e20ac6f 100644 --- a/component/componenttest/nop_extension.go +++ b/component/componenttest/nop_extension.go @@ -20,6 +20,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenthelper" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/internal/internalinterface" ) // NewNopExtensionCreateSettings returns a new nop settings for Create*Extension functions. @@ -35,7 +36,9 @@ type nopExtensionConfig struct { } // nopExtensionFactory is factory for nopExtension. -type nopExtensionFactory struct{} +type nopExtensionFactory struct { + internalinterface.BaseInternal +} var nopExtensionFactoryInstance = &nopExtensionFactory{} diff --git a/component/componenttest/nop_receiver.go b/component/componenttest/nop_receiver.go index f8ca0c1f585..15c1be743c3 100644 --- a/component/componenttest/nop_receiver.go +++ b/component/componenttest/nop_receiver.go @@ -21,6 +21,7 @@ import ( "go.opentelemetry.io/collector/component/componenthelper" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/internal/internalinterface" ) // NewNopReceiverCreateSettings returns a new nop settings for Create*Receiver functions. @@ -36,7 +37,9 @@ type nopReceiverConfig struct { } // nopReceiverFactory is factory for nopReceiver. -type nopReceiverFactory struct{} +type nopReceiverFactory struct { + internalinterface.BaseInternal +} var nopReceiverFactoryInstance = &nopReceiverFactory{} diff --git a/component/exporter.go b/component/exporter.go index 13057ccdd03..a753e74692c 100644 --- a/component/exporter.go +++ b/component/exporter.go @@ -54,6 +54,9 @@ type ExporterCreateSettings struct { // ExporterFactory can create MetricsExporter, TracesExporter and // LogsExporter. This is the new preferred factory type to create exporters. +// +// This interface cannot be directly implemented. Implementations must +// use the exporterhelper.NewFactory to implement it. type ExporterFactory interface { Factory diff --git a/component/exporter_test.go b/component/exporter_test.go index 0f5d64c2e1b..4e5a14df88e 100644 --- a/component/exporter_test.go +++ b/component/exporter_test.go @@ -15,16 +15,15 @@ package component import ( - "context" "testing" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" ) type TestExporterFactory struct { + ExporterFactory name string } @@ -33,26 +32,6 @@ func (f *TestExporterFactory) Type() config.Type { return config.Type(f.name) } -// CreateDefaultConfig creates the default configuration for the Exporter. -func (f *TestExporterFactory) CreateDefaultConfig() config.Exporter { - return nil -} - -// CreateTracesExporter creates a trace exporter based on this config. -func (f *TestExporterFactory) CreateTracesExporter(context.Context, ExporterCreateSettings, config.Exporter) (TracesExporter, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateMetricsExporter creates a metrics exporter based on this config. -func (f *TestExporterFactory) CreateMetricsExporter(context.Context, ExporterCreateSettings, config.Exporter) (MetricsExporter, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateLogsExporter creates a logs exporter based on this config. -func (f *TestExporterFactory) CreateLogsExporter(context.Context, ExporterCreateSettings, config.Exporter) (LogsExporter, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - func TestBuildExporters(t *testing.T) { type testCase struct { in []ExporterFactory @@ -62,18 +41,18 @@ func TestBuildExporters(t *testing.T) { testCases := []testCase{ { in: []ExporterFactory{ - &TestExporterFactory{"exp1"}, - &TestExporterFactory{"exp2"}, + &TestExporterFactory{name: "exp1"}, + &TestExporterFactory{name: "exp2"}, }, out: map[config.Type]ExporterFactory{ - "exp1": &TestExporterFactory{"exp1"}, - "exp2": &TestExporterFactory{"exp2"}, + "exp1": &TestExporterFactory{name: "exp1"}, + "exp2": &TestExporterFactory{name: "exp2"}, }, }, { in: []ExporterFactory{ - &TestExporterFactory{"exp1"}, - &TestExporterFactory{"exp1"}, + &TestExporterFactory{name: "exp1"}, + &TestExporterFactory{name: "exp1"}, }, }, } diff --git a/component/extension.go b/component/extension.go index 70215985154..7bd0f8f3046 100644 --- a/component/extension.go +++ b/component/extension.go @@ -53,6 +53,9 @@ type ExtensionCreateSettings struct { } // ExtensionFactory is a factory interface for extensions to the service. +// +// This interface cannot be directly implemented. Implementations must +// use the extensionhelper.NewFactory to implement it. type ExtensionFactory interface { Factory diff --git a/component/receiver.go b/component/receiver.go index 3f5511c4d17..421c0268abe 100644 --- a/component/receiver.go +++ b/component/receiver.go @@ -99,6 +99,9 @@ type ReceiverCreateSettings struct { // ReceiverFactory can create TracesReceiver, MetricsReceiver and // and LogsReceiver. This is the new preferred factory type to create receivers. +// +// This interface cannot be directly implemented. Implementations must +// use the receiverhelper.NewFactory to implement it. type ReceiverFactory interface { Factory diff --git a/component/receiver_test.go b/component/receiver_test.go index 2bd811b569c..bbec820e41c 100644 --- a/component/receiver_test.go +++ b/component/receiver_test.go @@ -15,17 +15,15 @@ package component import ( - "context" "testing" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/consumer" ) type TestReceiverFactory struct { + ReceiverFactory name config.Type } @@ -34,26 +32,6 @@ func (f *TestReceiverFactory) Type() config.Type { return f.name } -// CreateDefaultConfig creates the default configuration for the Receiver. -func (f *TestReceiverFactory) CreateDefaultConfig() config.Receiver { - return nil -} - -// CreateTracesReceiver creates a trace receiver based on this config. -func (f *TestReceiverFactory) CreateTracesReceiver(context.Context, ReceiverCreateSettings, config.Receiver, consumer.Traces) (TracesReceiver, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateMetricsReceiver creates a metrics receiver based on this config. -func (f *TestReceiverFactory) CreateMetricsReceiver(context.Context, ReceiverCreateSettings, config.Receiver, consumer.Metrics) (MetricsReceiver, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - -// CreateMetricsReceiver creates a metrics receiver based on this config. -func (f *TestReceiverFactory) CreateLogsReceiver(context.Context, ReceiverCreateSettings, config.Receiver, consumer.Logs) (LogsReceiver, error) { - return nil, componenterror.ErrDataTypeIsNotSupported -} - func TestBuildReceivers(t *testing.T) { type testCase struct { in []ReceiverFactory @@ -63,18 +41,18 @@ func TestBuildReceivers(t *testing.T) { testCases := []testCase{ { in: []ReceiverFactory{ - &TestReceiverFactory{"e1"}, - &TestReceiverFactory{"e2"}, + &TestReceiverFactory{name: "e1"}, + &TestReceiverFactory{name: "e2"}, }, out: map[config.Type]ReceiverFactory{ - "e1": &TestReceiverFactory{"e1"}, - "e2": &TestReceiverFactory{"e2"}, + "e1": &TestReceiverFactory{name: "e1"}, + "e2": &TestReceiverFactory{name: "e2"}, }, }, { in: []ReceiverFactory{ - &TestReceiverFactory{"e1"}, - &TestReceiverFactory{"e1"}, + &TestReceiverFactory{name: "e1"}, + &TestReceiverFactory{name: "e1"}, }, }, } diff --git a/exporter/exporterhelper/factory.go b/exporter/exporterhelper/factory.go index bb85681eafe..b68166c375e 100644 --- a/exporter/exporterhelper/factory.go +++ b/exporter/exporterhelper/factory.go @@ -20,6 +20,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/internal/internalinterface" ) // FactoryOption apply changes to ExporterOptions. @@ -38,6 +39,7 @@ type CreateMetricsExporter func(context.Context, component.ExporterCreateSetting type CreateLogsExporter func(context.Context, component.ExporterCreateSettings, config.Exporter) (component.LogsExporter, error) type factory struct { + internalinterface.BaseInternal cfgType config.Type createDefaultConfig CreateDefaultConfig createTracesExporter CreateTracesExporter diff --git a/extension/extensionhelper/factory.go b/extension/extensionhelper/factory.go index d184638f7da..d12617f3cea 100644 --- a/extension/extensionhelper/factory.go +++ b/extension/extensionhelper/factory.go @@ -19,6 +19,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/internal/internalinterface" ) // FactoryOption apply changes to ExporterOptions. @@ -31,6 +32,7 @@ type CreateDefaultConfig func() config.Extension type CreateServiceExtension func(context.Context, component.ExtensionCreateSettings, config.Extension) (component.Extension, error) type factory struct { + internalinterface.BaseInternal cfgType config.Type createDefaultConfig CreateDefaultConfig createServiceExtension CreateServiceExtension diff --git a/receiver/receiverhelper/factory.go b/receiver/receiverhelper/factory.go index 94c0f26f1c1..604a804de2d 100644 --- a/receiver/receiverhelper/factory.go +++ b/receiver/receiverhelper/factory.go @@ -21,6 +21,7 @@ import ( "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/internal/internalinterface" ) // FactoryOption apply changes to ReceiverOptions. @@ -60,6 +61,7 @@ type CreateMetricsReceiver func(context.Context, component.ReceiverCreateSetting type CreateLogsReceiver func(context.Context, component.ReceiverCreateSettings, config.Receiver, consumer.Logs) (component.LogsReceiver, error) type factory struct { + internalinterface.BaseInternal cfgType config.Type createDefaultConfig CreateDefaultConfig createTracesReceiver CreateTracesReceiver diff --git a/service/configcheck_test.go b/service/configcheck_test.go index 77ea7b0dc27..e4e5c59ece1 100644 --- a/service/configcheck_test.go +++ b/service/configcheck_test.go @@ -22,6 +22,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/internal/internalinterface" "go.opentelemetry.io/collector/service/defaultcomponents" ) @@ -47,7 +48,9 @@ func TestValidateConfigFromFactories_Failure(t *testing.T) { // badConfigExtensionFactory was created to force error path from factory returning // a config not satisfying the validation. -type badConfigExtensionFactory struct{} +type badConfigExtensionFactory struct { + internalinterface.BaseInternal +} func (b badConfigExtensionFactory) Type() config.Type { return "bad_config" From 6785e6fdd8a1c24eb981117fbb7a216d5d0803c4 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 12:09:47 -0700 Subject: [PATCH 129/149] Fix small nits in the batchprocessor split logic (#4340) Signed-off-by: Bogdan Drutu --- processor/batchprocessor/splitlogs.go | 50 +++++++++---------- processor/batchprocessor/splitmetrics.go | 42 ++++++++-------- processor/batchprocessor/splitmetrics_test.go | 22 ++++---- processor/batchprocessor/splittraces.go | 18 +++---- 4 files changed, 65 insertions(+), 67 deletions(-) diff --git a/processor/batchprocessor/splitlogs.go b/processor/batchprocessor/splitlogs.go index 9bc8bcfc89f..ff60604686b 100644 --- a/processor/batchprocessor/splitlogs.go +++ b/processor/batchprocessor/splitlogs.go @@ -23,62 +23,60 @@ func splitLogs(size int, src pdata.Logs) pdata.Logs { if src.LogRecordCount() <= size { return src } - totalCopiedLogs := 0 + totalCopiedLogRecords := 0 dest := pdata.NewLogs() - src.ResourceLogs().RemoveIf(func(srcRs pdata.ResourceLogs) bool { + src.ResourceLogs().RemoveIf(func(srcRl pdata.ResourceLogs) bool { // If we are done skip everything else. - if totalCopiedLogs == size { + if totalCopiedLogRecords == size { return false } // If it fully fits - srcRsCount := resourceLogsCount(srcRs) - if (totalCopiedLogs + srcRsCount) <= size { - totalCopiedLogs += srcRsCount - srcRs.MoveTo(dest.ResourceLogs().AppendEmpty()) + srcRlLRC := resourceLRC(srcRl) + if (totalCopiedLogRecords + srcRlLRC) <= size { + totalCopiedLogRecords += srcRlLRC + srcRl.MoveTo(dest.ResourceLogs().AppendEmpty()) return true } - destRs := dest.ResourceLogs().AppendEmpty() - srcRs.Resource().CopyTo(destRs.Resource()) - - srcRs.InstrumentationLibraryLogs().RemoveIf(func(srcIlm pdata.InstrumentationLibraryLogs) bool { + destRl := dest.ResourceLogs().AppendEmpty() + srcRl.Resource().CopyTo(destRl.Resource()) + srcRl.InstrumentationLibraryLogs().RemoveIf(func(srcIll pdata.InstrumentationLibraryLogs) bool { // If we are done skip everything else. - if totalCopiedLogs == size { + if totalCopiedLogRecords == size { return false } // If possible to move all metrics do that. - srcLogsLen := srcIlm.Logs().Len() - if size >= srcLogsLen+totalCopiedLogs { - totalCopiedLogs += srcLogsLen - srcIlm.MoveTo(destRs.InstrumentationLibraryLogs().AppendEmpty()) + srcIllLRC := srcIll.Logs().Len() + if size >= srcIllLRC+totalCopiedLogRecords { + totalCopiedLogRecords += srcIllLRC + srcIll.MoveTo(destRl.InstrumentationLibraryLogs().AppendEmpty()) return true } - destIlm := destRs.InstrumentationLibraryLogs().AppendEmpty() - srcIlm.InstrumentationLibrary().CopyTo(destIlm.InstrumentationLibrary()) - - srcIlm.Logs().RemoveIf(func(srcMetric pdata.LogRecord) bool { + destIll := destRl.InstrumentationLibraryLogs().AppendEmpty() + srcIll.InstrumentationLibrary().CopyTo(destIll.InstrumentationLibrary()) + srcIll.Logs().RemoveIf(func(srcMetric pdata.LogRecord) bool { // If we are done skip everything else. - if totalCopiedLogs == size { + if totalCopiedLogRecords == size { return false } - srcMetric.MoveTo(destIlm.Logs().AppendEmpty()) - totalCopiedLogs++ + srcMetric.MoveTo(destIll.Logs().AppendEmpty()) + totalCopiedLogRecords++ return true }) return false }) - return srcRs.InstrumentationLibraryLogs().Len() == 0 + return srcRl.InstrumentationLibraryLogs().Len() == 0 }) return dest } -// resourceLogsCount calculates the total number of logs. -func resourceLogsCount(rs pdata.ResourceLogs) (count int) { +// resourceLRC calculates the total number of log records in the pdata.ResourceLogs. +func resourceLRC(rs pdata.ResourceLogs) (count int) { for k := 0; k < rs.InstrumentationLibraryLogs().Len(); k++ { count += rs.InstrumentationLibraryLogs().At(k).Logs().Len() } diff --git a/processor/batchprocessor/splitmetrics.go b/processor/batchprocessor/splitmetrics.go index a92461f491f..5f87ca47751 100644 --- a/processor/batchprocessor/splitmetrics.go +++ b/processor/batchprocessor/splitmetrics.go @@ -34,7 +34,7 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { } // If it fully fits - srcRsDataPointCount := resourceMetricsDataPointCount(srcRs) + srcRsDataPointCount := resourceMetricsDPC(srcRs) if (totalCopiedDataPoints + srcRsDataPointCount) <= size { totalCopiedDataPoints += srcRsDataPointCount srcRs.MoveTo(dest.ResourceMetrics().AppendEmpty()) @@ -43,7 +43,6 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { destRs := dest.ResourceMetrics().AppendEmpty() srcRs.Resource().CopyTo(destRs.Resource()) - srcRs.InstrumentationLibraryMetrics().RemoveIf(func(srcIlm pdata.InstrumentationLibraryMetrics) bool { // If we are done skip everything else. if totalCopiedDataPoints == size { @@ -51,21 +50,29 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { } // If possible to move all metrics do that. - srcDataPointCount := metricSliceDataPointCount(srcIlm.Metrics()) - if size-totalCopiedDataPoints >= srcDataPointCount { - totalCopiedDataPoints += srcDataPointCount + srcIlmDataPointCount := instrumentationLibraryMetricsDPC(srcIlm) + if srcIlmDataPointCount+totalCopiedDataPoints <= size { + totalCopiedDataPoints += srcIlmDataPointCount srcIlm.MoveTo(destRs.InstrumentationLibraryMetrics().AppendEmpty()) return true } destIlm := destRs.InstrumentationLibraryMetrics().AppendEmpty() srcIlm.InstrumentationLibrary().CopyTo(destIlm.InstrumentationLibrary()) - srcIlm.Metrics().RemoveIf(func(srcMetric pdata.Metric) bool { // If we are done skip everything else. if totalCopiedDataPoints == size { return false } + + // If possible to move all points do that. + srcMetricDataPointCount := metricDPC(srcMetric) + if srcMetricDataPointCount+totalCopiedDataPoints <= size { + totalCopiedDataPoints += srcMetricDataPointCount + srcMetric.MoveTo(destIlm.Metrics().AppendEmpty()) + return true + } + // If the metric has more data points than free slots we should split it. copiedDataPoints, remove := splitMetric(srcMetric, destIlm.Metrics().AppendEmpty(), size-totalCopiedDataPoints) totalCopiedDataPoints += copiedDataPoints @@ -79,27 +86,28 @@ func splitMetrics(size int, src pdata.Metrics) pdata.Metrics { return dest } -// resourceMetricsDataPointCount calculates the total number of data points. -func resourceMetricsDataPointCount(rs pdata.ResourceMetrics) int { +// resourceMetricsDPC calculates the total number of data points in the pdata.ResourceMetrics. +func resourceMetricsDPC(rs pdata.ResourceMetrics) int { dataPointCount := 0 ilms := rs.InstrumentationLibraryMetrics() for k := 0; k < ilms.Len(); k++ { - dataPointCount += metricSliceDataPointCount(ilms.At(k).Metrics()) + dataPointCount += instrumentationLibraryMetricsDPC(ilms.At(k)) } return dataPointCount } -// metricSliceDataPointCount calculates the total number of data points. -func metricSliceDataPointCount(ms pdata.MetricSlice) int { +// instrumentationLibraryMetricsDPC calculates the total number of data points in the pdata.InstrumentationLibraryMetrics. +func instrumentationLibraryMetricsDPC(ilm pdata.InstrumentationLibraryMetrics) int { dataPointCount := 0 + ms := ilm.Metrics() for k := 0; k < ms.Len(); k++ { - dataPointCount += metricDataPointCount(ms.At(k)) + dataPointCount += metricDPC(ms.At(k)) } return dataPointCount } -// metricDataPointCount calculates the total number of data points. -func metricDataPointCount(ms pdata.Metric) int { +// metricDPC calculates the total number of data points in the pdata.Metric. +func metricDPC(ms pdata.Metric) int { switch ms.DataType() { case pdata.MetricDataTypeGauge: return ms.Gauge().DataPoints().Len() @@ -116,12 +124,6 @@ func metricDataPointCount(ms pdata.Metric) int { // splitMetric removes metric points from the input data and moves data of the specified size to destination. // Returns size of moved data and boolean describing, whether the metric should be removed from original slice. func splitMetric(ms, dest pdata.Metric, size int) (int, bool) { - mdDPC := metricDataPointCount(ms) - if mdDPC <= size { - ms.MoveTo(dest) - return mdDPC, true - } - dest.SetDataType(ms.DataType()) dest.SetName(ms.Name()) dest.SetDescription(ms.Description()) diff --git a/processor/batchprocessor/splitmetrics_test.go b/processor/batchprocessor/splitmetrics_test.go index 3218e707ed7..ca10f5370df 100644 --- a/processor/batchprocessor/splitmetrics_test.go +++ b/processor/batchprocessor/splitmetrics_test.go @@ -40,10 +40,10 @@ func TestSplitMetrics_noop(t *testing.T) { func TestSplitMetrics(t *testing.T) { md := testdata.GenerateMetricsManyMetricsSameResource(20) metrics := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() - dataPointCount := metricDataPointCount(metrics.At(0)) + dataPointCount := metricDPC(metrics.At(0)) for i := 0; i < metrics.Len(); i++ { metrics.At(i).SetName(getTestMetricName(0, i)) - assert.Equal(t, dataPointCount, metricDataPointCount(metrics.At(i))) + assert.Equal(t, dataPointCount, metricDPC(metrics.At(i))) } cp := pdata.NewMetrics() cpMetrics := cp.ResourceMetrics().AppendEmpty().InstrumentationLibraryMetrics().AppendEmpty().Metrics() @@ -86,10 +86,10 @@ func TestSplitMetrics(t *testing.T) { func TestSplitMetricsMultipleResourceSpans(t *testing.T) { md := testdata.GenerateMetricsManyMetricsSameResource(20) metrics := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() - dataPointCount := metricDataPointCount(metrics.At(0)) + dataPointCount := metricDPC(metrics.At(0)) for i := 0; i < metrics.Len(); i++ { metrics.At(i).SetName(getTestMetricName(0, i)) - assert.Equal(t, dataPointCount, metricDataPointCount(metrics.At(i))) + assert.Equal(t, dataPointCount, metricDPC(metrics.At(i))) } // add second index to resource metrics testdata.GenerateMetricsManyMetricsSameResource(20). @@ -111,10 +111,10 @@ func TestSplitMetricsMultipleResourceSpans(t *testing.T) { func TestSplitMetricsMultipleResourceSpans_SplitSizeGreaterThanMetricSize(t *testing.T) { td := testdata.GenerateMetricsManyMetricsSameResource(20) metrics := td.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() - dataPointCount := metricDataPointCount(metrics.At(0)) + dataPointCount := metricDPC(metrics.At(0)) for i := 0; i < metrics.Len(); i++ { metrics.At(i).SetName(getTestMetricName(0, i)) - assert.Equal(t, dataPointCount, metricDataPointCount(metrics.At(i))) + assert.Equal(t, dataPointCount, metricDPC(metrics.At(i))) } // add second index to resource metrics testdata.GenerateMetricsManyMetricsSameResource(20). @@ -142,7 +142,7 @@ func TestSplitMetricsUneven(t *testing.T) { dataPointCount := 2 for i := 0; i < metrics.Len(); i++ { metrics.At(i).SetName(getTestMetricName(0, i)) - assert.Equal(t, dataPointCount, metricDataPointCount(metrics.At(i))) + assert.Equal(t, dataPointCount, metricDPC(metrics.At(i))) } splitSize := 9 @@ -169,7 +169,7 @@ func TestSplitMetricsBatchSizeSmallerThanDataPointCount(t *testing.T) { dataPointCount := 2 for i := 0; i < metrics.Len(); i++ { metrics.At(i).SetName(getTestMetricName(0, i)) - assert.Equal(t, dataPointCount, metricDataPointCount(metrics.At(i))) + assert.Equal(t, dataPointCount, metricDPC(metrics.At(i))) } splitSize := 1 @@ -197,10 +197,10 @@ func TestSplitMetricsBatchSizeSmallerThanDataPointCount(t *testing.T) { func TestSplitMetricsMultipleILM(t *testing.T) { md := testdata.GenerateMetricsManyMetricsSameResource(20) metrics := md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics() - dataPointCount := metricDataPointCount(metrics.At(0)) + dataPointCount := metricDPC(metrics.At(0)) for i := 0; i < metrics.Len(); i++ { metrics.At(i).SetName(getTestMetricName(0, i)) - assert.Equal(t, dataPointCount, metricDataPointCount(metrics.At(i))) + assert.Equal(t, dataPointCount, metricDPC(metrics.At(i))) } // add second index to ilm md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0). @@ -238,7 +238,7 @@ func BenchmarkSplitMetrics(b *testing.B) { b.Skipf("SKIP: b.N too high, set -benchtime=x with n < 100000") } - dataPointCount := metricDataPointCount(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0)) + dataPointCount := metricDPC(md.ResourceMetrics().At(0).InstrumentationLibraryMetrics().At(0).Metrics().At(0)) clones := make([]pdata.Metrics, b.N) for n := 0; n < b.N; n++ { clones[n] = md.Clone() diff --git a/processor/batchprocessor/splittraces.go b/processor/batchprocessor/splittraces.go index 95b23a42abc..b3b8bbf5ccf 100644 --- a/processor/batchprocessor/splittraces.go +++ b/processor/batchprocessor/splittraces.go @@ -33,16 +33,15 @@ func splitTraces(size int, src pdata.Traces) pdata.Traces { } // If it fully fits - srcRsCount := resourceSpamsCount(srcRs) - if (totalCopiedSpans + srcRsCount) <= size { - totalCopiedSpans += srcRsCount + srcRsSC := resourceSC(srcRs) + if (totalCopiedSpans + srcRsSC) <= size { + totalCopiedSpans += srcRsSC srcRs.MoveTo(dest.ResourceSpans().AppendEmpty()) return true } destRs := dest.ResourceSpans().AppendEmpty() srcRs.Resource().CopyTo(destRs.Resource()) - srcRs.InstrumentationLibrarySpans().RemoveIf(func(srcIls pdata.InstrumentationLibrarySpans) bool { // If we are done skip everything else. if totalCopiedSpans == size { @@ -50,16 +49,15 @@ func splitTraces(size int, src pdata.Traces) pdata.Traces { } // If possible to move all metrics do that. - srcSpansLen := srcIls.Spans().Len() - if size-totalCopiedSpans >= srcSpansLen { - totalCopiedSpans += srcSpansLen + srcIlsSC := srcIls.Spans().Len() + if size-totalCopiedSpans >= srcIlsSC { + totalCopiedSpans += srcIlsSC srcIls.MoveTo(destRs.InstrumentationLibrarySpans().AppendEmpty()) return true } destIls := destRs.InstrumentationLibrarySpans().AppendEmpty() srcIls.InstrumentationLibrary().CopyTo(destIls.InstrumentationLibrary()) - srcIls.Spans().RemoveIf(func(srcSpan pdata.Span) bool { // If we are done skip everything else. if totalCopiedSpans == size { @@ -77,8 +75,8 @@ func splitTraces(size int, src pdata.Traces) pdata.Traces { return dest } -// resourceSpamsCount calculates the total number of spans. -func resourceSpamsCount(rs pdata.ResourceSpans) (count int) { +// resourceSC calculates the total number of spans in the pdata.ResourceSpans. +func resourceSC(rs pdata.ResourceSpans) (count int) { for k := 0; k < rs.InstrumentationLibrarySpans().Len(); k++ { count += rs.InstrumentationLibrarySpans().At(k).Spans().Len() } From fcc4bcd28cf926b1c901332262ae1d3695218ffe Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 15:48:32 -0700 Subject: [PATCH 130/149] Small nits in the builder (#4341) * Avoid using global viper; * Print the command name as well when printing version, update command name to reflect new binary name. * Remove unnecessary empty line. Signed-off-by: Bogdan Drutu --- cmd/builder/cmd/root.go | 22 ++++++++++++---------- cmd/builder/internal/builder/config.go | 1 - 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cmd/builder/cmd/root.go b/cmd/builder/cmd/root.go index 2be34e7ef5a..cec9886b38b 100644 --- a/cmd/builder/cmd/root.go +++ b/cmd/builder/cmd/root.go @@ -37,7 +37,7 @@ var ( Short: "Version of opentelemetry-collector-builder", Long: "Prints the version of opentelemetry-collector-builder binary", Run: func(cmd *cobra.Command, args []string) { - fmt.Println(version) + cmd.Println(fmt.Sprintf("%s version %s", cmd.Parent().Name(), version)) }, } ) @@ -47,7 +47,7 @@ func Execute() error { cobra.OnInitialize(initConfig) cmd := &cobra.Command{ - Use: "opentelemetry-collector-builder", + Use: "builder", Long: fmt.Sprintf("OpenTelemetry Collector distribution builder (%s)", version), RunE: func(cmd *cobra.Command, args []string) error { @@ -99,25 +99,27 @@ func Execute() error { func initConfig() { cfg.Logger.Info("OpenTelemetry Collector distribution builder", zap.String("version", version), zap.String("date", date)) + vp := viper.New() + // a couple of Viper goodies, to make it easier to use env vars when flags are not desirable - viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - viper.AutomaticEnv() + vp.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) + vp.AutomaticEnv() // load values from config file -- required for the modules configuration if cfgFile != "" { - viper.SetConfigFile(cfgFile) + vp.SetConfigFile(cfgFile) } else { - viper.AddConfigPath("$HOME") - viper.SetConfigName(".otelcol-builder") + vp.AddConfigPath("$HOME") + vp.SetConfigName(".otelcol-builder") } // load the config file - if err := viper.ReadInConfig(); err == nil { - cfg.Logger.Info("Using config file", zap.String("path", viper.ConfigFileUsed())) + if err := vp.ReadInConfig(); err == nil { + cfg.Logger.Info("Using config file", zap.String("path", vp.ConfigFileUsed())) } // convert Viper's internal state into our configuration object - if err := viper.Unmarshal(&cfg); err != nil { + if err := vp.Unmarshal(&cfg); err != nil { cfg.Logger.Error("failed to parse the config", zap.Error(err)) cobra.CheckErr(err) return diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index fd115252ed7..bb84c838817 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -66,7 +66,6 @@ type Module struct { GoMod string `mapstructure:"gomod"` // a gomod-compatible spec for the module Path string `mapstructure:"path"` // an optional path to the local version of this module Core *bool `mapstructure:"core"` // whether this module comes from core. For this property isn't referred from anywhere, it might be removed. please see #15. - } // DefaultConfig creates a new config, with default values From bdfeb05737cb0c2d1a69598b4ec8129223c72a86 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 15:49:27 -0700 Subject: [PATCH 131/149] Remove config.Pipeline.InputDataType, already in the Piplines map key (#4343) Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 1 + config/config_test.go | 1 - config/configtest/configtest_test.go | 1 - config/configunmarshaler/defaultunmarshaler.go | 9 ++------- config/configunmarshaler/defaultunmarshaler_test.go | 1 - config/service.go | 5 ++--- service/internal/builder/exporters_builder.go | 2 +- service/internal/builder/exporters_builder_test.go | 2 -- service/internal/builder/pipelines_builder.go | 10 +++++----- service/internal/builder/pipelines_builder_test.go | 1 - service/internal/builder/receivers_builder.go | 7 +++---- service/internal/components/constants.go | 1 + service/zpages.go | 2 +- 13 files changed, 16 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1305f7a9e4..c15a99fa88d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Force usage of `extensionhelper.NewFactory` to implement `component.ExtensionFactory` (#4338) - Move `service/parserprovider` package to `config/configmapprovider` (#4206) - Remove `config.Pipeline.Name` (#4326) +- Remove `config.Pipeline.InputDataType` (#4343) ## v0.38.0 Beta diff --git a/config/config_test.go b/config/config_test.go index 90240e71df7..c601372f7cc 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -259,7 +259,6 @@ func generateConfig() *Config { Extensions: []ComponentID{NewComponentID("nop")}, Pipelines: map[ComponentID]*Pipeline{ NewComponentID("traces"): { - InputType: TracesDataType, Receivers: []ComponentID{NewComponentID("nop")}, Processors: []ComponentID{NewComponentID("nop")}, Exporters: []ComponentID{NewComponentID("nop")}, diff --git a/config/configtest/configtest_test.go b/config/configtest/configtest_test.go index e672b1c950b..5d3e17fe1e6 100644 --- a/config/configtest/configtest_test.go +++ b/config/configtest/configtest_test.go @@ -59,7 +59,6 @@ func TestLoadConfig(t *testing.T) { require.Len(t, cfg.Service.Pipelines, 1) assert.Equal(t, &config.Pipeline{ - InputType: config.TracesDataType, Receivers: []config.ComponentID{config.NewComponentID("nop")}, Processors: []config.ComponentID{config.NewComponentID("nop")}, Exporters: []config.ComponentID{config.NewComponentID("nop")}, diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index 719af4445b9..2116e9abe04 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -198,13 +198,8 @@ func unmarshalService(srvRaw map[string]interface{}) (config.Service, error) { return srv, fmt.Errorf("error reading service configuration for: %w", err) } - for id, pipeline := range srv.Pipelines { - pipeline.InputType = config.DataType(id.Type()) - switch pipeline.InputType { - case config.TracesDataType: - case config.MetricsDataType: - case config.LogsDataType: - default: + for id := range srv.Pipelines { + if id.Type() != config.TracesDataType && id.Type() != config.MetricsDataType && id.Type() != config.LogsDataType { return srv, fmt.Errorf("unknown %s datatype %q for %v", pipelinesKeyName, id.Type(), id) } } diff --git a/config/configunmarshaler/defaultunmarshaler_test.go b/config/configunmarshaler/defaultunmarshaler_test.go index 5cedda9c8bc..48648d60559 100644 --- a/config/configunmarshaler/defaultunmarshaler_test.go +++ b/config/configunmarshaler/defaultunmarshaler_test.go @@ -109,7 +109,6 @@ func TestDecodeConfig(t *testing.T) { assert.Equal(t, &config.Pipeline{ - InputType: config.TracesDataType, Receivers: []config.ComponentID{config.NewComponentID("examplereceiver")}, Processors: []config.ComponentID{config.NewComponentID("exampleprocessor")}, Exporters: []config.ComponentID{config.NewComponentID("exampleexporter")}, diff --git a/config/service.go b/config/service.go index 6cf4098ac32..2c72434d6dd 100644 --- a/config/service.go +++ b/config/service.go @@ -64,9 +64,9 @@ func (srvTL *ServiceTelemetryLogs) validate() error { return nil } -// DataType is the data type that is supported for collection. We currently support +// DataType is a special Type that represents the data types supported by the collector. We currently support // collecting metrics, traces and logs, this can expand in the future. -type DataType string +type DataType = Type // Currently supported data types. Add new data types here when new types are supported in the future. const ( @@ -82,7 +82,6 @@ const ( // Pipeline defines a single pipeline. type Pipeline struct { - InputType DataType Receivers []ComponentID `mapstructure:"receivers"` Processors []ComponentID `mapstructure:"processors"` Exporters []ComponentID `mapstructure:"exporters"` diff --git a/service/internal/builder/exporters_builder.go b/service/internal/builder/exporters_builder.go index 27fb081b1b4..ca0ff12cf3b 100644 --- a/service/internal/builder/exporters_builder.go +++ b/service/internal/builder/exporters_builder.go @@ -194,7 +194,7 @@ func calcExportersRequiredDataTypes(cfg *config.Config) exportersRequiredDataTyp // Remember that this data type is required for the expCfg and also which // pipeline the requirement is coming from. - result[expID][pipeline.InputType] = pipelineID + result[expID][pipelineID.Type()] = pipelineID } } return result diff --git a/service/internal/builder/exporters_builder_test.go b/service/internal/builder/exporters_builder_test.go index 56496691cd9..da250df3d6f 100644 --- a/service/internal/builder/exporters_builder_test.go +++ b/service/internal/builder/exporters_builder_test.go @@ -51,7 +51,6 @@ func TestBuildExporters(t *testing.T) { Service: config.Service{ Pipelines: map[config.ComponentID]*config.Pipeline{ config.NewComponentID("traces"): { - InputType: config.TracesDataType, Exporters: []config.ComponentID{config.NewComponentID("otlp")}, }, }, @@ -116,7 +115,6 @@ func TestBuildExporters_BuildLogs(t *testing.T) { Service: config.Service{ Pipelines: map[config.ComponentID]*config.Pipeline{ config.NewComponentID("logs"): { - InputType: config.LogsDataType, Exporters: []config.ComponentID{config.NewComponentID("exampleexporter")}, }, }, diff --git a/service/internal/builder/pipelines_builder.go b/service/internal/builder/pipelines_builder.go index fd10bde2203..4867417a57c 100644 --- a/service/internal/builder/pipelines_builder.go +++ b/service/internal/builder/pipelines_builder.go @@ -126,7 +126,7 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineID config // Take into consideration the Capabilities for the exporter as well. mutatesConsumedData := false - switch pipelineCfg.InputType { + switch pipelineID.Type() { case config.TracesDataType: tc = pb.buildFanoutExportersTracesConsumer(pipelineCfg.Exporters) mutatesConsumedData = tc.Capabilities().MutatesData @@ -172,7 +172,7 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineID config BuildInfo: pb.buildInfo, } - switch pipelineCfg.InputType { + switch pipelineID.Type() { case config.TracesDataType: var proc component.TracesProcessor if proc, err = factory.CreateTracesProcessor(ctx, set, procCfg, tc); err != nil { @@ -213,12 +213,12 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineID config default: return nil, fmt.Errorf("error creating processor %q in pipeline %q, data type %s is not supported", - procID, pipelineID, pipelineCfg.InputType) + procID, pipelineID, pipelineID.Type()) } } - pipelineLogger := pb.settings.Logger.With(zap.Stringer("pipeline_id", pipelineID), - zap.String("pipeline_datatype", string(pipelineCfg.InputType))) + pipelineLogger := pb.settings.Logger.With(zap.String(components.ZapNameKey, components.ZapKindPipeline), + zap.String(components.ZapNameKey, pipelineID.String())) pipelineLogger.Info("Pipeline was built.") bp := &builtPipeline{ diff --git a/service/internal/builder/pipelines_builder_test.go b/service/internal/builder/pipelines_builder_test.go index 27d35ad9b41..b0cee6a9756 100644 --- a/service/internal/builder/pipelines_builder_test.go +++ b/service/internal/builder/pipelines_builder_test.go @@ -74,7 +74,6 @@ func createExampleConfig(dataType string) *config.Config { Service: config.Service{ Pipelines: map[config.ComponentID]*config.Pipeline{ config.NewComponentID(config.Type(dataType)): { - InputType: config.DataType(dataType), Receivers: []config.ComponentID{config.NewComponentID(exampleReceiverFactory.Type())}, Processors: []config.ComponentID{config.NewComponentID(exampleProcessorFactory.Type())}, Exporters: []config.ComponentID{config.NewComponentID(exampleExporterFactory.Type())}, diff --git a/service/internal/builder/receivers_builder.go b/service/internal/builder/receivers_builder.go index b94dbf10ae1..171f5aa914f 100644 --- a/service/internal/builder/receivers_builder.go +++ b/service/internal/builder/receivers_builder.go @@ -148,13 +148,12 @@ func (rb *receiversBuilder) findPipelinesToAttach(receiverID config.ComponentID) // Is this receiver attached to the pipeline? if hasReceiver(pipelineCfg, receiverID) { - if _, exists := pipelinesToAttach[pipelineCfg.InputType]; !exists { - pipelinesToAttach[pipelineCfg.InputType] = make([]*builtPipeline, 0) + if _, exists := pipelinesToAttach[pipelineID.Type()]; !exists { + pipelinesToAttach[pipelineID.Type()] = make([]*builtPipeline, 0) } // Yes, add it to the list of pipelines of corresponding data type. - pipelinesToAttach[pipelineCfg.InputType] = - append(pipelinesToAttach[pipelineCfg.InputType], pipelineProcessor) + pipelinesToAttach[pipelineID.Type()] = append(pipelinesToAttach[pipelineID.Type()], pipelineProcessor) } } diff --git a/service/internal/components/constants.go b/service/internal/components/constants.go index 52c730bcb14..5d580d5fcd7 100644 --- a/service/internal/components/constants.go +++ b/service/internal/components/constants.go @@ -20,5 +20,6 @@ const ( ZapKindProcessor = "processor" ZapKindLogExporter = "exporter" ZapKindExtension = "extension" + ZapKindPipeline = "pipeline" ZapNameKey = "name" ) diff --git a/service/zpages.go b/service/zpages.go index 3b03e20bec9..20cc45593e3 100644 --- a/service/zpages.go +++ b/service/zpages.go @@ -108,7 +108,7 @@ func (srv *service) getPipelinesSummaryTableData() zpages.SummaryPipelinesTableD } row := zpages.SummaryPipelinesTableRowData{ FullName: c.String(), - InputType: string(p.Config.InputType), + InputType: string(c.Type()), MutatesData: p.MutatesData, Receivers: recvs, Processors: procs, From aea73f8c07234a29a980dee69f229a37f6b348f5 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 16:03:16 -0700 Subject: [PATCH 132/149] Remove config.[Receivers|Exporters|Processors|Extensions], use map directly (#4344) Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 1 + config/config.go | 16 ++++++++++++---- config/configunmarshaler/defaultunmarshaler.go | 16 ++++++++-------- config/exporter.go | 3 --- config/extension.go | 3 --- config/processor.go | 3 --- config/receiver.go | 3 --- 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c15a99fa88d..2936763c753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## 🛑 Breaking changes 🛑 +- Remove `config.Receivers`, `config.Exporters`, `config.Processors`, and `config.Extensions`. Use map directly (#4344) - Remove `component.BaseProcessorFactory`, use `processorhelper.NewFactory` instead (#4175) - Force usage of `exporterhelper.NewFactory` to implement `component.ExporterFactory` (#4338) - Force usage of `receiverhelper.NewFactory` to implement `component.ReceiverFactory` (#4338) diff --git a/config/config.go b/config/config.go index 5574968a99b..5736796d60a 100644 --- a/config/config.go +++ b/config/config.go @@ -27,10 +27,18 @@ var ( // Config defines the configuration for the various elements of collector or agent. type Config struct { - Receivers - Exporters - Processors - Extensions + // Receivers is a map of ComponentID to Receivers. + Receivers map[ComponentID]Receiver + + // Exporters is a map of ComponentID to Exporters. + Exporters map[ComponentID]Exporter + + // Processors is a map of ComponentID to Processors. + Processors map[ComponentID]Processor + + // Extensions is a map of ComponentID to extensions. + Extensions map[ComponentID]Extension + Service } diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index 2116e9abe04..696dcd85c4b 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -150,9 +150,9 @@ func errorUnmarshalError(component string, id config.ComponentID, err error) err return fmt.Errorf("error reading %s configuration for %v: %w", component, id, err) } -func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExtensionFactory) (config.Extensions, error) { +func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExtensionFactory) (map[config.ComponentID]config.Extension, error) { // Prepare resulting map. - extensions := make(config.Extensions) + extensions := make(map[config.ComponentID]config.Extension) // Iterate over extensions and create a config for each. for id, value := range exts { @@ -222,9 +222,9 @@ func LoadReceiver(componentConfig *config.Map, id config.ComponentID, factory co return receiverCfg, nil } -func unmarshalReceivers(recvs map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ReceiverFactory) (config.Receivers, error) { +func unmarshalReceivers(recvs map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ReceiverFactory) (map[config.ComponentID]config.Receiver, error) { // Prepare resulting map. - receivers := make(config.Receivers) + receivers := make(map[config.ComponentID]config.Receiver) // Iterate over input map and create a config for each. for id, value := range recvs { @@ -249,9 +249,9 @@ func unmarshalReceivers(recvs map[config.ComponentID]map[string]interface{}, fac return receivers, nil } -func unmarshalExporters(exps map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExporterFactory) (config.Exporters, error) { +func unmarshalExporters(exps map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExporterFactory) (map[config.ComponentID]config.Exporter, error) { // Prepare resulting map. - exporters := make(config.Exporters) + exporters := make(map[config.ComponentID]config.Exporter) // Iterate over Exporters and create a config for each. for id, value := range exps { @@ -280,9 +280,9 @@ func unmarshalExporters(exps map[config.ComponentID]map[string]interface{}, fact return exporters, nil } -func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ProcessorFactory) (config.Processors, error) { +func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ProcessorFactory) (map[config.ComponentID]config.Processor, error) { // Prepare resulting map. - processors := make(config.Processors) + processors := make(map[config.ComponentID]config.Processor) // Iterate over processors and create a config for each. for id, value := range procs { diff --git a/config/exporter.go b/config/exporter.go index 0f9ab30ace2..500c5eed5d6 100644 --- a/config/exporter.go +++ b/config/exporter.go @@ -23,9 +23,6 @@ type Exporter interface { privateConfigExporter() } -// Exporters is a map of names to Exporters. -type Exporters map[ComponentID]Exporter - // ExporterSettings defines common settings for a component.Exporter configuration. // Specific exporters can embed this struct and extend it with more fields if needed. // diff --git a/config/extension.go b/config/extension.go index d9d4a6b2962..8ef5450aac1 100644 --- a/config/extension.go +++ b/config/extension.go @@ -23,9 +23,6 @@ type Extension interface { privateConfigExtension() } -// Extensions is a map of names to extensions. -type Extensions map[ComponentID]Extension - // ExtensionSettings defines common settings for a component.Extension configuration. // Specific processors can embed this struct and extend it with more fields if needed. // diff --git a/config/processor.go b/config/processor.go index 10214c84dab..18cac08f051 100644 --- a/config/processor.go +++ b/config/processor.go @@ -23,9 +23,6 @@ type Processor interface { privateConfigProcessor() } -// Processors is a map of names to Processors. -type Processors map[ComponentID]Processor - // ProcessorSettings defines common settings for a component.Processor configuration. // Specific processors can embed this struct and extend it with more fields if needed. // diff --git a/config/receiver.go b/config/receiver.go index c4bdf0333ea..5935b78d59a 100644 --- a/config/receiver.go +++ b/config/receiver.go @@ -23,9 +23,6 @@ type Receiver interface { privateConfigReceiver() } -// Receivers is a map of names to Receivers. -type Receivers map[ComponentID]Receiver - // ReceiverSettings defines common settings for a component.Receiver configuration. // Specific receivers can embed this struct and extend it with more fields if needed. // From e324cf1296c25313f9b9636243222bcf1dc57800 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 16:33:05 -0700 Subject: [PATCH 133/149] Fix small nits in config (#4345) Signed-off-by: Bogdan Drutu --- config/config.go | 20 ++++++++++---------- config/exporter.go | 13 +++++++------ config/extension.go | 12 ++++++------ config/processor.go | 12 ++++++------ 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/config/config.go b/config/config.go index 5736796d60a..bc16837c987 100644 --- a/config/config.go +++ b/config/config.go @@ -50,43 +50,43 @@ var _ validatable = (*Config)(nil) // invalid cases that we currently don't check for but which we may want to add in // the future (e.g. disallowing receiving and exporting on the same endpoint). func (cfg *Config) Validate() error { - // Currently there is no default receiver enabled. + // Currently, there is no default receiver enabled. // The configuration must specify at least one receiver to be valid. if len(cfg.Receivers) == 0 { return errMissingReceivers } // Validate the receiver configuration. - for recv, recvCfg := range cfg.Receivers { + for recvID, recvCfg := range cfg.Receivers { if err := recvCfg.Validate(); err != nil { - return fmt.Errorf("receiver \"%s\" has invalid configuration: %w", recv, err) + return fmt.Errorf("receiver %q has invalid configuration: %w", recvID, err) } } - // Currently there is no default exporter enabled. + // Currently, there is no default exporter enabled. // The configuration must specify at least one exporter to be valid. if len(cfg.Exporters) == 0 { return errMissingExporters } // Validate the exporter configuration. - for exp, expCfg := range cfg.Exporters { + for expID, expCfg := range cfg.Exporters { if err := expCfg.Validate(); err != nil { - return fmt.Errorf("exporter \"%s\" has invalid configuration: %w", exp, err) + return fmt.Errorf("exporter %q has invalid configuration: %w", expID, err) } } // Validate the processor configuration. - for proc, procCfg := range cfg.Processors { + for procID, procCfg := range cfg.Processors { if err := procCfg.Validate(); err != nil { - return fmt.Errorf("processor \"%s\" has invalid configuration: %w", proc, err) + return fmt.Errorf("processor %q has invalid configuration: %w", procID, err) } } // Validate the extension configuration. - for ext, extCfg := range cfg.Extensions { + for extID, extCfg := range cfg.Extensions { if err := extCfg.Validate(); err != nil { - return fmt.Errorf("extension \"%s\" has invalid configuration: %w", ext, err) + return fmt.Errorf("extension %q has invalid configuration: %w", extID, err) } } diff --git a/config/exporter.go b/config/exporter.go index 500c5eed5d6..3bba3874c99 100644 --- a/config/exporter.go +++ b/config/exporter.go @@ -41,17 +41,18 @@ func NewExporterSettings(id ComponentID) ExporterSettings { var _ Exporter = (*ExporterSettings)(nil) // ID returns the receiver ComponentID. -func (rs *ExporterSettings) ID() ComponentID { - return rs.id +func (es *ExporterSettings) ID() ComponentID { + return es.id } // SetIDName sets the receiver name. -func (rs *ExporterSettings) SetIDName(idName string) { - rs.id.nameVal = idName +func (es *ExporterSettings) SetIDName(idName string) { + es.id.nameVal = idName } -func (rs *ExporterSettings) Validate() error { +// Validate validates the configuration and returns an error if invalid. +func (es *ExporterSettings) Validate() error { return nil } -func (rs *ExporterSettings) privateConfigExporter() {} +func (es *ExporterSettings) privateConfigExporter() {} diff --git a/config/extension.go b/config/extension.go index 8ef5450aac1..44d87c8d86b 100644 --- a/config/extension.go +++ b/config/extension.go @@ -41,18 +41,18 @@ func NewExtensionSettings(id ComponentID) ExtensionSettings { var _ Extension = (*ExtensionSettings)(nil) // ID returns the receiver ComponentID. -func (rs *ExtensionSettings) ID() ComponentID { - return rs.id +func (es *ExtensionSettings) ID() ComponentID { + return es.id } // SetIDName sets the receiver name. -func (rs *ExtensionSettings) SetIDName(idName string) { - rs.id.nameVal = idName +func (es *ExtensionSettings) SetIDName(idName string) { + es.id.nameVal = idName } // Validate validates the configuration and returns an error if invalid. -func (rs *ExtensionSettings) Validate() error { +func (es *ExtensionSettings) Validate() error { return nil } -func (rs *ExtensionSettings) privateConfigExtension() {} +func (es *ExtensionSettings) privateConfigExtension() {} diff --git a/config/processor.go b/config/processor.go index 18cac08f051..212ba32ac17 100644 --- a/config/processor.go +++ b/config/processor.go @@ -41,18 +41,18 @@ func NewProcessorSettings(id ComponentID) ProcessorSettings { var _ Processor = (*ProcessorSettings)(nil) // ID returns the receiver ComponentID. -func (rs *ProcessorSettings) ID() ComponentID { - return rs.id +func (ps *ProcessorSettings) ID() ComponentID { + return ps.id } // SetIDName sets the receiver name. -func (rs *ProcessorSettings) SetIDName(idName string) { - rs.id.nameVal = idName +func (ps *ProcessorSettings) SetIDName(idName string) { + ps.id.nameVal = idName } // Validate validates the configuration and returns an error if invalid. -func (rs *ProcessorSettings) Validate() error { +func (ps *ProcessorSettings) Validate() error { return nil } -func (rs *ProcessorSettings) privateConfigProcessor() {} +func (ps *ProcessorSettings) privateConfigProcessor() {} From 9c65d765f70f160fb8276fb9a13ec3cfa9130726 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 18:13:30 -0700 Subject: [PATCH 134/149] Remove indirection in otlpexporter, added when thought we can have grpc/http merged (#4347) Signed-off-by: Bogdan Drutu --- exporter/otlpexporter/otlp.go | 99 +++++++++++------------------------ 1 file changed, 31 insertions(+), 68 deletions(-) diff --git a/exporter/otlpexporter/otlp.go b/exporter/otlpexporter/otlp.go index 3b8230afd68..f8ed53dcbed 100644 --- a/exporter/otlpexporter/otlp.go +++ b/exporter/otlpexporter/otlp.go @@ -17,7 +17,6 @@ package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexpor import ( "context" "errors" - "fmt" "time" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -37,7 +36,14 @@ import ( type exporter struct { // Input configuration. config *Config - w *grpcSender + + // gRPC clients and connection. + traceExporter otlpgrpc.TracesClient + metricExporter otlpgrpc.MetricsClient + logExporter otlpgrpc.LogsClient + clientConn *grpc.ClientConn + metadata metadata.MD + callOptions []grpc.CallOption } // Crete new exporter and start it. The exporter will begin connecting but @@ -55,97 +61,54 @@ func newExporter(cfg config.Exporter) (*exporter, error) { // start actually creates the gRPC connection. The client construction is deferred till this point as this // is the only place we get hold of Extensions which are required to construct auth round tripper. func (e *exporter) start(_ context.Context, host component.Host) (err error) { - e.w, err = newGrpcSender(e.config, host) - return -} - -func (e *exporter) shutdown(context.Context) error { - return e.w.stop() -} - -func (e *exporter) pushTraces(ctx context.Context, td pdata.Traces) error { - if err := e.w.exportTrace(ctx, td); err != nil { - return fmt.Errorf("failed to push trace data via OTLP exporter: %w", err) - } - return nil -} - -func (e *exporter) pushMetrics(ctx context.Context, md pdata.Metrics) error { - if err := e.w.exportMetrics(ctx, md); err != nil { - return fmt.Errorf("failed to push metrics data via OTLP exporter: %w", err) - } - return nil -} - -func (e *exporter) pushLogs(ctx context.Context, ld pdata.Logs) error { - if err := e.w.exportLogs(ctx, ld); err != nil { - return fmt.Errorf("failed to push log data via OTLP exporter: %w", err) - } - return nil -} - -type grpcSender struct { - // gRPC clients and connection. - traceExporter otlpgrpc.TracesClient - metricExporter otlpgrpc.MetricsClient - logExporter otlpgrpc.LogsClient - clientConn *grpc.ClientConn - metadata metadata.MD - callOptions []grpc.CallOption -} - -func newGrpcSender(config *Config, host component.Host) (*grpcSender, error) { - dialOpts, err := config.GRPCClientSettings.ToDialOptions(host) + dialOpts, err := e.config.GRPCClientSettings.ToDialOptions(host) if err != nil { - return nil, err + return err } - var clientConn *grpc.ClientConn - if clientConn, err = grpc.Dial(config.GRPCClientSettings.SanitizedEndpoint(), dialOpts...); err != nil { - return nil, err + if e.clientConn, err = grpc.Dial(e.config.GRPCClientSettings.SanitizedEndpoint(), dialOpts...); err != nil { + return err } - gs := &grpcSender{ - traceExporter: otlpgrpc.NewTracesClient(clientConn), - metricExporter: otlpgrpc.NewMetricsClient(clientConn), - logExporter: otlpgrpc.NewLogsClient(clientConn), - clientConn: clientConn, - metadata: metadata.New(config.GRPCClientSettings.Headers), - callOptions: []grpc.CallOption{ - grpc.WaitForReady(config.GRPCClientSettings.WaitForReady), - }, + e.traceExporter = otlpgrpc.NewTracesClient(e.clientConn) + e.metricExporter = otlpgrpc.NewMetricsClient(e.clientConn) + e.logExporter = otlpgrpc.NewLogsClient(e.clientConn) + e.metadata = metadata.New(e.config.GRPCClientSettings.Headers) + e.callOptions = []grpc.CallOption{ + grpc.WaitForReady(e.config.GRPCClientSettings.WaitForReady), } - return gs, nil + + return } -func (gs *grpcSender) stop() error { - return gs.clientConn.Close() +func (e *exporter) shutdown(context.Context) error { + return e.clientConn.Close() } -func (gs *grpcSender) exportTrace(ctx context.Context, td pdata.Traces) error { +func (e *exporter) pushTraces(ctx context.Context, td pdata.Traces) error { req := otlpgrpc.NewTracesRequest() req.SetTraces(td) - _, err := gs.traceExporter.Export(gs.enhanceContext(ctx), req, gs.callOptions...) + _, err := e.traceExporter.Export(e.enhanceContext(ctx), req, e.callOptions...) return processError(err) } -func (gs *grpcSender) exportMetrics(ctx context.Context, md pdata.Metrics) error { +func (e *exporter) pushMetrics(ctx context.Context, md pdata.Metrics) error { req := otlpgrpc.NewMetricsRequest() req.SetMetrics(md) - _, err := gs.metricExporter.Export(gs.enhanceContext(ctx), req, gs.callOptions...) + _, err := e.metricExporter.Export(e.enhanceContext(ctx), req, e.callOptions...) return processError(err) } -func (gs *grpcSender) exportLogs(ctx context.Context, ld pdata.Logs) error { +func (e *exporter) pushLogs(ctx context.Context, ld pdata.Logs) error { req := otlpgrpc.NewLogsRequest() req.SetLogs(ld) - _, err := gs.logExporter.Export(gs.enhanceContext(ctx), req, gs.callOptions...) + _, err := e.logExporter.Export(e.enhanceContext(ctx), req, e.callOptions...) return processError(err) } -func (gs *grpcSender) enhanceContext(ctx context.Context) context.Context { - if gs.metadata.Len() > 0 { - return metadata.NewOutgoingContext(ctx, gs.metadata) +func (e *exporter) enhanceContext(ctx context.Context) context.Context { + if e.metadata.Len() > 0 { + return metadata.NewOutgoingContext(ctx, e.metadata) } return ctx } From c24dfeb047a8d0ca4c5a210c305be8ea80c10994 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 2 Nov 2021 18:13:48 -0700 Subject: [PATCH 135/149] otlpexporter: simplify shouldRetry logic (#4348) Signed-off-by: Bogdan Drutu --- exporter/otlpexporter/otlp.go | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/exporter/otlpexporter/otlp.go b/exporter/otlpexporter/otlp.go index f8ed53dcbed..3fbfde292c9 100644 --- a/exporter/otlpexporter/otlp.go +++ b/exporter/otlpexporter/otlp.go @@ -150,11 +150,6 @@ func processError(err error) error { func shouldRetry(code codes.Code) bool { switch code { - case codes.OK: - // Success. This function should not be called for this code, the best we - // can do is tell the caller not to retry. - return false - case codes.Canceled, codes.DeadlineExceeded, codes.PermissionDenied, @@ -166,21 +161,9 @@ func shouldRetry(code codes.Code) bool { codes.DataLoss: // These are retryable errors. return true - - case codes.Unknown, - codes.InvalidArgument, - codes.NotFound, - codes.AlreadyExists, - codes.FailedPrecondition, - codes.Unimplemented, - codes.Internal: - // These are fatal errors, don't retry. - return false - - default: - // Don't retry on unknown codes. - return false } + // Don't retry on any other code. + return false } func getThrottleDuration(status *status.Status) time.Duration { From 33154127b74d9e284f9471c98a9238caa92f477e Mon Sep 17 00:00:00 2001 From: AH Alam Date: Wed, 3 Nov 2021 17:09:25 +0100 Subject: [PATCH 136/149] Fix broken link (#4353) * Fix broken link * Update README.md --- extension/ballastextension/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/ballastextension/README.md b/extension/ballastextension/README.md index e3b5bbd8b65..be34676c701 100644 --- a/extension/ballastextension/README.md +++ b/extension/ballastextension/README.md @@ -1,7 +1,7 @@ # Memory Ballast Memory Ballast extension enables applications to configure memory ballast for the process. For more details see: -- [Go memory ballast blogpost](https://blog.twitch.tv/go-memory-ballast-how-i-learnt-to-stop-worrying-and-love-the-heap-26c2462549a2) +- [Go memory ballast blogpost](https://web.archive.org/web/20210929130001/https://blog.twitch.tv/en/2019/04/10/go-memory-ballast-how-i-learnt-to-stop-worrying-and-love-the-heap-26c2462549a2/) - [Golang issue related to this](https://github.com/golang/go/issues/23044) The following settings can be configured: From ee4835cdcbbde2b0beaf7eefedab6239b61b476b Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 3 Nov 2021 09:10:07 -0700 Subject: [PATCH 137/149] Add tests for some String funcs in model/pdata (#4350) Signed-off-by: Bogdan Drutu --- model/pdata/spanid_test.go | 2 ++ model/pdata/timestamp.go | 2 +- model/pdata/timestamp_test.go | 2 ++ model/pdata/traceid_test.go | 6 ++++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/model/pdata/spanid_test.go b/model/pdata/spanid_test.go index bde8d456d11..6c098c60e60 100644 --- a/model/pdata/spanid_test.go +++ b/model/pdata/spanid_test.go @@ -24,8 +24,10 @@ func TestSpanID(t *testing.T) { sid := InvalidSpanID() assert.EqualValues(t, [8]byte{}, sid.Bytes()) assert.True(t, sid.IsEmpty()) + assert.Equal(t, "", sid.HexString()) sid = NewSpanID([8]byte{1, 2, 3, 4, 4, 3, 2, 1}) assert.EqualValues(t, [8]byte{1, 2, 3, 4, 4, 3, 2, 1}, sid.Bytes()) assert.False(t, sid.IsEmpty()) + assert.Equal(t, "0102030404030201", sid.HexString()) } diff --git a/model/pdata/timestamp.go b/model/pdata/timestamp.go index 92f2e145eb4..6a0984a50da 100644 --- a/model/pdata/timestamp.go +++ b/model/pdata/timestamp.go @@ -19,7 +19,7 @@ import ( ) // Timestamp is a time specified as UNIX Epoch time in nanoseconds since -// 00:00:00 UTC on 1 January 1970. +// 1970-01-01 00:00:00 +0000 UTC. type Timestamp uint64 // NewTimestampFromTime constructs a new Timestamp from the provided time.Time. diff --git a/model/pdata/timestamp_test.go b/model/pdata/timestamp_test.go index 132c59d6e73..497258fe7c3 100644 --- a/model/pdata/timestamp_test.go +++ b/model/pdata/timestamp_test.go @@ -28,9 +28,11 @@ func TestUnixNanosConverters(t *testing.T) { assert.EqualValues(t, uint64(1585012403000000789), tun) assert.EqualValues(t, tun, NewTimestampFromTime(t1)) assert.EqualValues(t, t1, NewTimestampFromTime(t1).AsTime()) + assert.Equal(t, "2020-03-24 01:13:23.000000789 +0000 UTC", t1.String()) } func TestZeroTimestamp(t *testing.T) { assert.Equal(t, time.Unix(0, 0).UTC(), Timestamp(0).AsTime()) assert.Zero(t, NewTimestampFromTime(time.Unix(0, 0).UTC())) + assert.Equal(t, "1970-01-01 00:00:00 +0000 UTC", Timestamp(0).String()) } diff --git a/model/pdata/traceid_test.go b/model/pdata/traceid_test.go index d5e3307fb79..ab38097bc00 100644 --- a/model/pdata/traceid_test.go +++ b/model/pdata/traceid_test.go @@ -22,10 +22,12 @@ import ( func TestTraceID(t *testing.T) { tid := InvalidTraceID() - assert.EqualValues(t, [16]byte{}, tid.Bytes()) + assert.Equal(t, [16]byte{}, tid.Bytes()) assert.True(t, tid.IsEmpty()) + assert.Equal(t, "", tid.HexString()) tid = NewTraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) - assert.EqualValues(t, [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}, tid.Bytes()) + assert.Equal(t, [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}, tid.Bytes()) assert.False(t, tid.IsEmpty()) + assert.Equal(t, "01020304050607080807060504030201", tid.HexString()) } From 52a2c2f8498e78bfa64672adc12e605f88371d81 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 3 Nov 2021 09:10:26 -0700 Subject: [PATCH 138/149] otlpexporter: simplify shouldRetry logic (#4348) (#4349) Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 1 + exporter/otlpexporter/otlp.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2936763c753..10cb4a804bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Move `service/parserprovider` package to `config/configmapprovider` (#4206) - Remove `config.Pipeline.Name` (#4326) - Remove `config.Pipeline.InputDataType` (#4343) +- otlpexporter: Do not retry on PermissionDenied and Unauthenticated (#4349) ## v0.38.0 Beta diff --git a/exporter/otlpexporter/otlp.go b/exporter/otlpexporter/otlp.go index 3fbfde292c9..d107c897cf4 100644 --- a/exporter/otlpexporter/otlp.go +++ b/exporter/otlpexporter/otlp.go @@ -152,8 +152,6 @@ func shouldRetry(code codes.Code) bool { switch code { case codes.Canceled, codes.DeadlineExceeded, - codes.PermissionDenied, - codes.Unauthenticated, codes.ResourceExhausted, codes.Aborted, codes.OutOfRange, From b12124792275d33bc41b1800ae25be683cd85fb3 Mon Sep 17 00:00:00 2001 From: Neelay Upadhyaya Date: Wed, 3 Nov 2021 22:29:24 +0530 Subject: [PATCH 139/149] Fix minor typo (#4351) * nit fix minor typo * Update component/receiver.go Co-authored-by: Alex Boten Co-authored-by: Bogdan Drutu Co-authored-by: Alex Boten --- component/receiver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/receiver.go b/component/receiver.go index 421c0268abe..6143f0142d2 100644 --- a/component/receiver.go +++ b/component/receiver.go @@ -33,7 +33,7 @@ import ( // was not accepted. There are 2 types of possible errors: Permanent and non-Permanent. // The receiver must check the type of the error using IsPermanent() helper. // -// If the error is Permanent than the nextConsumer.Consume*() call should not be +// If the error is Permanent, then the nextConsumer.Consume*() call should not be // retried with the same data. This typically happens when the data cannot be // serialized by the exporter that is attached to the pipeline or when the destination // refuses the data because it cannot decode it. The receiver must indicate to From 7e4a7e359ff3918bc8d05ec9d464ffe6ccbaee9a Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 3 Nov 2021 12:51:26 -0700 Subject: [PATCH 140/149] Use go:embed instead of generate using esc (#4356) Signed-off-by: Bogdan Drutu --- Makefile | 1 - internal/tools/go.mod | 1 - internal/tools/go.sum | 2 - internal/tools/tools.go | 1 - service/internal/zpages/templates.go | 50 +-- service/internal/zpages/tmplgen/gen.go | 18 -- service/internal/zpages/tmplgen/resources.go | 309 ------------------- 7 files changed, 29 insertions(+), 353 deletions(-) delete mode 100644 service/internal/zpages/tmplgen/gen.go delete mode 100644 service/internal/zpages/tmplgen/resources.go diff --git a/Makefile b/Makefile index fad45afae25..dd3ce1e67f2 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,6 @@ install-tools: cd $(TOOLS_MOD_DIR) && go install github.com/client9/misspell/cmd/misspell cd $(TOOLS_MOD_DIR) && go install github.com/golangci/golangci-lint/cmd/golangci-lint cd $(TOOLS_MOD_DIR) && go install github.com/google/addlicense - cd $(TOOLS_MOD_DIR) && go install github.com/mjibson/esc cd $(TOOLS_MOD_DIR) && go install github.com/ory/go-acc cd $(TOOLS_MOD_DIR) && go install github.com/pavius/impi/cmd/impi cd $(TOOLS_MOD_DIR) && go install github.com/tcnksm/ghr diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 2e12265dfcc..5c44d62fb1b 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -7,7 +7,6 @@ require ( github.com/golangci/golangci-lint v1.42.1 github.com/google/addlicense v1.0.0 github.com/jcchavezs/porto v0.4.0 - github.com/mjibson/esc v0.2.0 github.com/ory/go-acc v0.2.6 github.com/pavius/impi v0.0.3 github.com/tcnksm/ghr v0.14.0 diff --git a/internal/tools/go.sum b/internal/tools/go.sum index acfb7b01e90..9232d79a1fb 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -550,8 +550,6 @@ github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxd github.com/mitchellh/mapstructure v1.4.1/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/mjibson/esc v0.2.0 h1:k96hdaR9Z+nMcnDwNrOvhdBqtjyMrbVyxLpsRCdP2mA= -github.com/mjibson/esc v0.2.0/go.mod h1:9Hw9gxxfHulMF5OJKCyhYD7PzlSdhzXyaGEBRPH1OPs= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 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= diff --git a/internal/tools/tools.go b/internal/tools/tools.go index e94f7a8a0e2..7855a7b00bd 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -27,7 +27,6 @@ import ( _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/google/addlicense" _ "github.com/jcchavezs/porto/cmd/porto" - _ "github.com/mjibson/esc" _ "github.com/ory/go-acc" _ "github.com/pavius/impi/cmd/impi" _ "github.com/tcnksm/ghr" diff --git a/service/internal/zpages/templates.go b/service/internal/zpages/templates.go index 184a9a44d96..e8f9cc0bbf1 100644 --- a/service/internal/zpages/templates.go +++ b/service/internal/zpages/templates.go @@ -15,40 +15,48 @@ package zpages // import "go.opentelemetry.io/collector/service/internal/zpages" import ( + _ "embed" + "fmt" "html/template" "io" - "io/ioutil" "log" - - "go.opentelemetry.io/collector/service/internal/zpages/tmplgen" ) var ( - fs = tmplgen.FS(false) templateFunctions = template.FuncMap{ "even": even, "getKey": getKey, "getValue": getValue, } - componentHeaderTemplate = parseTemplate("component_header") - extensionsTableTemplate = parseTemplate("extensions_table") - headerTemplate = parseTemplate("header") - footerTemplate = parseTemplate("footer") - pipelinesTableTemplate = parseTemplate("pipelines_table") - propertiesTableTemplate = parseTemplate("properties_table") + + //go:embed templates/component_header.html + componentHeaderBytes []byte + componentHeaderTemplate = parseTemplate("component_header", componentHeaderBytes) + + //go:embed templates/extensions_table.html + extensionsTableBytes []byte + extensionsTableTemplate = parseTemplate("extensions_table", extensionsTableBytes) + + //go:embed templates/header.html + headerBytes []byte + headerTemplate = parseTemplate("header", headerBytes) + + //go:embed templates/footer.html + footerBytes []byte + footerTemplate = parseTemplate("footer", footerBytes) + + //go:embed templates/pipelines_table.html + pipelinesTableBytes []byte + pipelinesTableTemplate = parseTemplate("pipelines_table", pipelinesTableBytes) + + //go:embed templates/properties_table.html + propertiesTableBytes []byte + propertiesTableTemplate = parseTemplate("properties_table", propertiesTableBytes) ) -func parseTemplate(name string) *template.Template { - f, err := fs.Open("/templates/" + name + ".html") - if err != nil { - log.Panicf("%v: %v", name, err) - } - defer f.Close() - text, err := ioutil.ReadAll(f) - if err != nil { - log.Panicf("%v: %v", name, err) - } - return template.Must(template.New(name).Funcs(templateFunctions).Parse(string(text))) +func parseTemplate(name string, bytes []byte) *template.Template { + fmt.Println(string(bytes)) + return template.Must(template.New(name).Funcs(templateFunctions).Parse(string(bytes))) } // HeaderData contains data for the header template. diff --git a/service/internal/zpages/tmplgen/gen.go b/service/internal/zpages/tmplgen/gen.go deleted file mode 100644 index 41151765f7f..00000000000 --- a/service/internal/zpages/tmplgen/gen.go +++ /dev/null @@ -1,18 +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 tmplgen // import "go.opentelemetry.io/collector/service/internal/zpages/tmplgen" - -//go:generate esc -pkg tmplgen -o resources.go -modtime "0" ../templates/ -//go:generate addlicense -y "" -c "The OpenTelemetry Authors" resources.go diff --git a/service/internal/zpages/tmplgen/resources.go b/service/internal/zpages/tmplgen/resources.go deleted file mode 100644 index 6e15c8c3320..00000000000 --- a/service/internal/zpages/tmplgen/resources.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by "esc -pkg tmplgen -o resources.go -modtime 0 ../templates/"; DO NOT EDIT. - -package tmplgen - -import ( - "bytes" - "compress/gzip" - "encoding/base64" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "path" - "sync" - "time" -) - -type _escLocalFS struct{} - -var _escLocal _escLocalFS - -type _escStaticFS struct{} - -var _escStatic _escStaticFS - -type _escDirectory struct { - fs http.FileSystem - name string -} - -type _escFile struct { - compressed string - size int64 - modtime int64 - local string - isDir bool - - once sync.Once - data []byte - name string -} - -func (_escLocalFS) Open(name string) (http.File, error) { - f, present := _escData[path.Clean(name)] - if !present { - return nil, os.ErrNotExist - } - return os.Open(f.local) -} - -func (_escStaticFS) prepare(name string) (*_escFile, error) { - f, present := _escData[path.Clean(name)] - if !present { - return nil, os.ErrNotExist - } - var err error - f.once.Do(func() { - f.name = path.Base(name) - if f.size == 0 { - return - } - var gr *gzip.Reader - b64 := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(f.compressed)) - gr, err = gzip.NewReader(b64) - if err != nil { - return - } - f.data, err = ioutil.ReadAll(gr) - }) - if err != nil { - return nil, err - } - return f, nil -} - -func (fs _escStaticFS) Open(name string) (http.File, error) { - f, err := fs.prepare(name) - if err != nil { - return nil, err - } - return f.File() -} - -func (dir _escDirectory) Open(name string) (http.File, error) { - return dir.fs.Open(dir.name + name) -} - -func (f *_escFile) File() (http.File, error) { - type httpFile struct { - *bytes.Reader - *_escFile - } - return &httpFile{ - Reader: bytes.NewReader(f.data), - _escFile: f, - }, nil -} - -func (f *_escFile) Close() error { - return nil -} - -func (f *_escFile) Readdir(count int) ([]os.FileInfo, error) { - if !f.isDir { - return nil, fmt.Errorf(" escFile.Readdir: '%s' is not directory", f.name) - } - - fis, ok := _escDirs[f.local] - if !ok { - return nil, fmt.Errorf(" escFile.Readdir: '%s' is directory, but we have no info about content of this dir, local=%s", f.name, f.local) - } - limit := count - if count <= 0 || limit > len(fis) { - limit = len(fis) - } - - if len(fis) == 0 && count > 0 { - return nil, io.EOF - } - - return fis[0:limit], nil -} - -func (f *_escFile) Stat() (os.FileInfo, error) { - return f, nil -} - -func (f *_escFile) Name() string { - return f.name -} - -func (f *_escFile) Size() int64 { - return f.size -} - -func (f *_escFile) Mode() os.FileMode { - return 0 -} - -func (f *_escFile) ModTime() time.Time { - return time.Unix(f.modtime, 0) -} - -func (f *_escFile) IsDir() bool { - return f.isDir -} - -func (f *_escFile) Sys() interface{} { - return f -} - -// FS returns a http.Filesystem for the embedded assets. If useLocal is true, -// the filesystem's contents are instead used. -func FS(useLocal bool) http.FileSystem { - if useLocal { - return _escLocal - } - return _escStatic -} - -// Dir returns a http.Filesystem for the embedded assets on a given prefix dir. -// If useLocal is true, the filesystem's contents are instead used. -func Dir(useLocal bool, name string) http.FileSystem { - if useLocal { - return _escDirectory{fs: _escLocal, name: name} - } - return _escDirectory{fs: _escStatic, name: name} -} - -// FSByte returns the named file from the embedded assets. If useLocal is -// true, the filesystem's contents are instead used. -func FSByte(useLocal bool, name string) ([]byte, error) { - if useLocal { - f, err := _escLocal.Open(name) - if err != nil { - return nil, err - } - b, err := ioutil.ReadAll(f) - _ = f.Close() - return b, err - } - f, err := _escStatic.prepare(name) - if err != nil { - return nil, err - } - return f.data, nil -} - -// FSMustByte is the same as FSByte, but panics if name is not present. -func FSMustByte(useLocal bool, name string) []byte { - b, err := FSByte(useLocal, name) - if err != nil { - panic(err) - } - return b -} - -// FSString is the string version of FSByte. -func FSString(useLocal bool, name string) (string, error) { - b, err := FSByte(useLocal, name) - return string(b), err -} - -// FSMustString is the string version of FSMustByte. -func FSMustString(useLocal bool, name string) string { - return string(FSMustByte(useLocal, name)) -} - -var _escData = map[string]*_escFile{ - - "/templates/component_header.html": { - name: "component_header.html", - local: "../templates/component_header.html", - size: 156, - modtime: 0, - compressed: ` -H4sIAAAAAAAC/1SMsQqDMBRFd7/iIq7q5lBiltKt9B8CPklQX6R1e9x/L6ZQ2vXcc65ZE3AZ0V3ztmcV -PW467TnpQVZmzZp0Kfs96VJQizTjw1uyAgAXB+8C4lPmsT4fydqbdY+wCen64F0fB19iWV/yF/54X0en -U3kHAAD//zT+SdCcAAAA -`, - }, - - "/templates/extensions_table.html": { - name: "extensions_table.html", - local: "../templates/extensions_table.html", - size: 353, - modtime: 0, - compressed: ` -H4sIAAAAAAAC/2SQwU7DMBBE7/2KlemRNJwjxxwQHDnwB248DRbOOnK2tGD531HTQIvqk1fzZjU7Wuw2 -gCb5CmjVNiaHVE2j7Tz3DT0osyIiynltqWlp8xSHMTJYntmN0bOUsgDJcg9ap3jw7HC8n7+z5y0epgU7 -oxX5HeETfMGv9NPTkv4i2e6jT3HPrqE7AEui8yaECbdWkzPYUXWlaHFkg++5VR1YkJTRlt4Tdq06HVfK -4zeOAp58ZLYD2pw3L/sQXu2AUpT5N+raGl2Lu0TRtaTfqsCulJWu52bNTwAAAP//sz5qjmEBAAA= -`, - }, - - "/templates/footer.html": { - name: "footer.html", - local: "../templates/footer.html", - size: 15, - modtime: 0, - compressed: ` -H4sIAAAAAAAC/7LRT8pPqbTjstHPKMnNsQMEAAD//wEFevAPAAAA -`, - }, - - "/templates/header.html": { - name: "header.html", - local: "../templates/header.html", - size: 467, - modtime: 0, - compressed: ` -H4sIAAAAAAAC/5TRMU8sIRAH8P4+BY/25eC9szGGxUItLIwW11giO7uMB8wG5rxsLvfdDdnTxNhoBeFP -fpnM3/y5fbzZPj/dicAp2pVph4guj52ELK0J4Hq7EkIIk4Cd8MGVCtzJPQ/rS3mOGDmCPR7Vtl1OJ6OX -lyWNmHeiQOxkDVTY71mgpyxFKDB0UuvD4aBogswQIQGXWSHpwb21Xwo9Sf1d4jlCDQD8wQTmqV5pPVDm -qkaiMYKbsCpPSTfpenAJ49w9OIaCLv6995Sr/AXtqQc1Aqc+tgn/qwv1T6czpzD3ONJ6wrxTCbPy9ROv -vuDEoocBiqjF/5RszGuV1uhFsCujl0bMC/Vz62vzZe1hY98DAAD//7qRGmLTAQAA -`, - }, - - "/templates/pipelines_table.html": { - name: "pipelines_table.html", - local: "../templates/pipelines_table.html", - size: 1930, - modtime: 0, - compressed: ` -H4sIAAAAAAAC/7SVwXLTMBCG7zyFxnRyIjVcU1scoMxwgGE6vIAsbYKmykqzklu3xu/OWLZVp84Fgi8Z -Kfq1/+y3f5QiiMoA8+HJQJlVlhTQ1jshNR527H3G3zDGWBFoWAwbxaQ13gksPzBh9AFLA/vAi4p/qY35 -Lo5Q5BUv8qBObvENVt7dDJ+/55uFdGEgAQNQb/EVXR1+Prk1Pb7VQQTwn0UQK7rcgQT9AORX9PhBVoL3 -dlWT28ZZCotGinyKTdteCbYr2fUne3QWAcMtKmc1hq4bBSTwAOyK7KNGBc27uIx37uyjH2WDdMv0nsED -4It8dj7mNUVayPsD2RrVjr0FgIzPKoHxsLzK2xZQse3spEfVtr3d9RTxroud/h3EqUgK8UVVZjH9pzrj -ILNhkjMypyMBmUYCsh9JNE/pfQUw1hbsF8G+zPrBd93HZ6cdGI2A4gjlAuTmWU65SAKQJ9/fa1QljZYZ -nxRFLvjSvaLXrQCq+TT/M6oNCaKb8/Qc2YmeI5vovfwuV8HnyC7xuckz8ouSs/zOtrMuwYQLGjfhgsYl -XOmFWYUWNG5JC0bLCCsqLgjbfJfexEFX5PEvmP8JAAD//50711CKBwAA -`, - }, - - "/templates/properties_table.html": { - name: "properties_table.html", - local: "../templates/properties_table.html", - size: 420, - modtime: 0, - compressed: ` -H4sIAAAAAAAC/2SRwW7DIBBE7/6KVRr1VMc5u5gfqFT11Ds2U8sqWVuwqRoR/r1yTCpb4YAEO48ZDarV -MR7ezQkp1apqdaHEtA4U5OLQ7NrRW/gyTKYbuK/puNMFEVGMtB/Y4pfqho6UUr71hnvk0Qvt4XACyyw6 -fPhxgpcBIasXoqThi/ADztRqOC8l/j+L6b57P57Z1vQEIEdZnoELeER1jGBL5WqixJJxQ89NBxZ4favg -nvTaQ95wSWnuQlVi9RrUz9yG6XXZr+vDg3TrsTX4NO6M2WLDVOLv3YJtSoWqbl+h/wIAAP//aLmk3KQB -AAA= -`, - }, - - "/templates": { - name: "templates", - local: `../templates/`, - isDir: true, - }, -} - -var _escDirs = map[string][]os.FileInfo{ - - "../templates/": { - _escData["/templates/component_header.html"], - _escData["/templates/extensions_table.html"], - _escData["/templates/footer.html"], - _escData["/templates/header.html"], - _escData["/templates/pipelines_table.html"], - _escData["/templates/properties_table.html"], - }, -} From 5736e34ce639d11c75c48d3a0f969d14f5833a20 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 3 Nov 2021 14:56:07 -0700 Subject: [PATCH 141/149] Remove usage of request Form, we always send params in URL query (#4357) Signed-off-by: Bogdan Drutu --- service/zpages.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/service/zpages.go b/service/zpages.go index 20cc45593e3..ee6d60ac2b9 100644 --- a/service/zpages.go +++ b/service/zpages.go @@ -48,7 +48,6 @@ func (srv *service) RegisterZPages(mux *http.ServeMux, pathPrefix string) { } func (srv *service) handleServicezRequest(w http.ResponseWriter, r *http.Request) { - r.ParseForm() // nolint:errcheck w.Header().Set("Content-Type", "text/html; charset=utf-8") zpages.WriteHTMLHeader(w, zpages.HeaderData{Title: "service"}) zpages.WriteHTMLComponentHeader(w, zpages.ComponentHeaderData{ @@ -66,11 +65,12 @@ func (srv *service) handleServicezRequest(w http.ResponseWriter, r *http.Request } func (srv *service) handlePipelinezRequest(w http.ResponseWriter, r *http.Request) { - r.ParseForm() // nolint:errcheck + qValues := r.URL.Query() + pipelineName := qValues.Get(zPipelineName) + componentName := qValues.Get(zComponentName) + componentKind := qValues.Get(zComponentKind) + w.Header().Set("Content-Type", "text/html; charset=utf-8") - pipelineName := r.Form.Get(zPipelineName) - componentName := r.Form.Get(zComponentName) - componentKind := r.Form.Get(zComponentKind) zpages.WriteHTMLHeader(w, zpages.HeaderData{Title: "Pipelines"}) zpages.WriteHTMLPipelinesSummaryTable(w, srv.getPipelinesSummaryTableData()) if pipelineName != "" && componentName != "" && componentKind != "" { @@ -124,9 +124,9 @@ func (srv *service) getPipelinesSummaryTableData() zpages.SummaryPipelinesTableD } func handleExtensionzRequest(host component.Host, w http.ResponseWriter, r *http.Request) { - r.ParseForm() // nolint:errcheck + extensionName := r.URL.Query().Get(zExtensionName) + w.Header().Set("Content-Type", "text/html; charset=utf-8") - extensionName := r.Form.Get(zExtensionName) zpages.WriteHTMLHeader(w, zpages.HeaderData{Title: "Extensions"}) zpages.WriteHTMLExtensionsSummaryTable(w, getExtensionsSummaryTableData(host)) if extensionName != "" { From cffbecb2ac9ee98e6a60d22f910760be48a94c55 Mon Sep 17 00:00:00 2001 From: Anthony Mirabella Date: Wed, 3 Nov 2021 14:58:28 -0700 Subject: [PATCH 142/149] Rename pdata.AnyValueArray to AttributeSlice (#4325) * Rename pdata.AnyValueArray to AttributeSlice Signed-off-by: Anthony J Mirabella * Fix pdata tests, too Signed-off-by: Anthony J Mirabella * ArrayVal -> SliceVal Signed-off-by: Anthony J Mirabella * CR feedback Signed-off-by: Anthony J Mirabella * pdata: AttributeSlice -> AttributeValueSlice Signed-off-by: Anthony J Mirabella * Update CHANGELOG.md Co-authored-by: Bogdan Drutu --- CHANGELOG.md | 4 ++ internal/otlptext/databuffer.go | 4 +- internal/otlptext/databuffer_test.go | 14 ++-- .../cmd/pdatagen/internal/common_structs.go | 6 +- model/pdata/common.go | 26 ++++---- model/pdata/common_test.go | 66 +++++++++---------- model/pdata/generated_common.go | 36 +++++----- model/pdata/generated_common_test.go | 54 +++++++-------- 8 files changed, 107 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10cb4a804bc..0654331d82e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - 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) +- 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) - Remove `config.Pipeline.InputDataType` (#4343) - otlpexporter: Do not retry on PermissionDenied and Unauthenticated (#4349) diff --git a/internal/otlptext/databuffer.go b/internal/otlptext/databuffer.go index 2bbcbb87e08..45dc2031c63 100644 --- a/internal/otlptext/databuffer.go +++ b/internal/otlptext/databuffer.go @@ -211,7 +211,7 @@ func attributeValueToString(av pdata.AttributeValue) string { case pdata.AttributeValueTypeInt: return strconv.FormatInt(av.IntVal(), 10) case pdata.AttributeValueTypeArray: - return attributeValueArrayToString(av.ArrayVal()) + return attributeValueSliceToString(av.SliceVal()) case pdata.AttributeValueTypeMap: return attributeMapToString(av.MapVal()) default: @@ -219,7 +219,7 @@ func attributeValueToString(av pdata.AttributeValue) string { } } -func attributeValueArrayToString(av pdata.AnyValueArray) string { +func attributeValueSliceToString(av pdata.AttributeValueSlice) string { var b strings.Builder b.WriteByte('[') for i := 0; i < av.Len(); i++ { diff --git a/internal/otlptext/databuffer_test.go b/internal/otlptext/databuffer_test.go index 3873f1aeb5a..1d509f73b6a 100644 --- a/internal/otlptext/databuffer_test.go +++ b/internal/otlptext/databuffer_test.go @@ -24,17 +24,17 @@ import ( func TestNestedArraySerializesCorrectly(t *testing.T) { ava := pdata.NewAttributeValueArray() - ava.ArrayVal().AppendEmpty().SetStringVal("foo") - ava.ArrayVal().AppendEmpty().SetIntVal(42) + ava.SliceVal().AppendEmpty().SetStringVal("foo") + ava.SliceVal().AppendEmpty().SetIntVal(42) ava2 := pdata.NewAttributeValueArray() - ava2.ArrayVal().AppendEmpty().SetStringVal("bar") - ava2.CopyTo(ava.ArrayVal().AppendEmpty()) + ava2.SliceVal().AppendEmpty().SetStringVal("bar") + ava2.CopyTo(ava.SliceVal().AppendEmpty()) - ava.ArrayVal().AppendEmpty().SetBoolVal(true) - ava.ArrayVal().AppendEmpty().SetDoubleVal(5.5) + ava.SliceVal().AppendEmpty().SetBoolVal(true) + ava.SliceVal().AppendEmpty().SetDoubleVal(5.5) - assert.Equal(t, 5, ava.ArrayVal().Len()) + assert.Equal(t, 5, ava.SliceVal().Len()) assert.Equal(t, "[foo, 42, [bar], true, 5.5]", attributeValueToString(ava)) } diff --git a/model/internal/cmd/pdatagen/internal/common_structs.go b/model/internal/cmd/pdatagen/internal/common_structs.go index e4b3488a5de..01716967df0 100644 --- a/model/internal/cmd/pdatagen/internal/common_structs.go +++ b/model/internal/cmd/pdatagen/internal/common_structs.go @@ -28,7 +28,7 @@ var commonFile = &File{ }, structs: []baseStruct{ instrumentationLibrary, - anyValueArray, + attributeValueArray, }, } @@ -109,8 +109,8 @@ var anyValue = &messageValueStruct{ originFullName: "otlpcommon.AnyValue", } -var anyValueArray = &sliceOfValues{ - structName: "AnyValueArray", +var attributeValueArray = &sliceOfValues{ + structName: "AttributeValueSlice", element: anyValue, } diff --git a/model/pdata/common.go b/model/pdata/common.go index 5d853fbdf17..fd6b0735adf 100644 --- a/model/pdata/common.go +++ b/model/pdata/common.go @@ -197,17 +197,17 @@ func (a AttributeValue) MapVal() AttributeMap { return newAttributeMap(&kvlist.Values) } -// ArrayVal returns the array value associated with this AttributeValue. -// If the Type() is not AttributeValueTypeArray then returns an empty array. Note that modifying -// such empty array has no effect on this AttributeValue. +// SliceVal returns the slice value associated with this AttributeValue. +// If the Type() is not AttributeValueTypeArray then returns an empty slice. Note that modifying +// such empty slice has no effect on this AttributeValue. // // Calling this function on zero-initialized AttributeValue will cause a panic. -func (a AttributeValue) ArrayVal() AnyValueArray { +func (a AttributeValue) SliceVal() AttributeValueSlice { arr := a.orig.GetArrayValue() if arr == nil { - return NewAnyValueArray() + return NewAttributeValueSlice() } - return newAnyValueArray(&arr.Values) + return newAttributeValueSlice(&arr.Values) } // BytesVal returns the []byte value associated with this AttributeValue. @@ -262,10 +262,10 @@ func (a AttributeValue) SetMapVal(v AttributeMap) { a.orig.Value = &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{Values: *v.orig}} } -// SetArrayVal replaces the AnyValueArray value associated with this AttributeValue, +// 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) SetArrayVal(v AnyValueArray) { +func (a AttributeValue) SetSliceVal(v AttributeValueSlice) { a.orig.Value = &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{Values: *v.orig}} } @@ -295,7 +295,7 @@ func (a AttributeValue) copyTo(dest *otlpcommon.AnyValue) { return } // Deep copy to dest. - newAnyValueArray(&v.ArrayValue.Values).CopyTo(newAnyValueArray(&av.ArrayValue.Values)) + newAttributeValueSlice(&v.ArrayValue.Values).CopyTo(newAttributeValueSlice(&av.ArrayValue.Values)) default: // Primitive immutable type, no need for deep copy. dest.Value = a.orig.Value @@ -406,7 +406,7 @@ func (a AttributeValue) AsString() string { return base64.StdEncoding.EncodeToString(a.BytesVal()) case AttributeValueTypeArray: - jsonStr, _ := json.Marshal(a.ArrayVal().asRaw()) + jsonStr, _ := json.Marshal(a.SliceVal().asRaw()) return string(jsonStr) default: @@ -833,15 +833,15 @@ func (am AttributeMap) AsRaw() map[string]interface{} { case AttributeValueTypeMap: rawMap[k] = v.MapVal().AsRaw() case AttributeValueTypeArray: - rawMap[k] = v.ArrayVal().asRaw() + rawMap[k] = v.SliceVal().asRaw() } return true }) return rawMap } -// asRaw creates a slice out of a AnyValueArray. -func (es AnyValueArray) asRaw() []interface{} { +// asRaw creates a slice out of a AttributeValueSlice. +func (es AttributeValueSlice) asRaw() []interface{} { rawSlice := make([]interface{}, 0, es.Len()) for i := 0; i < es.Len(); i++ { v := es.At(i) diff --git a/model/pdata/common_test.go b/model/pdata/common_test.go index e1db1c60868..59909093b13 100644 --- a/model/pdata/common_test.go +++ b/model/pdata/common_test.go @@ -233,18 +233,18 @@ func TestAttributeValueEqual(t *testing.T) { assert.True(t, av1.Equal(av2)) av1 = NewAttributeValueArray() - av1.ArrayVal().AppendEmpty().SetIntVal(123) + av1.SliceVal().AppendEmpty().SetIntVal(123) assert.False(t, av1.Equal(av2)) assert.False(t, av2.Equal(av1)) av2 = NewAttributeValueArray() - av2.ArrayVal().AppendEmpty().SetDoubleVal(123) + av2.SliceVal().AppendEmpty().SetDoubleVal(123) assert.False(t, av1.Equal(av2)) - NewAttributeValueInt(123).CopyTo(av2.ArrayVal().At(0)) + NewAttributeValueInt(123).CopyTo(av2.SliceVal().At(0)) assert.True(t, av1.Equal(av2)) - av1.CopyTo(av2.ArrayVal().AppendEmpty()) + av1.CopyTo(av2.SliceVal().AppendEmpty()) assert.False(t, av1.Equal(av2)) assert.True(t, av1.Equal(av1)) @@ -628,7 +628,7 @@ func TestAttributeValue_CopyTo(t *testing.T) { AttributeValue{orig: orig}.CopyTo(dest) assert.Nil(t, dest.orig.Value.(*otlpcommon.AnyValue_KvlistValue).KvlistValue) - // Test nil ArrayValue case for ArrayVal() func. + // Test nil ArrayValue case for SliceVal() func. dest = NewAttributeValueEmpty() orig = &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_ArrayValue{ArrayValue: nil}} AttributeValue{orig: orig}.CopyTo(dest) @@ -884,46 +884,46 @@ func generateTestBytesAttributeMap() AttributeMap { func TestAttributeValueArray(t *testing.T) { a1 := NewAttributeValueArray() assert.EqualValues(t, AttributeValueTypeArray, a1.Type()) - assert.EqualValues(t, NewAnyValueArray(), a1.ArrayVal()) - assert.EqualValues(t, 0, a1.ArrayVal().Len()) + assert.EqualValues(t, NewAttributeValueSlice(), a1.SliceVal()) + assert.EqualValues(t, 0, a1.SliceVal().Len()) - a1.ArrayVal().AppendEmpty().SetDoubleVal(123) - assert.EqualValues(t, 1, a1.ArrayVal().Len()) - assert.EqualValues(t, NewAttributeValueDouble(123), a1.ArrayVal().At(0)) + a1.SliceVal().AppendEmpty().SetDoubleVal(123) + assert.EqualValues(t, 1, a1.SliceVal().Len()) + assert.EqualValues(t, NewAttributeValueDouble(123), a1.SliceVal().At(0)) // Create a second array. a2 := NewAttributeValueArray() - assert.EqualValues(t, 0, a2.ArrayVal().Len()) + assert.EqualValues(t, 0, a2.SliceVal().Len()) - a2.ArrayVal().AppendEmpty().SetStringVal("somestr") - assert.EqualValues(t, 1, a2.ArrayVal().Len()) - assert.EqualValues(t, NewAttributeValueString("somestr"), a2.ArrayVal().At(0)) + a2.SliceVal().AppendEmpty().SetStringVal("somestr") + assert.EqualValues(t, 1, a2.SliceVal().Len()) + assert.EqualValues(t, NewAttributeValueString("somestr"), a2.SliceVal().At(0)) // Insert the second array as a child. - a1.ArrayVal().AppendEmpty().SetArrayVal(a2.ArrayVal()) - assert.EqualValues(t, 2, a1.ArrayVal().Len()) - assert.EqualValues(t, NewAttributeValueDouble(123), a1.ArrayVal().At(0)) - assert.EqualValues(t, a2, a1.ArrayVal().At(1)) + a1.SliceVal().AppendEmpty().SetSliceVal(a2.SliceVal()) + assert.EqualValues(t, 2, a1.SliceVal().Len()) + assert.EqualValues(t, NewAttributeValueDouble(123), a1.SliceVal().At(0)) + assert.EqualValues(t, a2, a1.SliceVal().At(1)) // Check that the array was correctly inserted. - childArray := a1.ArrayVal().At(1) + childArray := a1.SliceVal().At(1) assert.EqualValues(t, AttributeValueTypeArray, childArray.Type()) - assert.EqualValues(t, 1, childArray.ArrayVal().Len()) + assert.EqualValues(t, 1, childArray.SliceVal().Len()) - v := childArray.ArrayVal().At(0) + v := childArray.SliceVal().At(0) assert.EqualValues(t, AttributeValueTypeString, v.Type()) assert.EqualValues(t, "somestr", v.StringVal()) - // Test nil values case for ArrayVal() func. + // Test nil values case for SliceVal() func. a1 = AttributeValue{orig: &otlpcommon.AnyValue{Value: &otlpcommon.AnyValue_ArrayValue{ArrayValue: nil}}} - assert.EqualValues(t, NewAnyValueArray(), a1.ArrayVal()) + assert.EqualValues(t, NewAttributeValueSlice(), a1.SliceVal()) } -func TestAnyValueArrayWithNilValues(t *testing.T) { +func TestAttributeSliceWithNilValues(t *testing.T) { origWithNil := []otlpcommon.AnyValue{ {}, {Value: &otlpcommon.AnyValue_StringValue{StringValue: "test_value"}}, } - sm := AnyValueArray{ + sm := AttributeValueSlice{ orig: &origWithNil, } @@ -1008,11 +1008,11 @@ func TestAsString(t *testing.T) { func TestAsRaw(t *testing.T) { arr := NewAttributeValueArray() - arr.ArrayVal().AppendEmpty().SetBoolVal(false) - arr.ArrayVal().AppendEmpty().SetBytesVal([]byte("test")) - arr.ArrayVal().AppendEmpty().SetDoubleVal(12.9) - arr.ArrayVal().AppendEmpty().SetIntVal(91) - arr.ArrayVal().AppendEmpty().SetStringVal("another string") + arr.SliceVal().AppendEmpty().SetBoolVal(false) + arr.SliceVal().AppendEmpty().SetBytesVal([]byte("test")) + arr.SliceVal().AppendEmpty().SetDoubleVal(12.9) + arr.SliceVal().AppendEmpty().SetIntVal(91) + arr.SliceVal().AppendEmpty().SetStringVal("another string") tests := []struct { name string @@ -1068,7 +1068,7 @@ func simpleAttributeValueMap() AttributeValue { func simpleAttributeValueArray() AttributeValue { ret := NewAttributeValueArray() - attrArr := ret.ArrayVal() + attrArr := ret.SliceVal() attrArr.AppendEmpty().SetStringVal("strVal") attrArr.AppendEmpty().SetIntVal(7) attrArr.AppendEmpty().SetDoubleVal(18.6) @@ -1086,7 +1086,7 @@ func constructTestAttributeSubmap() AttributeValue { func constructTestAttributeSubarray() AttributeValue { value := NewAttributeValueArray() - value.ArrayVal().AppendEmpty().SetStringVal("strOne") - value.ArrayVal().AppendEmpty().SetStringVal("strTwo") + value.SliceVal().AppendEmpty().SetStringVal("strOne") + value.SliceVal().AppendEmpty().SetStringVal("strTwo") return value } diff --git a/model/pdata/generated_common.go b/model/pdata/generated_common.go index 4839690d6a1..d986f223d96 100644 --- a/model/pdata/generated_common.go +++ b/model/pdata/generated_common.go @@ -77,34 +77,34 @@ func (ms InstrumentationLibrary) CopyTo(dest InstrumentationLibrary) { dest.SetVersion(ms.Version()) } -// AnyValueArray logically represents a slice of AttributeValue. +// AttributeValueSlice logically represents a slice of AttributeValue. // // This is a reference type. If passed by value and callee modifies it, the // caller will see the modification. // -// Must use NewAnyValueArray function to create new instances. +// Must use NewAttributeValueSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type AnyValueArray struct { +type AttributeValueSlice struct { // orig points to the slice otlpcommon.AnyValue field contained somewhere else. // We use pointer-to-slice to be able to modify it in functions like EnsureCapacity. orig *[]otlpcommon.AnyValue } -func newAnyValueArray(orig *[]otlpcommon.AnyValue) AnyValueArray { - return AnyValueArray{orig} +func newAttributeValueSlice(orig *[]otlpcommon.AnyValue) AttributeValueSlice { + return AttributeValueSlice{orig} } -// NewAnyValueArray creates a AnyValueArray with 0 elements. +// NewAttributeValueSlice creates a AttributeValueSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. -func NewAnyValueArray() AnyValueArray { +func NewAttributeValueSlice() AttributeValueSlice { orig := []otlpcommon.AnyValue(nil) - return AnyValueArray{&orig} + return AttributeValueSlice{&orig} } // Len returns the number of elements in the slice. // -// Returns "0" for a newly instance created with "NewAnyValueArray()". -func (es AnyValueArray) Len() int { +// Returns "0" for a newly instance created with "NewAttributeValueSlice()". +func (es AttributeValueSlice) Len() int { return len(*es.orig) } @@ -115,12 +115,12 @@ func (es AnyValueArray) Len() int { // e := es.At(i) // ... // Do something with the element // } -func (es AnyValueArray) At(ix int) AttributeValue { +func (es AttributeValueSlice) At(ix int) AttributeValue { return newAttributeValue(&(*es.orig)[ix]) } // CopyTo copies all elements from the current slice to the dest. -func (es AnyValueArray) CopyTo(dest AnyValueArray) { +func (es AttributeValueSlice) CopyTo(dest AttributeValueSlice) { srcLen := es.Len() destCap := cap(*dest.orig) if srcLen <= destCap { @@ -138,14 +138,14 @@ func (es AnyValueArray) CopyTo(dest AnyValueArray) { // 1. If the newCap <= cap then no change in capacity. // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // -// Here is how a new AnyValueArray can be initialized: -// es := NewAnyValueArray() +// Here is how a new AttributeValueSlice can be initialized: +// es := NewAttributeValueSlice() // es.EnsureCapacity(4) // for i := 0; i < 4; i++ { // e := es.AppendEmpty() // // Here should set all the values for e. // } -func (es AnyValueArray) EnsureCapacity(newCap int) { +func (es AttributeValueSlice) EnsureCapacity(newCap int) { oldCap := cap(*es.orig) if newCap <= oldCap { return @@ -158,14 +158,14 @@ func (es AnyValueArray) EnsureCapacity(newCap int) { // AppendEmpty will append to the end of the slice an empty AttributeValue. // It returns the newly added AttributeValue. -func (es AnyValueArray) AppendEmpty() AttributeValue { +func (es AttributeValueSlice) AppendEmpty() AttributeValue { *es.orig = append(*es.orig, otlpcommon.AnyValue{}) return es.At(es.Len() - 1) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. -func (es AnyValueArray) MoveAndAppendTo(dest AnyValueArray) { +func (es AttributeValueSlice) MoveAndAppendTo(dest AttributeValueSlice) { if *dest.orig == nil { // We can simply move the entire vector and avoid any allocations. *dest.orig = *es.orig @@ -177,7 +177,7 @@ func (es AnyValueArray) MoveAndAppendTo(dest AnyValueArray) { // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. -func (es AnyValueArray) RemoveIf(f func(AttributeValue) bool) { +func (es AttributeValueSlice) RemoveIf(f func(AttributeValue) bool) { newLen := 0 for i := 0; i < len(*es.orig); i++ { if f(es.At(i)) { diff --git a/model/pdata/generated_common_test.go b/model/pdata/generated_common_test.go index ac07ddf6708..990bdffd844 100644 --- a/model/pdata/generated_common_test.go +++ b/model/pdata/generated_common_test.go @@ -55,10 +55,10 @@ func TestInstrumentationLibrary_Version(t *testing.T) { assert.EqualValues(t, testValVersion, ms.Version()) } -func TestAnyValueArray(t *testing.T) { - es := NewAnyValueArray() +func TestAttributeValueSlice(t *testing.T) { + es := NewAttributeValueSlice() assert.EqualValues(t, 0, es.Len()) - es = newAnyValueArray(&[]otlpcommon.AnyValue{}) + es = newAttributeValueSlice(&[]otlpcommon.AnyValue{}) assert.EqualValues(t, 0, es.Len()) es.EnsureCapacity(7) @@ -73,23 +73,23 @@ func TestAnyValueArray(t *testing.T) { } } -func TestAnyValueArray_CopyTo(t *testing.T) { - dest := NewAnyValueArray() +func TestAttributeValueSlice_CopyTo(t *testing.T) { + dest := NewAttributeValueSlice() // Test CopyTo to empty - NewAnyValueArray().CopyTo(dest) - assert.EqualValues(t, NewAnyValueArray(), dest) + NewAttributeValueSlice().CopyTo(dest) + assert.EqualValues(t, NewAttributeValueSlice(), dest) // Test CopyTo larger slice - generateTestAnyValueArray().CopyTo(dest) - assert.EqualValues(t, generateTestAnyValueArray(), dest) + generateTestAttributeValueSlice().CopyTo(dest) + assert.EqualValues(t, generateTestAttributeValueSlice(), dest) // Test CopyTo same size slice - generateTestAnyValueArray().CopyTo(dest) - assert.EqualValues(t, generateTestAnyValueArray(), dest) + generateTestAttributeValueSlice().CopyTo(dest) + assert.EqualValues(t, generateTestAttributeValueSlice(), dest) } -func TestAnyValueArray_EnsureCapacity(t *testing.T) { - es := generateTestAnyValueArray() +func TestAttributeValueSlice_EnsureCapacity(t *testing.T) { + es := generateTestAttributeValueSlice() // Test ensure smaller capacity. const ensureSmallLen = 4 expectedEs := make(map[*otlpcommon.AnyValue]bool) @@ -113,24 +113,24 @@ func TestAnyValueArray_EnsureCapacity(t *testing.T) { assert.Equal(t, ensureLargeLen, cap(*es.orig)) } -func TestAnyValueArray_MoveAndAppendTo(t *testing.T) { +func TestAttributeValueSlice_MoveAndAppendTo(t *testing.T) { // Test MoveAndAppendTo to empty - expectedSlice := generateTestAnyValueArray() - dest := NewAnyValueArray() - src := generateTestAnyValueArray() + expectedSlice := generateTestAttributeValueSlice() + dest := NewAttributeValueSlice() + src := generateTestAttributeValueSlice() src.MoveAndAppendTo(dest) - assert.EqualValues(t, generateTestAnyValueArray(), dest) + assert.EqualValues(t, generateTestAttributeValueSlice(), dest) assert.EqualValues(t, 0, src.Len()) assert.EqualValues(t, expectedSlice.Len(), dest.Len()) // Test MoveAndAppendTo empty slice src.MoveAndAppendTo(dest) - assert.EqualValues(t, generateTestAnyValueArray(), dest) + assert.EqualValues(t, generateTestAttributeValueSlice(), dest) assert.EqualValues(t, 0, src.Len()) assert.EqualValues(t, expectedSlice.Len(), dest.Len()) // Test MoveAndAppendTo not empty slice - generateTestAnyValueArray().MoveAndAppendTo(dest) + generateTestAttributeValueSlice().MoveAndAppendTo(dest) assert.EqualValues(t, 2*expectedSlice.Len(), dest.Len()) for i := 0; i < expectedSlice.Len(); i++ { assert.EqualValues(t, expectedSlice.At(i), dest.At(i)) @@ -138,16 +138,16 @@ func TestAnyValueArray_MoveAndAppendTo(t *testing.T) { } } -func TestAnyValueArray_RemoveIf(t *testing.T) { +func TestAttributeValueSlice_RemoveIf(t *testing.T) { // Test RemoveIf on empty slice - emptySlice := NewAnyValueArray() + emptySlice := NewAttributeValueSlice() emptySlice.RemoveIf(func(el AttributeValue) bool { t.Fail() return false }) // Test RemoveIf - filtered := generateTestAnyValueArray() + filtered := generateTestAttributeValueSlice() pos := 0 filtered.RemoveIf(func(el AttributeValue) bool { pos++ @@ -167,13 +167,13 @@ func fillTestInstrumentationLibrary(tv InstrumentationLibrary) { tv.SetVersion("test_version") } -func generateTestAnyValueArray() AnyValueArray { - tv := NewAnyValueArray() - fillTestAnyValueArray(tv) +func generateTestAttributeValueSlice() AttributeValueSlice { + tv := NewAttributeValueSlice() + fillTestAttributeValueSlice(tv) return tv } -func fillTestAnyValueArray(tv AnyValueArray) { +func fillTestAttributeValueSlice(tv AttributeValueSlice) { l := 7 tv.EnsureCapacity(l) for i := 0; i < l; i++ { From 61d3a34fbcc2cdbeba1d9758b13c4bdf462944ff Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 4 Nov 2021 09:55:08 -0700 Subject: [PATCH 143/149] Small nits in default config unmarshaler (#4355) Signed-off-by: Bogdan Drutu --- .../configunmarshaler/defaultunmarshaler.go | 47 +++++++------------ receiver/otlpreceiver/config_test.go | 6 +-- 2 files changed, 19 insertions(+), 34 deletions(-) diff --git a/config/configunmarshaler/defaultunmarshaler.go b/config/configunmarshaler/defaultunmarshaler.go index 696dcd85c4b..c98cd5f77ae 100644 --- a/config/configunmarshaler/defaultunmarshaler.go +++ b/config/configunmarshaler/defaultunmarshaler.go @@ -84,13 +84,11 @@ func NewDefault() ConfigUnmarshaler { } // Unmarshal the Config from a config.Map. -// After the config is unmarshaled, `Validate()` must be called to validate. +// After the config is unmarshalled, `Validate()` must be called to validate. func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factories) (*config.Config, error) { var cfg config.Config - // Unmarshal the config. - - // Struct to validate top level sections. + // Unmarshal top level sections and validate. rawCfg := configSettings{} if err := v.UnmarshalExact(&rawCfg); err != nil { return nil, &configError{ @@ -99,7 +97,6 @@ func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factorie } } - // Start with the service extensions. var err error if cfg.Extensions, err = unmarshalExtensions(rawCfg.Extensions, factories.Extensions); err != nil { return nil, &configError{ @@ -108,8 +105,6 @@ func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factorie } } - // Unmarshal data components (receivers, exporters, and processors). - if cfg.Receivers, err = unmarshalReceivers(rawCfg.Receivers, factories.Receivers); err != nil { return nil, &configError{ error: err, @@ -131,7 +126,6 @@ func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factorie } } - // Unmarshal the service and its data pipelines. if cfg.Service, err = unmarshalService(rawCfg.Service); err != nil { return nil, &configError{ error: err, @@ -142,22 +136,12 @@ func (*defaultUnmarshaler) Unmarshal(v *config.Map, factories component.Factorie return &cfg, nil } -func errorUnknownType(component string, id config.ComponentID) error { - return fmt.Errorf("unknown %s type %q for %v", component, id.Type(), id) -} - -func errorUnmarshalError(component string, id config.ComponentID, err error) error { - return fmt.Errorf("error reading %s configuration for %v: %w", component, id, err) -} - func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, factories map[config.Type]component.ExtensionFactory) (map[config.ComponentID]config.Extension, error) { // Prepare resulting map. extensions := make(map[config.ComponentID]config.Extension) // Iterate over extensions and create a config for each. for id, value := range exts { - componentConfig := config.NewMapFromStringMap(value) - // Find extension factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { @@ -171,7 +155,7 @@ func unmarshalExtensions(exts map[config.ComponentID]map[string]interface{}, fac // 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. - if err := unmarshal(componentConfig, extensionCfg); err != nil { + if err := unmarshal(config.NewMapFromStringMap(value), extensionCfg); err != nil { return nil, errorUnmarshalError(extensionsKeyName, id, err) } @@ -195,12 +179,12 @@ func unmarshalService(srvRaw map[string]interface{}) (config.Service, error) { } if err := unmarshal(config.NewMapFromStringMap(srvRaw), &srv); err != nil { - return srv, fmt.Errorf("error reading service configuration for: %w", err) + return srv, fmt.Errorf("error reading service configuration: %w", err) } for id := range srv.Pipelines { if id.Type() != config.TracesDataType && id.Type() != config.MetricsDataType && id.Type() != config.LogsDataType { - return srv, fmt.Errorf("unknown %s datatype %q for %v", pipelinesKeyName, id.Type(), id) + return srv, fmt.Errorf("unknown %q datatype %q for %v", pipelinesKeyName, id.Type(), id) } } return srv, nil @@ -228,16 +212,13 @@ func unmarshalReceivers(recvs map[config.ComponentID]map[string]interface{}, fac // Iterate over input map and create a config for each. for id, value := range recvs { - componentConfig := config.NewMapFromStringMap(value) - // Find receiver factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { return nil, errorUnknownType(receiversKeyName, id) } - receiverCfg, err := LoadReceiver(componentConfig, id, factory) - + receiverCfg, err := LoadReceiver(config.NewMapFromStringMap(value), id, factory) if err != nil { // LoadReceiver already wraps the error. return nil, err @@ -255,8 +236,6 @@ func unmarshalExporters(exps map[config.ComponentID]map[string]interface{}, fact // Iterate over Exporters and create a config for each. for id, value := range exps { - componentConfig := config.NewMapFromStringMap(value) - // Find exporter factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { @@ -270,7 +249,7 @@ func unmarshalExporters(exps map[config.ComponentID]map[string]interface{}, fact // 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. - if err := unmarshal(componentConfig, exporterCfg); err != nil { + if err := unmarshal(config.NewMapFromStringMap(value), exporterCfg); err != nil { return nil, errorUnmarshalError(exportersKeyName, id, err) } @@ -286,8 +265,6 @@ func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, fa // Iterate over processors and create a config for each. for id, value := range procs { - componentConfig := config.NewMapFromStringMap(value) - // Find processor factory based on "type" that we read from config source. factory := factories[id.Type()] if factory == nil { @@ -301,7 +278,7 @@ func unmarshalProcessors(procs map[config.ComponentID]map[string]interface{}, fa // 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. - if err := unmarshal(componentConfig, processorCfg); err != nil { + if err := unmarshal(config.NewMapFromStringMap(value), processorCfg); err != nil { return nil, errorUnmarshalError(processorsKeyName, id, err) } @@ -376,3 +353,11 @@ func unmarshal(componentSection *config.Map, intoCfg interface{}) error { return componentSection.UnmarshalExact(intoCfg) } + +func errorUnknownType(component string, id config.ComponentID) error { + return fmt.Errorf("unknown %s type %q for %q", component, id.Type(), id) +} + +func errorUnmarshalError(component string, id config.ComponentID, err error) error { + return fmt.Errorf("error reading %s configuration for %q: %w", component, id, err) +} diff --git a/receiver/otlpreceiver/config_test.go b/receiver/otlpreceiver/config_test.go index 23c8636b3c5..c73b8d11b78 100644 --- a/receiver/otlpreceiver/config_test.go +++ b/receiver/otlpreceiver/config_test.go @@ -199,14 +199,14 @@ func TestFailedLoadConfig(t *testing.T) { factory := NewFactory() factories.Receivers[typeStr] = factory _, err = configtest.LoadConfigAndValidate(path.Join(".", "testdata", "typo_default_proto_config.yaml"), factories) - assert.EqualError(t, err, "error reading receivers configuration for otlp: 1 error(s) decoding:\n\n* 'protocols' has invalid keys: htttp") + assert.EqualError(t, err, "error reading receivers configuration for \"otlp\": 1 error(s) decoding:\n\n* 'protocols' has invalid keys: htttp") _, err = configtest.LoadConfigAndValidate(path.Join(".", "testdata", "bad_proto_config.yaml"), factories) - assert.EqualError(t, err, "error reading receivers configuration for otlp: 1 error(s) decoding:\n\n* 'protocols' has invalid keys: thrift") + assert.EqualError(t, err, "error reading receivers configuration for \"otlp\": 1 error(s) decoding:\n\n* 'protocols' has invalid keys: thrift") _, err = configtest.LoadConfigAndValidate(path.Join(".", "testdata", "bad_no_proto_config.yaml"), factories) assert.EqualError(t, err, "receiver \"otlp\" has invalid configuration: must specify at least one protocol when using the OTLP receiver") _, err = configtest.LoadConfigAndValidate(path.Join(".", "testdata", "bad_empty_config.yaml"), factories) - assert.EqualError(t, err, "error reading receivers configuration for otlp: empty config for OTLP receiver") + assert.EqualError(t, err, "error reading receivers configuration for \"otlp\": empty config for OTLP receiver") } From a81ca22f0b9e98b808ca033fad33fc0b99d4a06c Mon Sep 17 00:00:00 2001 From: "Daniel (Shijun) Qian" Date: Fri, 5 Nov 2021 00:58:18 +0800 Subject: [PATCH 144/149] stop build if config file not exist (#4327) * stop build if config file not exist * Update cmd/builder/cmd/root.go Co-authored-by: Bogdan Drutu Co-authored-by: Bogdan Drutu --- cmd/builder/cmd/root.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/builder/cmd/root.go b/cmd/builder/cmd/root.go index cec9886b38b..91190d9a10c 100644 --- a/cmd/builder/cmd/root.go +++ b/cmd/builder/cmd/root.go @@ -114,9 +114,10 @@ func initConfig() { } // load the config file - if err := vp.ReadInConfig(); err == nil { - cfg.Logger.Info("Using config file", zap.String("path", vp.ConfigFileUsed())) + if err := vp.ReadInConfig(); err != nil { + cobra.CheckErr(err) } + cfg.Logger.Info("Using config file", zap.String("path", vp.ConfigFileUsed())) // convert Viper's internal state into our configuration object if err := vp.Unmarshal(&cfg); err != nil { From 81a6531967ab3ee07e3ff17b90a2337e565efafe Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 4 Nov 2021 09:59:49 -0700 Subject: [PATCH 145/149] Fix extensionz page to use full name, small nits in zpages (#4358) Signed-off-by: Bogdan Drutu --- service/internal/zpages/templates.go | 18 ++++++------- .../zpages/templates/component_header.html | 3 +-- .../zpages/templates/extensions_table.html | 3 +-- .../{footer.html => page_footer.html} | 0 .../{header.html => page_header.html} | 2 +- .../zpages/templates/pipelines_table.html | 25 +++++++++---------- .../zpages/templates/properties_table.html | 4 +-- service/internal/zpages/templates_test.go | 8 +++--- service/zpages.go | 22 +++++++--------- 9 files changed, 37 insertions(+), 48 deletions(-) rename service/internal/zpages/templates/{footer.html => page_footer.html} (100%) rename service/internal/zpages/templates/{header.html => page_header.html} (78%) diff --git a/service/internal/zpages/templates.go b/service/internal/zpages/templates.go index e8f9cc0bbf1..9451665847e 100644 --- a/service/internal/zpages/templates.go +++ b/service/internal/zpages/templates.go @@ -37,11 +37,11 @@ var ( extensionsTableBytes []byte extensionsTableTemplate = parseTemplate("extensions_table", extensionsTableBytes) - //go:embed templates/header.html + //go:embed templates/page_header.html headerBytes []byte headerTemplate = parseTemplate("header", headerBytes) - //go:embed templates/footer.html + //go:embed templates/page_footer.html footerBytes []byte footerTemplate = parseTemplate("footer", footerBytes) @@ -64,8 +64,8 @@ type HeaderData struct { Title string } -// WriteHTMLHeader writes the header. -func WriteHTMLHeader(w io.Writer, hd HeaderData) { +// WriteHTMLPageHeader writes the header. +func WriteHTMLPageHeader(w io.Writer, hd HeaderData) { if err := headerTemplate.Execute(w, hd); err != nil { log.Printf("zpages: executing template: %v", err) } @@ -73,8 +73,7 @@ func WriteHTMLHeader(w io.Writer, hd HeaderData) { // SummaryExtensionsTableData contains data for extensions summary table template. type SummaryExtensionsTableData struct { - ComponentEndpoint string - Rows []SummaryExtensionsTableRowData + Rows []SummaryExtensionsTableRowData } // SummaryExtensionsTableRowData contains data for one row in extensions summary table template. @@ -93,8 +92,7 @@ func WriteHTMLExtensionsSummaryTable(w io.Writer, spd SummaryExtensionsTableData // SummaryPipelinesTableData contains data for pipelines summary table template. type SummaryPipelinesTableData struct { - ComponentEndpoint string - Rows []SummaryPipelinesTableRowData + Rows []SummaryPipelinesTableRowData } // SummaryPipelinesTableRowData contains data for one row in pipelines summary table template. @@ -142,8 +140,8 @@ func WriteHTMLPropertiesTable(w io.Writer, chd PropertiesTableData) { } } -// WriteHTMLFooter writes the footer. -func WriteHTMLFooter(w io.Writer) { +// WriteHTMLPageFooter writes the footer. +func WriteHTMLPageFooter(w io.Writer) { if err := footerTemplate.Execute(w, nil); err != nil { log.Printf("zpages: executing template: %v", err) } diff --git a/service/internal/zpages/templates/component_header.html b/service/internal/zpages/templates/component_header.html index 463a15cc7e6..82612747900 100644 --- a/service/internal/zpages/templates/component_header.html +++ b/service/internal/zpages/templates/component_header.html @@ -1,7 +1,6 @@ -{{$a := .ComponentEndpoint}} {{$link := .Link}} {{- if $link -}} -

{{.Name}}
+
{{.Name}}
{{- else -}}
{{.Name}}
{{- end -}} \ No newline at end of file diff --git a/service/internal/zpages/templates/extensions_table.html b/service/internal/zpages/templates/extensions_table.html index 0b39ee933e1..ec76cc3c34c 100644 --- a/service/internal/zpages/templates/extensions_table.html +++ b/service/internal/zpages/templates/extensions_table.html @@ -1,11 +1,10 @@ - {{$a := .ComponentEndpoint}} {{range $rowindex, $row := .Rows}} {{- if even $rowindex}} {{else}} {{end -}} - + {{end}}
{{.FullName}}{{.FullName}}
\ No newline at end of file diff --git a/service/internal/zpages/templates/footer.html b/service/internal/zpages/templates/page_footer.html similarity index 100% rename from service/internal/zpages/templates/footer.html rename to service/internal/zpages/templates/page_footer.html diff --git a/service/internal/zpages/templates/header.html b/service/internal/zpages/templates/page_header.html similarity index 78% rename from service/internal/zpages/templates/header.html rename to service/internal/zpages/templates/page_header.html index c381c0ff6c8..a71daf87729 100644 --- a/service/internal/zpages/templates/header.html +++ b/service/internal/zpages/templates/page_header.html @@ -2,7 +2,7 @@ {{.Title}} - + diff --git a/service/internal/zpages/templates/pipelines_table.html b/service/internal/zpages/templates/pipelines_table.html index a9461627e89..d066d77b537 100644 --- a/service/internal/zpages/templates/pipelines_table.html +++ b/service/internal/zpages/templates/pipelines_table.html @@ -1,18 +1,17 @@ - + - + - + - + - + - + - {{$a := .ComponentEndpoint}} {{range $rowindex, $row := .Rows}} {{- if even $rowindex}} @@ -21,22 +20,22 @@ - - - diff --git a/service/internal/zpages/templates/properties_table.html b/service/internal/zpages/templates/properties_table.html index a43841ba770..7c3318c109c 100644 --- a/service/internal/zpages/templates/properties_table.html +++ b/service/internal/zpages/templates/properties_table.html @@ -6,9 +6,9 @@ {{else}} {{end -}} - + - + {{end}}
FullNameFullName   |  InputTypeInputType   |  MutatesDataMutatesData   |  ReceiversReceivers   |  ProcessorsProcessors   |  ExportersExporters
{{$row.FullName}}  |   {{$row.InputType}}  |   {{$row.MutatesData}}  |   + {{range $recindex, $rec := $row.Receivers}} - {{$rec}} + {{$rec}}
{{end}}
  |   + → {{range $proindex, $pro := $row.Processors}} - {{$pro}} + {{$pro}} → {{end}}   |   + {{range $expindex, $exp := $row.Exporters}} - {{$exp}} + {{$exp}}
{{end}}
{{$element|getKey}}{{$element|getKey}}   |  {{$element|getValue}}{{$element|getValue}}
\ No newline at end of file diff --git a/service/internal/zpages/templates_test.go b/service/internal/zpages/templates_test.go index 3c997b1ca00..a426797c34e 100644 --- a/service/internal/zpages/templates_test.go +++ b/service/internal/zpages/templates_test.go @@ -53,14 +53,13 @@ func TestTemplateFuncs(t *testing.T) { func TestNoCrash(t *testing.T) { buf := new(bytes.Buffer) - assert.NotPanics(t, func() { WriteHTMLHeader(buf, HeaderData{Title: "Foo"}) }) + assert.NotPanics(t, func() { WriteHTMLPageHeader(buf, HeaderData{Title: "Foo"}) }) assert.NotPanics(t, func() { WriteHTMLComponentHeader(buf, ComponentHeaderData{Name: "Bar"}) }) assert.NotPanics(t, func() { WriteHTMLComponentHeader(buf, ComponentHeaderData{Name: "Bar", ComponentEndpoint: "pagez", Link: true}) }) assert.NotPanics(t, func() { WriteHTMLPipelinesSummaryTable(buf, SummaryPipelinesTableData{ - ComponentEndpoint: "pagez", Rows: []SummaryPipelinesTableRowData{{ FullName: "test", InputType: "metrics", @@ -73,7 +72,6 @@ func TestNoCrash(t *testing.T) { }) assert.NotPanics(t, func() { WriteHTMLExtensionsSummaryTable(buf, SummaryExtensionsTableData{ - ComponentEndpoint: "pagez", Rows: []SummaryExtensionsTableRowData{{ FullName: "test", }}, @@ -82,6 +80,6 @@ func TestNoCrash(t *testing.T) { assert.NotPanics(t, func() { WriteHTMLPropertiesTable(buf, PropertiesTableData{Name: "Bar", Properties: [][2]string{{"key", "value"}}}) }) - assert.NotPanics(t, func() { WriteHTMLFooter(buf) }) - assert.NotPanics(t, func() { WriteHTMLFooter(buf) }) + assert.NotPanics(t, func() { WriteHTMLPageFooter(buf) }) + assert.NotPanics(t, func() { WriteHTMLPageFooter(buf) }) } diff --git a/service/zpages.go b/service/zpages.go index ee6d60ac2b9..b9cfedeb019 100644 --- a/service/zpages.go +++ b/service/zpages.go @@ -49,7 +49,7 @@ func (srv *service) RegisterZPages(mux *http.ServeMux, pathPrefix string) { func (srv *service) handleServicezRequest(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") - zpages.WriteHTMLHeader(w, zpages.HeaderData{Title: "service"}) + zpages.WriteHTMLPageHeader(w, zpages.HeaderData{Title: "service"}) zpages.WriteHTMLComponentHeader(w, zpages.ComponentHeaderData{ Name: "Pipelines", ComponentEndpoint: pipelinezPath, @@ -61,7 +61,7 @@ func (srv *service) handleServicezRequest(w http.ResponseWriter, r *http.Request Link: true, }) zpages.WriteHTMLPropertiesTable(w, zpages.PropertiesTableData{Name: "Build And Runtime", Properties: version.RuntimeVar()}) - zpages.WriteHTMLFooter(w) + zpages.WriteHTMLPageFooter(w) } func (srv *service) handlePipelinezRequest(w http.ResponseWriter, r *http.Request) { @@ -71,7 +71,7 @@ func (srv *service) handlePipelinezRequest(w http.ResponseWriter, r *http.Reques componentKind := qValues.Get(zComponentKind) w.Header().Set("Content-Type", "text/html; charset=utf-8") - zpages.WriteHTMLHeader(w, zpages.HeaderData{Title: "Pipelines"}) + zpages.WriteHTMLPageHeader(w, zpages.HeaderData{Title: "Pipelines"}) zpages.WriteHTMLPipelinesSummaryTable(w, srv.getPipelinesSummaryTableData()) if pipelineName != "" && componentName != "" && componentKind != "" { fullName := componentName @@ -83,13 +83,11 @@ func (srv *service) handlePipelinezRequest(w http.ResponseWriter, r *http.Reques }) // TODO: Add config + status info. } - zpages.WriteHTMLFooter(w) + zpages.WriteHTMLPageFooter(w) } func (srv *service) getPipelinesSummaryTableData() zpages.SummaryPipelinesTableData { - data := zpages.SummaryPipelinesTableData{ - ComponentEndpoint: pipelinezPath, - } + data := zpages.SummaryPipelinesTableData{} data.Rows = make([]zpages.SummaryPipelinesTableRowData, 0, len(srv.builtPipelines)) for c, p := range srv.builtPipelines { @@ -127,7 +125,7 @@ func handleExtensionzRequest(host component.Host, w http.ResponseWriter, r *http extensionName := r.URL.Query().Get(zExtensionName) w.Header().Set("Content-Type", "text/html; charset=utf-8") - zpages.WriteHTMLHeader(w, zpages.HeaderData{Title: "Extensions"}) + zpages.WriteHTMLPageHeader(w, zpages.HeaderData{Title: "Extensions"}) zpages.WriteHTMLExtensionsSummaryTable(w, getExtensionsSummaryTableData(host)) if extensionName != "" { zpages.WriteHTMLComponentHeader(w, zpages.ComponentHeaderData{ @@ -135,18 +133,16 @@ func handleExtensionzRequest(host component.Host, w http.ResponseWriter, r *http }) // TODO: Add config + status info. } - zpages.WriteHTMLFooter(w) + zpages.WriteHTMLPageFooter(w) } func getExtensionsSummaryTableData(host component.Host) zpages.SummaryExtensionsTableData { - data := zpages.SummaryExtensionsTableData{ - ComponentEndpoint: extensionzPath, - } + data := zpages.SummaryExtensionsTableData{} extensions := host.GetExtensions() data.Rows = make([]zpages.SummaryExtensionsTableRowData, 0, len(extensions)) for c := range extensions { - row := zpages.SummaryExtensionsTableRowData{FullName: c.Name()} + row := zpages.SummaryExtensionsTableRowData{FullName: c.String()} data.Rows = append(data.Rows, row) } From 7e8cc96d882667e424be08c33733a0d969a2a4ee Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 4 Nov 2021 11:48:54 -0700 Subject: [PATCH 146/149] Built pipeline ensure correct Capabilities (#4361) Users of the Pipeline should not know about internal details. Signed-off-by: Bogdan Drutu --- service/internal/builder/pipelines_builder.go | 40 ++++++++++++ service/internal/builder/receivers_builder.go | 63 ------------------- 2 files changed, 40 insertions(+), 63 deletions(-) diff --git a/service/internal/builder/pipelines_builder.go b/service/internal/builder/pipelines_builder.go index 4867417a57c..6a380e2682a 100644 --- a/service/internal/builder/pipelines_builder.go +++ b/service/internal/builder/pipelines_builder.go @@ -221,6 +221,19 @@ func (pb *pipelinesBuilder) buildPipeline(ctx context.Context, pipelineID config zap.String(components.ZapNameKey, pipelineID.String())) pipelineLogger.Info("Pipeline was built.") + // Some consumers may not correctly implement the Capabilities, + // and ignore the next consumer when calculated the Capabilities. + // Because of this wrap the first consumer if any consumers in the pipeline + // mutate the data and the first says that it doesn't. + if tc != nil { + tc = capabilitiesTraces{Traces: tc, capabilities: consumer.Capabilities{MutatesData: mutatesConsumedData}} + } + if mc != nil { + mc = capabilitiesMetrics{Metrics: mc, capabilities: consumer.Capabilities{MutatesData: mutatesConsumedData}} + } + if lc != nil { + lc = capabilitiesLogs{Logs: lc, capabilities: consumer.Capabilities{MutatesData: mutatesConsumedData}} + } bp := &builtPipeline{ logger: pipelineLogger, firstTC: tc, @@ -280,3 +293,30 @@ func (pb *pipelinesBuilder) buildFanoutExportersLogsConsumer(exporterIDs []confi // Create a junction point that fans out to all exporters. return fanoutconsumer.NewLogs(exporters) } + +type capabilitiesLogs struct { + consumer.Logs + capabilities consumer.Capabilities +} + +func (mts capabilitiesLogs) Capabilities() consumer.Capabilities { + return mts.capabilities +} + +type capabilitiesMetrics struct { + consumer.Metrics + capabilities consumer.Capabilities +} + +func (mts capabilitiesMetrics) Capabilities() consumer.Capabilities { + return mts.capabilities +} + +type capabilitiesTraces struct { + consumer.Traces + capabilities consumer.Capabilities +} + +func (mts capabilitiesTraces) Capabilities() consumer.Capabilities { + return mts.capabilities +} diff --git a/service/internal/builder/receivers_builder.go b/service/internal/builder/receivers_builder.go index 171f5aa914f..0ff9cdc1736 100644 --- a/service/internal/builder/receivers_builder.go +++ b/service/internal/builder/receivers_builder.go @@ -265,91 +265,28 @@ func (rb *receiversBuilder) buildReceiver(ctx context.Context, set component.Rec } func buildFanoutTraceConsumer(pipelines []*builtPipeline) consumer.Traces { - // Optimize for the case when there is only one processor, no need to create junction point. - if len(pipelines) == 1 { - return pipelines[0].firstTC - } - var pipelineConsumers []consumer.Traces for _, pipeline := range pipelines { - // Some consumers may not correctly implement the Capabilities, - // and ignore the next consumer when calculated the Capabilities. - // Because of this wrap the first consumer if any consumers in the pipeline - // mutate the data and the first says that it doesn't. - if pipeline.MutatesData && !pipeline.firstTC.Capabilities().MutatesData { - pipeline.firstTC = mutatingTraces{Traces: pipeline.firstTC} - } pipelineConsumers = append(pipelineConsumers, pipeline.firstTC) } - // Create a junction point that fans out to all pipelines. return fanoutconsumer.NewTraces(pipelineConsumers) } func buildFanoutMetricConsumer(pipelines []*builtPipeline) consumer.Metrics { - // Optimize for the case when there is only one processor, no need to create junction point. - if len(pipelines) == 1 { - return pipelines[0].firstMC - } - var pipelineConsumers []consumer.Metrics for _, pipeline := range pipelines { - // Some consumers may not correctly implement the Capabilities, - // and ignore the next consumer when calculated the Capabilities. - // Because of this wrap the first consumer if any consumers in the pipeline - // mutate the data and the first says that it doesn't. - if pipeline.MutatesData && !pipeline.firstMC.Capabilities().MutatesData { - pipeline.firstMC = mutatingMetrics{Metrics: pipeline.firstMC} - } pipelineConsumers = append(pipelineConsumers, pipeline.firstMC) } - // Create a junction point that fans out to all pipelines. return fanoutconsumer.NewMetrics(pipelineConsumers) } func buildFanoutLogConsumer(pipelines []*builtPipeline) consumer.Logs { - // Optimize for the case when there is only one processor, no need to create junction point. - if len(pipelines) == 1 { - return pipelines[0].firstLC - } - var pipelineConsumers []consumer.Logs for _, pipeline := range pipelines { - // Some consumers may not correctly implement the Capabilities, - // and ignore the next consumer when calculated the Capabilities. - // Because of this wrap the first consumer if any consumers in the pipeline - // mutate the data and the first says that it doesn't. - if pipeline.MutatesData && !pipeline.firstLC.Capabilities().MutatesData { - pipeline.firstLC = mutatingLogs{Logs: pipeline.firstLC} - } pipelineConsumers = append(pipelineConsumers, pipeline.firstLC) } - // Create a junction point that fans out to all pipelines. return fanoutconsumer.NewLogs(pipelineConsumers) } - -type mutatingLogs struct { - consumer.Logs -} - -func (mts mutatingLogs) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: true} -} - -type mutatingMetrics struct { - consumer.Metrics -} - -func (mts mutatingMetrics) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: true} -} - -type mutatingTraces struct { - consumer.Traces -} - -func (mts mutatingTraces) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: true} -} From 000a8f497207cd250d018932f25c4068e71c30a0 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 4 Nov 2021 12:15:43 -0700 Subject: [PATCH 147/149] Move builder/cmd/root to internal, no need to be public (#4362) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move builder/cmd/root to internal, no need to be public Signed-off-by: Bogdan Drutu * Update cmd/builder/internal/root.go Co-authored-by: Juraci Paixão Kröhling Co-authored-by: Juraci Paixão Kröhling --- cmd/builder/{cmd => internal}/root.go | 2 +- cmd/builder/main.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename cmd/builder/{cmd => internal}/root.go (98%) diff --git a/cmd/builder/cmd/root.go b/cmd/builder/internal/root.go similarity index 98% rename from cmd/builder/cmd/root.go rename to cmd/builder/internal/root.go index 91190d9a10c..7800ad7b2aa 100644 --- a/cmd/builder/cmd/root.go +++ b/cmd/builder/internal/root.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cmd // import "go.opentelemetry.io/collector/cmd/builder/cmd" +package internal // import "go.opentelemetry.io/collector/cmd/builder/internal" import ( "fmt" diff --git a/cmd/builder/main.go b/cmd/builder/main.go index c3d1f436995..4a797781764 100644 --- a/cmd/builder/main.go +++ b/cmd/builder/main.go @@ -18,11 +18,11 @@ import ( "fmt" "os" - "go.opentelemetry.io/collector/cmd/builder/cmd" + "go.opentelemetry.io/collector/cmd/builder/internal" ) func main() { - if err := cmd.Execute(); err != nil { + if err := internal.Execute(); err != nil { fmt.Println(err.Error()) os.Exit(1) } From 9092332abf6e2a916b0470ca4d022d5513986c84 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 4 Nov 2021 12:21:27 -0700 Subject: [PATCH 148/149] Remove deprecated funcs consumererror.As[Traces|Metrics|Logs] (#4364) Signed-off-by: Bogdan Drutu --- CHANGELOG.md | 1 + consumer/consumererror/signalerrors.go | 32 -------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0654331d82e..2994d35baf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Remove `config.Pipeline.Name` (#4326) - Remove `config.Pipeline.InputDataType` (#4343) - otlpexporter: Do not retry on PermissionDenied and Unauthenticated (#4349) +- Remove deprecated funcs `consumererror.As[Traces|Metrics|Logs]` (#4364) ## v0.38.0 Beta diff --git a/consumer/consumererror/signalerrors.go b/consumer/consumererror/signalerrors.go index 47456f0de39..f8c7e5bd53d 100644 --- a/consumer/consumererror/signalerrors.go +++ b/consumer/consumererror/signalerrors.go @@ -15,8 +15,6 @@ package consumererror // import "go.opentelemetry.io/collector/consumer/consumererror" import ( - "errors" - "go.opentelemetry.io/collector/model/pdata" ) @@ -35,16 +33,6 @@ func NewTraces(err error, failed pdata.Traces) error { } } -// AsTraces finds the first error in err's chain that can be assigned to target. If such an error is found, -// it is assigned to target and true is returned, otherwise false is returned. -// Deprecated: Use `errors.As(err, target)` instead. -func AsTraces(err error, target *Traces) bool { - if err == nil { - return false - } - return errors.As(err, target) -} - // GetTraces returns failed traces from the associated error. func (err Traces) GetTraces() pdata.Traces { return err.failed @@ -70,16 +58,6 @@ func NewLogs(err error, failed pdata.Logs) error { } } -// AsLogs finds the first error in err's chain that can be assigned to target. If such an error is found, -// it is assigned to target and true is returned, otherwise false is returned. -// Deprecated: Use `errors.As(err, target)` instead. -func AsLogs(err error, target *Logs) bool { - if err == nil { - return false - } - return errors.As(err, target) -} - // GetLogs returns failed logs from the associated error. func (err Logs) GetLogs() pdata.Logs { return err.failed @@ -105,16 +83,6 @@ func NewMetrics(err error, failed pdata.Metrics) error { } } -// AsMetrics finds the first error in err's chain that can be assigned to target. If such an error is found, -// it is assigned to target and true is returned, otherwise false is returned. -// Deprecated: Use `errors.As(err, target)` instead. -func AsMetrics(err error, target *Metrics) bool { - if err == nil { - return false - } - return errors.As(err, target) -} - // GetMetrics returns failed metrics from the associated error. func (err Metrics) GetMetrics() pdata.Metrics { return err.failed From 484e315dc90dc35a8f31275aca4719f127373b68 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 4 Nov 2021 12:31:48 -0700 Subject: [PATCH 149/149] Consistent config member name with configuration keys (#4363) Signed-off-by: Bogdan Drutu --- cmd/builder/internal/builder/config.go | 4 ++-- cmd/builder/internal/builder/main.go | 4 ++-- cmd/builder/internal/root.go | 4 ++-- cmd/builder/internal/scaffold/main.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go index bb84c838817..5af02f97981 100644 --- a/cmd/builder/internal/builder/config.go +++ b/cmd/builder/internal/builder/config.go @@ -50,9 +50,9 @@ type Config struct { // Distribution holds the parameters for the final binary type Distribution struct { Module string `mapstructure:"module"` - ExeName string `mapstructure:"name"` + Name string `mapstructure:"name"` Go string `mapstructure:"go"` - LongName string `mapstructure:"description"` + Description string `mapstructure:"description"` OtelColVersion string `mapstructure:"otelcol_version"` IncludeCore bool `mapstructure:"include_core"` OutputPath string `mapstructure:"output_path"` diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go index 91040178e92..af163385e78 100644 --- a/cmd/builder/internal/builder/main.go +++ b/cmd/builder/internal/builder/main.go @@ -107,12 +107,12 @@ func Compile(cfg Config) error { cfg.Logger.Info("Compiling") // #nosec G204 - cmd := exec.Command(cfg.Distribution.Go, "build", "-ldflags=-s -w", "-trimpath", "-o", cfg.Distribution.ExeName) + cmd := exec.Command(cfg.Distribution.Go, "build", "-ldflags=-s -w", "-trimpath", "-o", cfg.Distribution.Name) cmd.Dir = cfg.Distribution.OutputPath if out, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("failed to compile the OpenTelemetry Collector distribution: %w. Output: %q", err, out) } - cfg.Logger.Info("Compiled", zap.String("binary", fmt.Sprintf("%s/%s", cfg.Distribution.OutputPath, cfg.Distribution.ExeName))) + cfg.Logger.Info("Compiled", zap.String("binary", fmt.Sprintf("%s/%s", cfg.Distribution.OutputPath, cfg.Distribution.Name))) return nil } diff --git a/cmd/builder/internal/root.go b/cmd/builder/internal/root.go index 7800ad7b2aa..d24dedebb8a 100644 --- a/cmd/builder/internal/root.go +++ b/cmd/builder/internal/root.go @@ -70,8 +70,8 @@ func Execute() error { // the distribution parameters, which we accept as CLI flags as well cmd.Flags().BoolVar(&cfg.SkipCompilation, "skip-compilation", false, "Whether builder should only generate go code with no compile of the collector (default false)") - cmd.Flags().StringVar(&cfg.Distribution.ExeName, "name", "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") - cmd.Flags().StringVar(&cfg.Distribution.LongName, "description", "Custom OpenTelemetry Collector distribution", "A descriptive name for the OpenTelemetry Collector distribution") + cmd.Flags().StringVar(&cfg.Distribution.Name, "name", "otelcol-custom", "The executable name for the OpenTelemetry Collector distribution") + cmd.Flags().StringVar(&cfg.Distribution.Description, "description", "Custom OpenTelemetry Collector distribution", "A descriptive name for the OpenTelemetry Collector distribution") cmd.Flags().StringVar(&cfg.Distribution.Version, "version", "1.0.0", "The version for the OpenTelemetry Collector distribution") cmd.Flags().BoolVar(&cfg.Distribution.IncludeCore, "include-core", true, "Whether the core components should be included in the distribution") cmd.Flags().StringVar(&cfg.Distribution.OtelColVersion, "otelcol-version", cfg.Distribution.OtelColVersion, "Which version of OpenTelemetry Collector to use as base") diff --git a/cmd/builder/internal/scaffold/main.go b/cmd/builder/internal/scaffold/main.go index 22394c264db..17d9066df65 100644 --- a/cmd/builder/internal/scaffold/main.go +++ b/cmd/builder/internal/scaffold/main.go @@ -48,8 +48,8 @@ func main() { } info := component.BuildInfo{ - Command: "{{ .Distribution.ExeName }}", - Description: "{{ .Distribution.LongName }}", + Command: "{{ .Distribution.Name }}", + Description: "{{ .Distribution.Description }}", Version: "{{ .Distribution.Version }}", }