-
Notifications
You must be signed in to change notification settings - Fork 761
Fix OTLP gRPC log exporter request wrapper and timeout precedence #4815
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,7 +100,7 @@ def __init__( | |
| insecure=insecure, | ||
| credentials=credentials, | ||
| headers=headers or environ.get(OTEL_EXPORTER_OTLP_LOGS_HEADERS), | ||
| timeout=timeout or environ_timeout, | ||
| timeout=timeout if timeout is not None else environ_timeout, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For both requests and gRPC when a timeout is not set, they will wait forever for the server: https://grpc.io/docs/guides/deadlines/#deadlines-on-the-client I don't think we want that ? I think we should always set some upper bound.. An explicit timeout of 0 will cause an error from python My thinking is we should update the code to explicitly disallow (or ignore?) a timeout of 0, and also to update the code to set some upper bound on the timeout.. WDYT? If you actually wanted this change you would also have to update this logic in all the exporters (we have similar logic for HTTP): |
||
| compression=compression, | ||
| stub=LogsServiceStub, | ||
| result=LogRecordExportResult, | ||
|
|
@@ -110,7 +110,7 @@ def __init__( | |
| def _translate_data( | ||
| self, data: Sequence[ReadableLogRecord] | ||
| ) -> ExportLogsServiceRequest: | ||
| return encode_logs(data) | ||
| return ExportLogsServiceRequest(resource_logs=encode_logs(data)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure about that: Do tests pass? |
||
|
|
||
| def export( # type: ignore [reportIncompatibleMethodOverride] | ||
| self, | ||
|
|
||
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.
This looks correct but please add a test and also update it for all the signals. Said that
OTLPExporterMixinhas the same issue so without updating that too this won't change behavior. Also no idea how the grpc client will behave.