-
Notifications
You must be signed in to change notification settings - Fork 660
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable max export delay value for OTLPExporterMixin #3559
base: main
Are you sure you want to change the base?
Conversation
@@ -151,6 +151,7 @@ class OTLPExporterMixin( | |||
timeout: Backend request timeout in seconds | |||
compression: gRPC compression method to use | |||
""" | |||
_MAX_EXPORT_DELAY_VALUE = 64 |
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.
Wondering if it makes sense for this to be a constructor argument with a default value, and for the name to reflect that it's a max backoff in seconds, so something like "max_backoff_seconds"?
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.
Constructor argument will be convenient for local modifications, like (here with your proposed name):
provider = TracerProvider()
exporter = OTLPSpanExporter()
exporter.max_backoff_seconds = 5
processor = BatchSpanProcessor(exporter)
provider.add_span_processor(processor)
set_tracer_provider(provider)
tracer = get_tracer(__name__)
with tracer.start_as_current_span("test_span"):
...
I could also use this feature, it would be nice in our setup. |
Description
Change related with #1842.
Default OTLPExporterMixin approach to retry exporting with hardcoded time range, causes issues when using it in short lasting processes and opentelemetry collector is not available.
Here is example where it "hangs" whole process execution: https://github.com/avpps/opentelemetry-python-examples/blob/master/examples/trace.py
I just moved hardcoded value to make it configurable. In my cases it make sense to not retry export at all.
Type of change
How Has This Been Tested?
OTLPExporterMixin tests pass after change.
Does This PR Require a Contrib Repo Change?
Checklist: