-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make gzip default for otlp gRPC/HTTP exporters #4632
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.
Before debating the change of default, I want to say huge thank you for this work. I would be extremely happy if you can split this into adding the benchmark and the results into a separate PR since that is a no brainer to merge.
I've split out the benchmarks to #4640. This PR is now only related to changing the default compression algo to gzip. |
Codecov Report
@@ Coverage Diff @@
## main #4632 +/- ##
=======================================
Coverage 90.70% 90.70%
=======================================
Files 179 179
Lines 10562 10566 +4
=======================================
+ Hits 9580 9584 +4
Misses 763 763
Partials 219 219
Continue to review full report at Codecov.
|
@tigrannajaryan @jpkrohling @codeboten please let me know if you are ok, since this is kind of a very subtle but major change |
I agree with the spirit of the change. Data likely goes to non-localhost from the Collector, so our previous reasoning that localhost doesn't need compression and non-localhost needs applies here. I have one concern: are we certain all existing receivers are fine with receiving gzip-ed payload? Was support of "gzip" always part of our OTLP receiver specification? We don't want to break anyone who was following the OTLP spec in their implementation. |
I think so, but there's a bit of interpretation involved in the answer. Here's the first version of OTLP in the spec. It says:
A reader should assume that a functioning OTLP server should be able to read gzip payloads. This requirement to support gzip was solidified relatively recently on Sept 29, 2021, with the additional language:
The justification for the gzip clarification was that the OTel JS SIG wanted to use gzip as the default for the browser case. Not sure where that landed. Overall, my interpretation is that even from the beginning, an OTLP server that doesn't support gzip is not spec compliant, since the spec has always allowed clients to gzip their payloads. |
Upon re-review and considering Tigran's comments, it seems that this change is overly broad as it changes the gRPC client and not the OTLP exporter's use of the gRPC client. This would impact any other exporter that uses As for whether the change is safe, I think I agree with the reading of the spec that compliant OTLP consumers should have always supported gzip. If, however, some consumer does not, does this change result in the exporter emitting clear and actionable logs instructing the operator that they need to disable gzip? I think if that is done there should be no issue with enabling it by default. |
@jack-berg you are quoting from the OTLP/HTTP section. That does not apply to OTLP/gRPC. In fact, unfortunately OTLP/gRPC spec doesn't say anything about compression as far as I can tell. Given the state of the spec I don't think we can rely on the spec guiding our decision. I am reluctant on approving this change since I am worried we may break receivers that we have no idea about. Perhaps we could ask vendors who support OTLP in the backend, do some sort of poll, I am not sure. |
Good point. I'll address this if we can agree on a strategy for changing the default.
Oops - must have been reading too fast. That's a good point. That should mean that there isn't anything in the spec blocking making gzip the default for OTLP over HTTP. In terms of OTLP over gRPC, I still do think there are a couple bits of evidence in spec that all compliant servers support gzip:
On a separate note, I do think that the argument for this change benefits from the collector being pre-1.0.0: It's a change that has a small but non-zero chance of impacting users, but which users can easily reconfigure and disable. It's a stroke of good luck that we're having this discussion now when users are more understanding of changes. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@tigrannajaryan please help with this PRto even get merged or comment what we need to do.. you have better experience with the protocol specifications |
I think the change is reasonable safe from OTLP compliance perspective. There is a small chance that we may break some receiver that does not support compression. That's OK, the requires gzip support, so they will need to fix their implementation. The only remaining question is this comment:
I haven't looked into other usages of configgrpc in the codebase. @jack-berg can you address this comment? Once this is addressed we can merge. |
Yes, I can take care of that. 👍 |
…tor into gzip-default
…iting scope to otlp
@jack-berg Please add a changelog entry. |
Let me know if you think a more descriptive entry is needed. |
I'm not super familiar with this project - is the failure of the "contrib-tests" check expected? |
It is possible. @open-telemetry/collector-approvers anyone knows what the contrib-test failure is? I am not sure. |
This looks to be due to a new module added after |
@jack-berg can try a rebase from main? |
…tor into gzip-default
…tor into gzip-default
…tor into gzip-default
Looks like |
Description:
Change OTLP gRPC exporter to use
gzip
compression by default. If this is merged, I can followup with the OTLP HTTP exporter to usegzip
by default as well.Link to tracking Issue:
#4587
Testing:
configgrpc_test.go
to validate default behaviorDocumentation:
Added details to
/config/configgrpc/README.md
with benchmark results and notes on compression.