]> git.feebdaed.xyz Git - 0xmirror/containerd.git/commitdiff
vendor: go.opentelemetry.io/otel/exporters v1.38.0
authorSebastiaan van Stijn <github@gone.nl>
Mon, 1 Dec 2025 12:25:56 +0000 (13:25 +0100)
committerSebastiaan van Stijn <github@gone.nl>
Mon, 8 Dec 2025 09:00:04 +0000 (10:00 +0100)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
57 files changed:
go.mod
go.sum
vendor/github.com/cenkalti/backoff/v4/.gitignore [deleted file]
vendor/github.com/cenkalti/backoff/v4/LICENSE [deleted file]
vendor/github.com/cenkalti/backoff/v4/README.md [deleted file]
vendor/github.com/cenkalti/backoff/v4/backoff.go [deleted file]
vendor/github.com/cenkalti/backoff/v4/context.go [deleted file]
vendor/github.com/cenkalti/backoff/v4/exponential.go [deleted file]
vendor/github.com/cenkalti/backoff/v4/retry.go [deleted file]
vendor/github.com/cenkalti/backoff/v4/ticker.go [deleted file]
vendor/github.com/cenkalti/backoff/v4/timer.go [deleted file]
vendor/github.com/cenkalti/backoff/v4/tries.go [deleted file]
vendor/github.com/cenkalti/backoff/v5/.gitignore [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/CHANGELOG.md [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/LICENSE [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/README.md [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/backoff.go [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/error.go [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/exponential.go [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/retry.go [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/ticker.go [new file with mode: 0644]
vendor/github.com/cenkalti/backoff/v5/timer.go [new file with mode: 0644]
vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go
vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/LICENSE
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/instrumentation.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/resource.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/span.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/LICENSE
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/LICENSE
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig/envconfig.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/gen.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/envconfig.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/optiontypes.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/tls.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/partialsuccess.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry/retry.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go
vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go
vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go
vendor/modules.txt

diff --git a/go.mod b/go.mod
index dc521fa55cb694f03d5deac70f6f2b7a57852276..f7fbaeba5a4480b6731c6358a9421746c5d845c1 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -69,9 +69,9 @@ require (
        go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0
        go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0
        go.opentelemetry.io/otel v1.38.0
-       go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0
-       go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0
-       go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0
+       go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0
+       go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0
+       go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0
        go.opentelemetry.io/otel/sdk v1.38.0
        go.opentelemetry.io/otel/trace v1.38.0
        go.uber.org/goleak v1.3.0
@@ -93,7 +93,7 @@ require (
 require (
        github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
        github.com/beorn7/perks v1.0.1 // indirect
-       github.com/cenkalti/backoff/v4 v4.3.0 // indirect
+       github.com/cenkalti/backoff/v5 v5.0.3 // indirect
        github.com/cespare/xxhash/v2 v2.3.0 // indirect
        github.com/cilium/ebpf v0.16.0 // indirect
        github.com/containers/ocicrypt v1.2.1 // indirect
@@ -112,7 +112,7 @@ require (
        github.com/google/deck v0.0.0-20230104221208-105ad94aa8ae // indirect
        github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
        github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
-       github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect
+       github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
        github.com/hashicorp/errwrap v1.1.0 // indirect
        github.com/json-iterator/go v1.1.12 // indirect
        github.com/knqyf263/go-plugin v0.9.0 // indirect
@@ -141,7 +141,7 @@ require (
        go.opencensus.io v0.24.0 // indirect
        go.opentelemetry.io/auto/sdk v1.2.1 // indirect
        go.opentelemetry.io/otel/metric v1.38.0 // indirect
-       go.opentelemetry.io/proto/otlp v1.5.0 // indirect
+       go.opentelemetry.io/proto/otlp v1.7.1 // indirect
        go.yaml.in/yaml/v2 v2.4.2 // indirect
        golang.org/x/crypto v0.45.0 // indirect
        golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
diff --git a/go.sum b/go.sum
index 97187c9a504b96f07b77d3e60444af53b0ba6e2b..0d1813617c7d132bcb1d73f831fc79c31d83c840 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -22,8 +22,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
 github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
 github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
-github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
-github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
+github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
+github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
 github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -181,8 +181,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs
 github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0/go.mod h1:hM2alZsMUni80N33RBe6J0e423LB+odMj7d3EMP9l20=
 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk=
 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnVTyacbefKhmbLhIhU=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs=
 github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
 github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
 github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
@@ -364,12 +364,12 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRND
 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
 go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
 go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 h1:m639+BofXTvcY1q8CGs4ItwQarYtJPOWmVobfM1HpVI=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0/go.mod h1:LjReUci/F4BUyv+y4dwnq3h/26iNOeC3wAIqgvTIZVo=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 h1:xJ2qHD0C1BeYVTLLR9sX12+Qb95kfeD/byKj6Ky1pXg=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0/go.mod h1:u5BF1xyjstDowA1R5QAO9JHzqK+ublenEW/dyqTjBVk=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 h1:GqRJVj7UmLjCVyVJ3ZFLdPRmhDUp2zFmQe3RHIOsw24=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0/go.mod h1:ri3aaHSmCTVYu2AWv44YMauwAQc0aqI9gHKIcSbI1pU=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0 h1:lwI4Dc5leUqENgGuQImwLo4WnuXFPetmPpkLi2IrX54=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0/go.mod h1:Kz/oCE7z5wuyhPxsXDuaPteSWqjSBD5YaSdbxZYGbGk=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0 h1:aTL7F04bJHUlztTsNGJ2l+6he8c+y/b//eR0jjjemT4=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0/go.mod h1:kldtb7jDTeol0l3ewcmd8SDvx3EmIE7lyvqbasU3QC4=
 go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
 go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
 go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
@@ -378,8 +378,8 @@ go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6
 go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
 go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
 go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
-go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
-go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
+go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4=
+go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE=
 go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
 go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
 go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
diff --git a/vendor/github.com/cenkalti/backoff/v4/.gitignore b/vendor/github.com/cenkalti/backoff/v4/.gitignore
deleted file mode 100644 (file)
index 50d95c5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-
-# IDEs
-.idea/
diff --git a/vendor/github.com/cenkalti/backoff/v4/LICENSE b/vendor/github.com/cenkalti/backoff/v4/LICENSE
deleted file mode 100644 (file)
index 89b8179..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Cenk Altı
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/cenkalti/backoff/v4/README.md b/vendor/github.com/cenkalti/backoff/v4/README.md
deleted file mode 100644 (file)
index 9433004..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Coverage Status][coveralls image]][coveralls]
-
-This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client].
-
-[Exponential backoff][exponential backoff wiki]
-is an algorithm that uses feedback to multiplicatively decrease the rate of some process,
-in order to gradually find an acceptable rate.
-The retries exponentially increase and stop increasing when a certain threshold is met.
-
-## Usage
-
-Import path is `github.com/cenkalti/backoff/v4`. Please note the version part at the end.
-
-Use https://pkg.go.dev/github.com/cenkalti/backoff/v4 to view the documentation.
-
-## Contributing
-
-* I would like to keep this library as small as possible.
-* Please don't send a PR without opening an issue and discussing it first.
-* If proposed change is not a common use case, I will probably not accept it.
-
-[godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v4
-[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png
-[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master
-[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master
-
-[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java
-[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff
-
-[advanced example]: https://pkg.go.dev/github.com/cenkalti/backoff/v4?tab=doc#pkg-examples
diff --git a/vendor/github.com/cenkalti/backoff/v4/backoff.go b/vendor/github.com/cenkalti/backoff/v4/backoff.go
deleted file mode 100644 (file)
index 3676ee4..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// Package backoff implements backoff algorithms for retrying operations.
-//
-// Use Retry function for retrying operations that may fail.
-// If Retry does not meet your needs,
-// copy/paste the function into your project and modify as you wish.
-//
-// There is also Ticker type similar to time.Ticker.
-// You can use it if you need to work with channels.
-//
-// See Examples section below for usage examples.
-package backoff
-
-import "time"
-
-// BackOff is a backoff policy for retrying an operation.
-type BackOff interface {
-       // NextBackOff returns the duration to wait before retrying the operation,
-       // or backoff. Stop to indicate that no more retries should be made.
-       //
-       // Example usage:
-       //
-       //      duration := backoff.NextBackOff();
-       //      if (duration == backoff.Stop) {
-       //              // Do not retry operation.
-       //      } else {
-       //              // Sleep for duration and retry operation.
-       //      }
-       //
-       NextBackOff() time.Duration
-
-       // Reset to initial state.
-       Reset()
-}
-
-// Stop indicates that no more retries should be made for use in NextBackOff().
-const Stop time.Duration = -1
-
-// ZeroBackOff is a fixed backoff policy whose backoff time is always zero,
-// meaning that the operation is retried immediately without waiting, indefinitely.
-type ZeroBackOff struct{}
-
-func (b *ZeroBackOff) Reset() {}
-
-func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }
-
-// StopBackOff is a fixed backoff policy that always returns backoff.Stop for
-// NextBackOff(), meaning that the operation should never be retried.
-type StopBackOff struct{}
-
-func (b *StopBackOff) Reset() {}
-
-func (b *StopBackOff) NextBackOff() time.Duration { return Stop }
-
-// ConstantBackOff is a backoff policy that always returns the same backoff delay.
-// This is in contrast to an exponential backoff policy,
-// which returns a delay that grows longer as you call NextBackOff() over and over again.
-type ConstantBackOff struct {
-       Interval time.Duration
-}
-
-func (b *ConstantBackOff) Reset()                     {}
-func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }
-
-func NewConstantBackOff(d time.Duration) *ConstantBackOff {
-       return &ConstantBackOff{Interval: d}
-}
diff --git a/vendor/github.com/cenkalti/backoff/v4/context.go b/vendor/github.com/cenkalti/backoff/v4/context.go
deleted file mode 100644 (file)
index 4848233..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-package backoff
-
-import (
-       "context"
-       "time"
-)
-
-// BackOffContext is a backoff policy that stops retrying after the context
-// is canceled.
-type BackOffContext interface { // nolint: golint
-       BackOff
-       Context() context.Context
-}
-
-type backOffContext struct {
-       BackOff
-       ctx context.Context
-}
-
-// WithContext returns a BackOffContext with context ctx
-//
-// ctx must not be nil
-func WithContext(b BackOff, ctx context.Context) BackOffContext { // nolint: golint
-       if ctx == nil {
-               panic("nil context")
-       }
-
-       if b, ok := b.(*backOffContext); ok {
-               return &backOffContext{
-                       BackOff: b.BackOff,
-                       ctx:     ctx,
-               }
-       }
-
-       return &backOffContext{
-               BackOff: b,
-               ctx:     ctx,
-       }
-}
-
-func getContext(b BackOff) context.Context {
-       if cb, ok := b.(BackOffContext); ok {
-               return cb.Context()
-       }
-       if tb, ok := b.(*backOffTries); ok {
-               return getContext(tb.delegate)
-       }
-       return context.Background()
-}
-
-func (b *backOffContext) Context() context.Context {
-       return b.ctx
-}
-
-func (b *backOffContext) NextBackOff() time.Duration {
-       select {
-       case <-b.ctx.Done():
-               return Stop
-       default:
-               return b.BackOff.NextBackOff()
-       }
-}
diff --git a/vendor/github.com/cenkalti/backoff/v4/exponential.go b/vendor/github.com/cenkalti/backoff/v4/exponential.go
deleted file mode 100644 (file)
index aac99f1..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-package backoff
-
-import (
-       "math/rand"
-       "time"
-)
-
-/*
-ExponentialBackOff is a backoff implementation that increases the backoff
-period for each retry attempt using a randomization function that grows exponentially.
-
-NextBackOff() is calculated using the following formula:
-
- randomized interval =
-     RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor])
-
-In other words NextBackOff() will range between the randomization factor
-percentage below and above the retry interval.
-
-For example, given the following parameters:
-
- RetryInterval = 2
- RandomizationFactor = 0.5
- Multiplier = 2
-
-the actual backoff period used in the next retry attempt will range between 1 and 3 seconds,
-multiplied by the exponential, that is, between 2 and 6 seconds.
-
-Note: MaxInterval caps the RetryInterval and not the randomized interval.
-
-If the time elapsed since an ExponentialBackOff instance is created goes past the
-MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop.
-
-The elapsed time can be reset by calling Reset().
-
-Example: Given the following default arguments, for 10 tries the sequence will be,
-and assuming we go over the MaxElapsedTime on the 10th try:
-
- Request #  RetryInterval (seconds)  Randomized Interval (seconds)
-
-  1          0.5                     [0.25,   0.75]
-  2          0.75                    [0.375,  1.125]
-  3          1.125                   [0.562,  1.687]
-  4          1.687                   [0.8435, 2.53]
-  5          2.53                    [1.265,  3.795]
-  6          3.795                   [1.897,  5.692]
-  7          5.692                   [2.846,  8.538]
-  8          8.538                   [4.269, 12.807]
-  9         12.807                   [6.403, 19.210]
- 10         19.210                   backoff.Stop
-
-Note: Implementation is not thread-safe.
-*/
-type ExponentialBackOff struct {
-       InitialInterval     time.Duration
-       RandomizationFactor float64
-       Multiplier          float64
-       MaxInterval         time.Duration
-       // After MaxElapsedTime the ExponentialBackOff returns Stop.
-       // It never stops if MaxElapsedTime == 0.
-       MaxElapsedTime time.Duration
-       Stop           time.Duration
-       Clock          Clock
-
-       currentInterval time.Duration
-       startTime       time.Time
-}
-
-// Clock is an interface that returns current time for BackOff.
-type Clock interface {
-       Now() time.Time
-}
-
-// ExponentialBackOffOpts is a function type used to configure ExponentialBackOff options.
-type ExponentialBackOffOpts func(*ExponentialBackOff)
-
-// Default values for ExponentialBackOff.
-const (
-       DefaultInitialInterval     = 500 * time.Millisecond
-       DefaultRandomizationFactor = 0.5
-       DefaultMultiplier          = 1.5
-       DefaultMaxInterval         = 60 * time.Second
-       DefaultMaxElapsedTime      = 15 * time.Minute
-)
-
-// NewExponentialBackOff creates an instance of ExponentialBackOff using default values.
-func NewExponentialBackOff(opts ...ExponentialBackOffOpts) *ExponentialBackOff {
-       b := &ExponentialBackOff{
-               InitialInterval:     DefaultInitialInterval,
-               RandomizationFactor: DefaultRandomizationFactor,
-               Multiplier:          DefaultMultiplier,
-               MaxInterval:         DefaultMaxInterval,
-               MaxElapsedTime:      DefaultMaxElapsedTime,
-               Stop:                Stop,
-               Clock:               SystemClock,
-       }
-       for _, fn := range opts {
-               fn(b)
-       }
-       b.Reset()
-       return b
-}
-
-// WithInitialInterval sets the initial interval between retries.
-func WithInitialInterval(duration time.Duration) ExponentialBackOffOpts {
-       return func(ebo *ExponentialBackOff) {
-               ebo.InitialInterval = duration
-       }
-}
-
-// WithRandomizationFactor sets the randomization factor to add jitter to intervals.
-func WithRandomizationFactor(randomizationFactor float64) ExponentialBackOffOpts {
-       return func(ebo *ExponentialBackOff) {
-               ebo.RandomizationFactor = randomizationFactor
-       }
-}
-
-// WithMultiplier sets the multiplier for increasing the interval after each retry.
-func WithMultiplier(multiplier float64) ExponentialBackOffOpts {
-       return func(ebo *ExponentialBackOff) {
-               ebo.Multiplier = multiplier
-       }
-}
-
-// WithMaxInterval sets the maximum interval between retries.
-func WithMaxInterval(duration time.Duration) ExponentialBackOffOpts {
-       return func(ebo *ExponentialBackOff) {
-               ebo.MaxInterval = duration
-       }
-}
-
-// WithMaxElapsedTime sets the maximum total time for retries.
-func WithMaxElapsedTime(duration time.Duration) ExponentialBackOffOpts {
-       return func(ebo *ExponentialBackOff) {
-               ebo.MaxElapsedTime = duration
-       }
-}
-
-// WithRetryStopDuration sets the duration after which retries should stop.
-func WithRetryStopDuration(duration time.Duration) ExponentialBackOffOpts {
-       return func(ebo *ExponentialBackOff) {
-               ebo.Stop = duration
-       }
-}
-
-// WithClockProvider sets the clock used to measure time.
-func WithClockProvider(clock Clock) ExponentialBackOffOpts {
-       return func(ebo *ExponentialBackOff) {
-               ebo.Clock = clock
-       }
-}
-
-type systemClock struct{}
-
-func (t systemClock) Now() time.Time {
-       return time.Now()
-}
-
-// SystemClock implements Clock interface that uses time.Now().
-var SystemClock = systemClock{}
-
-// Reset the interval back to the initial retry interval and restarts the timer.
-// Reset must be called before using b.
-func (b *ExponentialBackOff) Reset() {
-       b.currentInterval = b.InitialInterval
-       b.startTime = b.Clock.Now()
-}
-
-// NextBackOff calculates the next backoff interval using the formula:
-//     Randomized interval = RetryInterval * (1 Â± RandomizationFactor)
-func (b *ExponentialBackOff) NextBackOff() time.Duration {
-       // Make sure we have not gone over the maximum elapsed time.
-       elapsed := b.GetElapsedTime()
-       next := getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval)
-       b.incrementCurrentInterval()
-       if b.MaxElapsedTime != 0 && elapsed+next > b.MaxElapsedTime {
-               return b.Stop
-       }
-       return next
-}
-
-// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance
-// is created and is reset when Reset() is called.
-//
-// The elapsed time is computed using time.Now().UnixNano(). It is
-// safe to call even while the backoff policy is used by a running
-// ticker.
-func (b *ExponentialBackOff) GetElapsedTime() time.Duration {
-       return b.Clock.Now().Sub(b.startTime)
-}
-
-// Increments the current interval by multiplying it with the multiplier.
-func (b *ExponentialBackOff) incrementCurrentInterval() {
-       // Check for overflow, if overflow is detected set the current interval to the max interval.
-       if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier {
-               b.currentInterval = b.MaxInterval
-       } else {
-               b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)
-       }
-}
-
-// Returns a random value from the following interval:
-//     [currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval].
-func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {
-       if randomizationFactor == 0 {
-               return currentInterval // make sure no randomness is used when randomizationFactor is 0.
-       }
-       var delta = randomizationFactor * float64(currentInterval)
-       var minInterval = float64(currentInterval) - delta
-       var maxInterval = float64(currentInterval) + delta
-
-       // Get a random value from the range [minInterval, maxInterval].
-       // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then
-       // we want a 33% chance for selecting either 1, 2 or 3.
-       return time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))
-}
diff --git a/vendor/github.com/cenkalti/backoff/v4/retry.go b/vendor/github.com/cenkalti/backoff/v4/retry.go
deleted file mode 100644 (file)
index b9c0c51..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-package backoff
-
-import (
-       "errors"
-       "time"
-)
-
-// An OperationWithData is executing by RetryWithData() or RetryNotifyWithData().
-// The operation will be retried using a backoff policy if it returns an error.
-type OperationWithData[T any] func() (T, error)
-
-// An Operation is executing by Retry() or RetryNotify().
-// The operation will be retried using a backoff policy if it returns an error.
-type Operation func() error
-
-func (o Operation) withEmptyData() OperationWithData[struct{}] {
-       return func() (struct{}, error) {
-               return struct{}{}, o()
-       }
-}
-
-// Notify is a notify-on-error function. It receives an operation error and
-// backoff delay if the operation failed (with an error).
-//
-// NOTE that if the backoff policy stated to stop retrying,
-// the notify function isn't called.
-type Notify func(error, time.Duration)
-
-// Retry the operation o until it does not return error or BackOff stops.
-// o is guaranteed to be run at least once.
-//
-// If o returns a *PermanentError, the operation is not retried, and the
-// wrapped error is returned.
-//
-// Retry sleeps the goroutine for the duration returned by BackOff after a
-// failed operation returns.
-func Retry(o Operation, b BackOff) error {
-       return RetryNotify(o, b, nil)
-}
-
-// RetryWithData is like Retry but returns data in the response too.
-func RetryWithData[T any](o OperationWithData[T], b BackOff) (T, error) {
-       return RetryNotifyWithData(o, b, nil)
-}
-
-// RetryNotify calls notify function with the error and wait duration
-// for each failed attempt before sleep.
-func RetryNotify(operation Operation, b BackOff, notify Notify) error {
-       return RetryNotifyWithTimer(operation, b, notify, nil)
-}
-
-// RetryNotifyWithData is like RetryNotify but returns data in the response too.
-func RetryNotifyWithData[T any](operation OperationWithData[T], b BackOff, notify Notify) (T, error) {
-       return doRetryNotify(operation, b, notify, nil)
-}
-
-// RetryNotifyWithTimer calls notify function with the error and wait duration using the given Timer
-// for each failed attempt before sleep.
-// A default timer that uses system timer is used when nil is passed.
-func RetryNotifyWithTimer(operation Operation, b BackOff, notify Notify, t Timer) error {
-       _, err := doRetryNotify(operation.withEmptyData(), b, notify, t)
-       return err
-}
-
-// RetryNotifyWithTimerAndData is like RetryNotifyWithTimer but returns data in the response too.
-func RetryNotifyWithTimerAndData[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {
-       return doRetryNotify(operation, b, notify, t)
-}
-
-func doRetryNotify[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {
-       var (
-               err  error
-               next time.Duration
-               res  T
-       )
-       if t == nil {
-               t = &defaultTimer{}
-       }
-
-       defer func() {
-               t.Stop()
-       }()
-
-       ctx := getContext(b)
-
-       b.Reset()
-       for {
-               res, err = operation()
-               if err == nil {
-                       return res, nil
-               }
-
-               var permanent *PermanentError
-               if errors.As(err, &permanent) {
-                       return res, permanent.Err
-               }
-
-               if next = b.NextBackOff(); next == Stop {
-                       if cerr := ctx.Err(); cerr != nil {
-                               return res, cerr
-                       }
-
-                       return res, err
-               }
-
-               if notify != nil {
-                       notify(err, next)
-               }
-
-               t.Start(next)
-
-               select {
-               case <-ctx.Done():
-                       return res, ctx.Err()
-               case <-t.C():
-               }
-       }
-}
-
-// PermanentError signals that the operation should not be retried.
-type PermanentError struct {
-       Err error
-}
-
-func (e *PermanentError) Error() string {
-       return e.Err.Error()
-}
-
-func (e *PermanentError) Unwrap() error {
-       return e.Err
-}
-
-func (e *PermanentError) Is(target error) bool {
-       _, ok := target.(*PermanentError)
-       return ok
-}
-
-// Permanent wraps the given err in a *PermanentError.
-func Permanent(err error) error {
-       if err == nil {
-               return nil
-       }
-       return &PermanentError{
-               Err: err,
-       }
-}
diff --git a/vendor/github.com/cenkalti/backoff/v4/ticker.go b/vendor/github.com/cenkalti/backoff/v4/ticker.go
deleted file mode 100644 (file)
index df9d68b..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-package backoff
-
-import (
-       "context"
-       "sync"
-       "time"
-)
-
-// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff.
-//
-// Ticks will continue to arrive when the previous operation is still running,
-// so operations that take a while to fail could run in quick succession.
-type Ticker struct {
-       C        <-chan time.Time
-       c        chan time.Time
-       b        BackOff
-       ctx      context.Context
-       timer    Timer
-       stop     chan struct{}
-       stopOnce sync.Once
-}
-
-// NewTicker returns a new Ticker containing a channel that will send
-// the time at times specified by the BackOff argument. Ticker is
-// guaranteed to tick at least once.  The channel is closed when Stop
-// method is called or BackOff stops. It is not safe to manipulate the
-// provided backoff policy (notably calling NextBackOff or Reset)
-// while the ticker is running.
-func NewTicker(b BackOff) *Ticker {
-       return NewTickerWithTimer(b, &defaultTimer{})
-}
-
-// NewTickerWithTimer returns a new Ticker with a custom timer.
-// A default timer that uses system timer is used when nil is passed.
-func NewTickerWithTimer(b BackOff, timer Timer) *Ticker {
-       if timer == nil {
-               timer = &defaultTimer{}
-       }
-       c := make(chan time.Time)
-       t := &Ticker{
-               C:     c,
-               c:     c,
-               b:     b,
-               ctx:   getContext(b),
-               timer: timer,
-               stop:  make(chan struct{}),
-       }
-       t.b.Reset()
-       go t.run()
-       return t
-}
-
-// Stop turns off a ticker. After Stop, no more ticks will be sent.
-func (t *Ticker) Stop() {
-       t.stopOnce.Do(func() { close(t.stop) })
-}
-
-func (t *Ticker) run() {
-       c := t.c
-       defer close(c)
-
-       // Ticker is guaranteed to tick at least once.
-       afterC := t.send(time.Now())
-
-       for {
-               if afterC == nil {
-                       return
-               }
-
-               select {
-               case tick := <-afterC:
-                       afterC = t.send(tick)
-               case <-t.stop:
-                       t.c = nil // Prevent future ticks from being sent to the channel.
-                       return
-               case <-t.ctx.Done():
-                       return
-               }
-       }
-}
-
-func (t *Ticker) send(tick time.Time) <-chan time.Time {
-       select {
-       case t.c <- tick:
-       case <-t.stop:
-               return nil
-       }
-
-       next := t.b.NextBackOff()
-       if next == Stop {
-               t.Stop()
-               return nil
-       }
-
-       t.timer.Start(next)
-       return t.timer.C()
-}
diff --git a/vendor/github.com/cenkalti/backoff/v4/timer.go b/vendor/github.com/cenkalti/backoff/v4/timer.go
deleted file mode 100644 (file)
index 8120d02..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package backoff
-
-import "time"
-
-type Timer interface {
-       Start(duration time.Duration)
-       Stop()
-       C() <-chan time.Time
-}
-
-// defaultTimer implements Timer interface using time.Timer
-type defaultTimer struct {
-       timer *time.Timer
-}
-
-// C returns the timers channel which receives the current time when the timer fires.
-func (t *defaultTimer) C() <-chan time.Time {
-       return t.timer.C
-}
-
-// Start starts the timer to fire after the given duration
-func (t *defaultTimer) Start(duration time.Duration) {
-       if t.timer == nil {
-               t.timer = time.NewTimer(duration)
-       } else {
-               t.timer.Reset(duration)
-       }
-}
-
-// Stop is called when the timer is not used anymore and resources may be freed.
-func (t *defaultTimer) Stop() {
-       if t.timer != nil {
-               t.timer.Stop()
-       }
-}
diff --git a/vendor/github.com/cenkalti/backoff/v4/tries.go b/vendor/github.com/cenkalti/backoff/v4/tries.go
deleted file mode 100644 (file)
index 28d58ca..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package backoff
-
-import "time"
-
-/*
-WithMaxRetries creates a wrapper around another BackOff, which will
-return Stop if NextBackOff() has been called too many times since
-the last time Reset() was called
-
-Note: Implementation is not thread-safe.
-*/
-func WithMaxRetries(b BackOff, max uint64) BackOff {
-       return &backOffTries{delegate: b, maxTries: max}
-}
-
-type backOffTries struct {
-       delegate BackOff
-       maxTries uint64
-       numTries uint64
-}
-
-func (b *backOffTries) NextBackOff() time.Duration {
-       if b.maxTries == 0 {
-               return Stop
-       }
-       if b.maxTries > 0 {
-               if b.maxTries <= b.numTries {
-                       return Stop
-               }
-               b.numTries++
-       }
-       return b.delegate.NextBackOff()
-}
-
-func (b *backOffTries) Reset() {
-       b.numTries = 0
-       b.delegate.Reset()
-}
diff --git a/vendor/github.com/cenkalti/backoff/v5/.gitignore b/vendor/github.com/cenkalti/backoff/v5/.gitignore
new file mode 100644 (file)
index 0000000..50d95c5
--- /dev/null
@@ -0,0 +1,25 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+
+# IDEs
+.idea/
diff --git a/vendor/github.com/cenkalti/backoff/v5/CHANGELOG.md b/vendor/github.com/cenkalti/backoff/v5/CHANGELOG.md
new file mode 100644 (file)
index 0000000..658c374
--- /dev/null
@@ -0,0 +1,29 @@
+# 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.1.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [5.0.0] - 2024-12-19
+
+### Added
+
+- RetryAfterError can be returned from an operation to indicate how long to wait before the next retry.
+
+### Changed
+
+- Retry function now accepts additional options for specifying max number of tries and max elapsed time.
+- Retry function now accepts a context.Context.
+- Operation function signature changed to return result (any type) and error.
+
+### Removed
+
+- RetryNotify* and RetryWithData functions. Only single Retry function remains.
+- Optional arguments from ExponentialBackoff constructor.
+- Clock and Timer interfaces.
+
+### Fixed
+
+- The original error is returned from Retry if there's a PermanentError. (#144)
+- The Retry function respects the wrapped PermanentError. (#140)
diff --git a/vendor/github.com/cenkalti/backoff/v5/LICENSE b/vendor/github.com/cenkalti/backoff/v5/LICENSE
new file mode 100644 (file)
index 0000000..89b8179
--- /dev/null
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Cenk Altı
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/cenkalti/backoff/v5/README.md b/vendor/github.com/cenkalti/backoff/v5/README.md
new file mode 100644 (file)
index 0000000..4611b1d
--- /dev/null
@@ -0,0 +1,31 @@
+# Exponential Backoff [![GoDoc][godoc image]][godoc]
+
+This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client].
+
+[Exponential backoff][exponential backoff wiki]
+is an algorithm that uses feedback to multiplicatively decrease the rate of some process,
+in order to gradually find an acceptable rate.
+The retries exponentially increase and stop increasing when a certain threshold is met.
+
+## Usage
+
+Import path is `github.com/cenkalti/backoff/v5`. Please note the version part at the end.
+
+For most cases, use `Retry` function. See [example_test.go][example] for an example.
+
+If you have specific needs, copy `Retry` function (from [retry.go][retry-src]) into your code and modify it as needed.
+
+## Contributing
+
+* I would like to keep this library as small as possible.
+* Please don't send a PR without opening an issue and discussing it first.
+* If proposed change is not a common use case, I will probably not accept it.
+
+[godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v5
+[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png
+
+[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java
+[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff
+
+[retry-src]: https://github.com/cenkalti/backoff/blob/v5/retry.go
+[example]: https://github.com/cenkalti/backoff/blob/v5/example_test.go
diff --git a/vendor/github.com/cenkalti/backoff/v5/backoff.go b/vendor/github.com/cenkalti/backoff/v5/backoff.go
new file mode 100644 (file)
index 0000000..dd2b24c
--- /dev/null
@@ -0,0 +1,66 @@
+// Package backoff implements backoff algorithms for retrying operations.
+//
+// Use Retry function for retrying operations that may fail.
+// If Retry does not meet your needs,
+// copy/paste the function into your project and modify as you wish.
+//
+// There is also Ticker type similar to time.Ticker.
+// You can use it if you need to work with channels.
+//
+// See Examples section below for usage examples.
+package backoff
+
+import "time"
+
+// BackOff is a backoff policy for retrying an operation.
+type BackOff interface {
+       // NextBackOff returns the duration to wait before retrying the operation,
+       // backoff.Stop to indicate that no more retries should be made.
+       //
+       // Example usage:
+       //
+       //     duration := backoff.NextBackOff()
+       //     if duration == backoff.Stop {
+       //         // Do not retry operation.
+       //     } else {
+       //         // Sleep for duration and retry operation.
+       //     }
+       //
+       NextBackOff() time.Duration
+
+       // Reset to initial state.
+       Reset()
+}
+
+// Stop indicates that no more retries should be made for use in NextBackOff().
+const Stop time.Duration = -1
+
+// ZeroBackOff is a fixed backoff policy whose backoff time is always zero,
+// meaning that the operation is retried immediately without waiting, indefinitely.
+type ZeroBackOff struct{}
+
+func (b *ZeroBackOff) Reset() {}
+
+func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }
+
+// StopBackOff is a fixed backoff policy that always returns backoff.Stop for
+// NextBackOff(), meaning that the operation should never be retried.
+type StopBackOff struct{}
+
+func (b *StopBackOff) Reset() {}
+
+func (b *StopBackOff) NextBackOff() time.Duration { return Stop }
+
+// ConstantBackOff is a backoff policy that always returns the same backoff delay.
+// This is in contrast to an exponential backoff policy,
+// which returns a delay that grows longer as you call NextBackOff() over and over again.
+type ConstantBackOff struct {
+       Interval time.Duration
+}
+
+func (b *ConstantBackOff) Reset()                     {}
+func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }
+
+func NewConstantBackOff(d time.Duration) *ConstantBackOff {
+       return &ConstantBackOff{Interval: d}
+}
diff --git a/vendor/github.com/cenkalti/backoff/v5/error.go b/vendor/github.com/cenkalti/backoff/v5/error.go
new file mode 100644 (file)
index 0000000..beb2b38
--- /dev/null
@@ -0,0 +1,46 @@
+package backoff
+
+import (
+       "fmt"
+       "time"
+)
+
+// PermanentError signals that the operation should not be retried.
+type PermanentError struct {
+       Err error
+}
+
+// Permanent wraps the given err in a *PermanentError.
+func Permanent(err error) error {
+       if err == nil {
+               return nil
+       }
+       return &PermanentError{
+               Err: err,
+       }
+}
+
+// Error returns a string representation of the Permanent error.
+func (e *PermanentError) Error() string {
+       return e.Err.Error()
+}
+
+// Unwrap returns the wrapped error.
+func (e *PermanentError) Unwrap() error {
+       return e.Err
+}
+
+// RetryAfterError signals that the operation should be retried after the given duration.
+type RetryAfterError struct {
+       Duration time.Duration
+}
+
+// RetryAfter returns a RetryAfter error that specifies how long to wait before retrying.
+func RetryAfter(seconds int) error {
+       return &RetryAfterError{Duration: time.Duration(seconds) * time.Second}
+}
+
+// Error returns a string representation of the RetryAfter error.
+func (e *RetryAfterError) Error() string {
+       return fmt.Sprintf("retry after %s", e.Duration)
+}
diff --git a/vendor/github.com/cenkalti/backoff/v5/exponential.go b/vendor/github.com/cenkalti/backoff/v5/exponential.go
new file mode 100644 (file)
index 0000000..79d425e
--- /dev/null
@@ -0,0 +1,118 @@
+package backoff
+
+import (
+       "math/rand/v2"
+       "time"
+)
+
+/*
+ExponentialBackOff is a backoff implementation that increases the backoff
+period for each retry attempt using a randomization function that grows exponentially.
+
+NextBackOff() is calculated using the following formula:
+
+       randomized interval =
+           RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor])
+
+In other words NextBackOff() will range between the randomization factor
+percentage below and above the retry interval.
+
+For example, given the following parameters:
+
+       RetryInterval = 2
+       RandomizationFactor = 0.5
+       Multiplier = 2
+
+the actual backoff period used in the next retry attempt will range between 1 and 3 seconds,
+multiplied by the exponential, that is, between 2 and 6 seconds.
+
+Note: MaxInterval caps the RetryInterval and not the randomized interval.
+
+Example: Given the following default arguments, for 9 tries the sequence will be:
+
+       Request #  RetryInterval (seconds)  Randomized Interval (seconds)
+
+        1          0.5                     [0.25,   0.75]
+        2          0.75                    [0.375,  1.125]
+        3          1.125                   [0.562,  1.687]
+        4          1.687                   [0.8435, 2.53]
+        5          2.53                    [1.265,  3.795]
+        6          3.795                   [1.897,  5.692]
+        7          5.692                   [2.846,  8.538]
+        8          8.538                   [4.269, 12.807]
+        9         12.807                   [6.403, 19.210]
+
+Note: Implementation is not thread-safe.
+*/
+type ExponentialBackOff struct {
+       InitialInterval     time.Duration
+       RandomizationFactor float64
+       Multiplier          float64
+       MaxInterval         time.Duration
+
+       currentInterval time.Duration
+}
+
+// Default values for ExponentialBackOff.
+const (
+       DefaultInitialInterval     = 500 * time.Millisecond
+       DefaultRandomizationFactor = 0.5
+       DefaultMultiplier          = 1.5
+       DefaultMaxInterval         = 60 * time.Second
+)
+
+// NewExponentialBackOff creates an instance of ExponentialBackOff using default values.
+func NewExponentialBackOff() *ExponentialBackOff {
+       return &ExponentialBackOff{
+               InitialInterval:     DefaultInitialInterval,
+               RandomizationFactor: DefaultRandomizationFactor,
+               Multiplier:          DefaultMultiplier,
+               MaxInterval:         DefaultMaxInterval,
+       }
+}
+
+// Reset the interval back to the initial retry interval and restarts the timer.
+// Reset must be called before using b.
+func (b *ExponentialBackOff) Reset() {
+       b.currentInterval = b.InitialInterval
+}
+
+// NextBackOff calculates the next backoff interval using the formula:
+//
+//     Randomized interval = RetryInterval * (1 Â± RandomizationFactor)
+func (b *ExponentialBackOff) NextBackOff() time.Duration {
+       if b.currentInterval == 0 {
+               b.currentInterval = b.InitialInterval
+       }
+
+       next := getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval)
+       b.incrementCurrentInterval()
+       return next
+}
+
+// Increments the current interval by multiplying it with the multiplier.
+func (b *ExponentialBackOff) incrementCurrentInterval() {
+       // Check for overflow, if overflow is detected set the current interval to the max interval.
+       if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier {
+               b.currentInterval = b.MaxInterval
+       } else {
+               b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)
+       }
+}
+
+// Returns a random value from the following interval:
+//
+//     [currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval].
+func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {
+       if randomizationFactor == 0 {
+               return currentInterval // make sure no randomness is used when randomizationFactor is 0.
+       }
+       var delta = randomizationFactor * float64(currentInterval)
+       var minInterval = float64(currentInterval) - delta
+       var maxInterval = float64(currentInterval) + delta
+
+       // Get a random value from the range [minInterval, maxInterval].
+       // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then
+       // we want a 33% chance for selecting either 1, 2 or 3.
+       return time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))
+}
diff --git a/vendor/github.com/cenkalti/backoff/v5/retry.go b/vendor/github.com/cenkalti/backoff/v5/retry.go
new file mode 100644 (file)
index 0000000..32a7f98
--- /dev/null
@@ -0,0 +1,139 @@
+package backoff
+
+import (
+       "context"
+       "errors"
+       "time"
+)
+
+// DefaultMaxElapsedTime sets a default limit for the total retry duration.
+const DefaultMaxElapsedTime = 15 * time.Minute
+
+// Operation is a function that attempts an operation and may be retried.
+type Operation[T any] func() (T, error)
+
+// Notify is a function called on operation error with the error and backoff duration.
+type Notify func(error, time.Duration)
+
+// retryOptions holds configuration settings for the retry mechanism.
+type retryOptions struct {
+       BackOff        BackOff       // Strategy for calculating backoff periods.
+       Timer          timer         // Timer to manage retry delays.
+       Notify         Notify        // Optional function to notify on each retry error.
+       MaxTries       uint          // Maximum number of retry attempts.
+       MaxElapsedTime time.Duration // Maximum total time for all retries.
+}
+
+type RetryOption func(*retryOptions)
+
+// WithBackOff configures a custom backoff strategy.
+func WithBackOff(b BackOff) RetryOption {
+       return func(args *retryOptions) {
+               args.BackOff = b
+       }
+}
+
+// withTimer sets a custom timer for managing delays between retries.
+func withTimer(t timer) RetryOption {
+       return func(args *retryOptions) {
+               args.Timer = t
+       }
+}
+
+// WithNotify sets a notification function to handle retry errors.
+func WithNotify(n Notify) RetryOption {
+       return func(args *retryOptions) {
+               args.Notify = n
+       }
+}
+
+// WithMaxTries limits the number of all attempts.
+func WithMaxTries(n uint) RetryOption {
+       return func(args *retryOptions) {
+               args.MaxTries = n
+       }
+}
+
+// WithMaxElapsedTime limits the total duration for retry attempts.
+func WithMaxElapsedTime(d time.Duration) RetryOption {
+       return func(args *retryOptions) {
+               args.MaxElapsedTime = d
+       }
+}
+
+// Retry attempts the operation until success, a permanent error, or backoff completion.
+// It ensures the operation is executed at least once.
+//
+// Returns the operation result or error if retries are exhausted or context is cancelled.
+func Retry[T any](ctx context.Context, operation Operation[T], opts ...RetryOption) (T, error) {
+       // Initialize default retry options.
+       args := &retryOptions{
+               BackOff:        NewExponentialBackOff(),
+               Timer:          &defaultTimer{},
+               MaxElapsedTime: DefaultMaxElapsedTime,
+       }
+
+       // Apply user-provided options to the default settings.
+       for _, opt := range opts {
+               opt(args)
+       }
+
+       defer args.Timer.Stop()
+
+       startedAt := time.Now()
+       args.BackOff.Reset()
+       for numTries := uint(1); ; numTries++ {
+               // Execute the operation.
+               res, err := operation()
+               if err == nil {
+                       return res, nil
+               }
+
+               // Stop retrying if maximum tries exceeded.
+               if args.MaxTries > 0 && numTries >= args.MaxTries {
+                       return res, err
+               }
+
+               // Handle permanent errors without retrying.
+               var permanent *PermanentError
+               if errors.As(err, &permanent) {
+                       return res, permanent.Unwrap()
+               }
+
+               // Stop retrying if context is cancelled.
+               if cerr := context.Cause(ctx); cerr != nil {
+                       return res, cerr
+               }
+
+               // Calculate next backoff duration.
+               next := args.BackOff.NextBackOff()
+               if next == Stop {
+                       return res, err
+               }
+
+               // Reset backoff if RetryAfterError is encountered.
+               var retryAfter *RetryAfterError
+               if errors.As(err, &retryAfter) {
+                       next = retryAfter.Duration
+                       args.BackOff.Reset()
+               }
+
+               // Stop retrying if maximum elapsed time exceeded.
+               if args.MaxElapsedTime > 0 && time.Since(startedAt)+next > args.MaxElapsedTime {
+                       return res, err
+               }
+
+               // Notify on error if a notifier function is provided.
+               if args.Notify != nil {
+                       args.Notify(err, next)
+               }
+
+               // Wait for the next backoff period or context cancellation.
+               args.Timer.Start(next)
+               select {
+               case <-args.Timer.C():
+               case <-ctx.Done():
+                       return res, context.Cause(ctx)
+               }
+       }
+}
diff --git a/vendor/github.com/cenkalti/backoff/v5/ticker.go b/vendor/github.com/cenkalti/backoff/v5/ticker.go
new file mode 100644 (file)
index 0000000..f0d4b2a
--- /dev/null
@@ -0,0 +1,83 @@
+package backoff
+
+import (
+       "sync"
+       "time"
+)
+
+// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff.
+//
+// Ticks will continue to arrive when the previous operation is still running,
+// so operations that take a while to fail could run in quick succession.
+type Ticker struct {
+       C        <-chan time.Time
+       c        chan time.Time
+       b        BackOff
+       timer    timer
+       stop     chan struct{}
+       stopOnce sync.Once
+}
+
+// NewTicker returns a new Ticker containing a channel that will send
+// the time at times specified by the BackOff argument. Ticker is
+// guaranteed to tick at least once.  The channel is closed when Stop
+// method is called or BackOff stops. It is not safe to manipulate the
+// provided backoff policy (notably calling NextBackOff or Reset)
+// while the ticker is running.
+func NewTicker(b BackOff) *Ticker {
+       c := make(chan time.Time)
+       t := &Ticker{
+               C:     c,
+               c:     c,
+               b:     b,
+               timer: &defaultTimer{},
+               stop:  make(chan struct{}),
+       }
+       t.b.Reset()
+       go t.run()
+       return t
+}
+
+// Stop turns off a ticker. After Stop, no more ticks will be sent.
+func (t *Ticker) Stop() {
+       t.stopOnce.Do(func() { close(t.stop) })
+}
+
+func (t *Ticker) run() {
+       c := t.c
+       defer close(c)
+
+       // Ticker is guaranteed to tick at least once.
+       afterC := t.send(time.Now())
+
+       for {
+               if afterC == nil {
+                       return
+               }
+
+               select {
+               case tick := <-afterC:
+                       afterC = t.send(tick)
+               case <-t.stop:
+                       t.c = nil // Prevent future ticks from being sent to the channel.
+                       return
+               }
+       }
+}
+
+func (t *Ticker) send(tick time.Time) <-chan time.Time {
+       select {
+       case t.c <- tick:
+       case <-t.stop:
+               return nil
+       }
+
+       next := t.b.NextBackOff()
+       if next == Stop {
+               t.Stop()
+               return nil
+       }
+
+       t.timer.Start(next)
+       return t.timer.C()
+}
diff --git a/vendor/github.com/cenkalti/backoff/v5/timer.go b/vendor/github.com/cenkalti/backoff/v5/timer.go
new file mode 100644 (file)
index 0000000..a895309
--- /dev/null
@@ -0,0 +1,35 @@
+package backoff
+
+import "time"
+
+type timer interface {
+       Start(duration time.Duration)
+       Stop()
+       C() <-chan time.Time
+}
+
+// defaultTimer implements Timer interface using time.Timer
+type defaultTimer struct {
+       timer *time.Timer
+}
+
+// C returns the timers channel which receives the current time when the timer fires.
+func (t *defaultTimer) C() <-chan time.Time {
+       return t.timer.C
+}
+
+// Start starts the timer to fire after the given duration
+func (t *defaultTimer) Start(duration time.Duration) {
+       if t.timer == nil {
+               t.timer = time.NewTimer(duration)
+       } else {
+               t.timer.Reset(duration)
+       }
+}
+
+// Stop is called when the timer is not used anymore and resources may be freed.
+func (t *defaultTimer) Stop() {
+       if t.timer != nil {
+               t.timer.Stop()
+       }
+}
index 41cd4f5030e4f9dd7580dd08ae712c016cc04298..bbe7decf09bc61c5b2166c9ef3be4754d5df8913 100644 (file)
@@ -148,22 +148,20 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh
        }
 
        md, ok := ServerMetadataFromContext(ctx)
-       if !ok {
-               grpclog.Error("Failed to extract ServerMetadata from context")
-       }
-
-       handleForwardResponseServerMetadata(w, mux, md)
-
-       // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2
-       // Unless the request includes a TE header field indicating "trailers"
-       // is acceptable, as described in Section 4.3, a server SHOULD NOT
-       // generate trailer fields that it believes are necessary for the user
-       // agent to receive.
-       doForwardTrailers := requestAcceptsTrailers(r)
-
-       if doForwardTrailers {
-               handleForwardResponseTrailerHeader(w, mux, md)
-               w.Header().Set("Transfer-Encoding", "chunked")
+       if ok {
+               handleForwardResponseServerMetadata(w, mux, md)
+
+               // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2
+               // Unless the request includes a TE header field indicating "trailers"
+               // is acceptable, as described in Section 4.3, a server SHOULD NOT
+               // generate trailer fields that it believes are necessary for the user
+               // agent to receive.
+               doForwardTrailers := requestAcceptsTrailers(r)
+
+               if doForwardTrailers {
+                       handleForwardResponseTrailerHeader(w, mux, md)
+                       w.Header().Set("Transfer-Encoding", "chunked")
+               }
        }
 
        st := HTTPStatusFromCode(s.Code())
@@ -176,7 +174,7 @@ func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marsh
                grpclog.Errorf("Failed to write response: %v", err)
        }
 
-       if doForwardTrailers {
+       if ok && requestAcceptsTrailers(r) {
                handleForwardResponseTrailer(w, mux, md)
        }
 }
index f0727cf7c06c8fac6089f427f071e36f1dd74557..2f0b9e9e0f8691d89d455222e8025a89044460f6 100644 (file)
@@ -153,12 +153,10 @@ type responseBody interface {
 // ForwardResponseMessage forwards the message "resp" from gRPC server to REST client.
 func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message) error) {
        md, ok := ServerMetadataFromContext(ctx)
-       if !ok {
-               grpclog.Error("Failed to extract ServerMetadata from context")
+       if ok {
+               handleForwardResponseServerMetadata(w, mux, md)
        }
 
-       handleForwardResponseServerMetadata(w, mux, md)
-
        // RFC 7230 https://tools.ietf.org/html/rfc7230#section-4.1.2
        // Unless the request includes a TE header field indicating "trailers"
        // is acceptable, as described in Section 4.3, a server SHOULD NOT
@@ -166,7 +164,7 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha
        // agent to receive.
        doForwardTrailers := requestAcceptsTrailers(req)
 
-       if doForwardTrailers {
+       if ok && doForwardTrailers {
                handleForwardResponseTrailerHeader(w, mux, md)
                w.Header().Set("Transfer-Encoding", "chunked")
        }
@@ -204,7 +202,7 @@ func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marsha
                grpclog.Errorf("Failed to write response: %v", err)
        }
 
-       if doForwardTrailers {
+       if ok && doForwardTrailers {
                handleForwardResponseTrailer(w, mux, md)
        }
 }
index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..f1aee0f11001cd9276c67fd2a998cb54f378d461 100644 (file)
    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.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+   * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+   * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+   * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
index 3f0a518ae0f2bef4c61107ff817db21688a92d8e..30446bd28b64f9e2e267ab74900428c5a75ed248 100644 (file)
@@ -94,7 +94,7 @@ func NewUnstarted(client Client) *Exporter {
 }
 
 // MarshalLog is the marshaling function used by the logging system to represent this Exporter.
-func (e *Exporter) MarshalLog() interface{} {
+func (e *Exporter) MarshalLog() any {
        return struct {
                Type   string
                Client Client
index 4571a5ca3978d652903fff941668361082af8b1a..d9bfd6e1765b9cf9169a133e02d37610ef43874b 100644 (file)
@@ -1,12 +1,15 @@
 // Copyright The OpenTelemetry Authors
 // SPDX-License-Identifier: Apache-2.0
 
+// Package tracetransform provides conversion functionality for the otlptrace
+// exporters.
 package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
 
 import (
+       commonpb "go.opentelemetry.io/proto/otlp/common/v1"
+
        "go.opentelemetry.io/otel/attribute"
        "go.opentelemetry.io/otel/sdk/resource"
-       commonpb "go.opentelemetry.io/proto/otlp/common/v1"
 )
 
 // KeyValues transforms a slice of attribute KeyValues into OTLP key-values.
index 2e7690e43a24ade65b4903f84063dbeb53283821..43359c8944965ead76c5694a2b363c679013a021 100644 (file)
@@ -4,8 +4,9 @@
 package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
 
 import (
-       "go.opentelemetry.io/otel/sdk/instrumentation"
        commonpb "go.opentelemetry.io/proto/otlp/common/v1"
+
+       "go.opentelemetry.io/otel/sdk/instrumentation"
 )
 
 func InstrumentationScope(il instrumentation.Scope) *commonpb.InstrumentationScope {
index db7b698a566ce7813d1cca52848c9ba47f574409..526bb5e070b567a668ffcd9d69fc5162769df662 100644 (file)
@@ -4,8 +4,9 @@
 package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
 
 import (
-       "go.opentelemetry.io/otel/sdk/resource"
        resourcepb "go.opentelemetry.io/proto/otlp/resource/v1"
+
+       "go.opentelemetry.io/otel/sdk/resource"
 )
 
 // Resource transforms a Resource into an OTLP Resource.
index bf27ef0220e7d389d2ea353e269d0ab70d8ddbce..379bc8170df70a6b13fa40f150748bc43edd8145 100644 (file)
@@ -6,12 +6,13 @@ package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptr
 import (
        "math"
 
+       tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
+
        "go.opentelemetry.io/otel/attribute"
        "go.opentelemetry.io/otel/codes"
        "go.opentelemetry.io/otel/sdk/instrumentation"
        tracesdk "go.opentelemetry.io/otel/sdk/trace"
        "go.opentelemetry.io/otel/trace"
-       tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
 )
 
 // Spans transforms a slice of OpenTelemetry spans into a slice of OTLP
@@ -154,7 +155,6 @@ func links(links []tracesdk.Link) []*tracepb.Span_Link {
        for _, otLink := range links {
                // This redefinition is necessary to prevent otLink.*ID[:] copies
                // being reused -- in short we need a new otLink per iteration.
-               otLink := otLink
 
                tid := otLink.SpanContext.TraceID()
                sid := otLink.SpanContext.SpanID()
@@ -189,7 +189,7 @@ func spanEvents(es []tracesdk.Event) []*tracepb.Span_Event {
 
        events := make([]*tracepb.Span_Event, len(es))
        // Transform message events
-       for i := 0; i < len(es); i++ {
+       for i := range es {
                events[i] = &tracepb.Span_Event{
                        Name:                   es[i].Name,
                        TimeUnixNano:           uint64(max(0, es[i].Time.UnixNano())), // nolint:gosec // Overflow checked.
index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..f1aee0f11001cd9276c67fd2a998cb54f378d461 100644 (file)
    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.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+   * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+   * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+   * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
index 8409b5f8f95c6962a1998261e8dc4075e4122a68..4b4cc76f4a9edb4993b92c6a4d7de0af08ae8b95 100644 (file)
@@ -9,6 +9,8 @@ import (
        "sync"
        "time"
 
+       coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1"
+       tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
        "google.golang.org/genproto/googleapis/rpc/errdetails"
        "google.golang.org/grpc"
        "google.golang.org/grpc/codes"
@@ -20,8 +22,6 @@ import (
        "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"
        "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
        "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry"
-       coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1"
-       tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
 )
 
 type client struct {
@@ -223,7 +223,7 @@ func (c *client) exportContext(parent context.Context) (context.Context, context
        )
 
        if c.exportTimeout > 0 {
-               ctx, cancel = context.WithTimeout(parent, c.exportTimeout)
+               ctx, cancel = context.WithTimeoutCause(parent, c.exportTimeout, errors.New("exporter export timeout"))
        } else {
                ctx, cancel = context.WithCancel(parent)
        }
@@ -289,7 +289,7 @@ func throttleDelay(s *status.Status) (bool, time.Duration) {
 }
 
 // MarshalLog is the marshaling function used by the logging system to represent this Client.
-func (c *client) MarshalLog() interface{} {
+func (c *client) MarshalLog() any {
        return struct {
                Type     string
                Endpoint string
index 4abf48d1f622df98af71caeb03905d9d3016e46b..6eacdf311d28b392d8002a028bdb9e0d44aaee9e 100644 (file)
@@ -1,9 +1,11 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/envconfig/envconfig.go.tmpl
 
 // Copyright The OpenTelemetry Authors
 // SPDX-License-Identifier: Apache-2.0
 
+// Package envconfig provides functionality to parse configuration from
+// environment variables.
 package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig"
 
 import (
index 97cd6c54f709d6164497b7795747e81d89887068..b6e6b10fbf15f64a9f421006c8d4d1c594869f5e 100644 (file)
@@ -1,6 +1,7 @@
 // Copyright The OpenTelemetry Authors
 // SPDX-License-Identifier: Apache-2.0
 
+// Package internal provides internal functionally for the otlptracegrpc package.
 package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"
 
 //go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go
index 7bb189a94bca5956c6045a769a085899b28f216a..1d840be205b7e9b5ec2819feaa1db1b8cd8d838f 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl
 
 // Copyright The OpenTelemetry Authors
@@ -77,8 +77,16 @@ func getOptionsFromEnv() []GenericOption {
                }),
                envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
                envconfig.WithCertPool("TRACES_CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
-               envconfig.WithClientCert("CLIENT_CERTIFICATE", "CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
-               envconfig.WithClientCert("TRACES_CLIENT_CERTIFICATE", "TRACES_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
+               envconfig.WithClientCert(
+                       "CLIENT_CERTIFICATE",
+                       "CLIENT_KEY",
+                       func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
+               ),
+               envconfig.WithClientCert(
+                       "TRACES_CLIENT_CERTIFICATE",
+                       "TRACES_CLIENT_KEY",
+                       func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
+               ),
                withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }),
                envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
                envconfig.WithBool("TRACES_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
index 0a317d92637d97d7d5cb41edf49ca48ce307e25e..4f47117a58a48a3fef871697dcd82472e6735727 100644 (file)
@@ -1,9 +1,10 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl
 
 // Copyright The OpenTelemetry Authors
 // SPDX-License-Identifier: Apache-2.0
 
+// Package otlpconfig provides configuration for the otlptrace exporters.
 package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
 
 import (
@@ -52,7 +53,9 @@ type (
                // gRPC configurations
                GRPCCredentials credentials.TransportCredentials
 
-               Proxy HTTPTransportProxyFunc
+               // HTTP configurations
+               Proxy      HTTPTransportProxyFunc
+               HTTPClient *http.Client
        }
 
        Config struct {
@@ -89,12 +92,11 @@ func NewHTTPConfig(opts ...HTTPOption) Config {
        return cfg
 }
 
-// cleanPath returns a path with all spaces trimmed and all redundancies
-// removed. If urlPath is empty or cleaning it results in an empty string,
+// cleanPath returns a path with all spaces trimmed. If urlPath is empty,
 // defaultPath is returned instead.
 func cleanPath(urlPath string, defaultPath string) string {
-       tmp := path.Clean(strings.TrimSpace(urlPath))
-       if tmp == "." {
+       tmp := strings.TrimSpace(urlPath)
+       if tmp == "" || tmp == "." {
                return defaultPath
        }
        if !path.IsAbs(tmp) {
@@ -349,3 +351,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
                return cfg
        })
 }
+
+func WithHTTPClient(c *http.Client) GenericOption {
+       return newGenericOption(func(cfg Config) Config {
+               cfg.Traces.HTTPClient = c
+               return cfg
+       })
+}
index 3d4f699d477821a2cc802756acc5c8cb43cfa9ba..91849038722e5c8b31a87c8b7637f5bd817f1eec 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl
 
 // Copyright The OpenTelemetry Authors
index 38b97a0131347aaf94df8a27ce83115cd3299e49..ba6e411835f48c3026a79a4684ca93790a20e8ec 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl
 
 // Copyright The OpenTelemetry Authors
index a12ea4c48eb0d93ce73a97cc1bce5e9254a852de..1c4659423361d79340dab89cb472cfcda9564dcd 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/partialsuccess.go
 
 // Copyright The OpenTelemetry Authors
index 1c5450ab62d938fbe8110c5205bde17c6c11afb2..259a898ae771560fbb54cf376b93854a443dbde6 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/retry/retry.go.tmpl
 
 // Copyright The OpenTelemetry Authors
@@ -14,7 +14,7 @@ import (
        "fmt"
        "time"
 
-       "github.com/cenkalti/backoff/v4"
+       "github.com/cenkalti/backoff/v5"
 )
 
 // DefaultConfig are the recommended defaults to use.
@@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
                        RandomizationFactor: backoff.DefaultRandomizationFactor,
                        Multiplier:          backoff.DefaultMultiplier,
                        MaxInterval:         c.MaxInterval,
-                       MaxElapsedTime:      c.MaxElapsedTime,
-                       Stop:                backoff.Stop,
-                       Clock:               backoff.SystemClock,
                }
                b.Reset()
 
+               maxElapsedTime := c.MaxElapsedTime
+               startTime := time.Now()
+
                for {
                        err := fn(ctx)
                        if err == nil {
@@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
                                return err
                        }
 
-                       bOff := b.NextBackOff()
-                       if bOff == backoff.Stop {
+                       if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
                                return fmt.Errorf("max retry time elapsed: %w", err)
                        }
 
                        // Wait for the greater of the backoff or throttle delay.
-                       var delay time.Duration
-                       if bOff > throttle {
-                               delay = bOff
-                       } else {
-                               elapsed := b.GetElapsedTime()
-                               if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
-                                       return fmt.Errorf("max retry time would elapse: %w", err)
-                               }
-                               delay = throttle
+                       bOff := b.NextBackOff()
+                       delay := max(throttle, bOff)
+
+                       elapsed := time.Since(startTime)
+                       if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
+                               return fmt.Errorf("max retry time would elapse: %w", err)
                        }
 
                        if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
@@ -136,7 +132,7 @@ func wait(ctx context.Context, delay time.Duration) error {
                select {
                case <-timer.C:
                default:
-                       return ctx.Err()
+                       return context.Cause(ctx)
                }
        case <-timer.C:
        }
index 00ab1f20c6d4cbca466449d67f15580a1abf0c04..2da2298701b2970658ea2c4d69bd3b6d2ccce4b5 100644 (file)
@@ -199,8 +199,9 @@ func WithTimeout(duration time.Duration) Option {
 // explicitly returns a backoff time in the response. That time will take
 // precedence over these settings.
 //
-// These settings do not define any network retry strategy. That is entirely
-// handled by the gRPC ClientConn.
+// These settings define the retry strategy implemented by the exporter.
+// These settings do not define any network retry strategy.
+// That is handled by the gRPC ClientConn.
 //
 // If unset, the default retry policy will be used. It will retry the export
 // 5 seconds after receiving a retryable error and increase exponentially
index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..f1aee0f11001cd9276c67fd2a998cb54f378d461 100644 (file)
    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.
+
+--------------------------------------------------------------------------------
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+   * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+   * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+   * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
index 16c006b2cfddf128eceb82f855305bd9d53fbcab..c7b1a55149853b29c3e6ad7ec0f9ebe7c27466de 100644 (file)
@@ -18,6 +18,8 @@ import (
        "sync"
        "time"
 
+       coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1"
+       tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
        "google.golang.org/protobuf/proto"
 
        "go.opentelemetry.io/otel"
@@ -25,14 +27,12 @@ import (
        "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal"
        "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig"
        "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry"
-       coltracepb "go.opentelemetry.io/proto/otlp/collector/trace/v1"
-       tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
 )
 
 const contentTypeProto = "application/x-protobuf"
 
 var gzPool = sync.Pool{
-       New: func() interface{} {
+       New: func() any {
                w := gzip.NewWriter(io.Discard)
                return w
        },
@@ -71,20 +71,24 @@ var _ otlptrace.Client = (*client)(nil)
 func NewClient(opts ...Option) otlptrace.Client {
        cfg := otlpconfig.NewHTTPConfig(asHTTPOptions(opts)...)
 
-       httpClient := &http.Client{
-               Transport: ourTransport,
-               Timeout:   cfg.Traces.Timeout,
-       }
-
-       if cfg.Traces.TLSCfg != nil || cfg.Traces.Proxy != nil {
-               clonedTransport := ourTransport.Clone()
-               httpClient.Transport = clonedTransport
+       httpClient := cfg.Traces.HTTPClient
 
-               if cfg.Traces.TLSCfg != nil {
-                       clonedTransport.TLSClientConfig = cfg.Traces.TLSCfg
+       if httpClient == nil {
+               httpClient = &http.Client{
+                       Transport: ourTransport,
+                       Timeout:   cfg.Traces.Timeout,
                }
-               if cfg.Traces.Proxy != nil {
-                       clonedTransport.Proxy = cfg.Traces.Proxy
+
+               if cfg.Traces.TLSCfg != nil || cfg.Traces.Proxy != nil {
+                       clonedTransport := ourTransport.Clone()
+                       httpClient.Transport = clonedTransport
+
+                       if cfg.Traces.TLSCfg != nil {
+                               clonedTransport.TLSClientConfig = cfg.Traces.TLSCfg
+                       }
+                       if cfg.Traces.Proxy != nil {
+                               clonedTransport.Proxy = cfg.Traces.Proxy
+                       }
                }
        }
 
@@ -100,7 +104,7 @@ func NewClient(opts ...Option) otlptrace.Client {
 }
 
 // Start does nothing in a HTTP client.
-func (*client) Start(ctx context.Context) error {
+func (*client) Start(ctx context.Context) error {
        // nothing to do
        select {
        case <-ctx.Done():
@@ -205,7 +209,7 @@ func (d *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc
                        return err
                }
                respStr := strings.TrimSpace(respData.String())
-               if len(respStr) == 0 {
+               if respStr == "" {
                        respStr = "(empty)"
                }
                bodyErr := fmt.Errorf("body: %s", respStr)
@@ -226,7 +230,7 @@ func (d *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc
 
 func (d *client) newRequest(body []byte) (request, error) {
        u := url.URL{Scheme: d.getScheme(), Host: d.cfg.Endpoint, Path: d.cfg.URLPath}
-       r, err := http.NewRequest(http.MethodPost, u.String(), nil)
+       r, err := http.NewRequest(http.MethodPost, u.String(), http.NoBody)
        if err != nil {
                return request{Request: r}, err
        }
@@ -242,7 +246,7 @@ func (d *client) newRequest(body []byte) (request, error) {
        req := request{Request: r}
        switch Compression(d.cfg.Compression) {
        case NoCompression:
-               r.ContentLength = (int64)(len(body))
+               r.ContentLength = int64(len(body))
                req.bodyReader = bodyReader(body)
        case GzipCompression:
                // Ensure the content length is not used.
@@ -270,7 +274,7 @@ func (d *client) newRequest(body []byte) (request, error) {
 }
 
 // MarshalLog is the marshaling function used by the logging system to represent this Client.
-func (d *client) MarshalLog() interface{} {
+func (d *client) MarshalLog() any {
        return struct {
                Type     string
                Endpoint string
@@ -300,7 +304,7 @@ type request struct {
 // reset reinitializes the request Body and uses ctx for the request.
 func (r *request) reset(ctx context.Context) {
        r.Body = r.bodyReader()
-       r.Request = r.Request.WithContext(ctx)
+       r.Request = r.WithContext(ctx)
 }
 
 // retryableError represents a request failure that can be retried.
@@ -336,7 +340,7 @@ func (e retryableError) Unwrap() error {
        return e.err
 }
 
-func (e retryableError) As(target interface{}) bool {
+func (e retryableError) As(target any) bool {
        if e.err == nil {
                return false
        }
index f30bb66aeda39292498fba0e8e653eb50e8b6f32..f4385fb4e9eaf475c0305da737da7e9a1f419c3b 100644 (file)
@@ -1,9 +1,11 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/envconfig/envconfig.go.tmpl
 
 // Copyright The OpenTelemetry Authors
 // SPDX-License-Identifier: Apache-2.0
 
+// Package envconfig provides functionality to parse configuration from
+// environment variables.
 package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig"
 
 import (
index e4142b9d7c577dc56b5ae41948bc385f8ca36259..3d344dc85eedd88aebf41ef1f24566f56a1c721a 100644 (file)
@@ -1,6 +1,7 @@
 // Copyright The OpenTelemetry Authors
 // SPDX-License-Identifier: Apache-2.0
 
+// Package internal provides internal functionally for the otlptracehttp package.
 package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal"
 
 //go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go
index ff4141b6dc82c93ff48f11f849ece5f3c4a7e63e..121b02f5cd324e1bbd9988e7539f072a925440ac 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl
 
 // Copyright The OpenTelemetry Authors
@@ -77,8 +77,16 @@ func getOptionsFromEnv() []GenericOption {
                }),
                envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
                envconfig.WithCertPool("TRACES_CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
-               envconfig.WithClientCert("CLIENT_CERTIFICATE", "CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
-               envconfig.WithClientCert("TRACES_CLIENT_CERTIFICATE", "TRACES_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
+               envconfig.WithClientCert(
+                       "CLIENT_CERTIFICATE",
+                       "CLIENT_KEY",
+                       func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
+               ),
+               envconfig.WithClientCert(
+                       "TRACES_CLIENT_CERTIFICATE",
+                       "TRACES_CLIENT_KEY",
+                       func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
+               ),
                withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }),
                envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
                envconfig.WithBool("TRACES_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
index 6a9c4d3a6521887efaac5fbf3e8790d922a659d0..e415feea6ebf3ff2c7c0d096e686b6dbc10da71f 100644 (file)
@@ -1,9 +1,10 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl
 
 // Copyright The OpenTelemetry Authors
 // SPDX-License-Identifier: Apache-2.0
 
+// Package otlpconfig provides configuration for the otlptrace exporters.
 package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig"
 
 import (
@@ -52,7 +53,9 @@ type (
                // gRPC configurations
                GRPCCredentials credentials.TransportCredentials
 
-               Proxy HTTPTransportProxyFunc
+               // HTTP configurations
+               Proxy      HTTPTransportProxyFunc
+               HTTPClient *http.Client
        }
 
        Config struct {
@@ -89,12 +92,11 @@ func NewHTTPConfig(opts ...HTTPOption) Config {
        return cfg
 }
 
-// cleanPath returns a path with all spaces trimmed and all redundancies
-// removed. If urlPath is empty or cleaning it results in an empty string,
+// cleanPath returns a path with all spaces trimmed. If urlPath is empty,
 // defaultPath is returned instead.
 func cleanPath(urlPath string, defaultPath string) string {
-       tmp := path.Clean(strings.TrimSpace(urlPath))
-       if tmp == "." {
+       tmp := strings.TrimSpace(urlPath)
+       if tmp == "" || tmp == "." {
                return defaultPath
        }
        if !path.IsAbs(tmp) {
@@ -349,3 +351,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
                return cfg
        })
 }
+
+func WithHTTPClient(c *http.Client) GenericOption {
+       return newGenericOption(func(cfg Config) Config {
+               cfg.Traces.HTTPClient = c
+               return cfg
+       })
+}
index bc4db059524e717589d5f5ed2d357eec02115348..6a52b58cc0b70b4e3e54dca1d564262bd8992d9f 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl
 
 // Copyright The OpenTelemetry Authors
index dd6f12b220ba00f5f2bc484c63b4c0610b86e133..5b389cb03fa393b74cf77df13c4a4edd1f256ce2 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl
 
 // Copyright The OpenTelemetry Authors
index 9e04a9bc19696426a6fefb12113fe1bebc986a89..418e66428ae44528233e4330abde8b9da9ca1f45 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/partialsuccess.go
 
 // Copyright The OpenTelemetry Authors
index 86c4819f4491a734f1ade6b56271e83815660593..107428fa6cf87aae3dbefddfb326c68dc074a77e 100644 (file)
@@ -1,4 +1,4 @@
-// Code created by gotmpl. DO NOT MODIFY.
+// Code generated by gotmpl. DO NOT MODIFY.
 // source: internal/shared/otlp/retry/retry.go.tmpl
 
 // Copyright The OpenTelemetry Authors
@@ -14,7 +14,7 @@ import (
        "fmt"
        "time"
 
-       "github.com/cenkalti/backoff/v4"
+       "github.com/cenkalti/backoff/v5"
 )
 
 // DefaultConfig are the recommended defaults to use.
@@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
                        RandomizationFactor: backoff.DefaultRandomizationFactor,
                        Multiplier:          backoff.DefaultMultiplier,
                        MaxInterval:         c.MaxInterval,
-                       MaxElapsedTime:      c.MaxElapsedTime,
-                       Stop:                backoff.Stop,
-                       Clock:               backoff.SystemClock,
                }
                b.Reset()
 
+               maxElapsedTime := c.MaxElapsedTime
+               startTime := time.Now()
+
                for {
                        err := fn(ctx)
                        if err == nil {
@@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
                                return err
                        }
 
-                       bOff := b.NextBackOff()
-                       if bOff == backoff.Stop {
+                       if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
                                return fmt.Errorf("max retry time elapsed: %w", err)
                        }
 
                        // Wait for the greater of the backoff or throttle delay.
-                       var delay time.Duration
-                       if bOff > throttle {
-                               delay = bOff
-                       } else {
-                               elapsed := b.GetElapsedTime()
-                               if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
-                                       return fmt.Errorf("max retry time would elapse: %w", err)
-                               }
-                               delay = throttle
+                       bOff := b.NextBackOff()
+                       delay := max(throttle, bOff)
+
+                       elapsed := time.Since(startTime)
+                       if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
+                               return fmt.Errorf("max retry time would elapse: %w", err)
                        }
 
                        if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
@@ -136,7 +132,7 @@ func wait(ctx context.Context, delay time.Duration) error {
                select {
                case <-timer.C:
                default:
-                       return ctx.Err()
+                       return context.Cause(ctx)
                }
        case <-timer.C:
        }
index 3559c5664f4e58674b163a2a57015cbca35d69d3..cfe21dbfb05affd0c45d5eb6f4ca031096692d9d 100644 (file)
@@ -153,3 +153,19 @@ func WithRetry(rc RetryConfig) Option {
 func WithProxy(pf HTTPTransportProxyFunc) Option {
        return wrappedOption{otlpconfig.WithProxy(otlpconfig.HTTPTransportProxyFunc(pf))}
 }
+
+// WithHTTPClient sets the HTTP client to used by the exporter.
+//
+// This option will take precedence over [WithProxy], [WithTimeout],
+// [WithTLSClientConfig] options as well as OTEL_EXPORTER_OTLP_CERTIFICATE,
+// OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE, OTEL_EXPORTER_OTLP_TIMEOUT,
+// OTEL_EXPORTER_OTLP_TRACES_TIMEOUT environment variables.
+//
+// Timeout and all other fields of the passed [http.Client] are left intact.
+//
+// Be aware that passing an HTTP client with transport like
+// [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewTransport] can
+// cause the client to be instrumented twice and cause infinite recursion.
+func WithHTTPClient(c *http.Client) Option {
+       return wrappedOption{otlpconfig.WithHTTPClient(c)}
+}
index f5cad46b74d0d1da42e92f011f4d379fcd7e7ed4..3b79c1a0b5c788e085c3dd202c37a47c8239b274 100644 (file)
@@ -5,5 +5,5 @@ package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
 
 // Version is the current release version of the OpenTelemetry OTLP trace exporter in use.
 func Version() string {
-       return "1.35.0"
+       return "1.38.0"
 }
index dd1b73f1e99797d2c523d7f67305a25b64cda335..892864ea6295589f039fa0e9c7acf8bb1b2ec0a3 100644 (file)
@@ -22,8 +22,6 @@ const _ = grpc.SupportPackageIsVersion7
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
 type TraceServiceClient interface {
-       // For performance reasons, it is recommended to keep this RPC
-       // alive for the entire life of the application.
        Export(ctx context.Context, in *ExportTraceServiceRequest, opts ...grpc.CallOption) (*ExportTraceServiceResponse, error)
 }
 
@@ -48,8 +46,6 @@ func (c *traceServiceClient) Export(ctx context.Context, in *ExportTraceServiceR
 // All implementations must embed UnimplementedTraceServiceServer
 // for forward compatibility
 type TraceServiceServer interface {
-       // For performance reasons, it is recommended to keep this RPC
-       // alive for the entire life of the application.
        Export(context.Context, *ExportTraceServiceRequest) (*ExportTraceServiceResponse, error)
        mustEmbedUnimplementedTraceServiceServer()
 }
index 852209b097bd123506023ee622b3efefbd3f00f1..a7c5d19bff386491daae5cbcb673aa3cac63a57e 100644 (file)
@@ -430,6 +430,101 @@ func (x *InstrumentationScope) GetDroppedAttributesCount() uint32 {
        return 0
 }
 
+// A reference to an Entity.
+// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs.
+//
+// Status: [Development]
+type EntityRef struct {
+       state         protoimpl.MessageState
+       sizeCache     protoimpl.SizeCache
+       unknownFields protoimpl.UnknownFields
+
+       // The Schema URL, if known. This is the identifier of the Schema that the entity data
+       // is recorded in. To learn more about Schema URL see
+       // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
+       //
+       // This schema_url applies to the data in this message and to the Resource attributes
+       // referenced by id_keys and description_keys.
+       // TODO: discuss if we are happy with this somewhat complicated definition of what
+       // the schema_url applies to.
+       //
+       // This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
+       SchemaUrl string `protobuf:"bytes,1,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"`
+       // Defines the type of the entity. MUST not change during the lifetime of the entity.
+       // For example: "service" or "host". This field is required and MUST not be empty
+       // for valid entities.
+       Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
+       // Attribute Keys that identify the entity.
+       // MUST not change during the lifetime of the entity. The Id must contain at least one attribute.
+       // These keys MUST exist in the containing {message}.attributes.
+       IdKeys []string `protobuf:"bytes,3,rep,name=id_keys,json=idKeys,proto3" json:"id_keys,omitempty"`
+       // Descriptive (non-identifying) attribute keys of the entity.
+       // MAY change over the lifetime of the entity. MAY be empty.
+       // These attribute keys are not part of entity's identity.
+       // These keys MUST exist in the containing {message}.attributes.
+       DescriptionKeys []string `protobuf:"bytes,4,rep,name=description_keys,json=descriptionKeys,proto3" json:"description_keys,omitempty"`
+}
+
+func (x *EntityRef) Reset() {
+       *x = EntityRef{}
+       if protoimpl.UnsafeEnabled {
+               mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5]
+               ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+               ms.StoreMessageInfo(mi)
+       }
+}
+
+func (x *EntityRef) String() string {
+       return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntityRef) ProtoMessage() {}
+
+func (x *EntityRef) ProtoReflect() protoreflect.Message {
+       mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5]
+       if protoimpl.UnsafeEnabled && x != nil {
+               ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+               if ms.LoadMessageInfo() == nil {
+                       ms.StoreMessageInfo(mi)
+               }
+               return ms
+       }
+       return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntityRef.ProtoReflect.Descriptor instead.
+func (*EntityRef) Descriptor() ([]byte, []int) {
+       return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *EntityRef) GetSchemaUrl() string {
+       if x != nil {
+               return x.SchemaUrl
+       }
+       return ""
+}
+
+func (x *EntityRef) GetType() string {
+       if x != nil {
+               return x.Type
+       }
+       return ""
+}
+
+func (x *EntityRef) GetIdKeys() []string {
+       if x != nil {
+               return x.IdKeys
+       }
+       return nil
+}
+
+func (x *EntityRef) GetDescriptionKeys() []string {
+       if x != nil {
+               return x.DescriptionKeys
+       }
+       return nil
+}
+
 var File_opentelemetry_proto_common_v1_common_proto protoreflect.FileDescriptor
 
 var file_opentelemetry_proto_common_v1_common_proto_rawDesc = []byte{
@@ -488,15 +583,23 @@ var file_opentelemetry_proto_common_v1_common_proto_rawDesc = []byte{
        0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
        0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64,
        0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
-       0x43, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x7b, 0x0a, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
-       0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
-       0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
-       0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65,
-       0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72,
-       0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f,
-       0x76, 0x31, 0xaa, 0x02, 0x1d, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
-       0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
-       0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+       0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x82, 0x01, 0x0a, 0x09, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79,
+       0x52, 0x65, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x75, 0x72,
+       0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x55,
+       0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+       0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x64, 0x5f, 0x6b, 0x65, 0x79,
+       0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x69, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x12,
+       0x29, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b,
+       0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x63, 0x72,
+       0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x42, 0x7b, 0x0a, 0x20, 0x69, 0x6f,
+       0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
+       0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b,
+       0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67,
+       0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e,
+       0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f,
+       0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1d, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65,
+       0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f,
+       0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -511,13 +614,14 @@ func file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP() []byte {
        return file_opentelemetry_proto_common_v1_common_proto_rawDescData
 }
 
-var file_opentelemetry_proto_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_opentelemetry_proto_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
 var file_opentelemetry_proto_common_v1_common_proto_goTypes = []interface{}{
        (*AnyValue)(nil),             // 0: opentelemetry.proto.common.v1.AnyValue
        (*ArrayValue)(nil),           // 1: opentelemetry.proto.common.v1.ArrayValue
        (*KeyValueList)(nil),         // 2: opentelemetry.proto.common.v1.KeyValueList
        (*KeyValue)(nil),             // 3: opentelemetry.proto.common.v1.KeyValue
        (*InstrumentationScope)(nil), // 4: opentelemetry.proto.common.v1.InstrumentationScope
+       (*EntityRef)(nil),            // 5: opentelemetry.proto.common.v1.EntityRef
 }
 var file_opentelemetry_proto_common_v1_common_proto_depIdxs = []int32{
        1, // 0: opentelemetry.proto.common.v1.AnyValue.array_value:type_name -> opentelemetry.proto.common.v1.ArrayValue
@@ -599,6 +703,18 @@ func file_opentelemetry_proto_common_v1_common_proto_init() {
                                return nil
                        }
                }
+               file_opentelemetry_proto_common_v1_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+                       switch v := v.(*EntityRef); i {
+                       case 0:
+                               return &v.state
+                       case 1:
+                               return &v.sizeCache
+                       case 2:
+                               return &v.unknownFields
+                       default:
+                               return nil
+                       }
+               }
        }
        file_opentelemetry_proto_common_v1_common_proto_msgTypes[0].OneofWrappers = []interface{}{
                (*AnyValue_StringValue)(nil),
@@ -615,7 +731,7 @@ func file_opentelemetry_proto_common_v1_common_proto_init() {
                        GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
                        RawDescriptor: file_opentelemetry_proto_common_v1_common_proto_rawDesc,
                        NumEnums:      0,
-                       NumMessages:   5,
+                       NumMessages:   6,
                        NumExtensions: 0,
                        NumServices:   0,
                },
index b7545b03b9fe9424e6b3c6519b715b77f9f66739..eb7745d66e02145e866f20a6cb446a6eddbabb19 100644 (file)
@@ -48,6 +48,12 @@ type Resource struct {
        // dropped_attributes_count is the number of dropped attributes. If the value is 0, then
        // no attributes were dropped.
        DroppedAttributesCount uint32 `protobuf:"varint,2,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"`
+       // Set of entities that participate in this Resource.
+       //
+       // Note: keys in the references MUST exist in attributes of this message.
+       //
+       // Status: [Development]
+       EntityRefs []*v1.EntityRef `protobuf:"bytes,3,rep,name=entity_refs,json=entityRefs,proto3" json:"entity_refs,omitempty"`
 }
 
 func (x *Resource) Reset() {
@@ -96,6 +102,13 @@ func (x *Resource) GetDroppedAttributesCount() uint32 {
        return 0
 }
 
+func (x *Resource) GetEntityRefs() []*v1.EntityRef {
+       if x != nil {
+               return x.EntityRefs
+       }
+       return nil
+}
+
 var File_opentelemetry_proto_resource_v1_resource_proto protoreflect.FileDescriptor
 
 var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{
@@ -106,7 +119,7 @@ var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{
        0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76,
        0x31, 0x1a, 0x2a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79,
        0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31,
-       0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01,
+       0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd8, 0x01,
        0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74,
        0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
        0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
@@ -115,16 +128,21 @@ var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{
        0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61,
        0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
        0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74,
-       0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x83, 0x01,
-       0x0a, 0x22, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
-       0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
-       0x65, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72,
-       0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
-       0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
-       0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76,
-       0x31, 0xaa, 0x02, 0x1f, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
-       0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
-       0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+       0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x49, 0x0a,
+       0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, 0x03, 0x20, 0x03,
+       0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
+       0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
+       0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x66, 0x52, 0x0a, 0x65, 0x6e,
+       0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x66, 0x73, 0x42, 0x83, 0x01, 0x0a, 0x22, 0x69, 0x6f, 0x2e,
+       0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,
+       0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42,
+       0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
+       0x5a, 0x2a, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
+       0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70,
+       0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1f, 0x4f,
+       0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f,
+       0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x06,
+       0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -141,16 +159,18 @@ func file_opentelemetry_proto_resource_v1_resource_proto_rawDescGZIP() []byte {
 
 var file_opentelemetry_proto_resource_v1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
 var file_opentelemetry_proto_resource_v1_resource_proto_goTypes = []interface{}{
-       (*Resource)(nil),    // 0: opentelemetry.proto.resource.v1.Resource
-       (*v1.KeyValue)(nil), // 1: opentelemetry.proto.common.v1.KeyValue
+       (*Resource)(nil),     // 0: opentelemetry.proto.resource.v1.Resource
+       (*v1.KeyValue)(nil),  // 1: opentelemetry.proto.common.v1.KeyValue
+       (*v1.EntityRef)(nil), // 2: opentelemetry.proto.common.v1.EntityRef
 }
 var file_opentelemetry_proto_resource_v1_resource_proto_depIdxs = []int32{
        1, // 0: opentelemetry.proto.resource.v1.Resource.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
-       1, // [1:1] is the sub-list for method output_type
-       1, // [1:1] is the sub-list for method input_type
-       1, // [1:1] is the sub-list for extension type_name
-       1, // [1:1] is the sub-list for extension extendee
-       0, // [0:1] is the sub-list for field type_name
+       2, // 1: opentelemetry.proto.resource.v1.Resource.entity_refs:type_name -> opentelemetry.proto.common.v1.EntityRef
+       2, // [2:2] is the sub-list for method output_type
+       2, // [2:2] is the sub-list for method input_type
+       2, // [2:2] is the sub-list for extension type_name
+       2, // [2:2] is the sub-list for extension extendee
+       0, // [0:2] is the sub-list for field type_name
 }
 
 func init() { file_opentelemetry_proto_resource_v1_resource_proto_init() }
index d9b631c9ca0a6a7b0a656678194422f7e890a315..e7aab4c322b25b14150f71fe9b75d14822a2e7d2 100644 (file)
@@ -67,9 +67,9 @@ github.com/StackExchange/wmi
 # github.com/beorn7/perks v1.0.1
 ## explicit; go 1.11
 github.com/beorn7/perks/quantile
-# github.com/cenkalti/backoff/v4 v4.3.0
-## explicit; go 1.18
-github.com/cenkalti/backoff/v4
+# github.com/cenkalti/backoff/v5 v5.0.3
+## explicit; go 1.23
+github.com/cenkalti/backoff/v5
 # github.com/cespare/xxhash/v2 v2.3.0
 ## explicit; go 1.11
 github.com/cespare/xxhash/v2
@@ -343,8 +343,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus
 # github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0
 ## explicit; go 1.19
 github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors
-# github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1
-## explicit; go 1.22
+# github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2
+## explicit; go 1.23.0
 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule
 github.com/grpc-ecosystem/grpc-gateway/v2/runtime
 github.com/grpc-ecosystem/grpc-gateway/v2/utilities
@@ -604,19 +604,19 @@ go.opentelemetry.io/otel/semconv/v1.21.0
 go.opentelemetry.io/otel/semconv/v1.26.0
 go.opentelemetry.io/otel/semconv/v1.37.0
 go.opentelemetry.io/otel/semconv/v1.37.0/otelconv
-# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0
-## explicit; go 1.22.0
+# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0
+## explicit; go 1.23.0
 go.opentelemetry.io/otel/exporters/otlp/otlptrace
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform
-# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0
-## explicit; go 1.22.0
+# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0
+## explicit; go 1.23.0
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry
-# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0
-## explicit; go 1.22.0
+# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0
+## explicit; go 1.23.0
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig
@@ -643,8 +643,8 @@ go.opentelemetry.io/otel/trace
 go.opentelemetry.io/otel/trace/embedded
 go.opentelemetry.io/otel/trace/internal/telemetry
 go.opentelemetry.io/otel/trace/noop
-# go.opentelemetry.io/proto/otlp v1.5.0
-## explicit; go 1.22.0
+# go.opentelemetry.io/proto/otlp v1.7.1
+## explicit; go 1.23.0
 go.opentelemetry.io/proto/otlp/collector/trace/v1
 go.opentelemetry.io/proto/otlp/common/v1
 go.opentelemetry.io/proto/otlp/resource/v1