mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 539be170
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
3
vendor/go.opentelemetry.io/contrib/.gitattributes
generated
vendored
3
vendor/go.opentelemetry.io/contrib/.gitattributes
generated
vendored
@ -1,3 +0,0 @@
|
||||
* text=auto eol=lf
|
||||
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||
*.{bat,[bB][aA][tT]} text eol=crlf
|
13
vendor/go.opentelemetry.io/contrib/.gitignore
generated
vendored
13
vendor/go.opentelemetry.io/contrib/.gitignore
generated
vendored
@ -1,13 +0,0 @@
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
.tools/
|
||||
.idea/
|
||||
.vscode/
|
||||
*.iml
|
||||
*.so
|
||||
coverage.*
|
||||
example
|
||||
|
||||
instrumentation/google.golang.org/grpc/otelgrpc/example/server/server
|
||||
instrumentation/google.golang.org/grpc/otelgrpc/example/client/client
|
32
vendor/go.opentelemetry.io/contrib/.golangci.yml
generated
vendored
32
vendor/go.opentelemetry.io/contrib/.golangci.yml
generated
vendored
@ -1,32 +0,0 @@
|
||||
# See https://github.com/golangci/golangci-lint#config-file
|
||||
run:
|
||||
issues-exit-code: 1 #Default
|
||||
tests: true #Default
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- misspell
|
||||
- goimports
|
||||
- revive
|
||||
- gofmt
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
# helpers in tests often (rightfully) pass a *testing.T as their first argument
|
||||
- path: _test\.go
|
||||
text: "context.Context should be the first parameter of a function"
|
||||
linters:
|
||||
- revive
|
||||
# Yes, they are, but it's okay in a test
|
||||
- path: _test\.go
|
||||
text: "exported func.*returns unexported type.*which can be annoying to use"
|
||||
linters:
|
||||
- revive
|
||||
|
||||
linters-settings:
|
||||
misspell:
|
||||
locale: US
|
||||
#ignore-words:
|
||||
# - someword
|
||||
goimports:
|
||||
local-prefixes: go.opentelemetry.io
|
336
vendor/go.opentelemetry.io/contrib/CHANGELOG.md
generated
vendored
336
vendor/go.opentelemetry.io/contrib/CHANGELOG.md
generated
vendored
@ -1,336 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.21.0] - 2021-06-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- Dockerfile based examples for `otelgin` and `otelmacaron`. (#767)
|
||||
|
||||
### Changed
|
||||
|
||||
- Supported minimum version of Go bumped from 1.14 to 1.15. (#787)
|
||||
- EKS Resource Detector now use the Kubernetes Go client to obtain the ConfigMap. (#813)
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove service name from `otelmongodb` configuration and span attributes. (#763)
|
||||
|
||||
## [0.20.0] - 2021-04-23
|
||||
|
||||
### Changed
|
||||
|
||||
- The `go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo` instrumentation now accepts a `WithCommandAttributeDisabled`,
|
||||
so the caller can specify whether to opt-out of tracing the mongo command. (#712)
|
||||
- Upgrade to v0.20.0 of `go.opentelemetry.io/otel`. (#758)
|
||||
- The B3 and Jaeger propagators now store their debug or deferred state in the context.Context instead of the SpanContext. (#758)
|
||||
|
||||
## [0.19.0] - 2021-03-19
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade to v0.19.0 of `go.opentelemetry.io/otel`.
|
||||
- Fix Span names created in HTTP Instrumentation package to conform with guidelines. (#757)
|
||||
|
||||
## [0.18.0] - 2021-03-04
|
||||
|
||||
### Fixed
|
||||
|
||||
- `otelmemcache` no longer sets span status to OK instead of leaving it unset. (#477)
|
||||
- Fix goroutine leak in gRPC `StreamClientInterceptor`. (#581)
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove service name from `otelmemcache` configuration and span attributes. (#477)
|
||||
|
||||
## [0.17.0] - 2021-02-15
|
||||
|
||||
### Added
|
||||
|
||||
- Add `ot-tracer` propagator (#562)
|
||||
|
||||
### Changed
|
||||
|
||||
- Rename project default branch from `master` to `main`.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Added failure message for AWS ECS resource detector for better debugging (#568)
|
||||
- Goroutine leak in gRPC StreamClientInterceptor while streamer returns an error. (#581)
|
||||
|
||||
## [0.16.0] - 2021-01-13
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix module path for AWS ECS resource detector (#517)
|
||||
|
||||
## [0.15.1] - 2020-12-14
|
||||
|
||||
### Added
|
||||
|
||||
- Add registry link check to `Makefile` and pre-release script. (#446)
|
||||
- A new AWS X-Ray ID Generator (#459)
|
||||
- Migrate CircleCI jobs to GitHub Actions (#476)
|
||||
- Add CodeQL GitHub Action (#506)
|
||||
- Add gosec workflow to GitHub Actions (#507)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixes the body replacement in otelhttp to not to mutate a nil body. (#484)
|
||||
|
||||
## [0.15.0] - 2020-12-11
|
||||
|
||||
### Added
|
||||
|
||||
- A new Amazon EKS resource detector. (#465)
|
||||
- A new `gcp.CloudRun` detector for detecting resource from a Cloud Run instance. (#455)
|
||||
|
||||
## [0.14.0] - 2020-11-20
|
||||
|
||||
### Added
|
||||
|
||||
- `otelhttp.{Get,Head,Post,PostForm}` convenience wrappers for their `http` counterparts. (#390)
|
||||
- The AWS detector now adds the cloud zone, host image ID, host type, and host name to the returned `Resource`. (#410)
|
||||
- Add Amazon ECS Resource Detector for AWS X-Ray. (#466)
|
||||
- Add propagator for AWS X-Ray (#462)
|
||||
|
||||
### Changed
|
||||
|
||||
- Add semantic version to `Tracer` / `Meter` created by instrumentation packages `otelsaram`, `otelrestful`, `otelmongo`, `otelhttp` and `otelhttptrace`. (#412)
|
||||
- Update instrumentation guidelines about tracer / meter semantic version. (#412)
|
||||
- Replace internal tracer and meter helpers by helpers from `go.opentelemetry.io/otel`. (#414)
|
||||
- gRPC instrumentation sets span attribute `rpc.grpc.status_code`. (#453)
|
||||
|
||||
## Fixed
|
||||
|
||||
- `/detectors/aws` no longer fails if instance metadata is not available (e.g. not running in AWS) (#401)
|
||||
- The AWS detector now returns a partial resource and an appropriate error if it encounters an error part way through determining a `Resource` identity. (#410)
|
||||
- The `host` instrumentation unit test has been updated to not depend on the system it runs on. (#426)
|
||||
|
||||
## [0.13.0] - 2020-10-09
|
||||
|
||||
## Added
|
||||
|
||||
- A Jaeger propagator. (#375)
|
||||
|
||||
## Changed
|
||||
|
||||
- The `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` package instrumentation no longer accepts a `Tracer` as an argument to the interceptor function.
|
||||
Instead, a new `WithTracerProvider` option is added to configure the `TracerProvider` used when creating the `Tracer` for the instrumentation. (#373)
|
||||
- The `go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron` instrumentation now accepts a `TracerProvider` rather than a `Tracer`. (#374)
|
||||
- Remove `go.opentelemetry.io/otel/sdk` dependency from instrumentation. (#381)
|
||||
- Use `httpsnoop` in `go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux` to ensure `http.ResponseWriter` additional interfaces are preserved. (#388)
|
||||
|
||||
### Fixed
|
||||
|
||||
- The `go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho.Middleware` no longer sends duplicate errors to the global `ErrorHandler`. (#377, #364)
|
||||
- The import comment in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` is now correctly quoted. (#379)
|
||||
- The B3 propagator sets the sample bitmask when the sampling decision is `debug`. (#369)
|
||||
|
||||
## [0.12.0] - 2020-09-25
|
||||
|
||||
### Changed
|
||||
|
||||
- Replace `WithTracer` with `WithTracerProvider` in the `go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron` instrumentation. (#374)
|
||||
|
||||
### Added
|
||||
|
||||
- Benchmark tests for the gRPC instrumentation. (#296)
|
||||
- Integration testing for the gRPC instrumentation. (#297)
|
||||
- Allow custom labels to be added to net/http metrics. (#306)
|
||||
- Added B3 propagator, moving it out of open.telemetry.io/otel repo. (#344)
|
||||
|
||||
### Changed
|
||||
|
||||
- Unify instrumentation about provider options for `go.mongodb.org/mongo-driver`, `gin-gonic/gin`, `gorilla/mux`,
|
||||
`labstack/echo`, `emicklei/go-restful`, `bradfitz/gomemcache`, `Shopify/sarama`, `net/http` and `beego`. (#303)
|
||||
- Update instrumentation guidelines about uniform provider options. Also, update style guide. (#303)
|
||||
- Make config struct of instrumentation unexported. (#303)
|
||||
- Instrumentations have been updated to adhere to the [configuration style guide's](https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#config)
|
||||
updated recommendation to use `newConfig()` instead of `configure()`. (#336)
|
||||
- A new instrumentation naming scheme is implemented to avoid package name conflicts for instrumented packages while still remaining discoverable. (#359)
|
||||
- `google.golang.org/grpc` -> `google.golang.org/grpc/otelgrpc`
|
||||
- `go.mongodb.org/mongo-driver` -> `go.mongodb.org/mongo-driver/mongo/otelmongo`
|
||||
- `net/http` -> `net/http/otelhttp`
|
||||
- `net/http/httptrace` -> `net/http/httptrace/otelhttptrace`
|
||||
- `github.com/labstack/echo` -> `github.com/labstack/echo/otelecho`
|
||||
- `github.com/bradfitz/gomemcache` -> `github.com/bradfitz/gomemcache/memcache/otelmemcache`
|
||||
- `github.com/gin-gonic/gin` -> `github.com/gin-gonic/gin/otelgin`
|
||||
- `github.com/gocql/gocql` -> `github.com/gocql/gocql/otelgocql`
|
||||
- `github.com/emicklei/go-restful` -> `github.com/emicklei/go-restful/otelrestful`
|
||||
- `github.com/Shopify/sarama` -> `github.com/Shopify/sarama/otelsarama`
|
||||
- `github.com/gorilla/mux` -> `github.com/gorilla/mux/otelmux`
|
||||
- `github.com/astaxie/beego` -> `github.com/astaxie/beego/otelbeego`
|
||||
- `gopkg.in/macaron.v1` -> `gopkg.in/macaron.v1/otelmacaron`
|
||||
- Rename `OTelBeegoHandler` to `Handler` in the `go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego` package. (#359)
|
||||
|
||||
## [0.11.0] - 2020-08-25
|
||||
|
||||
### Added
|
||||
|
||||
- Top-level `Version()` and `SemVersion()` functions defining the current version of the contrib package. (#225)
|
||||
- Instrumentation for the `github.com/astaxie/beego` package. (#200)
|
||||
- Instrumentation for the `github.com/bradfitz/gomemcache` package. (#204)
|
||||
- Host metrics instrumentation. (#231)
|
||||
- Cortex histogram and distribution support. (#237)
|
||||
- Cortex example project. (#238)
|
||||
- Cortex HTTP authentication. (#246)
|
||||
|
||||
### Changed
|
||||
|
||||
- Remove service name as a parameter of Sarama instrumentation. (#221)
|
||||
- Replace `WithTracer` with `WithTracerProvider` in Sarama instrumentation. (#221)
|
||||
- Switch to use common top-level module `SemVersion()` when creating versioned tracer in `bradfitz/gomemcache`. (#226)
|
||||
- Use `IntegrationShouldRun` in `gomemcache_test`. (#254)
|
||||
- Use Go 1.15 for CI builds. (#236)
|
||||
- Improved configuration for `runtime` instrumentation. (#224)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Update dependabot configuration to include newly added `bradfitz/gomemcache` package. (#226)
|
||||
- Correct `runtime` instrumentation name. (#241)
|
||||
|
||||
## [0.10.1] - 2020-08-13
|
||||
|
||||
### Added
|
||||
|
||||
- The `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc` module has been added to replace the instrumentation that had previoiusly existed in the `go.opentelemetry.io/otel/instrumentation/grpctrace` package. (#189)
|
||||
- Instrumentation for the stdlib `net/http` and `net/http/httptrace` packages. (#190)
|
||||
- Initial Cortex exporter. (#202, #205, #210, #211, #215)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bump google.golang.org/grpc from 1.30.0 to 1.31.0. (#166)
|
||||
- Bump go.mongodb.org/mongo-driver from 1.3.5 to 1.4.0 in /instrumentation/go.mongodb.org/mongo-driver. (#170)
|
||||
- Bump google.golang.org/grpc in /instrumentation/github.com/gin-gonic/gin. (#173)
|
||||
- Bump google.golang.org/grpc in /instrumentation/github.com/labstack/echo. (#176)
|
||||
- Bump google.golang.org/grpc from 1.30.0 to 1.31.0 in /instrumentation/github.com/Shopify/sarama. (#179)
|
||||
- Bump cloud.google.com/go from 0.61.0 to 0.63.0 in /detectors/gcp. (#181, #199)
|
||||
- Bump github.com/aws/aws-sdk-go from 1.33.15 to 1.34.1 in /detectors/aws. (#184, #192, #193, #198, #201, #203)
|
||||
- Bump github.com/golangci/golangci-lint from 1.29.0 to 1.30.0 in /tools. (#186)
|
||||
- Setup CI to run tests that require external resources (Cassandra and MongoDB). (#191)
|
||||
- Bump github.com/Shopify/sarama from 1.26.4 to 1.27.0 in /instrumentation/github.com/Shopify/sarama. (#206)
|
||||
|
||||
## [0.10.0] - 2020-07-31
|
||||
|
||||
This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.10.0) dependency to v0.10.0 and includes new instrumentation for popular Kafka and Cassandra clients.
|
||||
|
||||
### Added
|
||||
|
||||
- A detector that generate resources from GCE instance. (#132)
|
||||
- A detector that generate resources from AWS instances. (#139)
|
||||
- Instrumentation for the Kafka client github.com/Shopify/sarama. (#134, #153)
|
||||
- Links and status message for mock span in the internal testing library. (#134)
|
||||
- Instrumentation for the Cassandra client github.com/gocql/gocql. (#137)
|
||||
- A detector that generate resources from GKE clusters. (#154)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bump github.com/aws/aws-sdk-go from 1.33.8 to 1.33.15 in /detectors/aws. (#155, #157, #159, #162)
|
||||
- Bump github.com/golangci/golangci-lint from 1.28.3 to 1.29.0 in /tools. (#146)
|
||||
|
||||
## [0.9.0] - 2020-07-20
|
||||
|
||||
This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.9.0) dependency to v0.9.0.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bump github.com/emicklei/go-restful/v3 from 3.0.0 to 3.2.0 in /instrumentation/github.com/emicklei/go-restful. (#133)
|
||||
- Update dependabot configuration to correctly check all included packages. (#131)
|
||||
- Update `RELEASING.md` with correct `tag.sh` command. (#130)
|
||||
|
||||
## [0.8.0] - 2020-07-10
|
||||
|
||||
This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.8.0) dependency to v0.8.0, includes minor fixes, and new instrumentation.
|
||||
|
||||
### Added
|
||||
|
||||
- Create this `CHANGELOG.md`. (#114)
|
||||
- Add `emicklei/go-restful/v3` trace instrumentation. (#115)
|
||||
|
||||
### Changed
|
||||
|
||||
- Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#114)
|
||||
- Move all `github.com` package instrumentation under a `github.com` directory. (#118)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Update README to include information about external instrumentation.
|
||||
To start, this includes native instrumentation found in the `go-redis/redis` package. (#117)
|
||||
- Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.2 in /tools. (#122, #123, #125)
|
||||
- Bump go.mongodb.org/mongo-driver from 1.3.4 to 1.3.5 in /instrumentation/go.mongodb.org/mongo-driver. (#124)
|
||||
|
||||
## [0.7.0] - 2020-06-29
|
||||
|
||||
This release upgrades its [go.opentelemetry.io/otel](https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.7.0) dependency to v0.7.0.
|
||||
|
||||
### Added
|
||||
|
||||
- Create `RELEASING.md` instructions. (#101)
|
||||
- Apply transitive dependabot go.mod updates as part of a new automatic Github workflow. (#94)
|
||||
- New dependabot integration to automate package upgrades. (#61)
|
||||
- Add automatic tag generation script for release. (#60)
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade Datadog metrics exporter to include Resource tags. (#46)
|
||||
- Added output validation to Datadog example. (#96)
|
||||
- Move Macaron package to match layout guidelines. (#92)
|
||||
- Update top-level README and instrumentation README. (#92)
|
||||
- Bump google.golang.org/grpc from 1.29.1 to 1.30.0. (#99)
|
||||
- Bump github.com/golangci/golangci-lint from 1.21.0 to 1.27.0 in /tools. (#77)
|
||||
- Bump go.mongodb.org/mongo-driver from 1.3.2 to 1.3.4 in /instrumentation/go.mongodb.org/mongo-driver. (#76)
|
||||
- Bump github.com/stretchr/testify from 1.5.1 to 1.6.1. (#74)
|
||||
- Bump gopkg.in/macaron.v1 from 1.3.5 to 1.3.9 in /instrumentation/macaron. (#68)
|
||||
- Bump github.com/gin-gonic/gin from 1.6.2 to 1.6.3 in /instrumentation/gin-gonic/gin. (#73)
|
||||
- Bump github.com/DataDog/datadog-go from 3.5.0+incompatible to 3.7.2+incompatible in /exporters/metric/datadog. (#78)
|
||||
- Replaced `internal/trace/http.go` helpers with `api/standard` helpers from otel-go repo. (#112)
|
||||
|
||||
## [0.6.1] - 2020-06-08
|
||||
|
||||
First official tagged release of `contrib` repository.
|
||||
|
||||
### Added
|
||||
|
||||
- `labstack/echo` trace instrumentation (#42)
|
||||
- `mongodb` trace instrumentation (#26)
|
||||
- Go Runtime metrics (#9)
|
||||
- `gorilla/mux` trace instrumentation (#19)
|
||||
- `gin-gonic` trace instrumentation (#15)
|
||||
- `macaron` trace instrumentation (#20)
|
||||
- `dogstatsd` metrics exporter (#10)
|
||||
- `datadog` metrics exporter (#22)
|
||||
- Tags to all modules in repository
|
||||
- Repository folder structure and automated build (#3)
|
||||
|
||||
### Changes
|
||||
|
||||
- Prefix support for dogstatsd (#34)
|
||||
- Update Go Runtime package to use batch observer (#44)
|
||||
|
||||
[Unreleased]: https://github.com/open-telemetry/opentelemetry-go-contrib/compare/v0.21.0...HEAD
|
||||
[0.21.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.21.0
|
||||
[0.20.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.20.0
|
||||
[0.19.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.19.0
|
||||
[0.18.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.18.0
|
||||
[0.17.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.17.0
|
||||
[0.16.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.16.0
|
||||
[0.15.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.15.1
|
||||
[0.15.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.15.0
|
||||
[0.14.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.14.0
|
||||
[0.13.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.13.0
|
||||
[0.12.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.12.0
|
||||
[0.11.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.11.0
|
||||
[0.10.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.10.1
|
||||
[0.10.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.10.0
|
||||
[0.9.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.9.0
|
||||
[0.8.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.8.0
|
||||
[0.7.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.7.0
|
||||
[0.6.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.6.1
|
17
vendor/go.opentelemetry.io/contrib/CODEOWNERS
generated
vendored
17
vendor/go.opentelemetry.io/contrib/CODEOWNERS
generated
vendored
@ -1,17 +0,0 @@
|
||||
#####################################################
|
||||
#
|
||||
# List of approvers for this repository
|
||||
#
|
||||
#####################################################
|
||||
#
|
||||
# Learn about membership in OpenTelemetry community:
|
||||
# https://github.com/open-telemetry/community/blob/main/community-membership.md
|
||||
#
|
||||
#
|
||||
# Learn about CODEOWNERS file format:
|
||||
# https://help.github.com/en/articles/about-code-owners
|
||||
#
|
||||
|
||||
* @jmacd @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @paivagustavo @MadVikingGod
|
||||
|
||||
CODEOWNERS @MrAlias @Aneurysm9
|
136
vendor/go.opentelemetry.io/contrib/CONTRIBUTING.md
generated
vendored
136
vendor/go.opentelemetry.io/contrib/CONTRIBUTING.md
generated
vendored
@ -1,136 +0,0 @@
|
||||
# Contributing to opentelemetry-go-contrib
|
||||
|
||||
The Go special interest group (SIG) meets regularly. See the
|
||||
OpenTelemetry
|
||||
[community](https://github.com/open-telemetry/community#golang-sdk)
|
||||
repo for information on this and other language SIGs.
|
||||
|
||||
See the [public meeting
|
||||
notes](https://docs.google.com/document/d/1A63zSWX0x2CyCK_LoNhmQC4rqhLpYXJzXbEPDUQ2n6w/edit#heading=h.9tngw7jdwd6b)
|
||||
for a summary description of past meetings. To request edit access,
|
||||
join the meeting or get in touch on
|
||||
[Slack](https://cloud-native.slack.com/archives/C01NPAXACKT).
|
||||
|
||||
## Development
|
||||
|
||||
There are some generated files checked into the repo. To make sure
|
||||
that the generated files are up-to-date, run `make` (or `make
|
||||
precommit` - the `precommit` target is the default).
|
||||
|
||||
The `precommit` target also fixes the formatting of the code and
|
||||
checks the status of the go module files.
|
||||
|
||||
If after running `make precommit` the output of `git status` contains
|
||||
`nothing to commit, working tree clean` then it means that everything
|
||||
is up-to-date and properly formatted.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
### How to Send Pull Requests
|
||||
|
||||
Everyone is welcome to contribute code to `opentelemetry-go-contrib` via
|
||||
GitHub pull requests (PRs).
|
||||
|
||||
To create a new PR, fork the project in GitHub and clone the upstream
|
||||
repo:
|
||||
|
||||
```sh
|
||||
$ git clone https://github.com/open-telemetry/opentelemetry-go-contrib
|
||||
```
|
||||
This would put the project in the `opentelemetry-go-contrib` directory in
|
||||
current working directory.
|
||||
|
||||
Enter the newly created directory and add your fork as a new remote:
|
||||
|
||||
```sh
|
||||
$ git remote add <YOUR_FORK> git@github.com:<YOUR_GITHUB_USERNAME>/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 <YOUR_BRANCH_NAME>
|
||||
# edit files
|
||||
# update changelog
|
||||
$ make precommit
|
||||
$ git add -p
|
||||
$ git commit
|
||||
$ git push <YOUR_FORK> <YOUR_BRANCH_NAME>
|
||||
```
|
||||
|
||||
Open a pull request against the main `opentelemetry-go-contrib` repo. Be sure to add the pull
|
||||
request ID to the entry you added to `CHANGELOG.md`.
|
||||
|
||||
### How to Receive Comments
|
||||
|
||||
* If the PR is not ready for review, please put `[WIP]` in the title,
|
||||
tag it as `work-in-progress`, or mark it as
|
||||
[`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/).
|
||||
* Make sure CLA is signed and CI is clear.
|
||||
|
||||
### How to Get PRs Merged
|
||||
|
||||
A PR is considered to be **ready to merge** when:
|
||||
|
||||
* It has received two approvals from Approvers/Maintainers (at
|
||||
different companies).
|
||||
* Feedback has been addressed.
|
||||
* Any substantive changes to your PR will require that you clear any prior
|
||||
Approval reviews, this includes changes resulting from other feedback. Unless
|
||||
the approver explicitly stated that their approval will persist across
|
||||
changes it should be assumed that the PR needs their review again. Other
|
||||
project members (e.g. approvers, maintainers) can help with this if there are
|
||||
any questions or if you forget to clear reviews.
|
||||
* It has been open for review for at least one working day. This gives
|
||||
people reasonable time to review.
|
||||
* Trivial change (typo, cosmetic, doc, etc.) doesn't have to wait for
|
||||
one day.
|
||||
* `CHANGELOG.md` has been updated to reflect what has been
|
||||
added, changed, removed, or fixed.
|
||||
* Urgent fix can take exception as long as it has been actively
|
||||
communicated.
|
||||
|
||||
Any Maintainer can merge the PR once it is **ready to merge**.
|
||||
|
||||
## Style Guide
|
||||
|
||||
* Make sure to run `make precommit` - this will find and fix the code
|
||||
formatting.
|
||||
* Check [opentelemetry-go Style Guide](https://github.com/open-telemetry/opentelemetry-go/blob/main/CONTRIBUTING.md#style-guide)
|
||||
|
||||
## Adding a new Contrib package
|
||||
|
||||
To add a new contrib package follow an existing one. An empty Sample instrumentation
|
||||
provides base structure with an example and a test. Each contrib package
|
||||
should be its own module. A contrib package may contain more than one go package.
|
||||
|
||||
### Folder Structure
|
||||
- instrumentation/\<instrumentation-package> (**Common**)
|
||||
- instrumentation/\<instrumentation-package>/trace (**specific to trace**)
|
||||
- instrumentation/\<instrumentation-package>/metrics (**specific to metrics**)
|
||||
|
||||
#### Example
|
||||
- instrumentation/gorm/trace
|
||||
- instrumentation/kafka/metrics
|
||||
|
||||
## Approvers and Maintainers
|
||||
|
||||
Approvers:
|
||||
|
||||
- [Evan Torrie](https://github.com/evantorrie), Verizon Media
|
||||
- [Josh MacDonald](https://github.com/jmacd), LightStep
|
||||
- [Sam Xie](https://github.com/XSAM)
|
||||
- [David Ashpole](https://github.com/dashpole), Google
|
||||
- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep
|
||||
- [Aaron Clawson](https://github.com/MadVikingGod)
|
||||
|
||||
Maintainers:
|
||||
|
||||
- [Anthony Mirabella](https://github.com/Aneurysm9), Centene
|
||||
- [Tyler Yahn](https://github.com/MrAlias), New Relic
|
||||
|
||||
### Become an Approver or a Maintainer
|
||||
|
||||
See the [community membership document in OpenTelemetry community
|
||||
repo](https://github.com/open-telemetry/community/blob/main/community-membership.md).
|
201
vendor/go.opentelemetry.io/contrib/LICENSE
generated
vendored
201
vendor/go.opentelemetry.io/contrib/LICENSE
generated
vendored
@ -1,201 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
203
vendor/go.opentelemetry.io/contrib/Makefile
generated
vendored
203
vendor/go.opentelemetry.io/contrib/Makefile
generated
vendored
@ -1,203 +0,0 @@
|
||||
TOOLS_MOD_DIR := ./tools
|
||||
|
||||
# All source code and documents. Used in spell check.
|
||||
ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
|
||||
# All directories with go.mod files related to opentelemetry library. Used for building, testing and linting.
|
||||
ALL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort))
|
||||
ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example|^$(TOOLS_MOD_DIR)' | sort)
|
||||
|
||||
# URLs to check if all contrib entries exist in the registry.
|
||||
REGISTRY_BASE_URL = https://raw.githubusercontent.com/open-telemetry/opentelemetry.io/main/content/en/registry
|
||||
CONTRIB_REPO_URL = https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main
|
||||
|
||||
# Mac OS Catalina 10.5.x doesn't support 386. Hence skip 386 test
|
||||
SKIP_386_TEST = false
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
SW_VERS := $(shell sw_vers -productVersion)
|
||||
ifeq ($(shell echo $(SW_VERS) | egrep '^(10.1[5-9]|1[1-9]|[2-9])'), $(SW_VERS))
|
||||
SKIP_386_TEST = true
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
GOTEST_MIN = go test -v -timeout 30s
|
||||
GOTEST = $(GOTEST_MIN) -race
|
||||
GOTEST_WITH_COVERAGE = $(GOTEST) -coverprofile=coverage.out -covermode=atomic -coverpkg=./...
|
||||
|
||||
.DEFAULT_GOAL := precommit
|
||||
|
||||
.PHONY: precommit
|
||||
|
||||
TOOLS_DIR := $(abspath ./.tools)
|
||||
|
||||
$(TOOLS_DIR)/golangci-lint: $(TOOLS_MOD_DIR)/go.mod $(TOOLS_MOD_DIR)/go.sum $(TOOLS_MOD_DIR)/tools.go
|
||||
cd $(TOOLS_MOD_DIR) && \
|
||||
go build -o $(TOOLS_DIR)/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||
|
||||
$(TOOLS_DIR)/misspell: $(TOOLS_MOD_DIR)/go.mod $(TOOLS_MOD_DIR)/go.sum $(TOOLS_MOD_DIR)/tools.go
|
||||
cd $(TOOLS_MOD_DIR) && \
|
||||
go build -o $(TOOLS_DIR)/misspell github.com/client9/misspell/cmd/misspell
|
||||
|
||||
$(TOOLS_DIR)/stringer: $(TOOLS_MOD_DIR)/go.mod $(TOOLS_MOD_DIR)/go.sum $(TOOLS_MOD_DIR)/tools.go
|
||||
cd $(TOOLS_MOD_DIR) && \
|
||||
go build -o $(TOOLS_DIR)/stringer golang.org/x/tools/cmd/stringer
|
||||
|
||||
precommit: dependabot-check license-check generate build lint test
|
||||
|
||||
.PHONY: test-with-coverage
|
||||
test-with-coverage:
|
||||
set -e; \
|
||||
printf "" > coverage.txt; \
|
||||
for dir in $(ALL_COVERAGE_MOD_DIRS); do \
|
||||
echo "go test ./... + coverage in $${dir}"; \
|
||||
(cd "$${dir}" && \
|
||||
$(GOTEST_WITH_COVERAGE) ./... && \
|
||||
go tool cover -html=coverage.out -o coverage.html); \
|
||||
[ -f "$${dir}/coverage.out" ] && cat "$${dir}/coverage.out" >> coverage.txt; \
|
||||
done; \
|
||||
sed -i.bak -e '2,$$ { /^mode: /d; }' coverage.txt && rm coverage.txt.bak
|
||||
|
||||
.PHONY: ci
|
||||
ci: precommit check-clean-work-tree test-with-coverage test-386
|
||||
|
||||
.PHONY: test-gocql
|
||||
test-gocql:
|
||||
@if ./tools/should_build.sh gocql; then \
|
||||
set -e; \
|
||||
docker run --name cass-integ --rm -p 9042:9042 -d cassandra:3; \
|
||||
CMD=cassandra IMG_NAME=cass-integ ./tools/wait.sh; \
|
||||
(cd instrumentation/github.com/gocql/gocql/otelgocql && \
|
||||
$(GOTEST_WITH_COVERAGE) . && \
|
||||
go tool cover -html=coverage.out -o coverage.html); \
|
||||
docker stop cass-integ; \
|
||||
fi
|
||||
|
||||
.PHONY: test-mongo-driver
|
||||
test-mongo-driver:
|
||||
@if ./tools/should_build.sh mongo-driver; then \
|
||||
set -e; \
|
||||
docker run --name mongo-integ --rm -p 27017:27017 -d mongo; \
|
||||
CMD=mongo IMG_NAME=mongo-integ ./tools/wait.sh; \
|
||||
(cd instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo && \
|
||||
$(GOTEST_WITH_COVERAGE) . && \
|
||||
go tool cover -html=coverage.out -o coverage.html); \
|
||||
docker stop mongo-integ; \
|
||||
fi
|
||||
|
||||
.PHONY: test-gomemcache
|
||||
test-gomemcache:
|
||||
@if ./tools/should_build.sh gomemcache; then \
|
||||
set -e; \
|
||||
docker run --name gomemcache-integ --rm -p 11211:11211 -d memcached; \
|
||||
CMD=gomemcache IMG_NAME=gomemcache-integ ./tools/wait.sh; \
|
||||
(cd instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache && \
|
||||
$(GOTEST_WITH_COVERAGE) . && \
|
||||
go tool cover -html=coverage.out -o coverage.html); \
|
||||
docker stop gomemcache-integ ; \
|
||||
fi
|
||||
|
||||
.PHONY: check-clean-work-tree
|
||||
check-clean-work-tree:
|
||||
@if ! git diff --quiet; then \
|
||||
echo; \
|
||||
echo 'Working tree is not clean, did you forget to run "make precommit"?'; \
|
||||
echo; \
|
||||
git status; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
# TODO: Fix this on windows.
|
||||
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
|
||||
echo "compiling all packages in $${dir}"; \
|
||||
(cd "$${dir}" && \
|
||||
go build ./... && \
|
||||
go test -run xxxxxMatchNothingxxxxx ./... >/dev/null); \
|
||||
done
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
|
||||
echo "go test ./... + race in $${dir}"; \
|
||||
(cd "$${dir}" && \
|
||||
$(GOTEST) ./...); \
|
||||
done
|
||||
|
||||
.PHONY: test-386
|
||||
test-386:
|
||||
if [ $(SKIP_386_TEST) = true ] ; then \
|
||||
echo "skipping the test for GOARCH 386 as it is not supported on the current OS"; \
|
||||
else \
|
||||
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
|
||||
echo "go test ./... GOARCH 386 in $${dir}"; \
|
||||
(cd "$${dir}" && \
|
||||
GOARCH=386 $(GOTEST_MIN) ./...); \
|
||||
done; \
|
||||
fi
|
||||
|
||||
.PHONY: lint
|
||||
lint: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell
|
||||
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
|
||||
echo "golangci-lint in $${dir}"; \
|
||||
(cd "$${dir}" && \
|
||||
$(TOOLS_DIR)/golangci-lint run --fix && \
|
||||
$(TOOLS_DIR)/golangci-lint run); \
|
||||
done
|
||||
$(TOOLS_DIR)/misspell -w $(ALL_DOCS)
|
||||
set -e; for dir in $(ALL_GO_MOD_DIRS) $(TOOLS_MOD_DIR); do \
|
||||
echo "go mod tidy in $${dir}"; \
|
||||
(cd "$${dir}" && \
|
||||
go mod tidy); \
|
||||
done
|
||||
|
||||
.PHONY: generate
|
||||
generate: $(TOOLS_DIR)/stringer
|
||||
PATH="$(TOOLS_DIR):$${PATH}" go generate ./...
|
||||
|
||||
.PHONY: license-check
|
||||
license-check:
|
||||
@licRes=$$(for f in $$(find . -type f \( -iname '*.go' -o -iname '*.sh' \) ! -path './vendor/*' ! -path './exporters/otlp/internal/opentelemetry-proto/*') ; do \
|
||||
awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=3 { found=1; next } END { if (!found) print FILENAME }' $$f; \
|
||||
done); \
|
||||
if [ -n "$${licRes}" ]; then \
|
||||
echo "license header checking failed:"; echo "$${licRes}"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
.PHONY: registry-links-check
|
||||
registry-links-check:
|
||||
@checkRes=$$( \
|
||||
for f in $$( find ./instrumentation ./exporters ./detectors ! -path './instrumentation/net/*' -type f -name 'go.mod' -exec dirname {} \; | egrep -v '/example|/utils' | sort ) \
|
||||
./instrumentation/net/http; do \
|
||||
TYPE="instrumentation"; \
|
||||
if $$(echo "$$f" | grep -q "exporters"); then \
|
||||
TYPE="exporter"; \
|
||||
fi; \
|
||||
if $$(echo "$$f" | grep -q "detectors"); then \
|
||||
TYPE="detector"; \
|
||||
fi; \
|
||||
NAME=$$(echo "$$f" | sed -e 's/.*\///' -e 's/.*otel//'); \
|
||||
LINK=$(CONTRIB_REPO_URL)/$$(echo "$$f" | sed -e 's/..//' -e 's/\/otel.*$$//'); \
|
||||
if ! $$(curl -s $(REGISTRY_BASE_URL)/$${TYPE}-go-$${NAME}.md | grep -q "$${LINK}"); then \
|
||||
echo "$$f"; \
|
||||
fi \
|
||||
done; \
|
||||
); \
|
||||
if [ -n "$$checkRes" ]; then \
|
||||
echo "WARNING: registry link check failed for the following packages:"; echo "$${checkRes}"; \
|
||||
fi
|
||||
|
||||
.PHONY: dependabot-check
|
||||
dependabot-check:
|
||||
@result=$$( \
|
||||
for f in $$( find . -type f -name go.mod -exec dirname {} \; | sed 's/^.\/\?/\//' ); \
|
||||
do grep -q "$$f" .github/dependabot.yml \
|
||||
|| echo "$$f"; \
|
||||
done; \
|
||||
); \
|
||||
if [ -n "$$result" ]; then \
|
||||
echo "missing go.mod dependabot check:"; echo "$$result"; \
|
||||
exit 1; \
|
||||
fi
|
40
vendor/go.opentelemetry.io/contrib/README.md
generated
vendored
40
vendor/go.opentelemetry.io/contrib/README.md
generated
vendored
@ -1,40 +0,0 @@
|
||||
# OpenTelemetry-Go Contrib
|
||||
|
||||
[](https://github.com/open-telemetry/opentelemetry-go-contrib/actions?query=workflow%3Abuild_and_test+branch%3Amain)
|
||||
[](https://app.codecov.io/gh/open-telemetry/opentelemetry-go-contrib?branch=main)
|
||||
[](https://pkg.go.dev/go.opentelemetry.io/contrib)
|
||||
[](https://goreportcard.com/report/go.opentelemetry.io/contrib)
|
||||
[](https://cloud-native.slack.com/archives/C01NPAXACKT)
|
||||
|
||||
Collection of 3rd-party instrumentation and exporters for [OpenTelemetry-Go](https://github.com/open-telemetry/opentelemetry-go).
|
||||
|
||||
## Contents
|
||||
|
||||
- [Instrumentation](./instrumentation/): Packages providing OpenTelemetry instrumentation for 3rd-party libraries.
|
||||
- [Exporters](./exporters/): Packages providing OpenTelemetry exporters for 3rd-party telemetry systems.
|
||||
- [Propagators](./propagators/): Packages providing OpenTelemetry context propagators for 3rd-party propagation formats.
|
||||
- [Detectors](./detectors/): Packages providing OpenTelemetry resource detectors for 3rd-party cloud computing environments.
|
||||
|
||||
## Project Status
|
||||
|
||||
This project is currently in a pre-GA phase. Our progress towards a GA release
|
||||
candidate is tracked in [this project
|
||||
board](https://github.com/orgs/open-telemetry/projects/5).
|
||||
|
||||
### Compatibility
|
||||
|
||||
This project is tested on the following systems.
|
||||
|
||||
| OS | Go Version | Architecture |
|
||||
| ------- | ---------- | ------------ |
|
||||
| Ubuntu | 1.16 | amd64 |
|
||||
| Ubuntu | 1.15 | amd64 |
|
||||
| Ubuntu | 1.16 | 386 |
|
||||
| Ubuntu | 1.15 | 386 |
|
||||
|
||||
While this project should work for other systems, no compatibility guarantees
|
||||
are made for those systems currently.
|
||||
|
||||
## Contributing
|
||||
|
||||
For information on how to contribute, consult [the contributing guidelines](./CONTRIBUTING.md)
|
96
vendor/go.opentelemetry.io/contrib/RELEASING.md
generated
vendored
96
vendor/go.opentelemetry.io/contrib/RELEASING.md
generated
vendored
@ -1,96 +0,0 @@
|
||||
# Release Process
|
||||
|
||||
There are two types of release for the `go.opentelemetry.io/contrib` repo
|
||||
and submodules.
|
||||
|
||||
1. **Case 1** A release due to changes independent of the
|
||||
`go.opentelemetry.io/otel` module, e.g. perhaps a critical bug fix in
|
||||
one of the contrib modules.
|
||||
|
||||
2. **Case 2** A release due to a breaking API change in
|
||||
`go.opentelemetry.io/otel` which all modules in this repo
|
||||
depend on.
|
||||
|
||||
## Pre-Release
|
||||
|
||||
Update go.mod for submodules to depend on the upcoming new release of
|
||||
the module in this repo, `go.opentelemetry.io/contrib`. Decide on the
|
||||
next version of the semantic tag to apply to the contrib
|
||||
module based on whether you fall into Case 1 or Case 2.
|
||||
|
||||
### Case 1
|
||||
|
||||
If the changes are all internal to this repo, then the new tag will
|
||||
most often be a patch or minor version upgrade to the existing tag on
|
||||
this module. Let's call this `<new_contrib_tag>`.
|
||||
|
||||
### Case 2
|
||||
|
||||
If a new release is required due to breaking changes in
|
||||
`go.opentelemetry.io/otel`, then the new semantic tag for this repo
|
||||
should be bumped to match the `go.opentelemetry.io/otel` new tag.
|
||||
Let's call this `<new_otel_tag>`. The script checks that
|
||||
`go.opentelemetry.io/otel@v<new_otel_tag>` is a valid tag, so you need
|
||||
to wait until that tag has been pushed in the main repo.
|
||||
|
||||
In nearly all cases, `<new_contrib_tag>` should be the same as
|
||||
`<new_otel_tag>`.
|
||||
|
||||
1. Run `pre_release.sh` script to create a branch `pre_release_<new_contrib_tag>`.
|
||||
The script will also run `go mod tidy` and `make ci`.
|
||||
|
||||
* **Case 1** `./pre_release.sh -t <new_contrib_tag>`
|
||||
* **Case 2** `./pre_release.sh -o <new_otel_tag> [-t <new_contrib_tag>]`
|
||||
|
||||
2. If you used `-o <new_otel_tag>` to rewrite the modules to depend on
|
||||
a new version of `go.opentelemetry.io/otel`, there will likely be
|
||||
breaking changes that require fixes to the files in this
|
||||
`contrib` repo. Make the appropriate fixes to address any API
|
||||
breaks and run through the
|
||||
|
||||
```
|
||||
git commit -m "fixes due to API changes"
|
||||
make precommit
|
||||
```
|
||||
|
||||
cycle until everything passes
|
||||
|
||||
4. Push the changes to upstream.
|
||||
|
||||
```
|
||||
git diff main
|
||||
git push
|
||||
```
|
||||
|
||||
5. Create a PR on github and merge the PR once approved.
|
||||
|
||||
|
||||
### Tag
|
||||
Now create a `<new_contrib_tag>` on the commit hash of the changes made in pre-release step,
|
||||
|
||||
1. Run the tag.sh script.
|
||||
|
||||
```
|
||||
./tag.sh <new_contrib_tag> <commit-hash>
|
||||
```
|
||||
2. Push tags upstream. Make sure you push upstream for all the sub-module tags as well.
|
||||
|
||||
```
|
||||
git push upstream <new_contrib_tag>
|
||||
git push upstream <submodules-path/new_contrib_tag>
|
||||
...
|
||||
```
|
||||
|
||||
## Release
|
||||
Now create a release for the new `<new_contrib_tag>` on github.
|
||||
The release body should include all the release notes in the Changelog for this release.
|
||||
Additionally, the `tag.sh` script generates commit logs since last release which can be used to suppliment the release notes.
|
||||
|
||||
<!-- ## Verify Examples -->
|
||||
<!-- After releasing run following script to verify that examples build outside of the otel repo. -->
|
||||
<!-- The script copies examples into a different directory and builds them. -->
|
||||
|
||||
<!-- ``` -->
|
||||
<!-- ./verify_examples.sh -->
|
||||
<!-- ``` -->
|
||||
|
3
vendor/go.opentelemetry.io/contrib/go.mod
generated
vendored
3
vendor/go.opentelemetry.io/contrib/go.mod
generated
vendored
@ -1,3 +0,0 @@
|
||||
module go.opentelemetry.io/contrib
|
||||
|
||||
go 1.15
|
0
vendor/go.opentelemetry.io/contrib/go.sum
generated
vendored
0
vendor/go.opentelemetry.io/contrib/go.sum
generated
vendored
@ -6,11 +6,7 @@ replace go.opentelemetry.io/contrib => ../../../../
|
||||
|
||||
require (
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/stretchr/testify v1.7.0
|
||||
go.opentelemetry.io/contrib v0.21.0
|
||||
go.opentelemetry.io/otel v1.0.0-RC1
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1
|
||||
go.uber.org/goleak v1.1.10
|
||||
google.golang.org/grpc v1.38.0
|
||||
go.opentelemetry.io/otel v1.2.0
|
||||
go.opentelemetry.io/otel/trace v1.2.0
|
||||
google.golang.org/grpc v1.42.0
|
||||
)
|
||||
|
@ -1,19 +1,31 @@
|
||||
cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
|
||||
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/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.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/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.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=
|
||||
@ -21,6 +33,7 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
@ -33,72 +46,71 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
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/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
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/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
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.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
go.opentelemetry.io/otel v1.0.0-RC1 h1:4CeoX93DNTWt8awGK9JmNXzF9j7TyOu9upscEdtcdXc=
|
||||
go.opentelemetry.io/otel v1.0.0-RC1/go.mod h1:x9tRa9HK4hSSq7jf2TKbqFbtt58/TGk0f9XiEYISI1I=
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1 h1:G685iP3XiskCwk/z0eIabL55XUl2gk0cljhGk9sB0Yk=
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1/go.mod h1:+eoIG0gdEOaPNftuy1YScLr1Gb4mL/9lpDkZ0JjMRq4=
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1 h1:jrjqKJZEibFrDz+umEASeU3LvdVyWKlnTh7XEfwrT58=
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1/go.mod h1:86UHmyHWFEtWjfWPSbu0+d0Pf9Q6e1U+3ViBOc+NXAg=
|
||||
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
|
||||
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
|
||||
go.opentelemetry.io/otel v1.2.0 h1:YOQDvxO1FayUcT9MIhJhgMyNO1WqoduiyvQHzGN0kUQ=
|
||||
go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I=
|
||||
go.opentelemetry.io/otel/trace v1.2.0 h1:Ys3iqbqZhcf28hHzrm5WAquMkDHNZTUkw7KHbuNjej0=
|
||||
go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0=
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
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/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-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/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-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/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 h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
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-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11 h1:Yq9t9jnGoR+dBuitxdo9l6Q7xh/zOyNnYUtDKaQ3x0E=
|
||||
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
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.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A=
|
||||
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@ -111,10 +123,10 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
||||
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/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.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=
|
||||
|
@ -41,7 +41,7 @@ type config struct {
|
||||
|
||||
// Option applies an option value for a config.
|
||||
type Option interface {
|
||||
Apply(*config)
|
||||
apply(*config)
|
||||
}
|
||||
|
||||
// newConfig returns a config configured with all the passed Options.
|
||||
@ -51,15 +51,17 @@ func newConfig(opts []Option) *config {
|
||||
TracerProvider: otel.GetTracerProvider(),
|
||||
}
|
||||
for _, o := range opts {
|
||||
o.Apply(c)
|
||||
o.apply(c)
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
type propagatorsOption struct{ p propagation.TextMapPropagator }
|
||||
|
||||
func (o propagatorsOption) Apply(c *config) {
|
||||
c.Propagators = o.p
|
||||
func (o propagatorsOption) apply(c *config) {
|
||||
if o.p != nil {
|
||||
c.Propagators = o.p
|
||||
}
|
||||
}
|
||||
|
||||
// WithPropagators returns an Option to use the Propagators when extracting
|
||||
@ -70,8 +72,10 @@ func WithPropagators(p propagation.TextMapPropagator) Option {
|
||||
|
||||
type tracerProviderOption struct{ tp trace.TracerProvider }
|
||||
|
||||
func (o tracerProviderOption) Apply(c *config) {
|
||||
c.TracerProvider = o.tp
|
||||
func (o tracerProviderOption) apply(c *config) {
|
||||
if o.tp != nil {
|
||||
c.TracerProvider = o.tp
|
||||
}
|
||||
}
|
||||
|
||||
// WithTracerProvider returns an Option to use the TracerProvider when
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto" // nolint:staticcheck
|
||||
|
||||
@ -30,13 +29,12 @@ import (
|
||||
"google.golang.org/grpc/peer"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/baggage"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
otelcontrib "go.opentelemetry.io/contrib"
|
||||
)
|
||||
|
||||
type messageType attribute.KeyValue
|
||||
@ -80,7 +78,7 @@ func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
|
||||
|
||||
tracer := newConfig(opts).TracerProvider.Tracer(
|
||||
instrumentationName,
|
||||
trace.WithInstrumentationVersion(otelcontrib.SemVersion()),
|
||||
trace.WithInstrumentationVersion(SemVersion()),
|
||||
)
|
||||
|
||||
name, attr := spanInfo(method, cc.Target())
|
||||
@ -202,9 +200,6 @@ func wrapClientStream(ctx context.Context, s grpc.ClientStream, desc *grpc.Strea
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
finished <- ctx.Err()
|
||||
return
|
||||
case event := <-events:
|
||||
switch event.Type {
|
||||
case receiveEndEvent:
|
||||
@ -214,6 +209,9 @@ func wrapClientStream(ctx context.Context, s grpc.ClientStream, desc *grpc.Strea
|
||||
finished <- event.Err
|
||||
return
|
||||
}
|
||||
case <-ctx.Done():
|
||||
finished <- ctx.Err()
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
@ -250,7 +248,7 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
|
||||
|
||||
tracer := newConfig(opts).TracerProvider.Tracer(
|
||||
instrumentationName,
|
||||
trace.WithInstrumentationVersion(otelcontrib.SemVersion()),
|
||||
trace.WithInstrumentationVersion(SemVersion()),
|
||||
)
|
||||
|
||||
name, attr := spanInfo(method, cc.Target())
|
||||
@ -310,7 +308,7 @@ func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor {
|
||||
|
||||
tracer := newConfig(opts).TracerProvider.Tracer(
|
||||
instrumentationName,
|
||||
trace.WithInstrumentationVersion(otelcontrib.SemVersion()),
|
||||
trace.WithInstrumentationVersion(SemVersion()),
|
||||
)
|
||||
|
||||
name, attr := spanInfo(info.FullMethod, peerFromCtx(ctx))
|
||||
@ -399,7 +397,7 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
|
||||
|
||||
tracer := newConfig(opts).TracerProvider.Tracer(
|
||||
instrumentationName,
|
||||
trace.WithInstrumentationVersion(otelcontrib.SemVersion()),
|
||||
trace.WithInstrumentationVersion(SemVersion()),
|
||||
)
|
||||
|
||||
name, attr := spanInfo(info.FullMethod, peerFromCtx(ctx))
|
||||
@ -429,7 +427,7 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
|
||||
// method and peer address.
|
||||
func spanInfo(fullMethod, peerAddress string) (string, []attribute.KeyValue) {
|
||||
attrs := []attribute.KeyValue{RPCSystemGRPC}
|
||||
name, mAttrs := parseFullMethod(fullMethod)
|
||||
name, mAttrs := internal.ParseFullMethod(fullMethod)
|
||||
attrs = append(attrs, mAttrs...)
|
||||
attrs = append(attrs, peerAttr(peerAddress)...)
|
||||
return name, attrs
|
||||
@ -461,27 +459,6 @@ func peerFromCtx(ctx context.Context) string {
|
||||
return p.Addr.String()
|
||||
}
|
||||
|
||||
// parseFullMethod returns a span name following the OpenTelemetry semantic
|
||||
// conventions as well as all applicable span attribute.KeyValue attributes based
|
||||
// on a gRPC's FullMethod.
|
||||
func parseFullMethod(fullMethod string) (string, []attribute.KeyValue) {
|
||||
name := strings.TrimLeft(fullMethod, "/")
|
||||
parts := strings.SplitN(name, "/", 2)
|
||||
if len(parts) != 2 {
|
||||
// Invalid format, does not follow `/package.service/method`.
|
||||
return name, []attribute.KeyValue(nil)
|
||||
}
|
||||
|
||||
var attrs []attribute.KeyValue
|
||||
if service := parts[0]; service != "" {
|
||||
attrs = append(attrs, semconv.RPCServiceKey.String(service))
|
||||
}
|
||||
if method := parts[1]; method != "" {
|
||||
attrs = append(attrs, semconv.RPCMethodKey.String(method))
|
||||
}
|
||||
return name, attrs
|
||||
}
|
||||
|
||||
// statusCodeAttr returns status code attribute based on given gRPC code
|
||||
func statusCodeAttr(c grpc_codes.Code) attribute.KeyValue {
|
||||
return GRPCStatusCodeKey.Int64(int64(c))
|
||||
|
43
vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
generated
vendored
Normal file
43
vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
// 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 internal
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||
)
|
||||
|
||||
// ParseFullMethod returns a span name following the OpenTelemetry semantic
|
||||
// conventions as well as all applicable span attribute.KeyValue attributes based
|
||||
// on a gRPC's FullMethod.
|
||||
func ParseFullMethod(fullMethod string) (string, []attribute.KeyValue) {
|
||||
name := strings.TrimLeft(fullMethod, "/")
|
||||
parts := strings.SplitN(name, "/", 2)
|
||||
if len(parts) != 2 {
|
||||
// Invalid format, does not follow `/package.service/method`.
|
||||
return name, []attribute.KeyValue(nil)
|
||||
}
|
||||
|
||||
var attrs []attribute.KeyValue
|
||||
if service := parts[0]; service != "" {
|
||||
attrs = append(attrs, semconv.RPCServiceKey.String(service))
|
||||
}
|
||||
if method := parts[1]; method != "" {
|
||||
attrs = append(attrs, semconv.RPCMethodKey.String(method))
|
||||
}
|
||||
return name, attrs
|
||||
}
|
@ -16,7 +16,7 @@ package otelgrpc
|
||||
|
||||
import (
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||
)
|
||||
|
||||
// Semantic conventions for attribute keys for gRPC.
|
||||
|
@ -12,13 +12,11 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package contrib contains common values used across all
|
||||
// instrumentation, exporter, and detector contributions.
|
||||
package contrib // import "go.opentelemetry.io/contrib"
|
||||
package otelgrpc
|
||||
|
||||
// Version is the current release version of OpenTelemetry Contrib in use.
|
||||
// Version is the current release version of the gRPC instrumentation.
|
||||
func Version() string {
|
||||
return "0.21.0"
|
||||
return "0.27.0"
|
||||
// This string is updated by the pre_release.sh script during release
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"go.opentelemetry.io/contrib"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
@ -62,15 +61,23 @@ func parentHook(hook string) string {
|
||||
|
||||
// ClientTraceOption allows customizations to how the httptrace.Client
|
||||
// collects information.
|
||||
type ClientTraceOption func(*clientTracer)
|
||||
type ClientTraceOption interface {
|
||||
apply(*clientTracer)
|
||||
}
|
||||
|
||||
// WithoutSubSpans will modify the httptrace.Client to only collect data
|
||||
type clientTraceOptionFunc func(*clientTracer)
|
||||
|
||||
func (fn clientTraceOptionFunc) apply(c *clientTracer) {
|
||||
fn(c)
|
||||
}
|
||||
|
||||
// WithoutSubSpans will modify the httptrace.ClientTrace to only collect data
|
||||
// as Events and Attributes on a span found in the context. By default
|
||||
// sub-spans will be generated.
|
||||
func WithoutSubSpans() ClientTraceOption {
|
||||
return func(ct *clientTracer) {
|
||||
return clientTraceOptionFunc(func(ct *clientTracer) {
|
||||
ct.useSpans = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithRedactedHeaders will be replaced by fixed '****' values for the header
|
||||
@ -78,19 +85,31 @@ func WithoutSubSpans() ClientTraceOption {
|
||||
// redacted by default: Authorization, WWW-Authenticate, Proxy-Authenticate
|
||||
// Proxy-Authorization, Cookie, Set-Cookie
|
||||
func WithRedactedHeaders(headers ...string) ClientTraceOption {
|
||||
return func(ct *clientTracer) {
|
||||
return clientTraceOptionFunc(func(ct *clientTracer) {
|
||||
for _, header := range headers {
|
||||
ct.redactedHeaders[strings.ToLower(header)] = struct{}{}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithoutHeaders will disable adding span annotations for the http headers
|
||||
// WithoutHeaders will disable adding span attributes for the http headers
|
||||
// and values.
|
||||
func WithoutHeaders() ClientTraceOption {
|
||||
return func(ct *clientTracer) {
|
||||
return clientTraceOptionFunc(func(ct *clientTracer) {
|
||||
ct.addHeaders = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// WithInsecureHeaders will add span attributes for all http headers *INCLUDING*
|
||||
// the sensitive headers that are redacted by default. The attribute values
|
||||
// will include the raw un-redacted text. This might be useful for
|
||||
// debugging authentication related issues, but should not be used for
|
||||
// production deployments.
|
||||
func WithInsecureHeaders() ClientTraceOption {
|
||||
return clientTraceOptionFunc(func(ct *clientTracer) {
|
||||
ct.addHeaders = true
|
||||
ct.redactedHeaders = nil
|
||||
})
|
||||
}
|
||||
|
||||
type clientTracer struct {
|
||||
@ -106,6 +125,13 @@ type clientTracer struct {
|
||||
useSpans bool
|
||||
}
|
||||
|
||||
// NewClientTrace returns an httptrace.ClientTrace implementation that will
|
||||
// record OpenTelemetry spans for requests made by an http.Client. By default
|
||||
// several spans will be added to the trace for various stages of a request
|
||||
// (dns, connection, tls, etc). Also by default, all HTTP headers will be
|
||||
// added as attributes to spans, although several headers will be automatically
|
||||
// redacted: Authorization, WWW-Authenticate, Proxy-Authenticate,
|
||||
// Proxy-Authorization, Cookie, and Set-Cookie.
|
||||
func NewClientTrace(ctx context.Context, opts ...ClientTraceOption) *httptrace.ClientTrace {
|
||||
ct := &clientTracer{
|
||||
Context: ctx,
|
||||
@ -122,7 +148,7 @@ func NewClientTrace(ctx context.Context, opts ...ClientTraceOption) *httptrace.C
|
||||
useSpans: true,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(ct)
|
||||
opt.apply(ct)
|
||||
}
|
||||
|
||||
var tp trace.TracerProvider
|
||||
@ -134,7 +160,7 @@ func NewClientTrace(ctx context.Context, opts ...ClientTraceOption) *httptrace.C
|
||||
|
||||
ct.tr = tp.Tracer(
|
||||
"go.opentelemetry.io/otel/instrumentation/httptrace",
|
||||
trace.WithInstrumentationVersion(contrib.SemVersion()),
|
||||
trace.WithInstrumentationVersion(SemVersion()),
|
||||
)
|
||||
|
||||
return &httptrace.ClientTrace{
|
||||
|
@ -6,9 +6,6 @@ replace go.opentelemetry.io/contrib => ../../../../..
|
||||
|
||||
require (
|
||||
github.com/google/go-cmp v0.5.6
|
||||
github.com/stretchr/testify v1.7.0
|
||||
go.opentelemetry.io/contrib v0.21.0
|
||||
go.opentelemetry.io/otel v1.0.0-RC1
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1
|
||||
go.opentelemetry.io/otel v1.0.0
|
||||
go.opentelemetry.io/otel/trace v1.0.0
|
||||
)
|
||||
|
@ -7,12 +7,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
go.opentelemetry.io/otel v1.0.0-RC1 h1:4CeoX93DNTWt8awGK9JmNXzF9j7TyOu9upscEdtcdXc=
|
||||
go.opentelemetry.io/otel v1.0.0-RC1/go.mod h1:x9tRa9HK4hSSq7jf2TKbqFbtt58/TGk0f9XiEYISI1I=
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1 h1:G685iP3XiskCwk/z0eIabL55XUl2gk0cljhGk9sB0Yk=
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1/go.mod h1:+eoIG0gdEOaPNftuy1YScLr1Gb4mL/9lpDkZ0JjMRq4=
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1 h1:jrjqKJZEibFrDz+umEASeU3LvdVyWKlnTh7XEfwrT58=
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1/go.mod h1:86UHmyHWFEtWjfWPSbu0+d0Pf9Q6e1U+3ViBOc+NXAg=
|
||||
go.opentelemetry.io/otel v1.0.0 h1:qTTn6x71GVBvoafHK/yaRUmFzI4LcONZD0/kXxl5PHI=
|
||||
go.opentelemetry.io/otel v1.0.0/go.mod h1:AjRVh9A5/5DE7S+mZtTR6t8vpKKryam+0lREnfmS4cg=
|
||||
go.opentelemetry.io/otel/trace v1.0.0 h1:TSBr8GTEtKevYMG/2d21M989r5WJYVimhTHBKVEZuh4=
|
||||
go.opentelemetry.io/otel/trace v1.0.0/go.mod h1:PXTWqayeFUlJV1YDNhsJYB184+IvAH814St6o6ajzIs=
|
||||
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=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
|
@ -26,9 +26,17 @@ import (
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
// Option is a function that allows configuration of the httptrace Extract()
|
||||
// and Inject() functions
|
||||
type Option func(*config)
|
||||
// Option allows configuration of the httptrace Extract()
|
||||
// and Inject() functions.
|
||||
type Option interface {
|
||||
apply(*config)
|
||||
}
|
||||
|
||||
type optionFunc func(*config)
|
||||
|
||||
func (o optionFunc) apply(c *config) {
|
||||
o(c)
|
||||
}
|
||||
|
||||
type config struct {
|
||||
propagators propagation.TextMapPropagator
|
||||
@ -37,16 +45,18 @@ type config struct {
|
||||
func newConfig(opts []Option) *config {
|
||||
c := &config{propagators: otel.GetTextMapPropagator()}
|
||||
for _, o := range opts {
|
||||
o(c)
|
||||
o.apply(c)
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
// WithPropagators sets the propagators to use for Extraction and Injection
|
||||
func WithPropagators(props propagation.TextMapPropagator) Option {
|
||||
return func(c *config) {
|
||||
c.propagators = props
|
||||
}
|
||||
return optionFunc(func(c *config) {
|
||||
if props != nil {
|
||||
c.propagators = props
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Extract returns the Attributes, Context Entries, and SpanContext that were encoded by Inject.
|
||||
|
26
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace/version.go
generated
vendored
Normal file
26
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace/version.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package otelhttptrace
|
||||
|
||||
// Version is the current release version of the httptrace instrumentation.
|
||||
func Version() string {
|
||||
return "0.24.0"
|
||||
// This string is updated by the pre_release.sh script during release
|
||||
}
|
||||
|
||||
// SemVersion is the semantic version to be supplied to tracer/meter creation.
|
||||
func SemVersion() string {
|
||||
return "semver:" + Version()
|
||||
}
|
3
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
generated
vendored
3
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
generated
vendored
@ -17,7 +17,6 @@ package otelhttp
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"go.opentelemetry.io/contrib"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
@ -43,5 +42,5 @@ const (
|
||||
type Filter func(*http.Request) bool
|
||||
|
||||
func newTracer(tp trace.TracerProvider) trace.Tracer {
|
||||
return tp.Tracer(instrumentationName, trace.WithInstrumentationVersion(contrib.SemVersion()))
|
||||
return tp.Tracer(instrumentationName, trace.WithInstrumentationVersion(SemVersion()))
|
||||
}
|
||||
|
18
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
generated
vendored
18
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
generated
vendored
@ -19,7 +19,6 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptrace"
|
||||
|
||||
"go.opentelemetry.io/contrib"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
"go.opentelemetry.io/otel/metric/global"
|
||||
@ -73,9 +72,10 @@ func newConfig(opts ...Option) *config {
|
||||
if c.TracerProvider != nil {
|
||||
c.Tracer = newTracer(c.TracerProvider)
|
||||
}
|
||||
|
||||
c.Meter = c.MeterProvider.Meter(
|
||||
instrumentationName,
|
||||
metric.WithInstrumentationVersion(contrib.SemVersion()),
|
||||
metric.WithInstrumentationVersion(SemVersion()),
|
||||
)
|
||||
|
||||
return c
|
||||
@ -85,7 +85,9 @@ func newConfig(opts ...Option) *config {
|
||||
// If none is specified, the global provider is used.
|
||||
func WithTracerProvider(provider trace.TracerProvider) Option {
|
||||
return optionFunc(func(cfg *config) {
|
||||
cfg.TracerProvider = provider
|
||||
if provider != nil {
|
||||
cfg.TracerProvider = provider
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -93,7 +95,9 @@ func WithTracerProvider(provider trace.TracerProvider) Option {
|
||||
// If none is specified, the global provider is used.
|
||||
func WithMeterProvider(provider metric.MeterProvider) Option {
|
||||
return optionFunc(func(cfg *config) {
|
||||
cfg.MeterProvider = provider
|
||||
if provider != nil {
|
||||
cfg.MeterProvider = provider
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -107,10 +111,12 @@ func WithPublicEndpoint() Option {
|
||||
}
|
||||
|
||||
// WithPropagators configures specific propagators. If this
|
||||
// option isn't specified then
|
||||
// option isn't specified, then the global TextMapPropagator is used.
|
||||
func WithPropagators(ps propagation.TextMapPropagator) Option {
|
||||
return optionFunc(func(c *config) {
|
||||
c.Propagators = ps
|
||||
if ps != nil {
|
||||
c.Propagators = ps
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
8
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.mod
generated
vendored
8
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.mod
generated
vendored
@ -7,9 +7,7 @@ replace go.opentelemetry.io/contrib => ../../../..
|
||||
require (
|
||||
github.com/felixge/httpsnoop v1.0.2
|
||||
github.com/stretchr/testify v1.7.0
|
||||
go.opentelemetry.io/contrib v0.21.0
|
||||
go.opentelemetry.io/otel v1.0.0-RC1
|
||||
go.opentelemetry.io/otel/metric v0.21.0
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1
|
||||
go.opentelemetry.io/otel v1.0.0
|
||||
go.opentelemetry.io/otel/metric v0.23.0
|
||||
go.opentelemetry.io/otel/trace v1.0.0
|
||||
)
|
||||
|
20
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.sum
generated
vendored
20
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/go.sum
generated
vendored
@ -9,16 +9,16 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
go.opentelemetry.io/otel v1.0.0-RC1 h1:4CeoX93DNTWt8awGK9JmNXzF9j7TyOu9upscEdtcdXc=
|
||||
go.opentelemetry.io/otel v1.0.0-RC1/go.mod h1:x9tRa9HK4hSSq7jf2TKbqFbtt58/TGk0f9XiEYISI1I=
|
||||
go.opentelemetry.io/otel/internal/metric v0.21.0 h1:gZlIBo5O51hZOOZz8vEcuRx/l5dnADadKfpT70AELoo=
|
||||
go.opentelemetry.io/otel/internal/metric v0.21.0/go.mod h1:iOfAaY2YycsXfYD4kaRSbLx2LKmfpKObWBEv9QK5zFo=
|
||||
go.opentelemetry.io/otel/metric v0.21.0 h1:ZtcJlHqVE4l8Su0WOLOd9fEPheJuYEiQ0wr9wv2p25I=
|
||||
go.opentelemetry.io/otel/metric v0.21.0/go.mod h1:JWCt1bjivC4iCrz/aCrM1GSw+ZcvY44KCbaeeRhzHnc=
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1 h1:G685iP3XiskCwk/z0eIabL55XUl2gk0cljhGk9sB0Yk=
|
||||
go.opentelemetry.io/otel/oteltest v1.0.0-RC1/go.mod h1:+eoIG0gdEOaPNftuy1YScLr1Gb4mL/9lpDkZ0JjMRq4=
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1 h1:jrjqKJZEibFrDz+umEASeU3LvdVyWKlnTh7XEfwrT58=
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1/go.mod h1:86UHmyHWFEtWjfWPSbu0+d0Pf9Q6e1U+3ViBOc+NXAg=
|
||||
go.opentelemetry.io/otel v1.0.0-RC3/go.mod h1:Ka5j3ua8tZs4Rkq4Ex3hwgBgOchyPVq5S6P2lz//nKQ=
|
||||
go.opentelemetry.io/otel v1.0.0 h1:qTTn6x71GVBvoafHK/yaRUmFzI4LcONZD0/kXxl5PHI=
|
||||
go.opentelemetry.io/otel v1.0.0/go.mod h1:AjRVh9A5/5DE7S+mZtTR6t8vpKKryam+0lREnfmS4cg=
|
||||
go.opentelemetry.io/otel/internal/metric v0.23.0 h1:mPfzm9Iqhw7G2nDBmUAjFTfPqLZPbOW2k7QI57ITbaI=
|
||||
go.opentelemetry.io/otel/internal/metric v0.23.0/go.mod h1:z+RPiDJe30YnCrOhFGivwBS+DU1JU/PiLKkk4re2DNY=
|
||||
go.opentelemetry.io/otel/metric v0.23.0 h1:mYCcDxi60P4T27/0jchIDFa1WHEfQeU3zH9UEMpnj2c=
|
||||
go.opentelemetry.io/otel/metric v0.23.0/go.mod h1:G/Nn9InyNnIv7J6YVkQfpc0JCfKBNJaERBGw08nqmVQ=
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC3/go.mod h1:VUt2TUYd8S2/ZRX09ZDFZQwn2RqfMB5MzO17jBojGxo=
|
||||
go.opentelemetry.io/otel/trace v1.0.0 h1:TSBr8GTEtKevYMG/2d21M989r5WJYVimhTHBKVEZuh4=
|
||||
go.opentelemetry.io/otel/trace v1.0.0/go.mod h1:PXTWqayeFUlJV1YDNhsJYB184+IvAH814St6o6ajzIs=
|
||||
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=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
|
6
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
generated
vendored
6
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
generated
vendored
@ -48,7 +48,7 @@ type Handler struct {
|
||||
filters []Filter
|
||||
spanNameFormatter func(string, *http.Request) string
|
||||
counters map[string]metric.Int64Counter
|
||||
valueRecorders map[string]metric.Int64ValueRecorder
|
||||
valueRecorders map[string]metric.Int64Histogram
|
||||
}
|
||||
|
||||
func defaultHandlerFormatter(operation string, _ *http.Request) string {
|
||||
@ -94,7 +94,7 @@ func handleErr(err error) {
|
||||
|
||||
func (h *Handler) createMeasures() {
|
||||
h.counters = make(map[string]metric.Int64Counter)
|
||||
h.valueRecorders = make(map[string]metric.Int64ValueRecorder)
|
||||
h.valueRecorders = make(map[string]metric.Int64Histogram)
|
||||
|
||||
requestBytesCounter, err := h.meter.NewInt64Counter(RequestContentLength)
|
||||
handleErr(err)
|
||||
@ -102,7 +102,7 @@ func (h *Handler) createMeasures() {
|
||||
responseBytesCounter, err := h.meter.NewInt64Counter(ResponseContentLength)
|
||||
handleErr(err)
|
||||
|
||||
serverLatencyMeasure, err := h.meter.NewInt64ValueRecorder(ServerLatency)
|
||||
serverLatencyMeasure, err := h.meter.NewInt64Histogram(ServerLatency)
|
||||
handleErr(err)
|
||||
|
||||
h.counters[RequestContentLength] = requestBytesCounter
|
||||
|
3
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
generated
vendored
3
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
generated
vendored
@ -21,6 +21,7 @@ import (
|
||||
"net/http/httptrace"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
@ -115,6 +116,7 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
|
||||
res, err := t.rt.RoundTrip(r)
|
||||
if err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
span.End()
|
||||
return res, err
|
||||
}
|
||||
@ -144,6 +146,7 @@ func (wb *wrappedBody) Read(b []byte) (int, error) {
|
||||
wb.span.End()
|
||||
default:
|
||||
wb.span.RecordError(err)
|
||||
wb.span.SetStatus(codes.Error, err.Error())
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
@ -12,9 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// This package provides all of its functionality through its
|
||||
// submodules. The submodules in the exporters directory provide
|
||||
// implementations for trace and metric exporters for third-party
|
||||
// collectors, and submodules in the instrumentation directory provide the
|
||||
// instrumentation for the popular go libraries.
|
||||
package contrib
|
||||
package otelhttp
|
||||
|
||||
// Version is the current release version of the otelhttp instrumentation.
|
||||
func Version() string {
|
||||
return "0.24.0"
|
||||
// This string is updated by the pre_release.sh script during release
|
||||
}
|
||||
|
||||
// SemVersion is the semantic version to be supplied to tracer/meter creation.
|
||||
func SemVersion() string {
|
||||
return "semver:" + Version()
|
||||
}
|
158
vendor/go.opentelemetry.io/contrib/pre_release.sh
generated
vendored
158
vendor/go.opentelemetry.io/contrib/pre_release.sh
generated
vendored
@ -1,158 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 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.
|
||||
|
||||
#
|
||||
# This script is used for
|
||||
# a) creating a new tagged release of go.opentelemetry.io/contrib
|
||||
# b) bumping the referenced version of go.opentelemetry.io/otel
|
||||
#
|
||||
# The options can be used together or individually.
|
||||
#
|
||||
set -e
|
||||
|
||||
declare CONTRIB_TAG
|
||||
declare OTEL_TAG
|
||||
|
||||
help() {
|
||||
printf "\n"
|
||||
printf "Usage: %s [-o otel_tag] [-t tag]\n" "$0"
|
||||
printf "\t-o Otel release tag. Update all go.mod to reference go.opentelemetry.io/otel <otel_tag>.\n"
|
||||
printf "\t-t New Contrib unreleased tag. Update all go.mod files with this tag.\n"
|
||||
exit 1 # Exit script after printing help
|
||||
}
|
||||
|
||||
while getopts "t:o:" opt
|
||||
do
|
||||
case "$opt" in
|
||||
t ) CONTRIB_TAG="$OPTARG" ;;
|
||||
o ) OTEL_TAG="$OPTARG" ;;
|
||||
? ) help ;; # Print help
|
||||
esac
|
||||
done
|
||||
|
||||
declare -r SEMVER_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$"
|
||||
|
||||
validate_tag() {
|
||||
local tag_=$1
|
||||
if [[ "${tag_}" =~ ${SEMVER_REGEX} ]]; then
|
||||
printf "%s is valid semver tag.\n" "${tag_}"
|
||||
else
|
||||
printf "%s is not a valid semver tag.\n" "${tag_}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Print help in case parameters are empty
|
||||
if [[ -z "$CONTRIB_TAG" && -z "$OTEL_TAG" ]]
|
||||
then
|
||||
printf "At least one of '-o' or '-t' must be specified.\n"
|
||||
help
|
||||
fi
|
||||
|
||||
|
||||
## Validate tags first
|
||||
if [ -n "${OTEL_TAG}" ]; then
|
||||
validate_tag "${OTEL_TAG}" || exit $?
|
||||
|
||||
# check that OTEL_TAG is a currently released tag for go.opentelemetry.io/otel
|
||||
TMPDIR=$(mktemp -d "/tmp/otel-contrib.XXXXXX") || exit 1
|
||||
trap "rm -fr ${TMPDIR}" EXIT
|
||||
(cd "${TMPDIR}" && go mod init tagtest)
|
||||
# requires go 1.14 for support of '-modfile'
|
||||
if ! go get -modfile="${TMPDIR}/go.mod" -d -v "go.opentelemetry.io/otel@${OTEL_TAG}"; then
|
||||
printf "go.opentelemetry.io/otel %s does not exist. Please supply a valid tag\n" "${OTEL_TAG}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -n "${CONTRIB_TAG}" ]; then
|
||||
validate_tag "${CONTRIB_TAG}" || exit $?
|
||||
TAG_FOUND=$(git tag --list "${CONTRIB_TAG}")
|
||||
if [[ ${TAG_FOUND} = "${CONTRIB_TAG}" ]] ; then
|
||||
printf "Tag %s already exists in this repo\n" "${CONTRIB_TAG}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
CONTRIB_TAG=${OTEL_TAG} # if contrib_tag not specified, but OTEL_TAG is, then set it to OTEL_TAG
|
||||
fi
|
||||
|
||||
# Get version for contrib.go
|
||||
OTEL_CONTRIB_VERSION=$(echo "${CONTRIB_TAG}" | egrep -o "${SEMVER_REGEX}")
|
||||
# Strip leading v
|
||||
OTEL_CONTRIB_VERSION="${OTEL_CONTRIB_VERSION#v}"
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if ! git diff --quiet; then \
|
||||
printf "Working tree is not clean, can't proceed\n"
|
||||
git status
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Update contrib.go version definition
|
||||
cp contrib.go contrib.go.bak
|
||||
sed "s/\(return \"\)[0-9]*\.[0-9]*\.[0-9]*\"/\1${OTEL_CONTRIB_VERSION}\"/" ./contrib.go.bak > ./contrib.go
|
||||
rm -f ./contrib.go.bak
|
||||
|
||||
declare -r BRANCH_NAME=pre_release_${CONTRIB_TAG}
|
||||
|
||||
patch_gomods() {
|
||||
local pkg_=$1
|
||||
local tag_=$2
|
||||
# now do the same for all the directories underneath
|
||||
PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep -v 'tools' | sed 's|^\.\/||' | sort)
|
||||
# quote any '.' characters in the pkg name
|
||||
local quoted_pkg_=${pkg_//./\\.}
|
||||
for dir in $PACKAGE_DIRS; do
|
||||
cp "${dir}/go.mod" "${dir}/go.mod.bak"
|
||||
sed "s|${quoted_pkg_}\([^ ]*\) v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[^0-9]*.*$|${pkg_}\1 ${tag_}|" "${dir}/go.mod.bak" >"${dir}/go.mod"
|
||||
rm -f "${dir}/go.mod.bak"
|
||||
done
|
||||
}
|
||||
|
||||
# branch off from existing main
|
||||
git checkout -b "${BRANCH_NAME}" main
|
||||
|
||||
# Update go.mods
|
||||
if [ -n "${OTEL_TAG}" ]; then
|
||||
# first update the top most module
|
||||
go get "go.opentelemetry.io/otel@${OTEL_TAG}"
|
||||
patch_gomods go.opentelemetry.io/otel "${OTEL_TAG}"
|
||||
fi
|
||||
|
||||
if [ -n "${CONTRIB_TAG}" ]; then
|
||||
patch_gomods go.opentelemetry.io/contrib "${CONTRIB_TAG}"
|
||||
fi
|
||||
|
||||
git diff
|
||||
# Run lint to update go.sum
|
||||
make lint
|
||||
|
||||
# Add changes and commit.
|
||||
git add .
|
||||
make ci
|
||||
# Check whether registry links are up to date
|
||||
make registry-links-check
|
||||
|
||||
declare COMMIT_MSG=""
|
||||
if [ -n "${OTEL_TAG}" ]; then
|
||||
COMMIT_MSG+="Bumping otel version to ${OTEL_TAG}"
|
||||
fi
|
||||
COMMIT_MSG+=". Prepare for releasing ${CONTRIB_TAG}"
|
||||
git commit -m "${COMMIT_MSG}"
|
||||
|
||||
printf "Now run following to verify the changes.\ngit diff main\n"
|
||||
printf "\nThen push the changes to upstream\n"
|
178
vendor/go.opentelemetry.io/contrib/tag.sh
generated
vendored
178
vendor/go.opentelemetry.io/contrib/tag.sh
generated
vendored
@ -1,178 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 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.
|
||||
|
||||
readonly PROGNAME=$(basename "$0")
|
||||
readonly PROGDIR=$(readlink -m "$(dirname "$0")")
|
||||
|
||||
readonly EXCLUDE_PACKAGES="tools"
|
||||
readonly SEMVER_REGEX="v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?"
|
||||
|
||||
usage() {
|
||||
cat <<- EOF
|
||||
Usage: $PROGNAME [OPTIONS] SEMVER_TAG COMMIT_HASH
|
||||
|
||||
Creates git tag for all Go packages in project.
|
||||
|
||||
OPTIONS:
|
||||
-h --help Show this help.
|
||||
|
||||
ARGUMENTS:
|
||||
SEMVER_TAG Semantic version to tag with.
|
||||
COMMIT_HASH Git commit hash to tag.
|
||||
EOF
|
||||
}
|
||||
|
||||
cmdline() {
|
||||
local arg commit
|
||||
|
||||
for arg
|
||||
do
|
||||
local delim=""
|
||||
case "$arg" in
|
||||
# Translate long form options to short form.
|
||||
--help) args="${args}-h ";;
|
||||
# Pass through for everything else.
|
||||
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
|
||||
args="${args}${delim}${arg}${delim} ";;
|
||||
esac
|
||||
done
|
||||
|
||||
# Reset and process short form options.
|
||||
eval set -- "$args"
|
||||
|
||||
while getopts "h" OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "unknown option: $OPTION"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Positional arguments.
|
||||
shift $((OPTIND-1))
|
||||
readonly TAG="$1"
|
||||
if [ -z "$TAG" ]
|
||||
then
|
||||
echo "missing SEMVER_TAG"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! "$TAG" =~ $SEMVER_REGEX ]]
|
||||
then
|
||||
printf "invalid semantic version: %s\n" "$TAG"
|
||||
exit 2
|
||||
fi
|
||||
if [[ "$( git tag --list "$TAG" )" ]]
|
||||
then
|
||||
printf "tag already exists: %s\n" "$TAG"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
shift
|
||||
commit="$1"
|
||||
if [ -z "$commit" ]
|
||||
then
|
||||
echo "missing COMMIT_HASH"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
# Verify rev is for a commit and unify hashes into a complete SHA1.
|
||||
readonly SHA="$( git rev-parse --quiet --verify "${commit}^{commit}" )"
|
||||
if [ -z "$SHA" ]
|
||||
then
|
||||
printf "invalid commit hash: %s\n" "$commit"
|
||||
exit 2
|
||||
fi
|
||||
if [ "$( git merge-base "$SHA" HEAD )" != "$SHA" ]
|
||||
then
|
||||
printf "commit '%s' not found on this branch\n" "$commit"
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
package_dirs() {
|
||||
# Return a list of package directories in the form:
|
||||
#
|
||||
# package/directory/a
|
||||
# package/directory/b
|
||||
# deeper/package/directory/a
|
||||
# ...
|
||||
#
|
||||
# Making sure to exclude any packages in the EXCLUDE_PACKAGES regexp.
|
||||
find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; \
|
||||
| grep -E -v "$EXCLUDE_PACKAGES" \
|
||||
| sed 's/^\.\///' \
|
||||
| sort
|
||||
}
|
||||
|
||||
git_tag() {
|
||||
local tag="$1"
|
||||
local commit="$2"
|
||||
|
||||
git tag -a "$tag" -s -m "Version $tag" "$commit"
|
||||
}
|
||||
|
||||
previous_version() {
|
||||
local current="$1"
|
||||
|
||||
# Requires git > 2.0
|
||||
git tag -l --sort=v:refname \
|
||||
| grep -E "^${SEMVER_REGEX}$" \
|
||||
| grep -v "$current" \
|
||||
| tail -1
|
||||
}
|
||||
|
||||
print_changes() {
|
||||
local tag="$1"
|
||||
local previous
|
||||
|
||||
previous="$( previous_version "$tag" )"
|
||||
if [ -n "$previous" ]
|
||||
then
|
||||
printf "\nRaw changes made between %s and %s\n" "$previous" "$tag"
|
||||
printf "======================================\n"
|
||||
git --no-pager log --pretty=oneline "${previous}..$tag"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
local dir
|
||||
|
||||
cmdline "$@"
|
||||
|
||||
cd "$PROGDIR" || exit 3
|
||||
|
||||
# Create tag for root package.
|
||||
git_tag "$TAG" "$SHA"
|
||||
printf "created tag: %s\n" "$TAG"
|
||||
|
||||
# Create tag for all sub-packages.
|
||||
for dir in $( package_dirs )
|
||||
do
|
||||
git_tag "${dir}/$TAG" "$SHA"
|
||||
printf "created tag: %s\n" "${dir}/$TAG"
|
||||
done
|
||||
|
||||
print_changes "$TAG"
|
||||
}
|
||||
main "$@"
|
Reference in New Issue
Block a user