-
Notifications
You must be signed in to change notification settings - Fork 657
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
[Issue #1107] Add gzip compression support for OTLP exporter #1141
[Issue #1107] Add gzip compression support for OTLP exporter #1141
Conversation
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.
The change looks good to me, has this been tested to work with the Otel collector?
No I don't think so, I only ran the tests inside the OTEL exporter. Do those tests include tests for the Otel collector? |
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.
The spec also mentions OTEL_EXPORTER_OTLP_COMPRESSION
environment variable which we should support here. I'm not sure what values it is supposed to take on though, do you think you could raise an issue in the spec repo to get some clarification? Or @codeboten might know?
exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py
Show resolved
Hide resolved
exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py
Outdated
Show resolved
Hide resolved
…n value directly rather than through str
…TLP trace exporter test
exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py
Outdated
Show resolved
Hide resolved
exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py
Outdated
Show resolved
Hide resolved
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.
@wilguo did you look into the environment variable option?
exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py
Outdated
Show resolved
Hide resolved
exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py
Outdated
Show resolved
Hide resolved
I have just opened an issue on the spec regarding the environment variable |
…t and modify Enum value from DEFAULT to NO_COMPRESSION
Oh sorry, I didn't see this comment in time. I just added the support for environment variable for gzip compression just now and pushed my changes. Should I roll back my changes or keep it in this PR? |
No worries! I think having it in here is fine, it didn't look like the other PR addressed the compression variable. Would be good to remain consistent and use the global config as in the other PR though:
|
exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/exporter.py
Outdated
Show resolved
Hide resolved
No worries @wilguo, thanks for getting back to me! |
Sorry guys, I was still not able to find a solution for testing the compression. I changed the test to now check the channel variable that's created when calling |
The way I would go about it is to follow @lzchen's suggestion of checking that the method to create the channel was called with the expected parameters rather than trying to compare the channel objects themselves since all we're testing here is the input parameters |
I did try and troubleshoot the AssertionError based on @lzchen's suggestion before trying it this way but I kept getting the assertion error still |
@codeboten @lzchen Is there another way that I could test this without using |
…n and removed compression tests
…1y/opentelemetry-python into gzip-compression-feature
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
Description
This PR adds gzip compression to OTLP exporter, closing #1107.
The changes have been made following these specifications:
https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/protocol/exporter.md#opentelemetry-protocol-exporter
Fixes #1107
Type of change
How Has This Been Tested?
Ran tests for OTLP Exporter
tox -e py38-test-exporter-otlp
Checklist: