Skip to content

OTLP Stdout exporter - #6632

Closed
zeitlinger wants to merge 4 commits into
open-telemetry:mainfrom
zeitlinger:stdout-exporter
Closed

zeitlinger wants to merge 4 commits into
open-telemetry:mainfrom
zeitlinger:stdout-exporter

Conversation

@zeitlinger

@zeitlinger zeitlinger commented Aug 8, 2024 •

Copy link
Copy Markdown
Member

@zeitlinger

Copy link
Copy Markdown
Member Author

@jack-berg can you take a look?

import java.util.Collection;
import java.util.Deque;

public class OtlpSpanExporter {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why build all this over again instead of extending OtlpJsonLoggingSpanExporter with additional configuration options?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tried that first - it turned out that the code reuse is much easier to do with the otlp exporters, which have the same options, such as memory mode and metrics aggregation things.

I didn't include the full code reuse, because that would make the pr bigger.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is different about this new exporter compared to OtlpJsonLoggingSpanExporter? Why can't we add a builder pattern to OtlpJsonLoggingSpanExporter to make the output stream configurable?

OtlpJsonLoggingSpanExporter.builder().setOutputStream(os).build();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That seems like another config option:

OtlpJsonLoggingSpanExporter.builder()
  .setOutputStream(os)
  // Wrap Resource{Signal} with Export{Signal}ServiceRequest message
  .wrapWithExportRequestMessage() // ..or some other better method name
  .build();

@jack-berg

Copy link
Copy Markdown
Member

Is the memory mode really applicable?

Memory mode is pretty great. I think we can reuse the existing OtlpJsonLogging{Signal}Exporters for this, and we have #6474 to track adding memory mode support to those.

@zeitlinger

Copy link
Copy Markdown
Member Author

Memory mode is pretty great.

that was also my assumption which I used for the pr 😄

@zeitlinger zeitlinger changed the title Stdout exporter OTLP Stdout exporter Aug 13, 2024
@codecov

codecov Bot commented Aug 21, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 91.46341% with 42 lines in your changes missing coverage. Please review.

Project coverage is 90.64%. Comparing base (ad120a5) to head (8d8f14f).
Report is 65 commits behind head on main.

Files with missing lines Patch % Lines
...lemetry/exporter/internal/ExporterBuilderUtil.java 69.76% 10 Missing and 3 partials ⚠️
...logging/otlp/internal/writer/StreamJsonWriter.java 56.52% 9 Missing and 1 partial ⚠️
...logging/otlp/internal/writer/LoggerJsonWriter.java 66.66% 6 Missing ⚠️
...er/logging/otlp/OtlpJsonLoggingMetricExporter.java 92.85% 3 Missing and 1 partial ⚠️
...logging/otlp/OtlpJsonLoggingLogRecordExporter.java 94.11% 1 Missing and 1 partial ⚠️
...rter/logging/otlp/OtlpJsonLoggingSpanExporter.java 94.11% 1 Missing and 1 partial ⚠️
...try/exporter/logging/otlp/internal/AccessUtil.java 60.00% 2 Missing ⚠️
...r/internal/otlp/logs/LogReusableDataMarshaler.java 94.44% 0 Missing and 1 partial ⚠️
...rnal/otlp/metrics/MetricReusableDataMarshaler.java 94.44% 0 Missing and 1 partial ⚠️
...nternal/otlp/traces/SpanReusableDataMarshaler.java 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6632      +/-   ##
============================================
+ Coverage     90.05%   90.64%   +0.58%     
- Complexity     6275     6422     +147     
============================================
  Files           697      721      +24     
  Lines         18944    19228     +284     
  Branches       1858     1856       -2     
============================================
+ Hits          17060    17429     +369     
+ Misses         1307     1223      -84     
+ Partials        577      576       -1     

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

@zeitlinger
zeitlinger marked this pull request as ready for review August 21, 2024 10:31
@zeitlinger
zeitlinger requested a review from a team August 21, 2024 10:31
@zeitlinger

Copy link
Copy Markdown
Member Author

@jack-berg I started completely new after our discussion (thanks for the feedback). I still haven't tested the component provider. I think I need a DefaultStructuredConfigProperties to do that. Is this the right way?

@zeitlinger

Copy link
Copy Markdown
Member Author

I still haven't tested the component provider. I think I need a DefaultStructuredConfigProperties to do that. Is this the right way?

it was easy to do with mockito

@jack-berg

jack-berg commented Aug 26, 2024 •

Copy link
Copy Markdown
Member

Need to find a way to make PRs more reviewable. Sometimes its unavoidable, but in this case, there are several of things that can be broken up, which would considerably shrink the PR:

  • Add the SPI implementations in followups (env var and declarative config can each be separate)
  • Demonstrate the concept with the exporter for one signal, then extend to the other signals
  • Decouple adding support for memory mode

With this big of a PR, I'm forced to either: 1. spend a couple of hours for each round of a detailed review. 2. give a cursory review and potentially miss bugs, or conceptual problems (not willing to do this)

With this being just a prototype for something that does not yet exist in the spec, I'm afraid I just can't justify the time required to do a detailed review. Reminder that I'm the only full time maintainer of this repo and my current focus for the project is delivering declarative configuration.

Apologies for not making this recommendation with the first iteration of this PR - that's on me.

Screenshot 2024-08-26 at 4 03 28 PM

@zeitlinger

zeitlinger commented Aug 27, 2024 •

Copy link
Copy Markdown
Member Author

Need to find a way to make PRs more reviewable.

fair point - I've created in initial PR #6675 that has

  • memory mode removed
  • is only for log records

The component providers are very small, so I left them in.

@zeitlinger
zeitlinger marked this pull request as draft August 27, 2024 12:10
@zeitlinger zeitlinger closed this Sep 26, 2024
@zeitlinger
zeitlinger deleted the stdout-exporter branch November 4, 2024 06:45
jsuereth pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Nov 26, 2024
Towards
#3817

## Changes

Add OTLP Stdout exporter.

For non-trivial changes, follow the [change proposal
process](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CONTRIBUTING.md#proposing-a-change).

* [x] Related issues
#3817
~* [ ] Related [OTEP(s)](https://github.com/open-telemetry/oteps) #~
* [x] Links to the prototypes:
open-telemetry/opentelemetry-java#6632
* [x]
[`CHANGELOG.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CHANGELOG.md)
file updated for non-trivial changes
~* [ ]
[`spec-compliance-matrix.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md)
updated if necessary~
* [x] reference implementation
open-telemetry/opentelemetry-java#6632

---------

Co-authored-by: Robert Pająk <[email protected]>
Co-authored-by: Cyrille Le Clerc <[email protected]>
Co-authored-by: Cijo Thomas <[email protected]>
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.

2 participants