Skip to content
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

Add compression support for otlp tonic #1165

Merged
merged 7 commits into from
Jul 29, 2023

Conversation

BrynCooke
Copy link
Contributor

@BrynCooke BrynCooke commented Jul 22, 2023

Part of #774

Design discussion issue (if applicable) #

It looks like there needs to be a larger refactor to allow compression to be pushed up to ExportConfig and to have with_env set the variables to something that allows late binding. It'd be better to do this separately though as it affects all the settings in ExportConfig.

Changes

Adds the ability to use compression when using grpc-tonic.

Added support for the following env variables:

  • OTEL_EXPORTER_OTLP_LOGS_COMPRESSION
  • OTEL_EXPORTER_OTLP_TRACES_COMPRESSION
  • OTEL_EXPORTER_OTLP_METRICS_COMPRESSION
  • OTEL_EXPORTER_OTLP_COMPRESSION

This doesn't use with_env yet as it is impossible currently to detect at this point if compression is enabled for logs|metrics|traces.

Longer term we can add a new enum for use in ExportConfig like:

enum ConfigSetting<T> {
  Env,
  Some(T),
  None
}

Which would allow with_env to mark a field as being resolved by env variable. Thus allowing OTEL_EXPORTER_OTLP_LOGS_COMPRESSION to be used for logs, OTEL_EXPORTER_OTLP_TRACES_COMPRESSION for traces etc...

I'm happy to try to do this as a follow-up.

Follow up:
I just noticed that from_env was removed from the jaeger exporter, so maybe if we are going in the same direction with the otlp exporter then there's not need for the above.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@codecov
Copy link

codecov bot commented Jul 22, 2023

Codecov Report

Patch coverage: 67.5% and project coverage change: +0.2 🎉

Comparison is base (b28e41a) 49.4% compared to head (0dca7b4) 49.7%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1165     +/-   ##
=======================================
+ Coverage   49.4%   49.7%   +0.2%     
=======================================
  Files        164     165      +1     
  Lines      20445   20587    +142     
=======================================
+ Hits       10120   10248    +128     
- Misses     10325   10339     +14     
Impacted Files Coverage Δ
opentelemetry-otlp/src/exporter/grpcio.rs 61.9% <ø> (+1.9%) ⬆️
opentelemetry-otlp/src/lib.rs 27.7% <ø> (ø)
opentelemetry-otlp/src/logs.rs 0.0% <0.0%> (ø)
opentelemetry-otlp/src/metric.rs 0.0% <0.0%> (ø)
opentelemetry-otlp/src/exporter/tonic.rs 75.0% <83.3%> (+3.3%) ⬆️
opentelemetry-otlp/src/span.rs 35.4% <83.3%> (+0.7%) ⬆️
opentelemetry-otlp/src/exporter/mod.rs 88.0% <95.2%> (+0.8%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@BrynCooke BrynCooke marked this pull request as ready for review July 22, 2023 21:44
@BrynCooke BrynCooke requested a review from a team July 22, 2023 21:44
Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me, thanks!

opentelemetry-otlp/src/exporter/tonic.rs Show resolved Hide resolved
@jtescher jtescher merged commit 58ad33a into open-telemetry:main Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants