Repository navigation
Add setOutputStreamMapper to OtlpStdout exporter builders - #9051
Open
HimanshuJha-2005 wants to merge 1 commit into
Open
HimanshuJha-2005 wants to merge 1 commit into
HimanshuJha-2005 wants to merge 1 commit into
Conversation
…etry#8976) Allows callers to customize the underlying output stream (e.g. for gzip compression, buffering, or framing) on OtlpStdoutSpanExporterBuilder, OtlpStdoutMetricExporterBuilder, and OtlpStdoutLogRecordExporterBuilder. Signed-off-by: Himanshu Jha <[email protected]>
|
|
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-22 20:09 UTC Review the latest changes. Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9051 +/- ##
============================================
+ Coverage 90.45% 90.46% +0.01%
- Complexity 11182 11189 +7
============================================
Files 1032 1032
Lines 30508 30541 +33
Branches 3992 3995 +3
============================================
+ Hits 27596 27630 +34
Misses 1935 1935
+ Partials 977 976 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8976.
Description
Adds
setOutputStreamMapper(Function<OutputStream, OutputStream> outputStreamMapper)toOtlpStdoutSpanExporterBuilder,OtlpStdoutMetricExporterBuilder, andOtlpStdoutLogRecordExporterBuilderas suggested in #8976.This allows callers to programmatically customize the destination stream, such as wrapping it in a
GZIPOutputStreamor a custom line-framing stream, without requiring non-standard environment variables.Key Changes
setOutputStreamMapper(Function<OutputStream, OutputStream> outputStreamMapper)onOtlpStdoutSpanExporterBuilder,OtlpStdoutMetricExporterBuilder, andOtlpStdoutLogRecordExporterBuilder.build()to apply the mapping function tooutputStreambefore passing it toStreamJsonWriter.setOutput(...)andsetOutputStreamMapper(...).outputStreamMapperand the mappedOutputStream.AbstractOtlpStdoutExporterTestcovering custom stream mapping, end-to-end GZIP compression and decompression, call ordering, and null safety across traces, metrics, and logs.Validation
./gradlew :exporters:logging-otlp:spotlessCheckpassed../gradlew :exporters:logging-otlp:checkpassed (including Checkstyle, AnimalSniffer Java 8 compatibility, jApiCmp, and JUnit 5 tests).