- Notifications
You must be signed in to change notification settings - Fork776
Make exportertimeout encompass retries/backoffs, add jitter to backoffs, cleanup code a bit#4564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
...orter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/metric_exporter/__init__.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
emdneto left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Running a basic example of sending span/metric to a non existent collector through grpc:
Before (timeout not respected)
$ OTEL_EXPORTER_OTLP_TIMEOUT=5 uv run repro.py2025-05-09 01:19:57 INFO [test] Hello world2025-05-09 01:19:57 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting metrics to localhost:4317, retrying in 1s.2025-05-09 01:19:58 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting metrics to localhost:4317, retrying in 2s.2025-05-09 01:20:00 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting metrics to localhost:4317, retrying in 4s.^[[B2025-05-09 01:20:02 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting traces to localhost:4317, retrying in 1s.2025-05-09 01:20:03 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting traces to localhost:4317, retrying in 2s.2025-05-09 01:20:04 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting metrics to localhost:4317, retrying in 8s.2025-05-09 01:20:05 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting traces to localhost:4317, retrying in 4s.2025-05-09 01:20:09 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting traces to localhost:4317, retrying in 8s.2025-05-09 01:20:12 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] Transient error StatusCode.UNAVAILABLE encountered while exporting metrics to localhost:4317, retrying in 16s.Now (timeout is respected)
$ OTEL_EXPORTER_OTLP_TIMEOUT=5 uv run repro.py2025-05-09 01:22:43 INFO [test] Hello world2025-05-09 01:22:48 ERROR [opentelemetry.exporter.otlp.proto.grpc.exporter] Failed to export metrics to localhost:4317, error code: StatusCode.DEADLINE_EXCEEDED2025-05-09 01:22:53 ERROR [opentelemetry.exporter.otlp.proto.grpc.exporter] Failed to export traces to localhost:4317, error code: StatusCode.DEADLINE_EXCEEDEDWhen exporting metrics/traces in the same program I noticed that:
Is this expected?
$ OTEL_EXPORTER_OTLP_TRACES_TIMEOUT=5 uv run repro.py2025-05-09 15:37:54 INFO [test] Hello world2025-05-09 15:38:04 ERROR [opentelemetry.exporter.otlp.proto.grpc.exporter] Failed to export traces to localhost:4317, error code: StatusCode.DEADLINE_EXCEEDED2025-05-09 15:38:04 ERROR [opentelemetry.exporter.otlp.proto.grpc.exporter] Failed to export metrics to localhost:4317, error code: StatusCode.DEADLINE_EXCEEDED...lemetry-exporter-opencensus/src/opentelemetry/exporter/opencensus/trace_exporter/__init__.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...pentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...pentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...xporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/__init__.pyShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
aabmass left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can add the description which issues that are fixed by this PR?https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue
...pentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
aabmass commentedMay 14, 2025
I didn't see this in the code, if you updated can you just update the description as well? |
DylanRussell commentedMay 15, 2025
Updated the description |
timeout encompass retries/backoffsDylanRussell commentedJun 10, 2025
@emdneto any additional comments on this since I made changes to remove the retry config ? Otherwise I think this can be merged |
...pentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.pyShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…try/exporter/otlp/proto/grpc/exporter.pyCo-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
emdneto left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@DylanRussell running griffe I got:
griffe check opentelemetry-exporter-otlp-proto-http -a main -s exporterexporter/opentelemetry-exporter-otlp-proto-http/tests/test_proto_span_exporter.py:0: TestOTLPSpanExporter.test_exponential_backoff: Public object was removedexporter/opentelemetry-exporter-otlp-proto-http/tests/test_proto_log_exporter.py:0: TestOTLPHTTPLogExporter.test_exponential_backoff: Public object was removedexporter/opentelemetry-exporter-otlp-proto-http/tests/metrics/test_otlp_metrics_exporter.py:0: TestOTLPMetricExporter.test_exponential_backoff: Public object was removedexporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py:205: OTLPMetricExporter.export(timeout_millis): Parameter default was changed: 10000 -> Noneaabmass commentedJun 10, 2025
Good to go@emdneto ? |
Uh oh!
There was an error while loading.Please reload this page.
6ed676a intoopen-telemetry:mainUh oh!
There was an error while loading.Please reload this page.
…58b0 (#524)This PR updates the upstream OpenTelemetry Python dependency to itsSeptember 2025 release; Upgrading from version 1.33.1/0.54b1 to1.37.0/0.58b0.It also resolves several conflicts between the following OTel PRs andexisting ADOT patches:starlette: Remove maximum version constraintopen-telemetry/opentelemetry-python-contrib#3456Make a BatchProcessor class which both BatchSpanRecordProcessor andBatchLogRecordProcessor can useopen-telemetry/opentelemetry-python#4562Make exporter timeout encompass retries/backoffs, add jitter tobackoffs, cleanup code a bitopen-telemetry/opentelemetry-python#4564Update BatchSpanProcessor to use new BatchProcessor classopen-telemetry/opentelemetry-python#4580Fix issue where deadlock can occur over logging._lockopen-telemetry/opentelemetry-python#4636Tests Performedtox -e linttox -e spellchecktox -e 3.9-test-aws-opentelemetry-distrotox -e 3.10-test-aws-opentelemetry-distrotox -e 3.11-test-aws-opentelemetry-distrotox -e 3.12-test-aws-opentelemetry-distrotox -e 3.13-test-aws-opentelemetry-distroSmoke/contract tests: ./gradlewappsignals-tests:contract-tests:contractTestsBy submitting this pull request, I confirm that you can use, modify,copy, and redistribute this contribution, under the terms of yourchoice.
Uh oh!
There was an error while loading.Please reload this page.
Description
Make
timeoutencompass retries and backoffs, rather than being applied per HTTP request or gRPC RPC.Added a +/- 20% jitter to each backoff (both gRPC/HTTP).
Cleanup up the exporter code some. I got rid of a pointless 32 second sleep we would do after our last retry attempt before failing.
fixes:#3309,#4043,#2663
#4183 -- similar to this PR and what's discussed in#4043, but I implemented it in as minimal a way as I could..
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Lots of unit tests.
Does This PR Require a Contrib Repo Change?
Checklist: