From d46c0d2e361423ea019bc2d18049066c889ac14e Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 17 Feb 2022 07:45:10 -0800 Subject: [PATCH 1/5] Add dependabot-generate make target (#2613) * Refactor common repo code for crosslink * Add dbotconf utility * Add dependabot-generate target to Makefile * Generate dependabot.yml * Update Makefile targets related to dependabot-generate --- .github/dependabot.yml | 170 +++++++++----------------- Makefile | 13 +- internal/tools/common.go | 79 +++++++++++- internal/tools/crosslink/crosslink.go | 112 ++++------------- internal/tools/dbotconf/dbotconf.go | 112 +++++++++++++++++ internal/tools/go.mod | 1 + 6 files changed, 276 insertions(+), 211 deletions(-) create mode 100644 internal/tools/dbotconf/dbotconf.go diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d326b38e49c..ca2daee0cbd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,8 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates -# \todo Eliminate duplication when/if Dependabot supports YAML anchors +# File generated by "make dependabot-generate"; DO NOT EDIT. version: 2 updates: - - - package-ecosystem: github-actions + - package-ecosystem: github-actions directory: / labels: - dependencies @@ -16,8 +11,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: / labels: - dependencies @@ -26,18 +20,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /bridge/opentracing - labels: - - dependencies - - go - - "Skip Changelog" - schedule: - day: sunday - interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /bridge/opencensus labels: - dependencies @@ -46,8 +29,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /bridge/opencensus/test labels: - dependencies @@ -56,9 +38,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /example/fib + - package-ecosystem: gomod + directory: /bridge/opentracing labels: - dependencies - go @@ -66,9 +47,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /example/prom-collector + - package-ecosystem: gomod + directory: /example/fib labels: - dependencies - go @@ -76,8 +56,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /example/jaeger labels: - dependencies @@ -86,8 +65,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /example/namedtracer labels: - dependencies @@ -96,8 +74,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /example/opencensus labels: - dependencies @@ -106,8 +83,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /example/otel-collector labels: - dependencies @@ -116,8 +92,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /example/passthrough labels: - dependencies @@ -126,8 +101,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /example/prometheus labels: - dependencies @@ -136,8 +110,7 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod + - package-ecosystem: gomod directory: /example/zipkin labels: - dependencies @@ -146,19 +119,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/prometheus - labels: - - dependencies - - go - - "Skip Changelog" - schedule: - day: sunday - interval: weekly - - - package-ecosystem: gomod - directory: /exporters/stdout/stdouttrace + - package-ecosystem: gomod + directory: /exporters/jaeger labels: - dependencies - go @@ -166,9 +128,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/stdout/stdoutmetric + - package-ecosystem: gomod + directory: /exporters/otlp/internal/retry labels: - dependencies - go @@ -176,9 +137,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/jaeger + - package-ecosystem: gomod + directory: /exporters/otlp/otlpmetric labels: - dependencies - go @@ -186,9 +146,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/zipkin + - package-ecosystem: gomod + directory: /exporters/otlp/otlpmetric/otlpmetricgrpc labels: - dependencies - go @@ -196,9 +155,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /sdk + - package-ecosystem: gomod + directory: /exporters/otlp/otlpmetric/otlpmetrichttp labels: - dependencies - go @@ -206,9 +164,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /internal/metric + - package-ecosystem: gomod + directory: /exporters/otlp/otlptrace labels: - dependencies - go @@ -216,9 +173,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /internal/tools + - package-ecosystem: gomod + directory: /exporters/otlp/otlptrace/otlptracegrpc labels: - dependencies - go @@ -226,9 +182,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /metric + - package-ecosystem: gomod + directory: /exporters/otlp/otlptrace/otlptracehttp labels: - dependencies - go @@ -236,9 +191,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /sdk/export/metric + - package-ecosystem: gomod + directory: /exporters/prometheus labels: - dependencies - go @@ -246,9 +200,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /sdk/metric + - package-ecosystem: gomod + directory: /exporters/stdout/stdoutmetric labels: - dependencies - go @@ -256,9 +209,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /internal/tools/semconv-gen + - package-ecosystem: gomod + directory: /exporters/stdout/stdouttrace labels: - dependencies - go @@ -266,9 +218,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/otlp/internal/retry + - package-ecosystem: gomod + directory: /exporters/zipkin labels: - dependencies - go @@ -276,9 +227,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/otlp/otlptrace + - package-ecosystem: gomod + directory: /internal/metric labels: - dependencies - go @@ -286,9 +236,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/otlp/otlptrace/otlptracegrpc + - package-ecosystem: gomod + directory: /internal/tools labels: - dependencies - go @@ -296,9 +245,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/otlp/otlptrace/otlptracehttp + - package-ecosystem: gomod + directory: /metric labels: - dependencies - go @@ -306,9 +254,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/otlp/otlpmetric + - package-ecosystem: gomod + directory: /schema labels: - dependencies - go @@ -316,9 +263,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/otlp/otlpmetric/otlpmetricgrpc + - package-ecosystem: gomod + directory: /sdk labels: - dependencies - go @@ -326,9 +272,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /trace + - package-ecosystem: gomod + directory: /sdk/export/metric labels: - dependencies - go @@ -336,9 +281,8 @@ updates: schedule: day: sunday interval: weekly - - - package-ecosystem: gomod - directory: /exporters/otlp/otlpmetric/otlpmetrichttp + - package-ecosystem: gomod + directory: /sdk/metric labels: - dependencies - go @@ -346,10 +290,8 @@ updates: schedule: day: sunday interval: weekly - - - - package-ecosystem: gomod - directory: /schema + - package-ecosystem: gomod + directory: /trace labels: - dependencies - go diff --git a/Makefile b/Makefile index b085561dbaa..bcb3a6d8629 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ TIMEOUT = 60 .DEFAULT_GOAL := precommit .PHONY: precommit ci -precommit: license-check misspell go-mod-tidy golangci-lint-fix test-default +precommit: dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default ci: dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage # Tools @@ -47,6 +47,9 @@ $(TOOLS)/semconvgen: PACKAGE=go.opentelemetry.io/build-tools/semconvgen CROSSLINK = $(TOOLS)/crosslink $(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/crosslink +DBOTCONF = $(TOOLS)/dbotconf +$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/dbotconf + GOLANGCI_LINT = $(TOOLS)/golangci-lint $(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint @@ -66,7 +69,7 @@ GOJQ = $(TOOLS)/gojq $(TOOLS)/gojq: PACKAGE=github.com/itchyny/gojq/cmd/gojq .PHONY: tools -tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) +tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) # Build @@ -187,9 +190,15 @@ dependabot-check: if [ -n "$$result" ]; then \ echo "missing dependabot entry:"; echo "$$result"; \ echo "new modules need to be added to the $(DEPENDABOT_PATH) file"; \ + echo "(run: make dependabot-generate)"; \ exit 1; \ fi +.PHONY: dependabot-generate +dependabot-generate: $(DBOTCONF) + @echo "gerating dependabot configuration"; \ + $(DBOTCONF) + .PHONY: check-clean-work-tree check-clean-work-tree: @if ! git diff --quiet; then \ diff --git a/internal/tools/common.go b/internal/tools/common.go index 525e5adcf3b..0c7389934ca 100644 --- a/internal/tools/common.go +++ b/internal/tools/common.go @@ -18,18 +18,28 @@ package tools // import "go.opentelemetry.io/otel/internal/tools" import ( + "bytes" "errors" "fmt" + "io" "os" "path/filepath" + "sort" "strings" + "text/tabwriter" + + "golang.org/x/mod/modfile" ) -// FindRepoRoot retrieves the root of the repository containing the current working directory. -// Beginning at the current working directory (dir), the algorithm checks if joining the ".git" -// suffix, such as "dir.get", is a valid file. Otherwise, it will continue checking the dir's -// parent directory until it reaches the repo root or returns an error if it cannot be found. -func FindRepoRoot() (string, error) { +// Repo represents a git repository. +type Repo string + +// FindRepoRoot retrieves the root of the repository containing the current +// working directory. Beginning at the current working directory (dir), the +// algorithm checks if joining the ".git" suffix, such as "dir.get", is a +// valid file. Otherwise, it will continue checking the dir's parent directory +// until it reaches the repo root or returns an error if it cannot be found. +func FindRepoRoot() (Repo, error) { start, err := os.Getwd() if err != nil { return "", err @@ -52,6 +62,63 @@ func FindRepoRoot() (string, error) { return "", err } - return dir, nil + return Repo(dir), nil + } +} + +// FindModules returns all Go modules contained in Repo r. +func (r Repo) FindModules() ([]*modfile.File, error) { + var results []*modfile.File + err := filepath.Walk(string(r), func(path string, info os.FileInfo, walkErr error) error { + if walkErr != nil { + // Walk failed to walk into this directory. Stop walking and + // signal this error. + return walkErr + } + + if !info.IsDir() { + return nil + } + + goMod := filepath.Join(path, "go.mod") + f, err := os.Open(goMod) + if errors.Is(err, os.ErrNotExist) { + return nil + } + if err != nil { + return err + } + + var b bytes.Buffer + io.Copy(&b, f) + if err = f.Close(); err != nil { + return err + } + + mFile, err := modfile.Parse(goMod, b.Bytes(), nil) + if err != nil { + return err + } + results = append(results, mFile) + return nil + }) + + sort.SliceStable(results, func(i, j int) bool { + return results[i].Syntax.Name < results[j].Syntax.Name + }) + + return results, err +} + +func PrintModFiles(w io.Writer, mFiles []*modfile.File) error { + tw := tabwriter.NewWriter(w, 0, 0, 1, ' ', 0) + if _, err := fmt.Fprintln(tw, "FILE PATH\tIMPORT PATH"); err != nil { + return err + } + for _, m := range mFiles { + if _, err := fmt.Fprintf(tw, "%s\t%s\n", m.Syntax.Name, m.Module.Mod.Path); err != nil { + return err + } } + return tw.Flush() } diff --git a/internal/tools/crosslink/crosslink.go b/internal/tools/crosslink/crosslink.go index a229bfa6db0..5f19d5b946e 100644 --- a/internal/tools/crosslink/crosslink.go +++ b/internal/tools/crosslink/crosslink.go @@ -25,106 +25,42 @@ package main import ( - "encoding/json" - "errors" - "fmt" - "io" "log" "os" - "os/exec" "path/filepath" "strings" - "text/tabwriter" "go.opentelemetry.io/otel/internal/tools" + "golang.org/x/mod/modfile" ) -type repo string - -type mod struct { - filePath string - importPath string -} - -func (r repo) findModules() (mods, error) { - var results []mod - err := filepath.Walk(string(r), func(path string, info os.FileInfo, err error) error { - if !info.IsDir() { - return nil - } - - _, err = os.Stat(filepath.Join(path, "go.mod")) - if errors.Is(err, os.ErrNotExist) { - return nil - } - if err != nil { - return err - } - - cmd := exec.Command("go", "mod", "edit", "-json") - cmd.Dir = path - out, err := cmd.Output() - if err != nil { - return err - } - - var result struct { - Module struct { - Path string - } - } - err = json.Unmarshal(out, &result) - if err != nil { - return err - } - - results = append(results, mod{ - filePath: path, - importPath: result.Module.Path, - }) - return nil - }) - - return results, err -} - -type mods []mod - -func (m mods) print(w io.Writer) error { - tw := tabwriter.NewWriter(w, 0, 0, 1, ' ', 0) - if _, err := fmt.Fprintln(tw, "FILE PATH\tIMPORT PATH"); err != nil { - return err - } - for _, m := range m { - if _, err := fmt.Fprintf(tw, "%s\t%s\n", m.filePath, m.importPath); err != nil { - return err - } - } - return tw.Flush() -} - -func (m mods) crossLink() error { +func crossLink(m []*modfile.File) error { for _, from := range m { - args := []string{"mod", "edit"} - + basepath := filepath.Dir(from.Syntax.Name) for _, to := range m { - localPath, err := filepath.Rel(from.filePath, to.filePath) + newPath, err := filepath.Rel(basepath, filepath.Dir(to.Syntax.Name)) if err != nil { return err } - if localPath == "." || localPath == ".." { - localPath += "/" - } else if !strings.HasPrefix(localPath, "..") { - localPath = "./" + localPath + switch { + case newPath == ".", newPath == "..": + newPath += "/" + case !strings.HasPrefix(newPath, ".."): + newPath = "./" + newPath } - args = append(args, "-replace", to.importPath+"="+localPath) + from.AddReplace(to.Module.Mod.Path, "", newPath, "") } - cmd := exec.Command("go", args...) - cmd.Dir = from.filePath - out, err := cmd.CombinedOutput() + from.Cleanup() + + f, err := os.OpenFile(from.Syntax.Name, os.O_RDWR|os.O_TRUNC, 0755) if err != nil { - log.Println(string(out)) + return err + } + if _, err = f.Write(modfile.Format(from.Syntax)); err != nil { + return err + } + if err = f.Close(); err != nil { return err } } @@ -132,23 +68,21 @@ func (m mods) crossLink() error { } func main() { - repoRootStr, err := tools.FindRepoRoot() + root, err := tools.FindRepoRoot() if err != nil { log.Fatalf("unable to find repo root: %v", err) } - repoRoot := repo(repoRootStr) - - mods, err := repoRoot.findModules() + mods, err := root.FindModules() if err != nil { log.Fatalf("unable to list modules: %v", err) } - if err := mods.print(os.Stdout); err != nil { + if err := tools.PrintModFiles(os.Stdout, mods); err != nil { log.Fatalf("unable to print modules: %v", err) } - if err := mods.crossLink(); err != nil { + if err := crossLink(mods); err != nil { log.Fatalf("unable to crosslink: %v", err) } } diff --git a/internal/tools/dbotconf/dbotconf.go b/internal/tools/dbotconf/dbotconf.go new file mode 100644 index 00000000000..a81a3a83fb9 --- /dev/null +++ b/internal/tools/dbotconf/dbotconf.go @@ -0,0 +1,112 @@ +// 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 main provides a utility to generate a complete dependabot +// configuration for a repository with multiple Go modules. +package main + +import ( + "flag" + "fmt" + "log" + "os" + "path/filepath" + "sort" + "strings" + "text/template" + + "go.opentelemetry.io/otel/internal/tools" + "golang.org/x/mod/modfile" +) + +var configPtr = flag.String("config", "./.github/dependabot.yml", "dependabot configuration path") + +const configTemplate = `# File generated by "make dependabot-generate"; DO NOT EDIT. + +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + labels: + - dependencies + - actions + - "Skip Changelog" + schedule: + day: sunday + interval: weekly +{{- range .}} + - package-ecosystem: gomod + directory: {{.}} + labels: + - dependencies + - go + - "Skip Changelog" + schedule: + day: sunday + interval: weekly +{{- end}} +` + +func gomodDirectories(basePath string, mods []*modfile.File) []string { + var dirs []string + for _, m := range mods { + targetPath := filepath.Dir(m.Syntax.Name) + relPath := strings.TrimPrefix(targetPath, basePath) + if relPath == "" { + relPath = "/" + } + dirs = append(dirs, relPath) + } + sort.Strings(dirs) + return dirs +} + +func generate(path string) error { + tpl, err := template.New("dependabot.yml").Parse(configTemplate) + if err != nil { + return fmt.Errorf("parse template: %w", err) + } + + root, err := tools.FindRepoRoot() + if err != nil { + return fmt.Errorf("find repo root: %w", err) + } + + mods, err := root.FindModules() + if err != nil { + return fmt.Errorf("list modules: %w", err) + } + data := gomodDirectories(string(root), mods) + + f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755) + if err != nil { + return err + } + if err = tpl.Execute(f, data); err != nil { + // Best effort. + _ = f.Close() + return fmt.Errorf("rendering template: %w", err) + } + if err = f.Close(); err != nil { + return fmt.Errorf("closing %s: %w", path, err) + } + return nil +} + +func main() { + flag.Parse() + if err := generate(*configPtr); err != nil { + log.Fatalf("failed to generate dependabot configuration: %v", err) + } +} diff --git a/internal/tools/go.mod b/internal/tools/go.mod index fbaac2e35a9..aac8b9cb1c0 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -11,6 +11,7 @@ require ( github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad go.opentelemetry.io/build-tools/multimod v0.0.0-20210920164323-2ceabab23375 go.opentelemetry.io/build-tools/semconvgen v0.0.0-20210920164323-2ceabab23375 + golang.org/x/mod v0.5.1 golang.org/x/tools v0.1.9 ) From b675dda67e56a6e1d4165444289c5da816a828ff Mon Sep 17 00:00:00 2001 From: Ben Wells Date: Thu, 17 Feb 2022 16:11:09 +0000 Subject: [PATCH 2/5] Fix typo in using instrumentation libraries markdown (#2621) Co-authored-by: Tyler Yahn --- website_docs/libraries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website_docs/libraries.md b/website_docs/libraries.md index 064af7ba0fc..8cd772da06d 100644 --- a/website_docs/libraries.md +++ b/website_docs/libraries.md @@ -92,4 +92,4 @@ A full list of instrumentation libraries available can be found in the [OpenTele Instrumentation libraries can do things like generate telemetry data for inbound and outbound HTTP requests, but they don't instrument your actual application. -To get richer telemetry data, use [manual instrumentatiion]({{< relref "manual" >}}) to enrich your telemetry data from instrumentation libraries with instrumentation from your running application. +To get richer telemetry data, use [manual instrumentation]({{< relref "manual" >}}) to enrich your telemetry data from instrumentation libraries with instrumentation from your running application. From 98c2c9d96c84816d1a6a65440b5a8c45bc748bfe Mon Sep 17 00:00:00 2001 From: Will Li Date: Fri, 18 Feb 2022 00:21:13 +0800 Subject: [PATCH 3/5] Add env support for span limits configuration (#2606) * add env support for otel_span configuration Signed-off-by: Cuichen Li * update changelog * update changelog and some logic based on comment * Update CHANGELOG.md Co-authored-by: Anthony Mirabella * add document about retrieve value from environment variable Signed-off-by: Cuichen Li * remove trailing whitespace Signed-off-by: Cuichen Li * parse environment variable before apply the options * Update CHANGELOG.md Co-authored-by: Tyler Yahn * Update sdk/trace/provider_test.go Co-authored-by: Tyler Yahn * Update CHANGELOG.md Co-authored-by: Anthony Mirabella Co-authored-by: Tyler Yahn --- CHANGELOG.md | 10 +++++++ sdk/internal/env/env.go | 15 ++++++++++ sdk/trace/config.go | 16 ++++++++++ sdk/trace/provider.go | 1 + sdk/trace/provider_test.go | 61 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b2bcfe09bf..59d0b7bad66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Added + +- Added support to configure the span limits with environment variables. + The following environment variables are used. (#2606) + - `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT` + - `OTEL_SPAN_EVENT_COUNT_LIMIT` + - `OTEL_SPAN_LINK_COUNT_LIMIT` + + If the provided environment variables are invalid (negative), the default values would be used. + ### Changed - Add event and link drop counts to the exported data from the `oltptrace` exporter. (#2601) diff --git a/sdk/internal/env/env.go b/sdk/internal/env/env.go index 397fd9593cc..df7a05626b3 100644 --- a/sdk/internal/env/env.go +++ b/sdk/internal/env/env.go @@ -40,6 +40,21 @@ const ( // Note: Must be less than or equal to EnvBatchSpanProcessorMaxQueueSize // i.e. 512 BatchSpanProcessorMaxExportBatchSizeKey = "OTEL_BSP_MAX_EXPORT_BATCH_SIZE" + + // SpanAttributesCountKey + // Maximum allowed span attribute count + // Default: 128 + SpanAttributesCountKey = "OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT" + + // SpanEventCountKey + // Maximum allowed span event count + // Default: 128 + SpanEventCountKey = "OTEL_SPAN_EVENT_COUNT_LIMIT" + + // SpanLinkCountKey + // Maximum allowed span link count + // Default: 128 + SpanLinkCountKey = "OTEL_SPAN_LINK_COUNT_LIMIT" ) // IntEnvOr returns the int value of the environment variable with name key if diff --git a/sdk/trace/config.go b/sdk/trace/config.go index 61a30439251..efea7b302f9 100644 --- a/sdk/trace/config.go +++ b/sdk/trace/config.go @@ -13,6 +13,7 @@ // limitations under the License. package trace // import "go.opentelemetry.io/otel/sdk/trace" +import "go.opentelemetry.io/otel/sdk/internal/env" // SpanLimits represents the limits of a span. type SpanLimits struct { @@ -50,14 +51,29 @@ func (sl *SpanLimits) ensureDefault() { } } +func (sl *SpanLimits) parsePotentialEnvConfigs() { + sl.AttributeCountLimit = env.IntEnvOr(env.SpanAttributesCountKey, sl.AttributeCountLimit) + sl.LinkCountLimit = env.IntEnvOr(env.SpanLinkCountKey, sl.LinkCountLimit) + sl.EventCountLimit = env.IntEnvOr(env.SpanEventCountKey, sl.EventCountLimit) +} + const ( // DefaultAttributeCountLimit is the default maximum allowed span attribute count. + // If not specified via WithSpanLimits, will try to retrieve the value from + // environment variable `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`. + // If Invalid value (negative or zero) is provided, the default value 128 will be used. DefaultAttributeCountLimit = 128 // DefaultEventCountLimit is the default maximum allowed span event count. + // If not specified via WithSpanLimits, will try to retrieve the value from + // environment variable `OTEL_SPAN_EVENT_COUNT_LIMIT`. + // If Invalid value (negative or zero) is provided, the default value 128 will be used. DefaultEventCountLimit = 128 // DefaultLinkCountLimit is the default maximum allowed span link count. + // If the value is not specified via WithSpanLimits, will try to retrieve the value from + // environment variable `OTEL_SPAN_LINK_COUNT_LIMIT`. + // If Invalid value (negative or zero) is provided, the default value 128 will be used. DefaultLinkCountLimit = 128 // DefaultAttributePerEventCountLimit is the default maximum allowed attribute per span event count. diff --git a/sdk/trace/provider.go b/sdk/trace/provider.go index c6b311f9cdc..2de79f03397 100644 --- a/sdk/trace/provider.go +++ b/sdk/trace/provider.go @@ -98,6 +98,7 @@ var _ trace.TracerProvider = &TracerProvider{} func NewTracerProvider(opts ...TracerProviderOption) *TracerProvider { o := tracerProviderConfig{} + o.spanLimits.parsePotentialEnvConfigs() for _, opt := range opts { o = opt.apply(o) } diff --git a/sdk/trace/provider_test.go b/sdk/trace/provider_test.go index e2fce31d7f7..0633889bdc2 100644 --- a/sdk/trace/provider_test.go +++ b/sdk/trace/provider_test.go @@ -17,8 +17,14 @@ package trace import ( "context" "errors" + "os" "testing" + "github.com/stretchr/testify/require" + + ottest "go.opentelemetry.io/otel/internal/internaltest" + "go.opentelemetry.io/otel/sdk/internal/env" + "github.com/stretchr/testify/assert" "go.opentelemetry.io/otel/trace" @@ -94,3 +100,58 @@ func TestSchemaURL(t *testing.T) { tracerStruct := tracerIface.(*tracer) assert.EqualValues(t, schemaURL, tracerStruct.instrumentationLibrary.SchemaURL) } + +func TestNewTraceProviderWithoutSpanLimitConfiguration(t *testing.T) { + envStore := ottest.NewEnvStore() + defer func() { + require.NoError(t, envStore.Restore()) + }() + envStore.Record(env.SpanAttributesCountKey) + envStore.Record(env.SpanEventCountKey) + envStore.Record(env.SpanLinkCountKey) + require.NoError(t, os.Setenv(env.SpanEventCountKey, "111")) + require.NoError(t, os.Setenv(env.SpanAttributesCountKey, "222")) + require.NoError(t, os.Setenv(env.SpanLinkCountKey, "333")) + tp := NewTracerProvider() + assert.Equal(t, 111, tp.spanLimits.EventCountLimit) + assert.Equal(t, 222, tp.spanLimits.AttributeCountLimit) + assert.Equal(t, 333, tp.spanLimits.LinkCountLimit) +} + +func TestNewTraceProviderWithSpanLimitConfigurationFromOptsAndEnvironmentVariable(t *testing.T) { + envStore := ottest.NewEnvStore() + defer func() { + require.NoError(t, envStore.Restore()) + }() + envStore.Record(env.SpanAttributesCountKey) + envStore.Record(env.SpanEventCountKey) + envStore.Record(env.SpanLinkCountKey) + require.NoError(t, os.Setenv(env.SpanEventCountKey, "111")) + require.NoError(t, os.Setenv(env.SpanAttributesCountKey, "222")) + require.NoError(t, os.Setenv(env.SpanLinkCountKey, "333")) + tp := NewTracerProvider(WithSpanLimits(SpanLimits{ + EventCountLimit: 1, + AttributeCountLimit: 2, + LinkCountLimit: 3, + })) + assert.Equal(t, 1, tp.spanLimits.EventCountLimit) + assert.Equal(t, 2, tp.spanLimits.AttributeCountLimit) + assert.Equal(t, 3, tp.spanLimits.LinkCountLimit) +} + +func TestNewTraceProviderWithInvalidSpanLimitConfigurationFromEnvironmentVariable(t *testing.T) { + envStore := ottest.NewEnvStore() + defer func() { + require.NoError(t, envStore.Restore()) + }() + envStore.Record(env.SpanAttributesCountKey) + envStore.Record(env.SpanEventCountKey) + envStore.Record(env.SpanLinkCountKey) + require.NoError(t, os.Setenv(env.SpanEventCountKey, "-111")) + require.NoError(t, os.Setenv(env.SpanAttributesCountKey, "-222")) + require.NoError(t, os.Setenv(env.SpanLinkCountKey, "-333")) + tp := NewTracerProvider() + assert.Equal(t, 128, tp.spanLimits.EventCountLimit) + assert.Equal(t, 128, tp.spanLimits.AttributeCountLimit) + assert.Equal(t, 128, tp.spanLimits.LinkCountLimit) +} From 8297dbf422d4ff9aa7edb4f7dfe80074f8dd8698 Mon Sep 17 00:00:00 2001 From: Chester Cheung Date: Fri, 18 Feb 2022 00:29:18 +0800 Subject: [PATCH 4/5] Remove the otlp trace exporter limit of SpanEvents when exporting (#2616) * remove the limit of SpanEvents when exporting * fix changelog * Update exporters/otlp/otlptrace/internal/tracetransform/span.go Co-authored-by: Sam Xie * Update exporters/otlp/otlptrace/internal/tracetransform/span.go Co-authored-by: Sam Xie * Update exporters/otlp/otlptrace/internal/tracetransform/span.go Co-authored-by: Sam Xie * Update CHANGELOG.md Co-authored-by: Sam Xie * fix unused param * fix changelog * Update CHANGELOG.md Co-authored-by: Tyler Yahn * fix unittest * fix code format Co-authored-by: Sam Xie Co-authored-by: Tyler Yahn --- CHANGELOG.md | 4 ++++ .../otlp/otlptrace/internal/tracetransform/span.go | 14 ++------------ .../otlptrace/internal/tracetransform/span_test.go | 13 ------------- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d0b7bad66..06e9bcda974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Add event and link drop counts to the exported data from the `oltptrace` exporter. (#2601) +### Fixed + +- Remove the OTLP trace exporter limit of SpanEvents when exporting. (#2616) + ## [1.4.1] - 2022-02-16 ### Fixed diff --git a/exporters/otlp/otlptrace/internal/tracetransform/span.go b/exporters/otlp/otlptrace/internal/tracetransform/span.go index 3c6a3ec4291..88c05912f0d 100644 --- a/exporters/otlp/otlptrace/internal/tracetransform/span.go +++ b/exporters/otlp/otlptrace/internal/tracetransform/span.go @@ -23,10 +23,6 @@ import ( tracepb "go.opentelemetry.io/proto/otlp/trace/v1" ) -const ( - maxEventsPerSpan = 128 -) - // Spans transforms a slice of OpenTelemetry spans into a slice of OTLP // ResourceSpans. func Spans(sdl []tracesdk.ReadOnlySpan) []*tracepb.ResourceSpans { @@ -177,14 +173,9 @@ func spanEvents(es []tracesdk.Event) []*tracepb.Span_Event { return nil } - evCount := len(es) - if evCount > maxEventsPerSpan { - evCount = maxEventsPerSpan - } - events := make([]*tracepb.Span_Event, evCount) - + events := make([]*tracepb.Span_Event, len(es)) // Transform message events - for i := 0; i < evCount; i++ { + for i := 0; i < len(es); i++ { events[i] = &tracepb.Span_Event{ Name: es[i].Name, TimeUnixNano: uint64(es[i].Time.UnixNano()), @@ -192,7 +183,6 @@ func spanEvents(es []tracesdk.Event) []*tracepb.Span_Event { DroppedAttributesCount: uint32(es[i].DroppedAttributeCount), } } - return events } diff --git a/exporters/otlp/otlptrace/internal/tracetransform/span_test.go b/exporters/otlp/otlptrace/internal/tracetransform/span_test.go index f83d748d63c..37860d2e047 100644 --- a/exporters/otlp/otlptrace/internal/tracetransform/span_test.go +++ b/exporters/otlp/otlptrace/internal/tracetransform/span_test.go @@ -15,7 +15,6 @@ package tracetransform import ( - "strconv" "testing" "time" @@ -102,18 +101,6 @@ func TestSpanEvent(t *testing.T) { assert.Equal(t, &tracepb.Span_Event{Name: "test 2", Attributes: KeyValues(attrs), TimeUnixNano: eventTimestamp, DroppedAttributesCount: 2}, got[1]) } -func TestExcessiveSpanEvents(t *testing.T) { - e := make([]tracesdk.Event, maxEventsPerSpan+1) - for i := 0; i < maxEventsPerSpan+1; i++ { - e[i] = tracesdk.Event{Name: strconv.Itoa(i)} - } - assert.Len(t, e, maxEventsPerSpan+1) - got := spanEvents(e) - assert.Len(t, got, maxEventsPerSpan) - // Ensure the drop order. - assert.Equal(t, strconv.Itoa(maxEventsPerSpan-1), got[len(got)-1].Name) -} - func TestNilLinks(t *testing.T) { assert.Nil(t, links(nil)) } From 8ebef7563fa38e092915a74db150570faba7b979 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Feb 2022 08:36:53 -0800 Subject: [PATCH 5/5] Bump github.com/golangci/golangci-lint from 1.44.0 to 1.44.1 in /internal/tools (#2624) * Bump github.com/golangci/golangci-lint in /internal/tools Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.44.0 to 1.44.1. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](https://github.com/golangci/golangci-lint/compare/v1.44.0...v1.44.1) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Auto-fix go.sum changes in dependent modules Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: MrAlias --- internal/tools/go.mod | 2 +- internal/tools/go.sum | 47 +++++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/internal/tools/go.mod b/internal/tools/go.mod index aac8b9cb1c0..5ca64048db6 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/client9/misspell v0.3.4 github.com/gogo/protobuf v1.3.2 - github.com/golangci/golangci-lint v1.44.0 + github.com/golangci/golangci-lint v1.44.1 github.com/itchyny/gojq v0.12.6 github.com/jcchavezs/porto v0.4.0 github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad diff --git a/internal/tools/go.sum b/internal/tools/go.sum index ae43fe3288b..8a5ca47194e 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -118,14 +118,14 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= -github.com/blizzy78/varnamelen v0.5.0 h1:v9LpMwxzTqAJC4lsD/jR7zWb8a66trcqhTEH4Mk6Fio= -github.com/blizzy78/varnamelen v0.5.0/go.mod h1:Mc0nLBKI1/FP0Ga4kqMOgBig0eS5QtR107JnMAb1Wuc= +github.com/blizzy78/varnamelen v0.6.0 h1:TOIDk9qRIMspALZKX8x+5hQfAjuvAFogppnxtvuNmBo= +github.com/blizzy78/varnamelen v0.6.0/go.mod h1:zy2Eic4qWqjrxa60jG34cfL0VXcSwzUrIx68eJPb4Q8= github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/breml/bidichk v0.2.1 h1:SRNtZuLdfkxtocj+xyHXKC1Uv3jVi6EPYx+NHSTNQvE= -github.com/breml/bidichk v0.2.1/go.mod h1:zbfeitpevDUGI7V91Uzzuwrn4Vls8MoBMrwtt78jmso= -github.com/breml/errchkjson v0.2.1 h1:QCToXnY9BNngrbJoW3qfCTt3BdtbnsI6wyP/WGrxxSE= -github.com/breml/errchkjson v0.2.1/go.mod h1:jZEATw/jF69cL1iy7//Yih8yp/mXp2CBoBr9GJwCAsY= +github.com/breml/bidichk v0.2.2 h1:w7QXnpH0eCBJm55zGCTJveZEkQBt6Fs5zThIdA6qQ9Y= +github.com/breml/bidichk v0.2.2/go.mod h1:zbfeitpevDUGI7V91Uzzuwrn4Vls8MoBMrwtt78jmso= +github.com/breml/errchkjson v0.2.3 h1:97eGTmR/w0paL2SwfRPI1jaAZHaH/fXnxWTw2eEIqE0= +github.com/breml/errchkjson v0.2.3/go.mod h1:jZEATw/jF69cL1iy7//Yih8yp/mXp2CBoBr9GJwCAsY= github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -172,8 +172,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/daixiang0/gci v0.2.9 h1:iwJvwQpBZmMg31w+QQ6jsyZ54KEATn6/nfARbBNW294= -github.com/daixiang0/gci v0.2.9/go.mod h1:+4dZ7TISfSmqfAGv59ePaHfNzgGtIkHAhhdKggP1JAc= +github.com/daixiang0/gci v0.3.0 h1:6x2xp99la0TfGmdDJ6T2VrLtCoZwYUVp4/5zT8J7+Go= +github.com/daixiang0/gci v0.3.0/go.mod h1:jaASoJmv/ykO9dAAPy31iJnreV19248qKDdVWf3QgC4= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -318,8 +318,8 @@ github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZB github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.44.0 h1:YJPouGNQEdK+x2KsCpWMIBy0q6MSuxHjkWMxJMNj/DU= -github.com/golangci/golangci-lint v1.44.0/go.mod h1:aBolpzNkmYogKPynGKdOWDCEc8LlwnxZC6w/SJ1TaEs= +github.com/golangci/golangci-lint v1.44.1 h1:/jcmjp9715WazPIu4oZz8KaV9xSq5HTuedjpWm/RVvc= +github.com/golangci/golangci-lint v1.44.1/go.mod h1:s0UbBHNNBlEPt8OcPsJV7IPONwQ+WEVywSk+FPpLV18= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= @@ -345,8 +345,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ 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 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= 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= @@ -457,6 +458,8 @@ github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOn 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/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= @@ -531,8 +534,8 @@ 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= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kulti/thelper v0.5.0 h1:CiEKStgoG4K9bjf/zk3eNX0D0J2iFWzxEY+h9UXmlJg= -github.com/kulti/thelper v0.5.0/go.mod h1:vMu2Cizjy/grP+jmsvOFDx1kYP6+PD1lqg4Yu5exl2U= +github.com/kulti/thelper v0.5.1 h1:Uf4CUekH0OvzQTFPrWkstJvXgm6pnNEtQu3HiqEkpB0= +github.com/kulti/thelper v0.5.1/go.mod h1:vMu2Cizjy/grP+jmsvOFDx1kYP6+PD1lqg4Yu5exl2U= github.com/kunwardeep/paralleltest v1.0.3 h1:UdKIkImEAXjR1chUWLn+PNXqWUGs//7tzMeWuP7NhmI= github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= @@ -540,8 +543,8 @@ github.com/kyoh86/exportloopref v0.1.8 h1:5Ry/at+eFdkX9Vsdw3qU4YkvGtzuVfzT4X7S77 github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= github.com/ldez/gomoddirectives v0.2.2 h1:p9/sXuNFArS2RLc+UpYZSI4KQwGMEDWC/LbtF5OPFVg= github.com/ldez/gomoddirectives v0.2.2/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.3.0 h1:Aubm2ZsrsjIGFvdxemMPJaXrSJ5Cys6VWyTQFt9k2dI= -github.com/ldez/tagliatelle v0.3.0/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= +github.com/ldez/tagliatelle v0.3.1 h1:3BqVVlReVUZwafJUwQ+oxbx2BEX2vUG4Yu/NOfMiKiM= +github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= github.com/leonklingele/grouper v1.1.0 h1:tC2y/ygPbMFSBOs3DcyaEMKnnwH7eYKzohOtRrf0SAg= github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= @@ -589,8 +592,8 @@ github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwg github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8ceC6BxnoG8TBrhgAvRg8obzup0= github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.1.3 h1:6tBZacs2/uv9UOpkBQhCtXh2NGgu2Ry97ZyjcN6uDCM= -github.com/mgechev/revive v1.1.3/go.mod h1:jMzDa13teAuv/KLeqgJw79NDe+1IT0ZO3Mht0vN1Yls= +github.com/mgechev/revive v1.1.4 h1:sZOjY6GU35Kr9jKa/wsKSHgrFz8eASIB5i3tqWZMp0A= +github.com/mgechev/revive v1.1.4/go.mod h1:ZZq2bmyssGh8MSPz3VVziqRNIMYTJXzP8MUKG90vZ9A= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= @@ -714,7 +717,7 @@ github.com/quasilyte/go-ruleguard v0.3.15/go.mod h1:NhuWhnlVEM1gT1A4VJHYfy9MuYSx github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.12-0.20220101150716-969a394a9451/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/dsl v0.3.12/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.15/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/go-ruleguard/dsl v0.3.17/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= github.com/quasilyte/gogrep v0.0.0-20220103110004-ffaa07af02e3 h1:P4QPNn+TK49zJjXKERt/vyPbv/mCHB/zQ4flDYOMN+M= @@ -748,7 +751,7 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil/v3 v3.21.12/go.mod h1:BToYZVTlSVlfazpDDYFnsVZLaoRG+g8ufT6fPQLdJzA= +github.com/shirou/gopsutil/v3 v3.22.1/go.mod h1:WapW1AOOPlHyXr+yOyw3uYx36enocrtSoSBy0L5vUHY= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -1052,6 +1055,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ 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 h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= 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= @@ -1135,15 +1139,15 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210915083310-ed5796bab164/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320/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= @@ -1243,7 +1247,6 @@ golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201028025901-8cd080b735b3/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201114224030-61ea331ec02b/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201118003311-bd56c0adb394/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-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=