diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000000..552b1333c219 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,29 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +### Problem Statement + +A clear and concise description of what the problem is. +Ex. I'm always frustrated when [...] + +### Proposed Solution + +A clear and concise description of what you want to happen. + +#### Alternatives + +A clear and concise description of any alternative solutions or features you've considered. + +#### Prior Art + +A clear and concise list of any similar and existing solutions from other projects that provide context to possible solutions. + +### Additional Context + +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fc1130e6d2c..98613439e8c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,14 +24,14 @@ jobs: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: Module cache - uses: actions/cache@v2.1.4 + uses: actions/cache@v2.1.5 env: cache-name: go-mod-cache with: path: ~/go/pkg/mod key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - name: Tools cache - uses: actions/cache@v2.1.4 + uses: actions/cache@v2.1.5 env: cache-name: go-tools-cache with: @@ -58,7 +58,7 @@ jobs: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: Module cache - uses: actions/cache@v2.1.4 + uses: actions/cache@v2.1.5 env: cache-name: go-mod-cache with: @@ -81,7 +81,7 @@ jobs: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: Module cache - uses: actions/cache@v2.1.4 + uses: actions/cache@v2.1.5 env: cache-name: go-mod-cache with: @@ -134,7 +134,7 @@ jobs: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH shell: bash - name: Module cache - uses: actions/cache@v2.1.4 + uses: actions/cache@v2.1.5 env: cache-name: go-mod-cache with: diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 000000000000..30076380bb7f --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,26 @@ +# Default state for all rules +default: true + +# ul-style +MD004: false + +# hard-tabs +MD010: false + +# line-length +MD013: false + +# no-duplicate-header +MD024: + siblings_only: true + +# ol-prefix +MD029: + style: ordered + +# no-inline-html +MD033: false + +# fenced-code-language +MD040: false + diff --git a/CHANGELOG.md b/CHANGELOG.md index b53e4e28d757..f816ba487da0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,44 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Added +### Changed + +- Make `NewSplitDriver` from `go.opentelemetry.io/otel/exporters/otlp` take variadic arguments instead of a `SplitConfig` item. + `NewSplitDriver` now automically implements an internal `noopDriver` for `SplitConfig` fields that are not initialized. (#1798) + +### Deprecated + +### Removed + +### Fixed + +### Security + +## [0.20.0] - 2021-04-23 + +### Added + +- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373) +- Adds semantic conventions for exceptions. (#1492) - Added Jaeger Environment variables: `OTEL_EXPORTER_JAEGER_AGENT_HOST`, `OTEL_EXPORTER_JAEGER_AGENT_PORT` These environment variables can be used to override Jaeger agent hostname and port (#1752) -- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373) -- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772) - Option `ExportTimeout` was added to batch span processor. (#1755) -- Adds semantic conventions for exceptions. (#1492) +- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770) +- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771) +- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771) +- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772) +- Extract resource attributes from the `OTEL_RESOURCE_ATTRIBUTES` environment variable and merge them with the `resource.Default` resource as well as resources provided to the `TracerProvider` and metric `Controller`. (#1785) +- Added `WithOSType` resource configuration option to set OS (Operating System) type resource attribute (`os.type`). (#1788) +- Added `WithProcess*` resource configuration options to set Process resource attributes. (#1788) + - `process.pid` + - `process.executable.name` + - `process.executable.path` + - `process.command_args` + - `process.owner` + - `process.runtime.name` + - `process.runtime.version` + - `process.runtime.description` +- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789) - Added support for configuring OTLP/HTTP and OTLP/gRPC Endpoints, TLS Certificates, Headers, Compression and Timeout via Environment Variables. (#1758, #1769 and #1811) - `OTEL_EXPORTER_OTLP_ENDPOINT` - `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` @@ -32,10 +64,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - `OTEL_EXPORTER_OTLP_CERTIFICATE` - `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` - `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` -- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770) -- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771) -- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771) -- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789) +- Adds `otlpgrpc.WithTimeout` option for configuring timeout to the otlp/gRPC exporter. (#1821) ### Fixed @@ -46,13 +75,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm Additionally, this tag is overridden, as specified in the OTel specification, if the event contains an attribute with that key. (#1768) - Zipkin Exporter: Ensure mapping between OTel and Zipkin span data complies with the specification. (#1688) - Fixed typo for default service name in Jaeger Exporter. (#1797) +- Fix flaky OTLP for the reconnnection of the client connection. (#1527, #1814) ### Changed -- Modify Zipkin Exporter default service name, use default resouce's serviceName instead of empty. (#1777) -- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD` - to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` - in compliance with OTel spec (#1752) - Span `RecordError` now records an `exception` event to comply with the semantic convention specification. (#1492) - Jaeger exporter was updated to use thrift v0.14.1. (#1712) - Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713) @@ -60,18 +86,28 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - The storage of a local or remote Span in a `context.Context` using its SpanContext is unified to store just the current Span. The Span's SpanContext can now self-identify as being remote or not. This means that `"go.opentelemetry.io/otel/trace".ContextWithRemoteSpanContext` will now overwrite any existing current Span, not just existing remote Spans, and make it the current Span in a `context.Context`. (#1731) +- Improve OTLP/gRPC exporter connection errors. (#1737) - Information about a parent span context in a `"go.opentelemetry.io/otel/export/trace".SpanSnapshot` is unified in a new `Parent` field. The existing `ParentSpanID` and `HasRemoteParent` fields are removed in favor of this. (#1748) - The `ParentContext` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is updated to hold a `context.Context` containing the parent span. This changes it to make `SamplingParameters` conform with the OpenTelemetry specification. (#1749) +- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD` + to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` in compliance with OTel specification. (#1752) - Modify `BatchSpanProcessor.ForceFlush` to abort after timeout/cancellation. (#1757) -- Improve OTLP/gRPC exporter connection errors. (#1737) - The `DroppedAttributeCount` field of the `Span` in the `go.opentelemetry.io/otel` package now only represents the number of attributes dropped for the span itself. It no longer is a conglomerate of itself, events, and link attributes that have been dropped. (#1771) - Make `ExportSpans` in Jaeger Exporter honor context deadline. (#1773) +- Modify Zipkin Exporter default service name, use default resource's serviceName instead of empty. (#1777) - The `go.opentelemetry.io/otel/sdk/export/trace` package is merged into the `go.opentelemetry.io/otel/sdk/trace` package. (#1778) - The prometheus.InstallNewPipeline example is moved from comment to example test (#1796) -- Convenience functions for stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800) +- The convenience functions for the stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800) +- Replace the flush function returned from the Jaeger exporter's convenience creation functions (`InstallNewPipeline` and `NewExportPipeline`) with the `TracerProvider` implementation they create. + This enables the caller to shutdown and flush using the related `TracerProvider` methods. (#1822) +- Updated the Jaeger exporter to have a default endpoint, `http://localhost:14250`, for the collector. (#1824) +- Changed the function `WithCollectorEndpoint` in the Jaeger exporter to no longer accept an endpoint as an argument. + The endpoint can be passed with the `CollectorEndpointOption` using the `WithEndpoint` function or by setting the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable value appropriately. (#1824) +- The Jaeger exporter no longer batches exported spans itself, instead it relies on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter creation functions (`NewRawExporter`, `NewExportPipeline`, and `InstallNewPipeline`) no longer accept the removed `Option` type as a variadic argument. (#1830) ### Removed @@ -90,6 +126,21 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - The `trace.FlagsDebug` and `trace.FlagsDeferred` constants have been removed and will be localized to the B3 propagator. (#1770) - Remove `Process` configuration, `WithProcessFromEnv` and `ProcessFromEnv`, and type from the Jaeger exporter package. The information that could be configured in the `Process` struct should be configured in a `Resource` instead. (#1776, #1804) +- Remove the `WithDisabled` option from the Jaeger exporter. + To disable the exporter unregister it from the `TracerProvider` or use a no-operation `TracerProvider`. (#1806) +- Removed the functions `CollectorEndpointFromEnv` and `WithCollectorEndpointOptionFromEnv` from the Jaeger exporter. + These functions for retrieving specific environment variable values are redundant of other internal functions and + are not intended for end user use. (#1824) +- Removed the Jaeger exporter `WithSDKOptions` `Option`. + This option was used to set SDK options for the exporter creation convenience functions. + These functions are provided as a way to easily setup or install the exporter with what are deemed reasonable SDK settings for common use cases. + If the SDK needs to be configured differently, the `NewRawExporter` function and direct setup of the SDK with the desired settings should be used. (#1825) +- The `WithBufferMaxCount` and `WithBatchMaxCount` `Option`s from the Jaeger exporter are removed. + The exporter no longer batches exports, instead relying on the SDK's `BatchSpanProcessor` for this functionality. (#1830) +- The Jaeger exporter `Option` type is removed. + The type is no longer used by the exporter to configure anything. + All the previous configurations these options provided were duplicates of SDK configuration. + They have been removed in favor of using the SDK configuration and focuses the exporter configuration to be only about the endpoints it will send telemetry to. (#1830) ## [0.19.0] - 2021-03-18 @@ -172,7 +223,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Stagger timestamps in exact aggregator tests. (#1569) - Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)`. (#1621) - Prevent end-users from implementing some interfaces (#1575) -``` + + ``` "otel/exporters/otlp/otlphttp".Option "otel/exporters/stdout".Option "otel/oteltest".Option @@ -185,7 +237,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm "otel/sdk/trace".ParentBasedSamplerOption "otel/sdk/trace".ReadOnlySpan "otel/sdk/trace".ReadWriteSpan -``` + ``` + ### Removed - Removed attempt to resample spans upon changing the span name with `span.SetName()`. (#1545) @@ -767,7 +820,7 @@ This release implements the v0.5.0 version of the OpenTelemetry specification. - Rename `Observer` instrument to `ValueObserver`. (#734) - The push controller now has a method (`Provider()`) to return a `metric.Provider` instead of the old `Meter` method that acted as a `metric.Provider`. (#738) - Replace `Measure` instrument by `ValueRecorder` instrument. (#732) -- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. 727) +- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. (#727) ### Fixed @@ -870,7 +923,6 @@ This release implements the v0.5.0 version of the OpenTelemetry specification. - Create a new recorder rather than reuse when multiple observations in same epoch for asynchronous instruments. #610 - The default port the OTLP exporter uses to connect to the OpenTelemetry collector is updated to match the one the collector listens on by default. (#611) - ## [0.4.2] - 2020-03-31 ### Fixed @@ -930,7 +982,7 @@ There is still a possibility of breaking changes. - Simplified export setup pipeline for the jaeger exporter to match other exporters. (#459) - The zipkin trace exporter. (#495) - The OTLP exporter to export metric and trace telemetry to the OpenTelemetry collector. (#497) (#544) (#545) -- The `StatusMessage` field was add to the trace `Span`. (#524) +- Add `StatusMessage` field to the trace `Span`. (#524) - Context propagation in OpenTracing bridge in terms of OpenTelemetry context propagation. (#525) - The `Resource` type was added to the SDK. (#528) - The global API now supports a `Tracer` and `Meter` function as shortcuts to getting a global `*Provider` and calling these methods directly. (#538) @@ -1023,14 +1075,12 @@ There is still a possibility of breaking changes. - `AlwaysParentSample` sampler to the trace API. (#455) - `WithNewRoot` option function to the trace API to specify the created span should be considered a root span. (#451) - ### Changed - Renamed `WithMap` to `ContextWithMap` in the correlation package. (#481) - Renamed `FromContext` to `MapFromContext` in the correlation package. (#481) - Move correlation context propagation to correlation package. (#479) - Do not default to putting remote span context into links. (#480) -- Propagators extrac - `Tracer.WithSpan` updated to accept `StartOptions`. (#472) - Renamed `MetricKind` to `Kind` to not stutter in the type usage. (#432) - Renamed the `export` package to `metric` to match directory structure. (#432) @@ -1178,7 +1228,6 @@ There is still a possibility of breaking changes. This allowed distinct label sets through, but any metrics sharing a label set could be overwritten or merged incorrectly. This was corrected. (#333) - ## [0.1.2] - 2019-11-18 ### Fixed @@ -1238,8 +1287,8 @@ It contains api and sdk for trace and meter. - CircleCI build CI manifest files. - CODEOWNERS file to track owners of this project. - -[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v0.19.0...HEAD +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v0.20.0...HEAD +[0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0 [0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0 [0.18.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.18.0 [0.17.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.17.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 51ab52c6384c..73df4022c302 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ You can view and edit the source code by cloning this repository: git clone https://github.com/open-telemetry/opentelemetry-go.git ``` -Run `make test` to run the tests instead of `go test`. +Run `make test` to run the tests instead of `go test`. There are some generated files checked into the repo. To make sure that the generated files are up-to-date, run `make` (or `make @@ -43,7 +43,7 @@ To create a new PR, fork the project in GitHub and clone the upstream repo: ```sh -$ go get -d go.opentelemetry.io/otel +go get -d go.opentelemetry.io/otel ``` (This may print some warning about "build constraints exclude all Go @@ -53,7 +53,7 @@ This will put the project in `${GOPATH}/src/go.opentelemetry.io/otel`. You can alternatively use `git` directly with: ```sh -$ git clone https://github.com/open-telemetry/opentelemetry-go +git clone https://github.com/open-telemetry/opentelemetry-go ``` (Note that `git clone` is *not* using the `go.opentelemetry.io/otel` name - @@ -66,20 +66,20 @@ current working directory. Enter the newly created directory and add your fork as a new remote: ```sh -$ git remote add git@github.com:/opentelemetry-go +git remote add git@github.com:/opentelemetry-go ``` Check out a new branch, make modifications, run linters and tests, update `CHANGELOG.md`, and push the branch to your fork: ```sh -$ git checkout -b +git checkout -b # edit files # update changelog -$ make precommit -$ git add -p -$ git commit -$ git push +make precommit +git add -p +git commit +git push ``` Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull @@ -140,8 +140,8 @@ It is preferable to have contributions follow the idioms of the language rather than conform to specific API names or argument patterns in the spec. -For a deeper discussion, see: -https://github.com/open-telemetry/opentelemetry-specification/issues/165 +For a deeper discussion, see +[this](https://github.com/open-telemetry/opentelemetry-specification/issues/165). ## Style Guide diff --git a/README.md b/README.md index c841ba896e56..81f72ef7ab1a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![Go Report Card](https://goreportcard.com/badge/go.opentelemetry.io/otel)](https://goreportcard.com/report/go.opentelemetry.io/otel) [![Slack](https://img.shields.io/badge/slack-@cncf/otel--go-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01NPAXACKT) - The Go [OpenTelemetry](https://opentelemetry.io/) implementation. ## Project Status diff --git a/RELEASING.md b/RELEASING.md index 71d23b47a546..eb9c6e7171fc 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -32,7 +32,6 @@ Update go.mod for submodules to depend on the new release which will happen in t 4. Push the changes to upstream and create a Pull Request on GitHub. Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. - ## Tag Once the Pull Request with all the version changes has been approved and merged it is time to tag the merged commit. diff --git a/bridge/opencensus/go.mod b/bridge/opencensus/go.mod index 81a653b54c4b..1e37099db699 100644 --- a/bridge/opencensus/go.mod +++ b/bridge/opencensus/go.mod @@ -4,12 +4,12 @@ go 1.14 require ( go.opencensus.io v0.22.6-0.20201102222123-380f4078db9f - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/oteltest v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/export/metric v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/oteltest v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel => ../.. diff --git a/bridge/opentracing/go.mod b/bridge/opentracing/go.mod index 5083e71213da..87e20b0877b0 100644 --- a/bridge/opentracing/go.mod +++ b/bridge/opentracing/go.mod @@ -6,8 +6,8 @@ replace go.opentelemetry.io/otel => ../.. require ( github.com/opentracing/opentracing-go v1.2.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../opencensus diff --git a/example/jaeger/go.mod b/example/jaeger/go.mod index 087c386dad8f..14a00892744e 100644 --- a/example/jaeger/go.mod +++ b/example/jaeger/go.mod @@ -9,9 +9,9 @@ replace ( ) require ( - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/exporters/trace/jaeger v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/exporters/trace/jaeger v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus diff --git a/example/jaeger/go.sum b/example/jaeger/go.sum index 2d4f16387d3f..48b7eee2843f 100644 --- a/example/jaeger/go.sum +++ b/example/jaeger/go.sum @@ -1,462 +1,16 @@ -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 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/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/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/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -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/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -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/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -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/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/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 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -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/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/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/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/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/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -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/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= -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= -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-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -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= -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/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/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/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-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/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-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/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-20210402161424-2e8d93401602/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 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-20180830151530-49385e6e1522/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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/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-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-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-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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/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/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-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-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-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -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-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.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -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.44.0 h1:URs6qR1lAxDsqWITsQXI4ZkGiYJ5dHtRNiCpfs2OeKA= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.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= -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/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-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/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.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/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= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 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/yaml.v2 v2.2.2/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.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= diff --git a/example/jaeger/main.go b/example/jaeger/main.go index 832f7ac4f06c..de3ea1b5f414 100644 --- a/example/jaeger/main.go +++ b/example/jaeger/main.go @@ -19,43 +19,71 @@ package main import ( "context" "log" + "time" "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/sdk/resource" - "go.opentelemetry.io/otel/semconv" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/exporters/trace/jaeger" - sdktrace "go.opentelemetry.io/otel/sdk/trace" + "go.opentelemetry.io/otel/sdk/resource" + tracesdk "go.opentelemetry.io/otel/sdk/trace" + "go.opentelemetry.io/otel/semconv" ) -// initTracer creates a new trace provider instance and registers it as global trace provider. -func initTracer() func() { - // Create and install Jaeger export pipeline. - flush, err := jaeger.InstallNewPipeline( - jaeger.WithCollectorEndpoint("http://localhost:14268/api/traces"), - jaeger.WithSDKOptions( - sdktrace.WithSampler(sdktrace.AlwaysSample()), - sdktrace.WithResource(resource.NewWithAttributes( - semconv.ServiceNameKey.String("trace-demo"), - attribute.String("exporter", "jaeger"), - attribute.Float64("float", 312.23), - )), - ), - ) +const ( + service = "trace-demo" + environment = "production" + id = 1 +) + +// tracerProvider returns an OpenTelemetry TracerProvider configured to use +// the Jaeger exporter that will send spans to the provided url. The returned +// TracerProvider will also use a Resource configured with all the information +// about the application. +func tracerProvider(url string) (*tracesdk.TracerProvider, error) { + // Create the Jaeger exporter + exp, err := jaeger.NewRawExporter(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url))) if err != nil { - log.Fatal(err) + return nil, err } - return flush + tp := tracesdk.NewTracerProvider( + // Always be sure to batch in production. + tracesdk.WithBatcher(exp), + // Record information about this application in an Resource. + tracesdk.WithResource(resource.NewWithAttributes( + semconv.ServiceNameKey.String(service), + attribute.String("environment", environment), + attribute.Int64("ID", id), + )), + ) + return tp, nil } func main() { - ctx := context.Background() + tp, err := tracerProvider("http://localhost:14268/api/traces") + if err != nil { + log.Fatal(err) + } + + // Register our TracerProvider as the global so any imported + // instrumentation in the future will default to using it. + otel.SetTracerProvider(tp) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + // Cleanly shutdown and flush telemetry when the application exits. + defer func(ctx context.Context) { + // Do not make the application hang when it is shutdown. + ctx, cancel = context.WithTimeout(ctx, time.Second*5) + defer cancel() + if err := tp.Shutdown(ctx); err != nil { + log.Fatal(err) + } + }(ctx) - flush := initTracer() - defer flush() + tr := tp.Tracer("component-main") - tr := otel.Tracer("component-main") ctx, span := tr.Start(ctx, "foo") defer span.End() @@ -63,6 +91,7 @@ func main() { } func bar(ctx context.Context) { + // Use the global TracerProvider. tr := otel.Tracer("component-bar") _, span := tr.Start(ctx, "bar") span.SetAttributes(attribute.Key("testset").String("value")) diff --git a/example/namedtracer/go.mod b/example/namedtracer/go.mod index a132b240f9a1..c8d3955e3457 100644 --- a/example/namedtracer/go.mod +++ b/example/namedtracer/go.mod @@ -9,10 +9,10 @@ replace ( ) require ( - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/exporters/stdout v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/exporters/stdout v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus diff --git a/example/opencensus/go.mod b/example/opencensus/go.mod index 6272117afd8d..62a42e2c0f42 100644 --- a/example/opencensus/go.mod +++ b/example/opencensus/go.mod @@ -11,11 +11,11 @@ replace ( require ( go.opencensus.io v0.22.6-0.20201102222123-380f4078db9f - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/bridge/opencensus v0.19.0 - go.opentelemetry.io/otel/exporters/stdout v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/export/metric v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/bridge/opencensus v0.20.0 + go.opentelemetry.io/otel/exporters/stdout v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opentracing => ../../bridge/opentracing diff --git a/example/otel-collector/go.mod b/example/otel-collector/go.mod index 22fd0887fb41..22d24859dd52 100644 --- a/example/otel-collector/go.mod +++ b/example/otel-collector/go.mod @@ -9,12 +9,12 @@ replace ( ) require ( - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/exporters/otlp v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/metric v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/exporters/otlp v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/metric v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 google.golang.org/grpc v1.37.0 ) diff --git a/example/prom-collector/go.mod b/example/prom-collector/go.mod index 9ad010006869..60cf1299ea32 100644 --- a/example/prom-collector/go.mod +++ b/example/prom-collector/go.mod @@ -10,12 +10,12 @@ replace ( ) require ( - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/exporters/metric/prometheus v0.19.0 - go.opentelemetry.io/otel/exporters/otlp v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/metric v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/exporters/metric/prometheus v0.20.0 + go.opentelemetry.io/otel/exporters/otlp v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/metric v0.20.0 google.golang.org/grpc v1.37.0 ) diff --git a/example/prometheus/go.mod b/example/prometheus/go.mod index 937bd01b51a5..a00bd1f7ac6e 100644 --- a/example/prometheus/go.mod +++ b/example/prometheus/go.mod @@ -9,9 +9,9 @@ replace ( ) require ( - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/exporters/metric/prometheus v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/exporters/metric/prometheus v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus diff --git a/example/zipkin/go.mod b/example/zipkin/go.mod index 4207485739a5..d0e3ab7fd835 100644 --- a/example/zipkin/go.mod +++ b/example/zipkin/go.mod @@ -9,10 +9,10 @@ replace ( ) require ( - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/exporters/trace/zipkin v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/exporters/trace/zipkin v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus diff --git a/exporters/metric/prometheus/go.mod b/exporters/metric/prometheus/go.mod index 8ec489b75a35..6089d4fdf1c9 100644 --- a/exporters/metric/prometheus/go.mod +++ b/exporters/metric/prometheus/go.mod @@ -10,11 +10,11 @@ replace ( require ( github.com/prometheus/client_golang v1.10.0 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/export/metric v0.19.0 - go.opentelemetry.io/otel/sdk/metric v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 + go.opentelemetry.io/otel/sdk/metric v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../../bridge/opencensus diff --git a/exporters/otlp/example_test.go b/exporters/otlp/example_test.go index 96bc218b3d1b..4b4c06297f8e 100644 --- a/exporters/otlp/example_test.go +++ b/exporters/otlp/example_test.go @@ -35,11 +35,7 @@ func ExampleNewExporter() { tracesDriver := otlpgrpc.NewDriver( // Configure traces driver here ) - config := otlp.SplitConfig{ - ForMetrics: metricsDriver, - ForTraces: tracesDriver, - } - driver := otlp.NewSplitDriver(config) + driver := otlp.NewSplitDriver(otlp.WithMetricDriver(metricsDriver), otlp.WithTraceDriver(tracesDriver)) exporter, err := otlp.NewExporter(ctx, driver) // Configure as needed. if err != nil { log.Fatalf("failed to create exporter: %v", err) diff --git a/exporters/otlp/go.mod b/exporters/otlp/go.mod index da7b2d39e2ce..fe4fdba85356 100644 --- a/exporters/otlp/go.mod +++ b/exporters/otlp/go.mod @@ -10,12 +10,12 @@ replace ( require ( github.com/google/go-cmp v0.5.5 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/export/metric v0.19.0 - go.opentelemetry.io/otel/sdk/metric v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 + go.opentelemetry.io/otel/sdk/metric v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 go.opentelemetry.io/proto/otlp v0.7.0 google.golang.org/grpc v1.37.0 google.golang.org/protobuf v1.26.0 diff --git a/exporters/otlp/options.go b/exporters/otlp/options.go index 7cfaa35d3cc0..f2d176f6e3aa 100644 --- a/exporters/otlp/options.go +++ b/exporters/otlp/options.go @@ -43,3 +43,36 @@ func WithMetricExportKindSelector(selector metricsdk.ExportKindSelector) Exporte cfg.exportKindSelector = selector } } + +// SplitDriverOption provides options for setting up a split driver. +type SplitDriverOption interface { + Apply(*splitDriver) +} + +// WithMetricDriver allows one to set the driver used for metrics +// in a SplitDriver. +func WithMetricDriver(dr ProtocolDriver) SplitDriverOption { + return metricDriverOption{dr} +} + +type metricDriverOption struct { + driver ProtocolDriver +} + +func (o metricDriverOption) Apply(s *splitDriver) { + s.metric = o.driver +} + +// WithTraceDriver allows one to set the driver used for traces +// in a SplitDriver. +func WithTraceDriver(dr ProtocolDriver) SplitDriverOption { + return traceDriverOption{dr} +} + +type traceDriverOption struct { + driver ProtocolDriver +} + +func (o traceDriverOption) Apply(s *splitDriver) { + s.trace = o.driver +} diff --git a/exporters/otlp/otlp_test.go b/exporters/otlp/otlp_test.go index c24c8ab5c606..42c7cde80495 100644 --- a/exporters/otlp/otlp_test.go +++ b/exporters/otlp/otlp_test.go @@ -283,46 +283,112 @@ func TestNewExportPipeline(t *testing.T) { } func TestSplitDriver(t *testing.T) { - driverTraces := &stubProtocolDriver{} - driverMetrics := &stubProtocolDriver{} - config := otlp.SplitConfig{ - ForMetrics: driverMetrics, - ForTraces: driverTraces, - } - driver := otlp.NewSplitDriver(config) - ctx := context.Background() - assert.NoError(t, driver.Start(ctx)) - assert.Equal(t, 1, driverTraces.started) - assert.Equal(t, 1, driverMetrics.started) - assert.Equal(t, 0, driverTraces.stopped) - assert.Equal(t, 0, driverMetrics.stopped) - assert.Equal(t, 0, driverTraces.tracesExported) - assert.Equal(t, 0, driverTraces.metricsExported) - assert.Equal(t, 0, driverMetrics.tracesExported) - assert.Equal(t, 0, driverMetrics.metricsExported) recordCount := 5 spanCount := 7 - assert.NoError(t, driver.ExportMetrics(ctx, stubCheckpointSet{recordCount}, metricsdk.StatelessExportKindSelector())) - assert.NoError(t, driver.ExportTraces(ctx, stubSpanSnapshot(spanCount))) - assert.Len(t, driverTraces.rm, 0) - assert.Len(t, driverTraces.rs, spanCount) - assert.Len(t, driverMetrics.rm, recordCount) - assert.Len(t, driverMetrics.rs, 0) - assert.Equal(t, 1, driverTraces.tracesExported) - assert.Equal(t, 0, driverTraces.metricsExported) - assert.Equal(t, 0, driverMetrics.tracesExported) - assert.Equal(t, 1, driverMetrics.metricsExported) - - assert.NoError(t, driver.Stop(ctx)) - assert.Equal(t, 1, driverTraces.started) - assert.Equal(t, 1, driverMetrics.started) - assert.Equal(t, 1, driverTraces.stopped) - assert.Equal(t, 1, driverMetrics.stopped) - assert.Equal(t, 1, driverTraces.tracesExported) - assert.Equal(t, 0, driverTraces.metricsExported) - assert.Equal(t, 0, driverMetrics.tracesExported) - assert.Equal(t, 1, driverMetrics.metricsExported) + assertExport := func(t testing.TB, ctx context.Context, driver otlp.ProtocolDriver) { + t.Helper() + assert.NoError(t, driver.ExportMetrics(ctx, stubCheckpointSet{recordCount}, metricsdk.StatelessExportKindSelector())) + assert.NoError(t, driver.ExportTraces(ctx, stubSpanSnapshot(spanCount))) + } + + t.Run("with metric/trace drivers configured", func(t *testing.T) { + driverTraces := &stubProtocolDriver{} + driverMetrics := &stubProtocolDriver{} + + driver := otlp.NewSplitDriver(otlp.WithMetricDriver(driverMetrics), otlp.WithTraceDriver(driverTraces)) + ctx := context.Background() + assert.NoError(t, driver.Start(ctx)) + assert.Equal(t, 1, driverTraces.started) + assert.Equal(t, 1, driverMetrics.started) + assert.Equal(t, 0, driverTraces.stopped) + assert.Equal(t, 0, driverMetrics.stopped) + assert.Equal(t, 0, driverTraces.tracesExported) + assert.Equal(t, 0, driverTraces.metricsExported) + assert.Equal(t, 0, driverMetrics.tracesExported) + assert.Equal(t, 0, driverMetrics.metricsExported) + + assertExport(t, ctx, driver) + assert.Len(t, driverTraces.rm, 0) + assert.Len(t, driverTraces.rs, spanCount) + assert.Len(t, driverMetrics.rm, recordCount) + assert.Len(t, driverMetrics.rs, 0) + assert.Equal(t, 1, driverTraces.tracesExported) + assert.Equal(t, 0, driverTraces.metricsExported) + assert.Equal(t, 0, driverMetrics.tracesExported) + assert.Equal(t, 1, driverMetrics.metricsExported) + + assert.NoError(t, driver.Stop(ctx)) + assert.Equal(t, 1, driverTraces.started) + assert.Equal(t, 1, driverMetrics.started) + assert.Equal(t, 1, driverTraces.stopped) + assert.Equal(t, 1, driverMetrics.stopped) + assert.Equal(t, 1, driverTraces.tracesExported) + assert.Equal(t, 0, driverTraces.metricsExported) + assert.Equal(t, 0, driverMetrics.tracesExported) + assert.Equal(t, 1, driverMetrics.metricsExported) + }) + + t.Run("with just metric driver", func(t *testing.T) { + driverMetrics := &stubProtocolDriver{} + + driver := otlp.NewSplitDriver(otlp.WithMetricDriver(driverMetrics)) + ctx := context.Background() + assert.NoError(t, driver.Start(ctx)) + + assert.Equal(t, 1, driverMetrics.started) + assert.Equal(t, 0, driverMetrics.stopped) + assert.Equal(t, 0, driverMetrics.tracesExported) + assert.Equal(t, 0, driverMetrics.metricsExported) + + assertExport(t, ctx, driver) + assert.Len(t, driverMetrics.rm, recordCount) + assert.Len(t, driverMetrics.rs, 0) + assert.Equal(t, 0, driverMetrics.tracesExported) + assert.Equal(t, 1, driverMetrics.metricsExported) + + assert.NoError(t, driver.Stop(ctx)) + assert.Equal(t, 1, driverMetrics.started) + assert.Equal(t, 1, driverMetrics.stopped) + assert.Equal(t, 0, driverMetrics.tracesExported) + assert.Equal(t, 1, driverMetrics.metricsExported) + }) + + t.Run("with just trace driver", func(t *testing.T) { + driverTraces := &stubProtocolDriver{} + + driver := otlp.NewSplitDriver(otlp.WithTraceDriver(driverTraces)) + ctx := context.Background() + assert.NoError(t, driver.Start(ctx)) + assert.Equal(t, 1, driverTraces.started) + assert.Equal(t, 0, driverTraces.stopped) + assert.Equal(t, 0, driverTraces.tracesExported) + assert.Equal(t, 0, driverTraces.metricsExported) + + assertExport(t, ctx, driver) + assert.Len(t, driverTraces.rm, 0) + assert.Len(t, driverTraces.rs, spanCount) + assert.Equal(t, 1, driverTraces.tracesExported) + assert.Equal(t, 0, driverTraces.metricsExported) + + assert.NoError(t, driver.Stop(ctx)) + assert.Equal(t, 1, driverTraces.started) + assert.Equal(t, 1, driverTraces.stopped) + assert.Equal(t, 1, driverTraces.tracesExported) + assert.Equal(t, 0, driverTraces.metricsExported) + }) + + t.Run("with no drivers configured", func(t *testing.T) { + + driver := otlp.NewSplitDriver() + ctx := context.Background() + assert.NoError(t, driver.Start(ctx)) + + assert.NoError(t, driver.ExportMetrics(ctx, stubCheckpointSet{recordCount}, metricsdk.StatelessExportKindSelector())) + assert.NoError(t, driver.ExportTraces(ctx, stubSpanSnapshot(spanCount))) + assert.NoError(t, driver.Stop(ctx)) + }) + } func TestSplitDriverFail(t *testing.T) { @@ -357,11 +423,7 @@ func TestSplitDriverFail(t *testing.T) { injectedStartError: errStartMetric, injectedStopError: errStopMetric, } - config := otlp.SplitConfig{ - ForMetrics: driverMetrics, - ForTraces: driverTraces, - } - driver := otlp.NewSplitDriver(config) + driver := otlp.NewSplitDriver(otlp.WithMetricDriver(driverMetrics), otlp.WithTraceDriver(driverTraces)) errStart := driver.Start(ctx) if shouldStartFail { assert.Error(t, errStart) diff --git a/exporters/otlp/otlpgrpc/driver.go b/exporters/otlp/otlpgrpc/driver.go index 66979a360f77..c5df20566c7b 100644 --- a/exporters/otlp/otlpgrpc/driver.go +++ b/exporters/otlp/otlpgrpc/driver.go @@ -123,6 +123,8 @@ func (d *driver) ExportMetrics(ctx context.Context, cps metricsdk.CheckpointSet, } ctx, cancel := d.metricsDriver.connection.contextWithStop(ctx) defer cancel() + ctx, tCancel := context.WithTimeout(ctx, d.metricsDriver.connection.sCfg.Timeout) + defer tCancel() rms, err := transform.CheckpointSet(ctx, selector, cps, 1) if err != nil { @@ -162,6 +164,8 @@ func (d *driver) ExportTraces(ctx context.Context, ss []*tracesdk.SpanSnapshot) } ctx, cancel := d.tracesDriver.connection.contextWithStop(ctx) defer cancel() + ctx, tCancel := context.WithTimeout(ctx, d.tracesDriver.connection.sCfg.Timeout) + defer tCancel() protoSpans := transform.SpanData(ss) if len(protoSpans) == 0 { diff --git a/exporters/otlp/otlpgrpc/example_test.go b/exporters/otlp/otlpgrpc/example_test.go index 4715e25bd3f3..35f241d728fb 100644 --- a/exporters/otlp/otlpgrpc/example_test.go +++ b/exporters/otlp/otlpgrpc/example_test.go @@ -143,11 +143,7 @@ func Example_withDifferentSignalCollectors() { otlpgrpc.WithInsecure(), otlpgrpc.WithEndpoint("localhost:30082"), ) - splitCfg := otlp.SplitConfig{ - ForMetrics: metricsDriver, - ForTraces: tracesDriver, - } - driver := otlp.NewSplitDriver(splitCfg) + driver := otlp.NewSplitDriver(otlp.WithMetricDriver(metricsDriver), otlp.WithTraceDriver(tracesDriver)) ctx := context.Background() exp, err := otlp.NewExporter(ctx, driver) if err != nil { diff --git a/exporters/otlp/otlpgrpc/mock_collector_test.go b/exporters/otlp/otlpgrpc/mock_collector_test.go index fd806008a5f6..7183b9511fc9 100644 --- a/exporters/otlp/otlpgrpc/mock_collector_test.go +++ b/exporters/otlp/otlpgrpc/mock_collector_test.go @@ -18,6 +18,8 @@ import ( "context" "fmt" "net" + "runtime" + "strings" "sync" "testing" "time" @@ -50,6 +52,7 @@ type mockTraceService struct { mu sync.RWMutex storage otlptest.SpansStorage headers metadata.MD + delay time.Duration } func (mts *mockTraceService) getHeaders() metadata.MD { @@ -71,6 +74,9 @@ func (mts *mockTraceService) getResourceSpans() []*tracepb.ResourceSpans { } func (mts *mockTraceService) Export(ctx context.Context, exp *collectortracepb.ExportTraceServiceRequest) (*collectortracepb.ExportTraceServiceResponse, error) { + if mts.delay > 0 { + time.Sleep(mts.delay) + } reply := &collectortracepb.ExportTraceServiceResponse{} mts.mu.Lock() defer mts.mu.Unlock() @@ -84,6 +90,7 @@ type mockMetricService struct { mu sync.RWMutex storage otlptest.MetricsStorage + delay time.Duration } func (mms *mockMetricService) getMetrics() []*metricpb.Metric { @@ -93,6 +100,9 @@ func (mms *mockMetricService) getMetrics() []*metricpb.Metric { } func (mms *mockMetricService) Export(ctx context.Context, exp *collectormetricpb.ExportMetricsServiceRequest) (*collectormetricpb.ExportMetricsServiceResponse, error) { + if mms.delay > 0 { + time.Sleep(mms.delay) + } reply := &collectormetricpb.ExportMetricsServiceResponse{} mms.mu.Lock() defer mms.mu.Unlock() @@ -107,7 +117,8 @@ type mockCollector struct { metricSvc *mockMetricService endpoint string - stopFunc func() error + ln *listener + stopFunc func() stopOnce sync.Once } @@ -119,8 +130,9 @@ var errAlreadyStopped = fmt.Errorf("already stopped") func (mc *mockCollector) stop() error { var err = errAlreadyStopped mc.stopOnce.Do(func() { + err = nil if mc.stopFunc != nil { - err = mc.stopFunc() + mc.stopFunc() } }) // Give it sometime to shutdown. @@ -189,19 +201,70 @@ func runMockCollectorAtEndpoint(t *testing.T, endpoint string) *mockCollector { mc := makeMockCollector(t) collectortracepb.RegisterTraceServiceServer(srv, mc.traceSvc) collectormetricpb.RegisterMetricsServiceServer(srv, mc.metricSvc) + mc.ln = newListener(ln) go func() { - _ = srv.Serve(ln) + _ = srv.Serve((net.Listener)(mc.ln)) }() - deferFunc := func() error { - srv.Stop() - return ln.Close() + mc.endpoint = ln.Addr().String() + // srv.Stop calls Close on mc.ln. + mc.stopFunc = srv.Stop + + return mc +} + +type listener struct { + closeOnce sync.Once + wrapped net.Listener + C chan struct{} +} + +func newListener(wrapped net.Listener) *listener { + return &listener{ + wrapped: wrapped, + C: make(chan struct{}, 1), } +} - _, collectorPortStr, _ := net.SplitHostPort(ln.Addr().String()) +func (l *listener) Close() error { return l.wrapped.Close() } - mc.endpoint = "localhost:" + collectorPortStr - mc.stopFunc = deferFunc +func (l *listener) Addr() net.Addr { return l.wrapped.Addr() } - return mc +// Accept waits for and returns the next connection to the listener. It will +// send a signal on l.C that a connection has been made before returning. +func (l *listener) Accept() (net.Conn, error) { + conn, err := l.wrapped.Accept() + if err != nil { + // Go 1.16 exported net.ErrClosed that could clean up this check, but to + // remain backwards compatible with previous versions of Go that we + // support the following string evaluation is used instead to keep in line + // with the previously recommended way to check this: + // https://github.com/golang/go/issues/4373#issuecomment-353076799 + if strings.Contains(err.Error(), "use of closed network connection") { + // If the listener has been closed, do not allow callers of + // WaitForConn to wait for a connection that will never come. + l.closeOnce.Do(func() { close(l.C) }) + } + return conn, err + } + + select { + case l.C <- struct{}{}: + default: + // If C is full, assume nobody is listening and move on. + } + return conn, nil +} + +// WaitForConn will wait indefintely for a connection to be estabilished with +// the listener before returning. +func (l *listener) WaitForConn() { + for { + select { + case <-l.C: + return + default: + runtime.Gosched() + } + } } diff --git a/exporters/otlp/otlpgrpc/options.go b/exporters/otlp/otlpgrpc/options.go index 37d877bf2bad..dd7201f94a73 100644 --- a/exporters/otlp/otlpgrpc/options.go +++ b/exporters/otlp/otlpgrpc/options.go @@ -182,3 +182,21 @@ func WithDialOption(opts ...grpc.DialOption) Option { cfg.DialOptions = opts }) } + +// WithTimeout tells the driver the max waiting time for the backend to process +// each spans or metrics batch. If unset, the default will be 10 seconds. +func WithTimeout(duration time.Duration) Option { + return otlpconfig.WithTimeout(duration) +} + +// WithTracesTimeout tells the driver the max waiting time for the backend to process +// each spans batch. If unset, the default will be 10 seconds. +func WithTracesTimeout(duration time.Duration) Option { + return otlpconfig.WithTracesTimeout(duration) +} + +// WithMetricsTimeout tells the driver the max waiting time for the backend to process +// each metrics batch. If unset, the default will be 10 seconds. +func WithMetricsTimeout(duration time.Duration) Option { + return otlpconfig.WithMetricsTimeout(duration) +} diff --git a/exporters/otlp/otlpgrpc/otlp_integration_test.go b/exporters/otlp/otlpgrpc/otlp_integration_test.go index 0b3a722a615b..b83900c50629 100644 --- a/exporters/otlp/otlpgrpc/otlp_integration_test.go +++ b/exporters/otlp/otlpgrpc/otlp_integration_test.go @@ -18,11 +18,13 @@ import ( "context" "fmt" "net" - "runtime" "strings" "testing" "time" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -149,44 +151,22 @@ func TestNewExporter_collectorConnectionDiesThenReconnectsWhenInRestMode(t *test ctx := context.Background() exp := newGRPCExporter(t, ctx, mc.endpoint, otlpgrpc.WithReconnectionPeriod(reconnectionPeriod)) - defer func() { - _ = exp.Shutdown(ctx) - }() + defer func() { require.NoError(t, exp.Shutdown(ctx)) }() + + // Wait for a connection. + mc.ln.WaitForConn() // We'll now stop the collector right away to simulate a connection // dying in the midst of communication or even not existing before. - _ = mc.stop() + require.NoError(t, mc.stop()) // first export, it will send disconnected message to the channel on export failure, // trigger almost immediate reconnection - require.Error( - t, - exp.ExportSpans(ctx, []*sdktrace.SpanSnapshot{{Name: "in the midst"}}), - "transport: Error while dialing dial tcp %s: connect: connection refused", - mc.endpoint, - ) - - // Give the exporter sometime to reconnect - func() { - timer := time.After(reconnectionPeriod * 10) - for { - select { - case <-timer: - return - default: - runtime.Gosched() - } - } - }() + require.Error(t, exp.ExportSpans(ctx, []*sdktrace.SpanSnapshot{{Name: "in the midst"}})) // second export, it will detect connection issue, change state of exporter to disconnected and // send message to disconnected channel but this time reconnection gouroutine will be in (rest mode, not listening to the disconnected channel) - require.Error( - t, - exp.ExportSpans(ctx, []*sdktrace.SpanSnapshot{{Name: "in the midst"}}), - "transport: Error while dialing dial tcp %s: connect: connection refused2", - mc.endpoint, - ) + require.Error(t, exp.ExportSpans(ctx, []*sdktrace.SpanSnapshot{{Name: "in the midst"}})) // as a result we have exporter in disconnected state waiting for disconnection message to reconnect @@ -195,17 +175,7 @@ func TestNewExporter_collectorConnectionDiesThenReconnectsWhenInRestMode(t *test // make sure reconnection loop hits beginning and goes back to waiting mode // after hitting beginning of the loop it should reconnect - func() { - timer := time.After(reconnectionPeriod * 10) - for { - select { - case <-timer: - return - default: - runtime.Gosched() - } - } - }() + nmc.ln.WaitForConn() n := 10 for i := 0; i < n; i++ { @@ -226,22 +196,24 @@ func TestNewExporter_collectorConnectionDiesThenReconnectsWhenInRestMode(t *test if g, w := len(dSpans), 0; g != w { t.Fatalf("Disconnected collector: spans: got %d want %d", g, w) } + + require.NoError(t, nmc.Stop()) } func TestNewExporter_collectorConnectionDiesThenReconnects(t *testing.T) { mc := runMockCollector(t) - reconnectionPeriod := 20 * time.Millisecond + reconnectionPeriod := 50 * time.Millisecond ctx := context.Background() exp := newGRPCExporter(t, ctx, mc.endpoint, otlpgrpc.WithReconnectionPeriod(reconnectionPeriod)) - defer func() { - _ = exp.Shutdown(ctx) - }() + defer func() { require.NoError(t, exp.Shutdown(ctx)) }() + + mc.ln.WaitForConn() // We'll now stop the collector right away to simulate a connection // dying in the midst of communication or even not existing before. - _ = mc.stop() + require.NoError(t, mc.stop()) // In the test below, we'll stop the collector many times, // while exporting traces and test to ensure that we can @@ -249,29 +221,14 @@ func TestNewExporter_collectorConnectionDiesThenReconnects(t *testing.T) { for j := 0; j < 3; j++ { // No endpoint up. - require.Error( - t, - exp.ExportSpans(ctx, []*sdktrace.SpanSnapshot{{Name: "in the midst"}}), - "transport: Error while dialing dial tcp %s: connect: connection refused", - mc.endpoint, - ) + require.Error(t, exp.ExportSpans(ctx, []*sdktrace.SpanSnapshot{{Name: "in the midst"}})) // Now resurrect the collector by making a new one but reusing the // old endpoint, and the collector should reconnect automatically. nmc := runMockCollectorAtEndpoint(t, mc.endpoint) // Give the exporter sometime to reconnect - func() { - timer := time.After(reconnectionPeriod * 10) - for { - select { - case <-timer: - return - default: - runtime.Gosched() - } - } - }() + nmc.ln.WaitForConn() n := 10 for i := 0; i < n; i++ { @@ -289,7 +246,9 @@ func TestNewExporter_collectorConnectionDiesThenReconnects(t *testing.T) { if g, w := len(dSpans), 0; g != w { t.Fatalf("Round #%d: Disconnected collector: spans: got %d want %d", j, g, w) } - _ = nmc.stop() + + // Disconnect for the next try. + require.NoError(t, nmc.stop()) } } @@ -346,6 +305,90 @@ func TestNewExporter_withHeaders(t *testing.T) { assert.Equal(t, "value1", headers.Get("header1")[0]) } +func TestNewExporter_WithTimeout(t *testing.T) { + tts := []struct { + name string + fn func(exp *otlp.Exporter) error + timeout time.Duration + metrics int + spans int + code codes.Code + delay bool + }{ + { + name: "Timeout Spans", + fn: func(exp *otlp.Exporter) error { + return exp.ExportSpans(context.Background(), []*sdktrace.SpanSnapshot{{Name: "timed out"}}) + }, + timeout: time.Millisecond * 100, + code: codes.DeadlineExceeded, + delay: true, + }, + { + name: "Timeout Metrics", + fn: func(exp *otlp.Exporter) error { + return exp.Export(context.Background(), otlptest.OneRecordCheckpointSet{}) + }, + timeout: time.Millisecond * 100, + code: codes.DeadlineExceeded, + delay: true, + }, + + { + name: "No Timeout Spans", + fn: func(exp *otlp.Exporter) error { + return exp.ExportSpans(context.Background(), []*sdktrace.SpanSnapshot{{Name: "timed out"}}) + }, + timeout: time.Minute, + spans: 1, + code: codes.OK, + }, + { + name: "No Timeout Metrics", + fn: func(exp *otlp.Exporter) error { + return exp.Export(context.Background(), otlptest.OneRecordCheckpointSet{}) + }, + timeout: time.Minute, + metrics: 1, + code: codes.OK, + }, + } + + for _, tt := range tts { + t.Run(tt.name, func(t *testing.T) { + + mc := runMockCollector(t) + if tt.delay { + mc.traceSvc.delay = time.Second * 10 + mc.metricSvc.delay = time.Second * 10 + } + defer func() { + _ = mc.stop() + }() + + ctx := context.Background() + exp := newGRPCExporter(t, ctx, mc.endpoint, otlpgrpc.WithTimeout(tt.timeout)) + defer func() { + _ = exp.Shutdown(ctx) + }() + + err := tt.fn(exp) + + if tt.code == codes.OK { + require.NoError(t, err) + } else { + require.Error(t, err) + } + + s := status.Convert(err) + require.Equal(t, tt.code, s.Code()) + + require.Len(t, mc.getSpans(), tt.spans) + require.Len(t, mc.getMetrics(), tt.metrics) + }) + } +} + func TestNewExporter_withInvalidSecurityConfiguration(t *testing.T) { mc := runMockCollector(t) defer func() { @@ -583,11 +626,7 @@ func TestMultiConnectionDriver(t *testing.T) { tracesDriver := otlpgrpc.NewDriver(optsTraces...) metricsDriver := otlpgrpc.NewDriver(optsMetrics...) - splitCfg := otlp.SplitConfig{ - ForMetrics: metricsDriver, - ForTraces: tracesDriver, - } - driver := otlp.NewSplitDriver(splitCfg) + driver := otlp.NewSplitDriver(otlp.WithMetricDriver(metricsDriver), otlp.WithTraceDriver(tracesDriver)) ctx := context.Background() exp, err := otlp.NewExporter(ctx, driver) if err != nil { diff --git a/exporters/otlp/protocoldriver.go b/exporters/otlp/protocoldriver.go index 7c45cefb9fdf..209b970d69a8 100644 --- a/exporters/otlp/protocoldriver.go +++ b/exporters/otlp/protocoldriver.go @@ -66,16 +66,27 @@ type splitDriver struct { trace ProtocolDriver } +// noopDriver implements the ProtocolDriver interface and +// is used internally to implement split drivers that do not have +// all drivers configured. +type noopDriver struct{} + +var _ ProtocolDriver = (*noopDriver)(nil) + var _ ProtocolDriver = (*splitDriver)(nil) // NewSplitDriver creates a protocol driver which contains two other // protocol drivers and will forward traces to one of them and metrics // to another. -func NewSplitDriver(cfg SplitConfig) ProtocolDriver { - return &splitDriver{ - metric: cfg.ForMetrics, - trace: cfg.ForTraces, +func NewSplitDriver(opts ...SplitDriverOption) ProtocolDriver { + driver := splitDriver{ + metric: &noopDriver{}, + trace: &noopDriver{}, } + for _, opt := range opts { + opt.Apply(&driver) + } + return &driver } // Start implements ProtocolDriver. It starts both drivers at the same @@ -143,3 +154,23 @@ func (d *splitDriver) ExportMetrics(ctx context.Context, cps metricsdk.Checkpoin func (d *splitDriver) ExportTraces(ctx context.Context, ss []*tracesdk.SpanSnapshot) error { return d.trace.ExportTraces(ctx, ss) } + +// Start does nothing. +func (d *noopDriver) Start(ctx context.Context) error { + return nil +} + +// Stop does nothing. +func (d *noopDriver) Stop(ctx context.Context) error { + return nil +} + +// ExportMetrics does nothing. +func (d *noopDriver) ExportMetrics(ctx context.Context, cps metricsdk.CheckpointSet, selector metricsdk.ExportKindSelector) error { + return nil +} + +// ExportTraces does nothing. +func (d *noopDriver) ExportTraces(ctx context.Context, ss []*tracesdk.SpanSnapshot) error { + return nil +} diff --git a/exporters/stdout/go.mod b/exporters/stdout/go.mod index 8c332d3ecd11..a572a95c4378 100644 --- a/exporters/stdout/go.mod +++ b/exporters/stdout/go.mod @@ -9,12 +9,12 @@ replace ( require ( github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/export/metric v0.19.0 - go.opentelemetry.io/otel/sdk/metric v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 + go.opentelemetry.io/otel/sdk/metric v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../bridge/opencensus diff --git a/exporters/trace/jaeger/agent.go b/exporters/trace/jaeger/agent.go index 76b2aff51090..403f23269543 100644 --- a/exporters/trace/jaeger/agent.go +++ b/exporters/trace/jaeger/agent.go @@ -111,9 +111,9 @@ func newAgentClientUDP(params agentClientUDPParams) (*agentClientUDP, error) { } // EmitBatch implements EmitBatch() of Agent interface -func (a *agentClientUDP) EmitBatch(batch *gen.Batch) error { +func (a *agentClientUDP) EmitBatch(ctx context.Context, batch *gen.Batch) error { a.thriftBuffer.Reset() - if err := a.client.EmitBatch(context.Background(), batch); err != nil { + if err := a.client.EmitBatch(ctx, batch); err != nil { return err } if a.thriftBuffer.Len() > a.maxPacketSize { diff --git a/exporters/trace/jaeger/env.go b/exporters/trace/jaeger/env.go index 92d4a8174166..96f2d51c2f16 100644 --- a/exporters/trace/jaeger/env.go +++ b/exporters/trace/jaeger/env.go @@ -42,21 +42,3 @@ func envOr(key, defaultValue string) string { } return defaultValue } - -// CollectorEndpointFromEnv return environment variable value of OTEL_EXPORTER_JAEGER_ENDPOINT -func CollectorEndpointFromEnv() string { - return os.Getenv(envEndpoint) -} - -// WithCollectorEndpointOptionFromEnv uses environment variables to set the username and password -// if basic auth is required. -func WithCollectorEndpointOptionFromEnv() CollectorEndpointOption { - return func(o *CollectorEndpointOptions) { - if e := os.Getenv(envUser); e != "" { - o.username = e - } - if e := os.Getenv(envPassword); e != "" { - o.password = e - } - } -} diff --git a/exporters/trace/jaeger/env_test.go b/exporters/trace/jaeger/env_test.go index 12c7828345c9..2890a4583c5c 100644 --- a/exporters/trace/jaeger/env_test.go +++ b/exporters/trace/jaeger/env_test.go @@ -24,6 +24,27 @@ import ( ottest "go.opentelemetry.io/otel/internal/internaltest" ) +func TestNewRawExporterWithDefault(t *testing.T) { + const ( + collectorEndpoint = "http://localhost:14250" + username = "" + password = "" + ) + + // Create Jaeger Exporter with default values + exp, err := NewRawExporter( + WithCollectorEndpoint(), + ) + + assert.NoError(t, err) + + require.IsType(t, &collectorUploader{}, exp.uploader) + uploader := exp.uploader.(*collectorUploader) + assert.Equal(t, collectorEndpoint, uploader.endpoint) + assert.Equal(t, username, uploader.username) + assert.Equal(t, password, uploader.password) +} + func TestNewRawExporterWithEnv(t *testing.T) { const ( collectorEndpoint = "http://localhost" @@ -43,7 +64,7 @@ func TestNewRawExporterWithEnv(t *testing.T) { // Create Jaeger Exporter with environment variables exp, err := NewRawExporter( - WithCollectorEndpoint(CollectorEndpointFromEnv(), WithCollectorEndpointOptionFromEnv()), + WithCollectorEndpoint(), ) assert.NoError(t, err) @@ -55,11 +76,12 @@ func TestNewRawExporterWithEnv(t *testing.T) { assert.Equal(t, password, uploader.password) } -func TestNewRawExporterWithEnvImplicitly(t *testing.T) { +func TestNewRawExporterWithPassedOption(t *testing.T) { const ( collectorEndpoint = "http://localhost" username = "user" password = "password" + optionEndpoint = "should not be overwritten" ) envStore, err := ottest.SetEnvVariables(map[string]string{ @@ -72,16 +94,16 @@ func TestNewRawExporterWithEnvImplicitly(t *testing.T) { require.NoError(t, envStore.Restore()) }() - // Create Jaeger Exporter with environment variables + // Create Jaeger Exporter with passed endpoint option, should be used over envEndpoint exp, err := NewRawExporter( - WithCollectorEndpoint("should be overwritten"), + WithCollectorEndpoint(WithEndpoint(optionEndpoint)), ) assert.NoError(t, err) require.IsType(t, &collectorUploader{}, exp.uploader) uploader := exp.uploader.(*collectorUploader) - assert.Equal(t, collectorEndpoint, uploader.endpoint) + assert.Equal(t, optionEndpoint, uploader.endpoint) assert.Equal(t, username, uploader.username) assert.Equal(t, password, uploader.password) } @@ -152,52 +174,43 @@ func TestEnvOrWithAgentHostPortFromEnv(t *testing.T) { } } -func TestCollectorEndpointFromEnv(t *testing.T) { - const ( - collectorEndpoint = "http://localhost" - ) - - envStore, err := ottest.SetEnvVariables(map[string]string{ - envEndpoint: collectorEndpoint, - }) - require.NoError(t, err) - defer func() { - require.NoError(t, envStore.Restore()) - }() - - assert.Equal(t, collectorEndpoint, CollectorEndpointFromEnv()) -} - -func TestWithCollectorEndpointOptionFromEnv(t *testing.T) { +func TestEnvOrWithCollectorEndpointOptionsFromEnv(t *testing.T) { testCases := []struct { name string + envEndpoint string envUsername string envPassword string - collectorEndpointOptions CollectorEndpointOptions + defaultCollectorEndpointOptions CollectorEndpointOptions expectedCollectorEndpointOptions CollectorEndpointOptions }{ { name: "overrides value via environment variables", + envEndpoint: "http://localhost:14252", envUsername: "username", envPassword: "password", - collectorEndpointOptions: CollectorEndpointOptions{ + defaultCollectorEndpointOptions: CollectorEndpointOptions{ + endpoint: "endpoint not to be used", username: "foo", password: "bar", }, expectedCollectorEndpointOptions: CollectorEndpointOptions{ + endpoint: "http://localhost:14252", username: "username", password: "password", }, }, { name: "environment variables is empty, will not overwrite value", + envEndpoint: "", envUsername: "", envPassword: "", - collectorEndpointOptions: CollectorEndpointOptions{ + defaultCollectorEndpointOptions: CollectorEndpointOptions{ + endpoint: "endpoint to be used", username: "foo", password: "bar", }, expectedCollectorEndpointOptions: CollectorEndpointOptions{ + endpoint: "endpoint to be used", username: "foo", password: "bar", }, @@ -205,6 +218,7 @@ func TestWithCollectorEndpointOptionFromEnv(t *testing.T) { } envStore := ottest.NewEnvStore() + envStore.Record(envEndpoint) envStore.Record(envUser) envStore.Record(envPassword) defer func() { @@ -212,13 +226,17 @@ func TestWithCollectorEndpointOptionFromEnv(t *testing.T) { }() for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { + require.NoError(t, os.Setenv(envEndpoint, tc.envEndpoint)) require.NoError(t, os.Setenv(envUser, tc.envUsername)) require.NoError(t, os.Setenv(envPassword, tc.envPassword)) - f := WithCollectorEndpointOptionFromEnv() - f(&tc.collectorEndpointOptions) + endpoint := envOr(envEndpoint, tc.defaultCollectorEndpointOptions.endpoint) + username := envOr(envUser, tc.defaultCollectorEndpointOptions.username) + password := envOr(envPassword, tc.defaultCollectorEndpointOptions.password) - assert.Equal(t, tc.expectedCollectorEndpointOptions, tc.collectorEndpointOptions) + assert.Equal(t, tc.expectedCollectorEndpointOptions.endpoint, endpoint) + assert.Equal(t, tc.expectedCollectorEndpointOptions.username, username) + assert.Equal(t, tc.expectedCollectorEndpointOptions.password, password) }) } } diff --git a/exporters/trace/jaeger/go.mod b/exporters/trace/jaeger/go.mod index dd9ab5c7ccc4..336202e8d07b 100644 --- a/exporters/trace/jaeger/go.mod +++ b/exporters/trace/jaeger/go.mod @@ -10,10 +10,9 @@ replace ( require ( github.com/google/go-cmp v0.5.5 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 - google.golang.org/api v0.44.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../../bridge/opencensus diff --git a/exporters/trace/jaeger/go.sum b/exporters/trace/jaeger/go.sum index 2d4f16387d3f..48b7eee2843f 100644 --- a/exporters/trace/jaeger/go.sum +++ b/exporters/trace/jaeger/go.sum @@ -1,462 +1,16 @@ -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 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/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/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/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -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/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -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/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -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/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/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 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -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/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/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/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/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/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -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/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= -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= -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-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -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= -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/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/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/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-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/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-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/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-20210402161424-2e8d93401602/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 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-20180830151530-49385e6e1522/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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/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-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-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-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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/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/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-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-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-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -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-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.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -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.44.0 h1:URs6qR1lAxDsqWITsQXI4ZkGiYJ5dHtRNiCpfs2OeKA= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.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= -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/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-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/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.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/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= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 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/yaml.v2 v2.2.2/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.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= diff --git a/exporters/trace/jaeger/jaeger.go b/exporters/trace/jaeger/jaeger.go index f5c4112e7aca..d3f5f97fc2ad 100644 --- a/exporters/trace/jaeger/jaeger.go +++ b/exporters/trace/jaeger/jaeger.go @@ -21,8 +21,6 @@ import ( "fmt" "sync" - "google.golang.org/api/support/bundler" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" @@ -44,67 +42,14 @@ const ( keyEventName = "event" ) -type Option func(*options) - -// options are the options to be used when initializing a Jaeger export. -type options struct { - - // BufferMaxCount defines the total number of traces that can be buffered in memory - BufferMaxCount int - - // BatchMaxCount defines the maximum number of spans sent in one batch - BatchMaxCount int - - // TracerProviderOptions defines the options for tracer provider of sdk. - TracerProviderOptions []sdktrace.TracerProviderOption - - Disabled bool -} - -// WithBufferMaxCount defines the total number of traces that can be buffered in memory -func WithBufferMaxCount(bufferMaxCount int) Option { - return func(o *options) { - o.BufferMaxCount = bufferMaxCount - } -} - -// WithBatchMaxCount defines the maximum number of spans in one batch -func WithBatchMaxCount(batchMaxCount int) Option { - return func(o *options) { - o.BatchMaxCount = batchMaxCount - } -} - -// WithSDKOptions configures options for tracer provider of sdk. -func WithSDKOptions(opts ...sdktrace.TracerProviderOption) Option { - return func(o *options) { - o.TracerProviderOptions = opts - } -} - -// WithDisabled option will cause pipeline methods to use -// a no-op provider -func WithDisabled(disabled bool) Option { - return func(o *options) { - o.Disabled = disabled - } -} - // NewRawExporter returns an OTel Exporter implementation that exports the // collected spans to Jaeger. -// -// It will IGNORE Disabled option. -func NewRawExporter(endpointOption EndpointOption, opts ...Option) (*Exporter, error) { +func NewRawExporter(endpointOption EndpointOption) (*Exporter, error) { uploader, err := endpointOption() if err != nil { return nil, err } - o := options{} - for _, opt := range opts { - opt(&o) - } - // Fetch default service.name from default resource for backup var defaultServiceName string defaultResource := resource.Default() @@ -115,133 +60,92 @@ func NewRawExporter(endpointOption EndpointOption, opts ...Option) (*Exporter, e return nil, fmt.Errorf("failed to get service name from default resource") } + stopCh := make(chan struct{}) e := &Exporter{ uploader: uploader, + stopCh: stopCh, defaultServiceName: defaultServiceName, } - bundler := bundler.NewBundler((*sdktrace.SpanSnapshot)(nil), func(bundle interface{}) { - if err := e.upload(bundle.([]*sdktrace.SpanSnapshot)); err != nil { - otel.Handle(err) - } - }) - - // Set BufferedByteLimit with the total number of spans that are permissible to be held in memory. - // This needs to be done since the size of messages is always set to 1. Failing to set this would allow - // 1G messages to be held in memory since that is the default value of BufferedByteLimit. - if o.BufferMaxCount != 0 { - bundler.BufferedByteLimit = o.BufferMaxCount - } - - // The default value bundler uses is 10, increase to send larger batches - if o.BatchMaxCount != 0 { - bundler.BundleCountThreshold = o.BatchMaxCount - } - - e.bundler = bundler return e, nil } // NewExportPipeline sets up a complete export pipeline // with the recommended setup for trace provider -func NewExportPipeline(endpointOption EndpointOption, opts ...Option) (trace.TracerProvider, func(), error) { - o := options{} - for _, opt := range opts { - opt(&o) - } - if o.Disabled { - return trace.NewNoopTracerProvider(), func() {}, nil - } - - exporter, err := NewRawExporter(endpointOption, opts...) +func NewExportPipeline(endpointOption EndpointOption) (*sdktrace.TracerProvider, error) { + exporter, err := NewRawExporter(endpointOption) if err != nil { - return nil, nil, err + return nil, err } - pOpts := append(o.TracerProviderOptions, sdktrace.WithSyncer(exporter)) - tp := sdktrace.NewTracerProvider(pOpts...) - return tp, exporter.Flush, nil + tp := sdktrace.NewTracerProvider(sdktrace.WithBatcher(exporter)) + return tp, nil } // InstallNewPipeline instantiates a NewExportPipeline with the // recommended configuration and registers it globally. -func InstallNewPipeline(endpointOption EndpointOption, opts ...Option) (func(), error) { - tp, flushFn, err := NewExportPipeline(endpointOption, opts...) +func InstallNewPipeline(endpointOption EndpointOption) (*sdktrace.TracerProvider, error) { + tp, err := NewExportPipeline(endpointOption) if err != nil { - return nil, err + return tp, err } otel.SetTracerProvider(tp) - return flushFn, nil + return tp, nil } -// Exporter is an implementation of an OTel SpanSyncer that uploads spans to -// Jaeger. +// Exporter exports OpenTelemetry spans to a Jaeger agent or collector. type Exporter struct { - bundler *bundler.Bundler - uploader batchUploader - - stoppedMu sync.RWMutex - stopped bool - + uploader batchUploader + stopOnce sync.Once + stopCh chan struct{} defaultServiceName string } var _ sdktrace.SpanExporter = (*Exporter)(nil) -// ExportSpans exports SpanSnapshots to Jaeger. -func (e *Exporter) ExportSpans(ctx context.Context, ss []*sdktrace.SpanSnapshot) error { - e.stoppedMu.RLock() - stopped := e.stopped - e.stoppedMu.RUnlock() - if stopped { +// ExportSpans transforms and exports OpenTelemetry spans to Jaeger. +func (e *Exporter) ExportSpans(ctx context.Context, spans []*sdktrace.SpanSnapshot) error { + // Return fast if context is already canceled or Exporter shutdown. + select { + case <-ctx.Done(): + return ctx.Err() + case <-e.stopCh: return nil + default: } - for _, span := range ss { - // TODO(jbd): Handle oversized bundlers. - err := e.bundler.AddWait(ctx, span, 1) - if err != nil { - return fmt.Errorf("failed to bundle %q: %w", span.Name, err) - } + // Cancel export if Exporter is shutdown. + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + go func(ctx context.Context, cancel context.CancelFunc) { select { case <-ctx.Done(): - return ctx.Err() - default: + case <-e.stopCh: + cancel() + } + }(ctx, cancel) + + for _, batch := range jaegerBatchList(spans, e.defaultServiceName) { + if err := e.uploader.upload(ctx, batch); err != nil { + return err } } return nil } -// flush is used to wrap the bundler's Flush method for testing. -var flush = func(e *Exporter) { - e.bundler.Flush() -} - -// Shutdown stops the exporter flushing any pending exports. +// Shutdown stops the Exporter. This will close all connections and release +// all resources held by the Exporter. func (e *Exporter) Shutdown(ctx context.Context) error { - e.stoppedMu.Lock() - e.stopped = true - e.stoppedMu.Unlock() - - done := make(chan struct{}, 1) - // Shadow so if the goroutine is leaked in testing it doesn't cause a race - // condition when the file level var is reset. - go func(FlushFunc func(*Exporter)) { - // The OpenTelemetry specification is explicit in not having this - // method block so the preference here is to orphan this goroutine if - // the context is canceled or times out while this flushing is - // occurring. This is a consequence of the bundler Flush method not - // supporting a context. - FlushFunc(e) - done <- struct{}{} - }(flush) + // Stop any active and subsequent exports. + e.stopOnce.Do(func() { close(e.stopCh) }) select { case <-ctx.Done(): return ctx.Err() - case <-done: + default: } - return nil + return e.uploader.shutdown(ctx) } func spanSnapshotToThrift(ss *sdktrace.SpanSnapshot) *gen.Span { @@ -404,25 +308,6 @@ func getBoolTag(k string, b bool) *gen.Tag { } } -// Flush waits for exported trace spans to be uploaded. -// -// This is useful if your program is ending and you do not want to lose recent spans. -func (e *Exporter) Flush() { - flush(e) -} - -func (e *Exporter) upload(spans []*sdktrace.SpanSnapshot) error { - batchList := jaegerBatchList(spans, e.defaultServiceName) - for _, batch := range batchList { - err := e.uploader.upload(batch) - if err != nil { - return err - } - } - - return nil -} - // jaegerBatchList transforms a slice of SpanSnapshot into a slice of jaeger // Batch. func jaegerBatchList(ssl []*sdktrace.SpanSnapshot, defaultServiceName string) []*gen.Batch { diff --git a/exporters/trace/jaeger/jaeger_benchmark_test.go b/exporters/trace/jaeger/jaeger_benchmark_test.go new file mode 100644 index 000000000000..212279dc201d --- /dev/null +++ b/exporters/trace/jaeger/jaeger_benchmark_test.go @@ -0,0 +1,114 @@ +// 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 jaeger + +import ( + "context" + "fmt" + "testing" + "time" + + "go.opentelemetry.io/otel/sdk/instrumentation" + tracesdk "go.opentelemetry.io/otel/sdk/trace" + "go.opentelemetry.io/otel/trace" +) + +var ( + traceID trace.TraceID + spanID trace.SpanID + spanContext trace.SpanContext + + instrLibName = "benchmark.tests" +) + +func init() { + var err error + traceID, err = trace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f10") + if err != nil { + panic(err) + } + spanID, err = trace.SpanIDFromHex("0102030405060708") + if err != nil { + panic(err) + } + spanContext = trace.NewSpanContext(trace.SpanContextConfig{ + TraceID: traceID, + SpanID: spanID, + }) +} + +func spans(n int) []*tracesdk.SpanSnapshot { + now := time.Now() + s := make([]*tracesdk.SpanSnapshot, n) + for i := 0; i < n; i++ { + name := fmt.Sprintf("span %d", i) + s[i] = &tracesdk.SpanSnapshot{ + SpanContext: spanContext, + Name: name, + StartTime: now, + EndTime: now, + SpanKind: trace.SpanKindClient, + InstrumentationLibrary: instrumentation.Library{ + Name: instrLibName, + }, + } + } + return s +} + +func benchmarkExportSpans(b *testing.B, o EndpointOption, i int) { + ctx := context.Background() + s := spans(i) + exp, err := NewRawExporter(o) + if err != nil { + b.Fatal(err) + } + + b.ReportAllocs() + b.ResetTimer() + + for n := 0; n < b.N; n++ { + if err := exp.ExportSpans(ctx, s); err != nil { + b.Error(err) + } + } +} + +func benchmarkCollector(b *testing.B, i int) { + benchmarkExportSpans(b, withTestCollectorEndpoint(), i) +} + +func benchmarkAgent(b *testing.B, i int) { + benchmarkExportSpans(b, WithAgentEndpoint(), i) +} + +func BenchmarkCollectorExportSpans1(b *testing.B) { benchmarkCollector(b, 1) } +func BenchmarkCollectorExportSpans10(b *testing.B) { benchmarkCollector(b, 10) } +func BenchmarkCollectorExportSpans100(b *testing.B) { benchmarkCollector(b, 100) } +func BenchmarkCollectorExportSpans1000(b *testing.B) { benchmarkCollector(b, 1000) } +func BenchmarkCollectorExportSpans10000(b *testing.B) { benchmarkCollector(b, 10000) } +func BenchmarkAgentExportSpans1(b *testing.B) { benchmarkAgent(b, 1) } +func BenchmarkAgentExportSpans10(b *testing.B) { benchmarkAgent(b, 10) } +func BenchmarkAgentExportSpans100(b *testing.B) { benchmarkAgent(b, 100) } + +/* +* BUG: These tests are not possible currently because the thrift payload size +* does not fit in a UDP packet with the default size (65000) and will return +* an error. + +func BenchmarkAgentExportSpans1000(b *testing.B) { benchmarkAgent(b, 1000) } +func BenchmarkAgentExportSpans10000(b *testing.B) { benchmarkAgent(b, 10000) } + +*/ diff --git a/exporters/trace/jaeger/jaeger_test.go b/exporters/trace/jaeger/jaeger_test.go index d74e6cde6c2a..1889b78ae0bd 100644 --- a/exporters/trace/jaeger/jaeger_test.go +++ b/exporters/trace/jaeger/jaeger_test.go @@ -17,17 +17,16 @@ package jaeger import ( "context" "encoding/binary" + "errors" "fmt" "os" "sort" - "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "google.golang.org/api/support/bundler" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" @@ -46,190 +45,71 @@ const ( ) func TestInstallNewPipeline(t *testing.T) { - testCases := []struct { - name string - endpoint EndpointOption - options []Option - expectedProvider trace.TracerProvider - }{ - { - name: "simple pipeline", - endpoint: WithCollectorEndpoint(collectorEndpoint), - expectedProvider: &sdktrace.TracerProvider{}, - }, - { - name: "with agent endpoint", - endpoint: WithAgentEndpoint(), - expectedProvider: &sdktrace.TracerProvider{}, - }, - { - name: "with disabled", - endpoint: WithCollectorEndpoint(collectorEndpoint), - options: []Option{ - WithDisabled(true), - }, - expectedProvider: trace.NewNoopTracerProvider(), - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - fn, err := InstallNewPipeline( - tc.endpoint, - tc.options..., - ) - defer fn() - - assert.NoError(t, err) - assert.IsType(t, tc.expectedProvider, otel.GetTracerProvider()) - - otel.SetTracerProvider(nil) - }) - } + tp, err := InstallNewPipeline(WithCollectorEndpoint(WithEndpoint(collectorEndpoint))) + require.NoError(t, err) + // Ensure InstallNewPipeline sets the global TracerProvider. By default + // the global tracer provider will be a NoOp implementation, this checks + // if that has been overwritten. + assert.IsType(t, tp, otel.GetTracerProvider()) } -func TestNewExportPipeline(t *testing.T) { - testCases := []struct { - name string - endpoint EndpointOption - options []Option - expectedProviderType trace.TracerProvider - testSpanSampling, spanShouldBeSampled bool +func TestNewExportPipelinePassthroughError(t *testing.T) { + for _, testcase := range []struct { + name string + failing bool + epo EndpointOption }{ { - name: "simple pipeline", - endpoint: WithCollectorEndpoint(collectorEndpoint), - expectedProviderType: &sdktrace.TracerProvider{}, - }, - { - name: "with disabled", - endpoint: WithCollectorEndpoint(collectorEndpoint), - options: []Option{ - WithDisabled(true), + name: "failing underlying NewRawExporter", + failing: true, + epo: func() (batchUploader, error) { + return nil, errors.New("error") }, - expectedProviderType: trace.NewNoopTracerProvider(), }, { - name: "always on", - endpoint: WithCollectorEndpoint(collectorEndpoint), - options: []Option{ - WithSDKOptions(sdktrace.WithSampler(sdktrace.AlwaysSample())), - }, - expectedProviderType: &sdktrace.TracerProvider{}, - testSpanSampling: true, - spanShouldBeSampled: true, + name: "with default agent endpoint", + epo: WithAgentEndpoint(), }, { - name: "never", - endpoint: WithCollectorEndpoint(collectorEndpoint), - options: []Option{ - WithSDKOptions(sdktrace.WithSampler(sdktrace.NeverSample())), - }, - expectedProviderType: &sdktrace.TracerProvider{}, - testSpanSampling: true, - spanShouldBeSampled: false, + name: "with collector endpoint", + epo: WithCollectorEndpoint(WithEndpoint(collectorEndpoint)), }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - tp, fn, err := NewExportPipeline( - tc.endpoint, - tc.options..., - ) - defer fn() - - assert.NoError(t, err) - assert.NotEqual(t, tp, otel.GetTracerProvider()) - assert.IsType(t, tc.expectedProviderType, tp) - - if tc.testSpanSampling { - _, span := tp.Tracer("jaeger test").Start(context.Background(), tc.name) - spanCtx := span.SpanContext() - assert.Equal(t, tc.spanShouldBeSampled, spanCtx.IsSampled()) - span.End() + } { + t.Run(testcase.name, func(t *testing.T) { + _, err := NewExportPipeline(testcase.epo) + if testcase.failing { + require.Error(t, err) + return } + require.NoError(t, err) }) } } func TestNewRawExporter(t *testing.T) { testCases := []struct { - name string - endpoint EndpointOption - options []Option - expectedServiceName string - expectedTagsLen, expectedBufferMaxCount, expectedBatchMaxCount int + name string + endpoint EndpointOption }{ { - name: "default exporter", - endpoint: WithCollectorEndpoint(collectorEndpoint), - expectedServiceName: "unknown_service", - expectedBufferMaxCount: bundler.DefaultBufferedByteLimit, - expectedBatchMaxCount: bundler.DefaultBundleCountThreshold, + name: "default exporter with collector endpoint", + endpoint: WithCollectorEndpoint(), }, { - name: "default exporter with agent endpoint", - endpoint: WithAgentEndpoint(), - expectedServiceName: "unknown_service", - expectedBufferMaxCount: bundler.DefaultBufferedByteLimit, - expectedBatchMaxCount: bundler.DefaultBundleCountThreshold, - }, - { - name: "with buffer and batch max count", - endpoint: WithCollectorEndpoint(collectorEndpoint), - options: []Option{ - WithBufferMaxCount(99), - WithBatchMaxCount(99), - }, - expectedServiceName: "unknown_service", - expectedBufferMaxCount: 99, - expectedBatchMaxCount: 99, + name: "default exporter with agent endpoint", + endpoint: WithAgentEndpoint(), }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - exp, err := NewRawExporter( - tc.endpoint, - tc.options..., - ) - + _, err := NewRawExporter(tc.endpoint) assert.NoError(t, err) - assert.Equal(t, tc.expectedBufferMaxCount, exp.bundler.BufferedByteLimit) - assert.Equal(t, tc.expectedBatchMaxCount, exp.bundler.BundleCountThreshold) - assert.NotEmpty(t, exp.defaultServiceName) - assert.True(t, strings.HasPrefix(exp.defaultServiceName, tc.expectedServiceName)) }) } } -func TestNewRawExporterShouldFail(t *testing.T) { - testCases := []struct { - name string - endpoint EndpointOption - expectedErrMsg string - }{ - { - name: "with empty collector endpoint", - endpoint: WithCollectorEndpoint(""), - expectedErrMsg: "collectorEndpoint must not be empty", - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - _, err := NewRawExporter( - tc.endpoint, - ) - - assert.Error(t, err) - assert.EqualError(t, err, tc.expectedErrMsg) - }) - } -} - -func TestNewRawExporterShouldFailIfCollectorUnset(t *testing.T) { +func TestNewRawExporterUseEnvVarIfOptionUnset(t *testing.T) { // Record and restore env envStore := ottest.NewEnvStore() envStore.Record(envEndpoint) @@ -239,19 +119,22 @@ func TestNewRawExporterShouldFailIfCollectorUnset(t *testing.T) { // If the user sets the environment variable OTEL_EXPORTER_JAEGER_ENDPOINT, endpoint will always get a value. require.NoError(t, os.Unsetenv(envEndpoint)) - _, err := NewRawExporter( - WithCollectorEndpoint(""), + WithCollectorEndpoint(), ) - assert.Error(t, err) + assert.NoError(t, err) } type testCollectorEndpoint struct { batchesUploaded []*gen.Batch } -func (c *testCollectorEndpoint) upload(batch *gen.Batch) error { +func (c *testCollectorEndpoint) shutdown(context.Context) error { + return nil +} + +func (c *testCollectorEndpoint) upload(_ context.Context, batch *gen.Batch) error { c.batchesUploaded = append(c.batchesUploaded, batch) return nil } @@ -270,7 +153,7 @@ func withTestCollectorEndpointInjected(ce *testCollectorEndpoint) func() (batchU } } -func TestExporter_ExportSpan(t *testing.T) { +func TestExporterExportSpan(t *testing.T) { const ( serviceName = "test-service" tagKey = "key" @@ -278,25 +161,27 @@ func TestExporter_ExportSpan(t *testing.T) { ) testCollector := &testCollectorEndpoint{} - tp, spanFlush, err := NewExportPipeline( - withTestCollectorEndpointInjected(testCollector), - WithSDKOptions( - sdktrace.WithResource(resource.NewWithAttributes( - semconv.ServiceNameKey.String(serviceName), - attribute.String(tagKey, tagVal), - )), - ), + exp, err := NewRawExporter(withTestCollectorEndpointInjected(testCollector)) + require.NoError(t, err) + tp := sdktrace.NewTracerProvider( + sdktrace.WithBatcher(exp), + sdktrace.WithResource(resource.NewWithAttributes( + semconv.ServiceNameKey.String(serviceName), + attribute.String(tagKey, tagVal), + )), ) - assert.NoError(t, err) - otel.SetTracerProvider(tp) - tracer := otel.Tracer("test-tracer") + + tracer := tp.Tracer("test-tracer") + + ctx := context.Background() for i := 0; i < 3; i++ { - _, span := tracer.Start(context.Background(), fmt.Sprintf("test-span-%d", i)) + _, span := tracer.Start(ctx, fmt.Sprintf("test-span-%d", i)) span.End() assert.True(t, span.SpanContext().IsValid()) } - spanFlush() + require.NoError(t, tp.Shutdown(ctx)) + batchesUploaded := testCollector.batchesUploaded require.Len(t, batchesUploaded, 1) uploadedBatch := batchesUploaded[0] @@ -576,43 +461,22 @@ func Test_spanSnapshotToThrift(t *testing.T) { } func TestExporterShutdownHonorsCancel(t *testing.T) { - orig := flush - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) - // Do this after the parent context is canceled to avoid a race. - defer func() { - <-ctx.Done() - flush = orig - }() - defer cancel() - flush = func(e *Exporter) { - <-ctx.Done() - } + ctx, cancel := context.WithCancel(context.Background()) + cancel() e, err := NewRawExporter(withTestCollectorEndpoint()) require.NoError(t, err) - innerCtx, innerCancel := context.WithCancel(ctx) - go innerCancel() - assert.Errorf(t, e.Shutdown(innerCtx), context.Canceled.Error()) + assert.EqualError(t, e.Shutdown(ctx), context.Canceled.Error()) } func TestExporterShutdownHonorsTimeout(t *testing.T) { - orig := flush - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) - // Do this after the parent context is canceled to avoid a race. - defer func() { - <-ctx.Done() - flush = orig - }() - defer cancel() - flush = func(e *Exporter) { - <-ctx.Done() - } + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond) + <-ctx.Done() e, err := NewRawExporter(withTestCollectorEndpoint()) require.NoError(t, err) - innerCtx, innerCancel := context.WithTimeout(ctx, time.Microsecond*10) - assert.Errorf(t, e.Shutdown(innerCtx), context.DeadlineExceeded.Error()) - innerCancel() + assert.EqualError(t, e.Shutdown(ctx), context.DeadlineExceeded.Error()) + cancel() } func TestErrorOnExportShutdownExporter(t *testing.T) { @@ -899,49 +763,3 @@ func TestProcess(t *testing.T) { }) } } - -func TestNewExporterPipelineWithOptions(t *testing.T) { - const ( - serviceName = "test-service" - eventCountLimit = 10 - tagKey = "key" - tagVal = "val" - ) - - testCollector := &testCollectorEndpoint{} - tp, spanFlush, err := NewExportPipeline( - withTestCollectorEndpointInjected(testCollector), - WithSDKOptions( - sdktrace.WithResource(resource.NewWithAttributes( - semconv.ServiceNameKey.String(serviceName), - attribute.String(tagKey, tagVal), - )), - sdktrace.WithSpanLimits(sdktrace.SpanLimits{ - EventCountLimit: eventCountLimit, - }), - ), - ) - assert.NoError(t, err) - - otel.SetTracerProvider(tp) - _, span := otel.Tracer("test-tracer").Start(context.Background(), "test-span") - for i := 0; i < eventCountLimit*2; i++ { - span.AddEvent(fmt.Sprintf("event-%d", i)) - } - span.End() - spanFlush() - - assert.True(t, span.SpanContext().IsValid()) - - batchesUploaded := testCollector.batchesUploaded - require.Len(t, batchesUploaded, 1) - uploadedBatch := batchesUploaded[0] - assert.Equal(t, serviceName, uploadedBatch.GetProcess().GetServiceName()) - require.Len(t, uploadedBatch.GetSpans(), 1) - uploadedSpan := uploadedBatch.GetSpans()[0] - assert.Len(t, uploadedSpan.GetLogs(), eventCountLimit) - - require.Len(t, uploadedBatch.GetProcess().GetTags(), 1) - assert.Equal(t, tagKey, uploadedBatch.GetProcess().GetTags()[0].GetKey()) - assert.Equal(t, tagVal, uploadedBatch.GetProcess().GetTags()[0].GetVStr()) -} diff --git a/exporters/trace/jaeger/uploader.go b/exporters/trace/jaeger/uploader.go index bfaa6ebc15f5..ee50cc6280c1 100644 --- a/exporters/trace/jaeger/uploader.go +++ b/exporters/trace/jaeger/uploader.go @@ -17,7 +17,6 @@ package jaeger // import "go.opentelemetry.io/otel/exporters/trace/jaeger" import ( "bytes" "context" - "errors" "fmt" "io" "io/ioutil" @@ -32,7 +31,8 @@ import ( // batchUploader send a batch of spans to Jaeger type batchUploader interface { - upload(batch *gen.Batch) error + upload(context.Context, *gen.Batch) error + shutdown(context.Context) error } type EndpointOption func() (batchUploader, error) @@ -114,30 +114,31 @@ func WithAttemptReconnectingInterval(interval time.Duration) AgentEndpointOption } } -// WithCollectorEndpoint defines the full url to the Jaeger HTTP Thrift collector. -// For example, http://localhost:14268/api/traces -func WithCollectorEndpoint(collectorEndpoint string, options ...CollectorEndpointOption) EndpointOption { +// WithCollectorEndpoint defines the full url to the Jaeger HTTP Thrift collector. This will +// use the following environment variables for configuration if no explicit option is provided: +// +// - OTEL_EXPORTER_JAEGER_ENDPOINT is the HTTP endpoint for sending spans directly to a collector. +// - OTEL_EXPORTER_JAEGER_USER is the username to be sent as authentication to the collector endpoint. +// - OTEL_EXPORTER_JAEGER_PASSWORD is the password to be sent as authentication to the collector endpoint. +// +// The passed options will take precedence over any environment variables. +// If neither values are provided for the endpoint, the default value of "http://localhost:14250" will be used. +// If neither values are provided for the username or the password, they will not be set since there is no default. +func WithCollectorEndpoint(options ...CollectorEndpointOption) EndpointOption { return func() (batchUploader, error) { - // Overwrite collector endpoint if environment variables are available. - if e := CollectorEndpointFromEnv(); e != "" { - collectorEndpoint = e - } - - if collectorEndpoint == "" { - return nil, errors.New("collectorEndpoint must not be empty") - } - o := &CollectorEndpointOptions{ + endpoint: envOr(envEndpoint, "http://localhost:14250"), + username: envOr(envUser, ""), + password: envOr(envPassword, ""), httpClient: http.DefaultClient, } - options = append(options, WithCollectorEndpointOptionFromEnv()) for _, opt := range options { opt(o) } return &collectorUploader{ - endpoint: collectorEndpoint, + endpoint: o.endpoint, username: o.username, password: o.password, httpClient: o.httpClient, @@ -148,24 +149,44 @@ func WithCollectorEndpoint(collectorEndpoint string, options ...CollectorEndpoin type CollectorEndpointOption func(o *CollectorEndpointOptions) type CollectorEndpointOptions struct { - // username to be used if basic auth is required. + // endpoint for sending spans directly to a collector. + endpoint string + + // username to be used for authentication with the collector endpoint. username string - // password to be used if basic auth is required. + // password to be used for authentication with the collector endpoint. password string // httpClient to be used to make requests to the collector endpoint. httpClient *http.Client } -// WithUsername sets the username to be used if basic auth is required. +// WithEndpoint is the URL for the Jaeger collector that spans are sent to. +// This option overrides any value set for the +// OTEL_EXPORTER_JAEGER_ENDPOINT environment variable. +// If this option is not passed and the environment variable is not set, +// "http://localhost:14250" will be used by default. +func WithEndpoint(endpoint string) CollectorEndpointOption { + return func(o *CollectorEndpointOptions) { + o.endpoint = endpoint + } +} + +// WithUsername sets the username to be used in the authorization header sent for all requests to the collector. +// This option overrides any value set for the +// OTEL_EXPORTER_JAEGER_USER environment variable. +// If this option is not passed and the environment variable is not set, no username will be set. func WithUsername(username string) CollectorEndpointOption { return func(o *CollectorEndpointOptions) { o.username = username } } -// WithPassword sets the password to be used if basic auth is required. +// WithPassword sets the password to be used in the authorization header sent for all requests to the collector. +// This option overrides any value set for the +// OTEL_EXPORTER_JAEGER_PASSWORD environment variable. +// If this option is not passed and the environment variable is not set, no password will be set. func WithPassword(password string) CollectorEndpointOption { return func(o *CollectorEndpointOptions) { o.password = password @@ -187,8 +208,24 @@ type agentUploader struct { var _ batchUploader = (*agentUploader)(nil) -func (a *agentUploader) upload(batch *gen.Batch) error { - return a.client.EmitBatch(batch) +func (a *agentUploader) shutdown(ctx context.Context) error { + done := make(chan error, 1) + go func() { + done <- a.client.Close() + }() + + select { + case <-ctx.Done(): + // Prioritize not blocking the calling thread and just leak the + // spawned goroutine to close the client. + return ctx.Err() + case err := <-done: + return err + } +} + +func (a *agentUploader) upload(ctx context.Context, batch *gen.Batch) error { + return a.client.EmitBatch(ctx, batch) } // collectorUploader implements batchUploader interface sending batches to @@ -202,12 +239,18 @@ type collectorUploader struct { var _ batchUploader = (*collectorUploader)(nil) -func (c *collectorUploader) upload(batch *gen.Batch) error { +func (c *collectorUploader) shutdown(ctx context.Context) error { + // The Exporter will cancel any active exports and will prevent all + // subsequent exports, so nothing to do here. + return nil +} + +func (c *collectorUploader) upload(ctx context.Context, batch *gen.Batch) error { body, err := serialize(batch) if err != nil { return err } - req, err := http.NewRequest("POST", c.endpoint, body) + req, err := http.NewRequestWithContext(ctx, "POST", c.endpoint, body) if err != nil { return err } diff --git a/exporters/trace/zipkin/go.mod b/exporters/trace/zipkin/go.mod index e4e6a4570c9c..7c9fc8c72d1f 100644 --- a/exporters/trace/zipkin/go.mod +++ b/exporters/trace/zipkin/go.mod @@ -11,9 +11,9 @@ require ( github.com/google/go-cmp v0.5.5 github.com/openzipkin/zipkin-go v0.2.5 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../../../bridge/opencensus diff --git a/go.mod b/go.mod index a6a36d88b24b..a0e9267ad36a 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.14 require ( github.com/google/go-cmp v0.5.5 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/oteltest v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/oteltest v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel => ./ diff --git a/handler_test.go b/handler_test.go index 1aba19c5d815..5268ac6aa900 100644 --- a/handler_test.go +++ b/handler_test.go @@ -17,10 +17,8 @@ package otel import ( "bytes" "errors" - "fmt" "log" "testing" - "time" "github.com/stretchr/testify/suite" ) @@ -72,53 +70,15 @@ func (s *HandlerTestSuite) TestGlobalHandler() { } func (s *HandlerTestSuite) TestNoDropsOnDelegate() { - // max time to wait for goroutine to Handle an error. - pause := 10 * time.Millisecond - - var sent int - err := errors.New("") - stop := make(chan struct{}) - beat := make(chan struct{}) - done := make(chan struct{}) - - // Wait for a error to be submitted from the following goroutine. - wait := func(d time.Duration) error { - timer := time.NewTimer(d) - select { - case <-timer.C: - // We are about to fail, stop the spawned goroutine. - stop <- struct{}{} - return fmt.Errorf("no errors sent in %v", d) - case <-beat: - // Allow the timer to be reclaimed by GC. - timer.Stop() - return nil - } - } - - go func() { - // Slow down to speed up: do not overload the processor. - ticker := time.NewTicker(100 * time.Microsecond) - for { - select { - case <-stop: - ticker.Stop() - done <- struct{}{} - return - case <-ticker.C: - sent++ - Handle(err) - } - - select { - case beat <- struct{}{}: - default: - } + causeErr := func() func() { + err := errors.New("") + return func() { + Handle(err) } }() - // Wait for the spice to flow - s.Require().NoError(wait(pause), "starting error stream") + causeErr() + s.Require().Len(s.errLogger.Got(), 1) // Change to another Handler. We are testing this is loss-less. newErrLogger := new(errLogger) @@ -126,16 +86,10 @@ func (s *HandlerTestSuite) TestNoDropsOnDelegate() { l: log.New(newErrLogger, "", 0), } SetErrorHandler(secondary) - s.Require().NoError(wait(pause), "switched to new Handler") - - // Testing done, stop sending errors. - stop <- struct{}{} - // Ensure we do not lose any straglers. - <-done - got := append(s.errLogger.Got(), newErrLogger.Got()...) - s.Assert().Greater(len(got), 1, "at least 2 errors should have been sent") - s.Assert().Len(got, sent) + causeErr() + s.Assert().Len(s.errLogger.Got(), 1, "original Handler used after delegation") + s.Assert().Len(newErrLogger.Got(), 1, "new Handler not used after delegation") } func TestHandlerTestSuite(t *testing.T) { diff --git a/metric/go.mod b/metric/go.mod index 687e9a168d2f..47bc47badde6 100644 --- a/metric/go.mod +++ b/metric/go.mod @@ -49,6 +49,6 @@ replace go.opentelemetry.io/otel/trace => ../trace require ( github.com/google/go-cmp v0.5.5 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/oteltest v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/oteltest v0.20.0 ) diff --git a/oteltest/go.mod b/oteltest/go.mod index 555239f192f7..07b7ddf270a4 100644 --- a/oteltest/go.mod +++ b/oteltest/go.mod @@ -47,7 +47,7 @@ replace go.opentelemetry.io/otel/sdk/metric => ../sdk/metric replace go.opentelemetry.io/otel/trace => ../trace require ( - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) diff --git a/sdk/export/metric/go.mod b/sdk/export/metric/go.mod index 08a7e713f8b5..170d38157fad 100644 --- a/sdk/export/metric/go.mod +++ b/sdk/export/metric/go.mod @@ -48,7 +48,7 @@ replace go.opentelemetry.io/otel/trace => ../../../trace require ( github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 ) diff --git a/sdk/go.mod b/sdk/go.mod index 990c36e8d968..8b516740d1fc 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -7,9 +7,9 @@ replace go.opentelemetry.io/otel => ../ require ( github.com/google/go-cmp v0.5.5 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/oteltest v0.19.0 - go.opentelemetry.io/otel/trace v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/oteltest v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 ) replace go.opentelemetry.io/otel/bridge/opencensus => ../bridge/opencensus diff --git a/sdk/metric/controller/basic/config.go b/sdk/metric/controller/basic/config.go index 803dd9c9fd8a..87be85b90006 100644 --- a/sdk/metric/controller/basic/config.go +++ b/sdk/metric/controller/basic/config.go @@ -64,9 +64,11 @@ type Option interface { Apply(*Config) } -// WithResource sets the Resource configuration option of a Config. +// WithResource sets the Resource configuration option of a Config by merging it +// with the Resource configuration in the environment. func WithResource(r *resource.Resource) Option { - return resourceOption{r} + res := resource.Merge(resource.Environment(), r) + return resourceOption{res} } type resourceOption struct{ *resource.Resource } diff --git a/sdk/metric/controller/basic/controller_test.go b/sdk/metric/controller/basic/controller_test.go index 447b831f8f42..ae4725546cfc 100644 --- a/sdk/metric/controller/basic/controller_test.go +++ b/sdk/metric/controller/basic/controller_test.go @@ -24,6 +24,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/attribute" + ottest "go.opentelemetry.io/otel/internal/internaltest" "go.opentelemetry.io/otel/metric" export "go.opentelemetry.io/otel/sdk/export/metric" "go.opentelemetry.io/otel/sdk/export/metric/aggregation" @@ -34,6 +35,8 @@ import ( "go.opentelemetry.io/otel/sdk/resource" ) +const envVar = "OTEL_RESOURCE_ATTRIBUTES" + func getMap(t *testing.T, cont *controller.Controller) map[string]float64 { out := processortest.NewOutput(attribute.DefaultEncoder()) @@ -58,6 +61,12 @@ func checkTestContext(t *testing.T, ctx context.Context) { } func TestControllerUsesResource(t *testing.T) { + store, err := ottest.SetEnvVariables(map[string]string{ + envVar: "key=value,T=U", + }) + require.NoError(t, err) + defer func() { require.NoError(t, store.Restore()) }() + cases := []struct { name string options []controller.Option @@ -66,7 +75,7 @@ func TestControllerUsesResource(t *testing.T) { { name: "explicitly empty resource", options: []controller.Option{controller.WithResource(resource.Empty())}, - wanted: ""}, + wanted: resource.Environment().Encoded(attribute.DefaultEncoder())}, { name: "uses default if no resource option", options: nil, @@ -74,15 +83,18 @@ func TestControllerUsesResource(t *testing.T) { { name: "explicit resource", options: []controller.Option{controller.WithResource(resource.NewWithAttributes(attribute.String("R", "S")))}, - wanted: "R=S"}, + wanted: "R=S,T=U,key=value"}, { name: "last resource wins", options: []controller.Option{ controller.WithResource(resource.Default()), controller.WithResource(resource.NewWithAttributes(attribute.String("R", "S"))), }, - wanted: "R=S", - }, + wanted: "R=S,T=U,key=value"}, + { + name: "overlapping attributes with environment resource", + options: []controller.Option{controller.WithResource(resource.NewWithAttributes(attribute.String("T", "V")))}, + wanted: "T=V,key=value"}, } for _, c := range cases { t.Run(fmt.Sprintf("case-%s", c.name), func(t *testing.T) { diff --git a/sdk/metric/go.mod b/sdk/metric/go.mod index 9a93db44a175..6ad529662cf2 100644 --- a/sdk/metric/go.mod +++ b/sdk/metric/go.mod @@ -49,8 +49,8 @@ replace go.opentelemetry.io/otel/trace => ../../trace require ( github.com/benbjohnson/clock v1.0.3 // do not upgrade to v1.1.x because it would require Go >= 1.15 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 - go.opentelemetry.io/otel/metric v0.19.0 - go.opentelemetry.io/otel/sdk v0.19.0 - go.opentelemetry.io/otel/sdk/export/metric v0.19.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/metric v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/sdk/export/metric v0.20.0 ) diff --git a/sdk/metric/sdk.go b/sdk/metric/sdk.go index 56218a78a562..268fa742da78 100644 --- a/sdk/metric/sdk.go +++ b/sdk/metric/sdk.go @@ -282,10 +282,12 @@ func (s *syncInstrument) acquireHandle(kvs []attribute.KeyValue, labelPtr *attri } } +// The order of the input array `kvs` may be sorted after the function is called. func (s *syncInstrument) Bind(kvs []attribute.KeyValue) metric.BoundSyncImpl { return s.acquireHandle(kvs, nil) } +// The order of the input array `kvs` may be sorted after the function is called. func (s *syncInstrument) RecordOne(ctx context.Context, num number.Number, kvs []attribute.KeyValue) { h := s.acquireHandle(kvs, nil) defer h.Unbind() @@ -396,6 +398,7 @@ func (m *Accumulator) collectSyncInstruments() int { } // CollectAsync implements internal.AsyncCollector. +// The order of the input array `kvs` may be sorted after the function is called. func (m *Accumulator) CollectAsync(kv []attribute.KeyValue, obs ...metric.Observation) { labels := attribute.NewSetWithSortable(kv, &m.asyncSortSlice) @@ -472,6 +475,7 @@ func (m *Accumulator) checkpointAsync(a *asyncInstrument) int { } // RecordBatch enters a batch of metric events. +// The order of the input array `kvs` may be sorted after the function is called. func (m *Accumulator) RecordBatch(ctx context.Context, kvs []attribute.KeyValue, measurements ...metric.Measurement) { // Labels will be computed the first time acquireHandle is // called. Subsequent calls to acquireHandle will re-use the diff --git a/sdk/resource/export_test.go b/sdk/resource/export_test.go new file mode 100644 index 000000000000..87e8853c0087 --- /dev/null +++ b/sdk/resource/export_test.go @@ -0,0 +1,31 @@ +// 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 resource // import "go.opentelemetry.io/otel/sdk/resource" + +var ( + SetDefaultOSProviders = setDefaultOSProviders + SetOSProviders = setOSProviders + SetDefaultRuntimeProviders = setDefaultRuntimeProviders + SetRuntimeProviders = setRuntimeProviders + SetDefaultUserProviders = setDefaultUserProviders + SetUserProviders = setUserProviders +) + +var ( + CommandArgs = commandArgs + RuntimeName = runtimeName + RuntimeOS = runtimeOS + RuntimeArch = runtimeArch +) diff --git a/sdk/resource/os.go b/sdk/resource/os.go new file mode 100644 index 000000000000..816d209217af --- /dev/null +++ b/sdk/resource/os.go @@ -0,0 +1,39 @@ +// 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 resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + "strings" + + "go.opentelemetry.io/otel/semconv" +) + +type osTypeDetector struct{} + +// Detect returns a *Resource that describes the operating system type the +// service is running on. +func (osTypeDetector) Detect(ctx context.Context) (*Resource, error) { + osType := runtimeOS() + + return NewWithAttributes( + semconv.OSTypeKey.String(strings.ToLower(osType)), + ), nil +} + +// WithOSType adds an attribute with the operating system type to the configured Resource. +func WithOSType() Option { + return WithDetectors(osTypeDetector{}) +} diff --git a/sdk/resource/os_test.go b/sdk/resource/os_test.go new file mode 100644 index 000000000000..7de00b4f6d6a --- /dev/null +++ b/sdk/resource/os_test.go @@ -0,0 +1,51 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/otel/sdk/resource" +) + +func mockRuntimeProviders() { + resource.SetRuntimeProviders( + fakeRuntimeNameProvider, + fakeRuntimeVersionProvider, + func() string { return "LINUX" }, + fakeRuntimeArchProvider, + ) +} + +func TestWithOSType(t *testing.T) { + mockRuntimeProviders() + + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithOSType(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "os.type": "linux", + }, toMap(res)) + + restoreProcessAttributesProviders() +} diff --git a/sdk/resource/process.go b/sdk/resource/process.go new file mode 100644 index 000000000000..f15f97ec5ac9 --- /dev/null +++ b/sdk/resource/process.go @@ -0,0 +1,237 @@ +// 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 resource // import "go.opentelemetry.io/otel/sdk/resource" + +import ( + "context" + "fmt" + "os" + "os/user" + "path/filepath" + "runtime" + + "go.opentelemetry.io/otel/semconv" +) + +type pidProvider func() int +type executablePathProvider func() (string, error) +type commandArgsProvider func() []string +type ownerProvider func() (*user.User, error) +type runtimeNameProvider func() string +type runtimeVersionProvider func() string +type runtimeOSProvider func() string +type runtimeArchProvider func() string + +var ( + defaultPidProvider pidProvider = os.Getpid + defaultExecutablePathProvider executablePathProvider = os.Executable + defaultCommandArgsProvider commandArgsProvider = func() []string { return os.Args } + defaultOwnerProvider ownerProvider = user.Current + defaultRuntimeNameProvider runtimeNameProvider = func() string { return runtime.Compiler } + defaultRuntimeVersionProvider runtimeVersionProvider = runtime.Version + defaultRuntimeOSProvider runtimeOSProvider = func() string { return runtime.GOOS } + defaultRuntimeArchProvider runtimeArchProvider = func() string { return runtime.GOARCH } +) + +var ( + pid = defaultPidProvider + executablePath = defaultExecutablePathProvider + commandArgs = defaultCommandArgsProvider + owner = defaultOwnerProvider + runtimeName = defaultRuntimeNameProvider + runtimeVersion = defaultRuntimeVersionProvider + runtimeOS = defaultRuntimeOSProvider + runtimeArch = defaultRuntimeArchProvider +) + +func setDefaultOSProviders() { + setOSProviders( + defaultPidProvider, + defaultExecutablePathProvider, + defaultCommandArgsProvider, + ) +} + +func setOSProviders( + pidProvider pidProvider, + executablePathProvider executablePathProvider, + commandArgsProvider commandArgsProvider, +) { + pid = pidProvider + executablePath = executablePathProvider + commandArgs = commandArgsProvider +} + +func setDefaultRuntimeProviders() { + setRuntimeProviders( + defaultRuntimeNameProvider, + defaultRuntimeVersionProvider, + defaultRuntimeOSProvider, + defaultRuntimeArchProvider, + ) +} + +func setRuntimeProviders( + runtimeNameProvider runtimeNameProvider, + runtimeVersionProvider runtimeVersionProvider, + runtimeOSProvider runtimeOSProvider, + runtimeArchProvider runtimeArchProvider, +) { + runtimeName = runtimeNameProvider + runtimeVersion = runtimeVersionProvider + runtimeOS = runtimeOSProvider + runtimeArch = runtimeArchProvider +} + +func setDefaultUserProviders() { + setUserProviders(defaultOwnerProvider) +} + +func setUserProviders(ownerProvider ownerProvider) { + owner = ownerProvider +} + +type processPIDDetector struct{} +type processExecutableNameDetector struct{} +type processExecutablePathDetector struct{} +type processCommandArgsDetector struct{} +type processOwnerDetector struct{} +type processRuntimeNameDetector struct{} +type processRuntimeVersionDetector struct{} +type processRuntimeDescriptionDetector struct{} + +// Detect returns a *Resource that describes the process identifier (PID) of the +// executing process. +func (processPIDDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessPIDKey.Int(pid())), nil +} + +// Detect returns a *Resource that describes the name of the process executable. +func (processExecutableNameDetector) Detect(ctx context.Context) (*Resource, error) { + executableName := filepath.Base(commandArgs()[0]) + + return NewWithAttributes(semconv.ProcessExecutableNameKey.String(executableName)), nil +} + +// Detect returns a *Resource that describes the full path of the process executable. +func (processExecutablePathDetector) Detect(ctx context.Context) (*Resource, error) { + executablePath, err := executablePath() + if err != nil { + return nil, err + } + + return NewWithAttributes(semconv.ProcessExecutablePathKey.String(executablePath)), nil +} + +// Detect returns a *Resource that describes all the command arguments as received +// by the process. +func (processCommandArgsDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessCommandArgsKey.Array(commandArgs())), nil +} + +// Detect returns a *Resource that describes the username of the user that owns the +// process. +func (processOwnerDetector) Detect(ctx context.Context) (*Resource, error) { + owner, err := owner() + if err != nil { + return nil, err + } + + return NewWithAttributes(semconv.ProcessOwnerKey.String(owner.Username)), nil +} + +// Detect returns a *Resource that describes the name of the compiler used to compile +// this process image. +func (processRuntimeNameDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessRuntimeNameKey.String(runtimeName())), nil +} + +// Detect returns a *Resource that describes the version of the runtime of this process. +func (processRuntimeVersionDetector) Detect(ctx context.Context) (*Resource, error) { + return NewWithAttributes(semconv.ProcessRuntimeVersionKey.String(runtimeVersion())), nil +} + +// Detect returns a *Resource that describes the runtime of this process. +func (processRuntimeDescriptionDetector) Detect(ctx context.Context) (*Resource, error) { + runtimeDescription := fmt.Sprintf( + "go version %s %s/%s", runtimeVersion(), runtimeOS(), runtimeArch()) + + return NewWithAttributes( + semconv.ProcessRuntimeDescriptionKey.String(runtimeDescription), + ), nil +} + +// WithProcessPID adds an attribute with the process identifier (PID) to the +// configured Resource. +func WithProcessPID() Option { + return WithDetectors(processPIDDetector{}) +} + +// WithProcessExecutableName adds an attribute with the name of the process +// executable to the configured Resource. +func WithProcessExecutableName() Option { + return WithDetectors(processExecutableNameDetector{}) +} + +// WithProcessExecutablePath adds an attribute with the full path to the process +// executable to the configured Resource. +func WithProcessExecutablePath() Option { + return WithDetectors(processExecutablePathDetector{}) +} + +// WithProcessCommandArgs adds an attribute with all the command arguments (including +// the command/executable itself) as received by the process the configured Resource. +func WithProcessCommandArgs() Option { + return WithDetectors(processCommandArgsDetector{}) +} + +// WithProcessOwner adds an attribute with the username of the user that owns the process +// to the configured Resource. +func WithProcessOwner() Option { + return WithDetectors(processOwnerDetector{}) +} + +// WithProcessRuntimeName adds an attribute with the name of the runtime of this +// process to the configured Resource. +func WithProcessRuntimeName() Option { + return WithDetectors(processRuntimeNameDetector{}) +} + +// WithProcessRuntimeVersion adds an attribute with the version of the runtime of +// this process to the configured Resource. +func WithProcessRuntimeVersion() Option { + return WithDetectors(processRuntimeVersionDetector{}) +} + +// WithProcessRuntimeDescription adds an attribute with an additional description +// about the runtime of the process to the configured Resource. +func WithProcessRuntimeDescription() Option { + return WithDetectors(processRuntimeDescriptionDetector{}) +} + +// WithProcess adds all the Process attributes to the configured Resource. +// See individual WithProcess* functions to configure specific attributes. +func WithProcess() Option { + return WithDetectors( + processPIDDetector{}, + processExecutableNameDetector{}, + processExecutablePathDetector{}, + processCommandArgsDetector{}, + processOwnerDetector{}, + processRuntimeNameDetector{}, + processRuntimeVersionDetector{}, + processRuntimeDescriptionDetector{}, + ) +} diff --git a/sdk/resource/process_test.go b/sdk/resource/process_test.go new file mode 100644 index 000000000000..d4692293d3e5 --- /dev/null +++ b/sdk/resource/process_test.go @@ -0,0 +1,302 @@ +// 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 resource_test + +import ( + "context" + "fmt" + "os" + "os/user" + "runtime" + "testing" + + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/otel/sdk/resource" +) + +var ( + fakePID = 123 + fakeExecutablePath = "/fake/path/mock" + fakeCommandArgs = []string{"mock", "-t", "30"} + fakeOwner = "gopher" + fakeRuntimeName = "gcmock" + fakeRuntimeVersion = "go1.2.3" + fakeRuntimeOS = "linux" + fakeRuntimeArch = "amd64" +) + +var ( + fakeExecutableName = "mock" + fakeRuntimeDescription = "go version go1.2.3 linux/amd64" +) + +var ( + fakePidProvider = func() int { return fakePID } + fakeExecutablePathProvider = func() (string, error) { return fakeExecutablePath, nil } + fakeCommandArgsProvider = func() []string { return fakeCommandArgs } + fakeOwnerProvider = func() (*user.User, error) { return &user.User{Username: fakeOwner}, nil } + fakeRuntimeNameProvider = func() string { return fakeRuntimeName } + fakeRuntimeVersionProvider = func() string { return fakeRuntimeVersion } + fakeRuntimeOSProvider = func() string { return fakeRuntimeOS } + fakeRuntimeArchProvider = func() string { return fakeRuntimeArch } +) + +var ( + fakeExecutablePathProviderWithError = func() (string, error) { + return "", fmt.Errorf("Unable to get process executable") + } + fakeOwnerProviderWithError = func() (*user.User, error) { + return nil, fmt.Errorf("Unable to get process user") + } +) + +func mockProcessAttributesProviders() { + resource.SetOSProviders( + fakePidProvider, + fakeExecutablePathProvider, + fakeCommandArgsProvider, + ) + resource.SetRuntimeProviders( + fakeRuntimeNameProvider, + fakeRuntimeVersionProvider, + fakeRuntimeOSProvider, + fakeRuntimeArchProvider, + ) + resource.SetUserProviders( + fakeOwnerProvider, + ) +} + +func mockProcessAttributesProvidersWithErrors() { + resource.SetOSProviders( + fakePidProvider, + fakeExecutablePathProviderWithError, + fakeCommandArgsProvider, + ) + resource.SetRuntimeProviders( + fakeRuntimeNameProvider, + fakeRuntimeVersionProvider, + fakeRuntimeOSProvider, + fakeRuntimeArchProvider, + ) + resource.SetUserProviders( + fakeOwnerProviderWithError, + ) +} + +func restoreProcessAttributesProviders() { + resource.SetDefaultOSProviders() + resource.SetDefaultRuntimeProviders() + resource.SetDefaultUserProviders() +} + +func TestWithProcessFuncs(t *testing.T) { + mockProcessAttributesProviders() + + t.Run("WithPID", testWithProcessPID) + t.Run("WithExecutableName", testWithProcessExecutableName) + t.Run("WithExecutablePath", testWithProcessExecutablePath) + t.Run("WithCommandArgs", testWithProcessCommandArgs) + t.Run("WithOwner", testWithProcessOwner) + t.Run("WithRuntimeName", testWithProcessRuntimeName) + t.Run("WithRuntimeVersion", testWithProcessRuntimeVersion) + t.Run("WithRuntimeDescription", testWithProcessRuntimeDescription) + t.Run("WithProcess", testWithProcess) + + restoreProcessAttributesProviders() +} + +func TestWithProcessFuncsErrors(t *testing.T) { + mockProcessAttributesProvidersWithErrors() + + t.Run("WithPID", testWithProcessExecutablePathError) + t.Run("WithExecutableName", testWithProcessOwnerError) + + restoreProcessAttributesProviders() +} + +func TestCommandArgs(t *testing.T) { + require.EqualValues(t, os.Args, resource.CommandArgs()) +} + +func TestRuntimeName(t *testing.T) { + require.EqualValues(t, runtime.Compiler, resource.RuntimeName()) +} + +func TestRuntimeOS(t *testing.T) { + require.EqualValues(t, runtime.GOOS, resource.RuntimeOS()) +} + +func TestRuntimeArch(t *testing.T) { + require.EqualValues(t, runtime.GOARCH, resource.RuntimeArch()) +} + +func testWithProcessPID(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessPID(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.pid": fmt.Sprint(fakePID), + }, toMap(res)) +} + +func testWithProcessExecutableName(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessExecutableName(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.executable.name": fakeExecutableName, + }, toMap(res)) +} + +func testWithProcessExecutablePath(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessExecutablePath(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.executable.path": fakeExecutablePath, + }, toMap(res)) +} + +func testWithProcessCommandArgs(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessCommandArgs(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.command_args": fmt.Sprint(fakeCommandArgs), + }, toMap(res)) +} + +func testWithProcessOwner(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessOwner(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.owner": fakeOwner, + }, toMap(res)) +} + +func testWithProcessRuntimeName(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessRuntimeName(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.runtime.name": fakeRuntimeName, + }, toMap(res)) +} + +func testWithProcessRuntimeVersion(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessRuntimeVersion(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.runtime.version": fakeRuntimeVersion, + }, toMap(res)) +} + +func testWithProcessRuntimeDescription(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessRuntimeDescription(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.runtime.description": fakeRuntimeDescription, + }, toMap(res)) +} + +func testWithProcess(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcess(), + ) + + require.NoError(t, err) + require.EqualValues(t, map[string]string{ + "process.pid": fmt.Sprint(fakePID), + "process.executable.name": fakeExecutableName, + "process.executable.path": fakeExecutablePath, + "process.command_args": fmt.Sprint(fakeCommandArgs), + "process.owner": fakeOwner, + "process.runtime.name": fakeRuntimeName, + "process.runtime.version": fakeRuntimeVersion, + "process.runtime.description": fakeRuntimeDescription, + }, toMap(res)) +} + +func testWithProcessExecutablePathError(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessExecutablePath(), + ) + + require.Error(t, err) + require.EqualValues(t, map[string]string{}, toMap(res)) +} + +func testWithProcessOwnerError(t *testing.T) { + ctx := context.Background() + + res, err := resource.New(ctx, + resource.WithoutBuiltin(), + resource.WithProcessOwner(), + ) + + require.Error(t, err) + require.EqualValues(t, map[string]string{}, toMap(res)) +} diff --git a/sdk/resource/resource.go b/sdk/resource/resource.go index a2db66cf3b58..2e5d10151cc6 100644 --- a/sdk/resource/resource.go +++ b/sdk/resource/resource.go @@ -40,7 +40,7 @@ var ( otel.Handle(err) } return r - }(Detect(context.Background(), defaultServiceNameDetector{}, TelemetrySDK{})) + }(Detect(context.Background(), defaultServiceNameDetector{}, FromEnv{}, TelemetrySDK{})) ) // NewWithAttributes creates a resource from attrs. If attrs contains @@ -144,6 +144,17 @@ func Default() *Resource { return defaultResource } +// Environment returns an instance of Resource with attributes +// extracted from the OTEL_RESOURCE_ATTRIBUTES environment variable. +func Environment() *Resource { + detector := &FromEnv{} + resource, err := detector.Detect(context.Background()) + if err == nil { + otel.Handle(err) + } + return resource +} + // Equivalent returns an object that can be compared for equality // between two resources. This value is suitable for use as a key in // a map. diff --git a/sdk/trace/provider.go b/sdk/trace/provider.go index ac56af73bba5..601c239c0e04 100644 --- a/sdk/trace/provider.go +++ b/sdk/trace/provider.go @@ -262,9 +262,7 @@ func WithSpanProcessor(sp SpanProcessor) TracerProviderOption { // resource.Default() Resource by default. func WithResource(r *resource.Resource) TracerProviderOption { return func(opts *TracerProviderConfig) { - if r != nil { - opts.resource = r - } + opts.resource = resource.Merge(resource.Environment(), r) } } diff --git a/sdk/trace/span.go b/sdk/trace/span.go index 6fdb4ed9eb6c..c966f34b336a 100644 --- a/sdk/trace/span.go +++ b/sdk/trace/span.go @@ -367,7 +367,7 @@ func (s *span) Attributes() []attribute.KeyValue { return s.attributes.toKeyValue() } -// Events returns the links of this span. +// Links returns the links of this span. func (s *span) Links() []trace.Link { s.mu.Lock() defer s.mu.Unlock() diff --git a/sdk/trace/span_processor_annotator_example_test.go b/sdk/trace/span_processor_annotator_example_test.go new file mode 100644 index 000000000000..e2842b7a35f2 --- /dev/null +++ b/sdk/trace/span_processor_annotator_example_test.go @@ -0,0 +1,82 @@ +// 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 trace + +import ( + "context" + "fmt" + + "go.opentelemetry.io/otel/attribute" +) + +/* +Sometimes information about a runtime environment can change dynamically or be +delayed from startup. Instead of continuously recreating and distributing a +TracerProvider with an immutable Resource or delaying the startup of your +application on a slow-loading piece of information, annotate the created spans +dynamically using a SpanProcessor. +*/ + +var ( + // owner represents the owner of the application. In this example it is + // stored as a simple string, but in real-world use this may be the + // response to an asynchronous request. + owner = "unknown" + ownerKey = attribute.Key("owner") +) + +// Annotator is a SpanProcessor that adds attributes to all started spans. +type Annotator struct { + // AttrsFunc is called when a span is started. The attributes it returns + // are set on the Span being started. + AttrsFunc func() []attribute.KeyValue +} + +func (a Annotator) OnStart(_ context.Context, s ReadWriteSpan) { s.SetAttributes(a.AttrsFunc()...) } +func (a Annotator) Shutdown(context.Context) error { return nil } +func (a Annotator) ForceFlush(context.Context) error { return nil } +func (a Annotator) OnEnd(s ReadOnlySpan) { + attr := s.Attributes()[0] + fmt.Printf("%s: %s\n", attr.Key, attr.Value.AsString()) +} + +func ExampleSpanProcessor_annotated() { + a := Annotator{ + AttrsFunc: func() []attribute.KeyValue { + return []attribute.KeyValue{ownerKey.String(owner)} + }, + } + tracer := NewTracerProvider(WithSpanProcessor(a)).Tracer("annotated") + + // Simulate the situation where we want to annotate spans with an owner, + // but at startup we do not now this information. Instead of waiting for + // the owner to be known before starting and blocking here, start doing + // work and update when the information becomes available. + ctx := context.Background() + _, s0 := tracer.Start(ctx, "span0") + + // Simulate an asynchronous call to determine the owner succeeding. We now + // know that the owner of this application has been determined to be + // Alice. Make sure all subsequent spans are annotated appropriately. + owner = "alice" + + _, s1 := tracer.Start(ctx, "span1") + s0.End() + s1.End() + + // Output: + // owner: unknown + // owner: alice +} diff --git a/sdk/trace/span_processor_example_test.go b/sdk/trace/span_processor_filter_example_test.go similarity index 98% rename from sdk/trace/span_processor_example_test.go rename to sdk/trace/span_processor_filter_example_test.go index fb07a2f58326..3983a007ce01 100644 --- a/sdk/trace/span_processor_example_test.go +++ b/sdk/trace/span_processor_filter_example_test.go @@ -79,7 +79,7 @@ type noopExporter struct{} func (noopExporter) ExportSpans(context.Context, []*SpanSnapshot) error { return nil } func (noopExporter) Shutdown(context.Context) error { return nil } -func ExampleSpanProcessor() { +func ExampleSpanProcessor_filtered() { exportSP := NewSimpleSpanProcessor(noopExporter{}) // Build a SpanProcessor chain to filter out all spans from the pernicious diff --git a/sdk/trace/trace_test.go b/sdk/trace/trace_test.go index 786656b464fe..c2ac388b46e9 100644 --- a/sdk/trace/trace_test.go +++ b/sdk/trace/trace_test.go @@ -43,6 +43,8 @@ import ( "go.opentelemetry.io/otel/sdk/resource" ) +const envVar = "OTEL_RESOURCE_ATTRIBUTES" + type storingHandler struct { errs []error } @@ -1307,6 +1309,12 @@ func TestWithSpanKind(t *testing.T) { } func TestWithResource(t *testing.T) { + store, err := ottest.SetEnvVariables(map[string]string{ + envVar: "key=value,rk5=7", + }) + require.NoError(t, err) + defer func() { require.NoError(t, store.Restore()) }() + cases := []struct { name string options []TracerProviderOption @@ -1316,7 +1324,7 @@ func TestWithResource(t *testing.T) { { name: "explicitly empty resource", options: []TracerProviderOption{WithResource(resource.Empty())}, - want: resource.Empty(), + want: resource.Environment(), }, { name: "uses default if no resource option", @@ -1326,14 +1334,19 @@ func TestWithResource(t *testing.T) { { name: "explicit resource", options: []TracerProviderOption{WithResource(resource.NewWithAttributes(attribute.String("rk1", "rv1"), attribute.Int64("rk2", 5)))}, - want: resource.NewWithAttributes(attribute.String("rk1", "rv1"), attribute.Int64("rk2", 5)), + want: resource.Merge(resource.Environment(), resource.NewWithAttributes(attribute.String("rk1", "rv1"), attribute.Int64("rk2", 5))), }, { name: "last resource wins", options: []TracerProviderOption{ WithResource(resource.NewWithAttributes(attribute.String("rk1", "vk1"), attribute.Int64("rk2", 5))), WithResource(resource.NewWithAttributes(attribute.String("rk3", "rv3"), attribute.Int64("rk4", 10)))}, - want: resource.NewWithAttributes(attribute.String("rk3", "rv3"), attribute.Int64("rk4", 10)), + want: resource.Merge(resource.Environment(), resource.NewWithAttributes(attribute.String("rk3", "rv3"), attribute.Int64("rk4", 10))), + }, + { + name: "overlapping attributes with environment resource", + options: []TracerProviderOption{WithResource(resource.NewWithAttributes(attribute.String("rk1", "rv1"), attribute.Int64("rk5", 10)))}, + want: resource.Merge(resource.Environment(), resource.NewWithAttributes(attribute.String("rk1", "rv1"), attribute.Int64("rk5", 10))), }, } for _, tc := range cases { diff --git a/semconv/resource.go b/semconv/resource.go index 188dacee4f1b..69a9b5a6f33a 100644 --- a/semconv/resource.go +++ b/semconv/resource.go @@ -116,8 +116,24 @@ const ( // `proc/[pid]/cmdline`. On Windows, can be set to the result of // `GetCommandLineW`. ProcessCommandLineKey = attribute.Key("process.command_line") + // All the command arguments (including the command/executable itself) + // as received by the process. On Linux-based systems (and some other + // Unixoid systems supporting procfs), can be set according to the list + // of null-delimited strings extracted from `proc/[pid]/cmdline`. For + // libc-based executables, this would be the full argv vector passed to + // `main`. + ProcessCommandArgsKey = attribute.Key("process.command_args") // The username of the user that owns the process. ProcessOwnerKey = attribute.Key("process.owner") + // The name of the runtime of this process. For compiled native + // binaries, this SHOULD be the name of the compiler. + ProcessRuntimeNameKey = attribute.Key("process.runtime.name") + // The version of the runtime of this process, as returned by the + // runtime without modification. + ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") + // An additional description about the runtime of the process, for + // example a specific vendor customization of the runtime environment. + ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") ) // Semantic conventions for Kubernetes resource attribute keys. @@ -183,6 +199,14 @@ const ( K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") ) +// Semantic conventions for OS resource attribute keys. +const ( + // The operating system type. + OSTypeKey = attribute.Key("os.type") + // Human readable (not intended to be parsed) OS version information. + OSDescriptionKey = attribute.Key("os.description") +) + // Semantic conventions for host resource attribute keys. const ( // A uniquely identifying name for the host: 'hostname', FQDN, or user specified name diff --git a/trace/config_test.go b/trace/config_test.go index df25bf3f3f5a..4a94aa2cdc2b 100644 --- a/trace/config_test.go +++ b/trace/config_test.go @@ -271,4 +271,4 @@ func TestErrorConfig(t *testing.T) { for _, test := range tests { assert.Equal(t, test.expected, NewErrorConfig(test.options...)) } -} \ No newline at end of file +} diff --git a/trace/go.mod b/trace/go.mod index 508fa95968e7..914e4f4384a3 100644 --- a/trace/go.mod +++ b/trace/go.mod @@ -49,5 +49,5 @@ replace go.opentelemetry.io/otel/trace => ./ require ( github.com/google/go-cmp v0.5.5 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.19.0 + go.opentelemetry.io/otel v0.20.0 ) diff --git a/version.go b/version.go index f15d8d1753ef..81be6f368172 100644 --- a/version.go +++ b/version.go @@ -16,5 +16,5 @@ package otel // import "go.opentelemetry.io/otel" // Version is the current release version of OpenTelemetry in use. func Version() string { - return "0.19.0" + return "0.20.0" } diff --git a/version_test.go b/version_test.go new file mode 100644 index 000000000000..ce598d1f4b61 --- /dev/null +++ b/version_test.go @@ -0,0 +1,34 @@ +// 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 otel_test + +import ( + "regexp" + "testing" + + "github.com/stretchr/testify/assert" + + "go.opentelemetry.io/otel" +) + +// regex taken from https://github.com/Masterminds/semver/tree/v3.1.1 +var versionRegex = regexp.MustCompile(`^v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?$`) + +func TestVersionSemver(t *testing.T) { + v := otel.Version() + assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v) +} diff --git a/website_docs/exporting_data.md b/website_docs/exporting_data.md index 962b6da0972f..8b468eed8c11 100644 --- a/website_docs/exporting_data.md +++ b/website_docs/exporting_data.md @@ -13,7 +13,7 @@ A sampler needs to be set on the tracer provider when its configured, as follows ```go provider := sdktrace.NewTracerProvider( - sdktrace.WithConfig(sdktrace.Config{DefaultSampler: sdktrace.AlwaysSample()}), + sdktrace.WithSampler(sdktrace.AlwaysSample()), ) ``` @@ -24,6 +24,8 @@ Other samplers include: * `TraceIDRatioBased`, which will sample a fraction of traces, based on the fraction given to the sampler. Thus, if you set this to .5, half of traces will be sampled. * `ParentBased`, which behaves differently based on the incoming sampling decision. In general, this will sample spans that have parents that were sampled, and will not sample spans whose parents were _not_ sampled. +When you're in production, you should consider using the `TraceIDRatioBased` sampler with the `ParentBased` samler. + # Resources Resources are a special type of attribute that apply to all spans generated by a process. These should be used to represent underlying metadata about a process that's non-ephemeral - for example, the hostname of a process, or its instance ID. @@ -32,9 +34,9 @@ Resources should be assigned to a tracer provider at its initialization, and are ```go resources := resource.New( - label.String("service.name", "myService"), - label.String("service.version", "1.0.0"), - label.String("instance.id", "abcdef12345"), + attribute.String("service.name", "myService"), + attribute.String("service.version", "1.0.0"), + attribute.String("instance.id", "abcdef12345"), ) provider := sdktrace.NewTracerProvider( diff --git a/website_docs/getting-started.md b/website_docs/getting-started.md index d9394d8742a6..46f1878cdd6b 100644 --- a/website_docs/getting-started.md +++ b/website_docs/getting-started.md @@ -15,7 +15,7 @@ To get started with this guide, create a new directory and add a new file named To install the necessary prerequisites for OpenTelemetry, you'll want to run the following command in the directory with your `go.mod`: -`go get go.opentelemetry.io/otel@v0.16.0 go.opentelemetry.io/otel/sdk@v0.16.0 go.opentelemetry.io/otel/exporters/stdout@v0.16.0` +`go get go.opentelemetry.io/otel@v0.20.0 go.opentelemetry.io/otel/sdk@v0.20.0 go.opentelemetry.io/otel/exporters/stdout@v0.20.0` In your `main.go` file, you'll need to import several packages: @@ -30,7 +30,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/baggage" "go.opentelemetry.io/otel/exporters/stdout" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/propagation" controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" @@ -128,22 +128,22 @@ It's important to note that if you do not set a propagator, the default is to us The next step is to create metric instruments that will capture measurements. There are two kinds of instruments: synchronous and asynchronous. Synchronous instruments capture measurements by explicitly calling the capture either by the application or by an instrumented library. Depending on the semantics of the measurements, we can say that synchronous instruments record or add measurements. Asynchronous instruments provide a callback that captures measurements. The callback is periodically called by meter in the background. We can say that asynchronous instrument performs observations. -Each measurement can be associated with labels that can later be used by visualisation software to categorize and filter measurements. In case of synchronous instruments the labels can be passed at the moment of capturing a measurement or can be passed when binding the instrument. Such a bound instrument can be later used to capture measurements without passing the labels. In case of asynchronous instruments, the labels are passed each time an observation is made explicitly in the callback. +Each measurement can be associated with attributes that can later be used by visualisation software to categorize and filter measurements. In case of synchronous instruments the attributes can be passed at the moment of capturing a measurement or can be passed when binding the instrument. Such a bound instrument can be later used to capture measurements without passing the attributes. In case of asynchronous instruments, the attributes are passed each time an observation is made explicitly in the callback. To set up some metric instruments, add the following code to your `main.go` file - ```go - fooKey := label.Key("ex.com/foo") - barKey := label.Key("ex.com/bar") - lemonsKey := label.Key("ex.com/lemons") - anotherKey := label.Key("ex.com/another") + fooKey := attribute.Key("ex.com/foo") + barKey := attribute.Key("ex.com/bar") + lemonsKey := attribute.Key("ex.com/lemons") + anotherKey := attribute.Key("ex.com/another") - commonLabels := []label.KeyValue{lemonsKey.Int(10), label.String("A", "1"), label.String("B", "2"), label.String("C", "3")} + commonAttributes := []attribute.KeyValue{lemonsKey.Int(10), attribute.String("A", "1"), attribute.String("B", "2"), attribute.String("C", "3")} meter := otel.Meter("ex.com/basic") observerCallback := func(_ context.Context, result metric.Float64ObserverResult) { - result.Observe(1, commonLabels...) + result.Observe(1, commonAttributes...) } _ = metric.Must(meter).NewFloat64ValueObserver("ex.com.one", observerCallback, metric.WithDescription("A ValueObserver set to 1.0"), @@ -151,11 +151,11 @@ To set up some metric instruments, add the following code to your `main.go` file valueRecorder := metric.Must(meter).NewFloat64ValueRecorder("ex.com.two") - boundRecorder := valueRecorder.Bind(commonLabels...) + boundRecorder := valueRecorder.Bind(commonAttributes...) defer boundRecorder.Unbind() ``` -In this block we first create some keys and labels that we will later use when capturing the measurements. Then we ask a global meter provider to give us a named meter instance ("ex.com/basic"). This acts as a way to namespace our instruments and make them distinct from other instruments in this process or another. Then we use the meter to create two instruments - an asynchronous value observer and a synchronous value recorder. +In this block we first create some keys and attributes that we will later use when capturing the measurements. Then we ask a global meter provider to give us a named meter instance ("ex.com/basic"). This acts as a way to namespace our instruments and make them distinct from other instruments in this process or another. Then we use the meter to create two instruments - an asynchronous value observer and a synchronous value recorder. # Quick Start @@ -173,13 +173,13 @@ Let's put the concepts we've just covered together, and create a trace and some ctx, span = tracer.Start(ctx, "operation") defer span.End() - span.AddEvent("Nice operation!", trace.WithAttributes(label.Int("bogons", 100))) + span.AddEvent("Nice operation!", trace.WithAttributes(attribute.Int("bogons", 100))) span.SetAttributes(anotherKey.String("yes")) meter.RecordBatch( // Note: call-site variables added as context Entries: baggage.ContextWithValues(ctx, anotherKey.String("xyz")), - commonLabels, + commonAttributes, valueRecorder.Measurement(2.0), ) diff --git a/website_docs/instrumentation.md b/website_docs/instrumentation.md index bbe2fb62b8e7..756779f338aa 100644 --- a/website_docs/instrumentation.md +++ b/website_docs/instrumentation.md @@ -46,15 +46,15 @@ Attributes are keys and values that are applied as metadata to your spans and ar ```go // setting attributes at creation... -ctx, span = tracer.Start(ctx, "attributesAtCreation", trace.WithAttributes(label.String("hello", "world"))) +ctx, span = tracer.Start(ctx, "attributesAtCreation", trace.WithAttributes(attribute.String("hello", "world"))) // ... and after creation -span.SetAttributes(label.Bool("isTrue", true), label.String("stringAttr", "hi!")) +span.SetAttributes(attribute.Bool("isTrue", true), attribute.String("stringAttr", "hi!")) ``` Attribute keys can be precomputed, as well - ```go -var myKey = label.Key("myCoolAttribute") +var myKey = attribute.Key("myCoolAttribute") span.SetAttributes(myKey.String("a value")) ``` @@ -82,7 +82,7 @@ A useful characteristic of events is that their timestamps are displayed as offs Events can also have attributes of their own - ```go -span.AddEvent("Cancelled wait due to external signal", trace.WithAttributes(label.Int("pid", 4328), label.String("signal", "SIGHUP"))) +span.AddEvent("Cancelled wait due to external signal", trace.WithAttributes(attribute.Int("pid", 4328), attribute.String("signal", "SIGHUP"))) ``` # Creating Metrics