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 memory mode support to OTLP exporters #6430

Merged
merged 5 commits into from May 9, 2024

Conversation

jack-berg
Copy link
Member

@jack-berg jack-berg commented May 3, 2024

Related to #6429, #6410, #6422.

Adds support for opting into low allocation memory usage in OTLP exporters via:

export OTEL_JAVA_EXPERIMENTAL_EXPORTER_MEMORY_MODE=reusable_data

cc @laurit

@jack-berg jack-berg requested a review from a team as a code owner May 3, 2024 22:00
Method method =
OtlpHttpSpanExporterBuilder.class.getDeclaredMethod("setMemoryMode", MemoryMode.class);
method.setAccessible(true);
method.invoke(builder, memoryMode);
} else {
Copy link
Member Author

Choose a reason for hiding this comment

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

This ugliness will go away once we promote memory mode to the stable API. I think we just need a release or so to be sure we think this concept is going to work.

Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 68.75000% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 90.75%. Comparing base (417f82c) to head (a1548a6).
Report is 2 commits behind head on main.

❗ Current head a1548a6 differs from pull request most recent head 039bdfa. Consider uploading reports for the commit 039bdfa to get more accurate results

Files Patch % Lines
...exporter/otlp/http/trace/OtlpHttpSpanExporter.java 45.45% 11 Missing and 1 partial ⚠️
...etry/exporter/otlp/trace/OtlpGrpcSpanExporter.java 40.00% 11 Missing and 1 partial ⚠️
...lemetry/exporter/otlp/internal/OtlpConfigUtil.java 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6430      +/-   ##
============================================
- Coverage     91.25%   90.75%   -0.50%     
+ Complexity     6099     6038      -61     
============================================
  Files           667      652      -15     
  Lines         18104    17790     -314     
  Branches       1792     1781      -11     
============================================
- Hits          16520    16146     -374     
- Misses         1062     1127      +65     
+ Partials        522      517       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -237,9 +239,27 @@ public static void setMemoryModeOnOtlpMetricExporterBuilder(
"setMemoryMode", MemoryMode.class);
method.setAccessible(true);
method.invoke(builder, memoryMode);
} else if (builder instanceof OtlpGrpcSpanExporterBuilder) {
// Calling getDeclaredMethod causes all private methods to be read, which causes a
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could have been avoided by using method handles. Alternatively could have used an internal interface to expose this method.

@jack-berg jack-berg changed the title Add memory mode support to OTLP span exporters Add memory mode support to OTLP exporters May 7, 2024
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.

None yet

2 participants