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

OTLPLogExporter example to not use OTLP-Pipeline builders #1811

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cijothomas
Copy link
Member

Opening a PR to show some issues related to : #1810

@cijothomas cijothomas requested a review from a team May 23, 2024 18:17
@@ -55,15 +56,15 @@ fn init_metrics() -> Result<opentelemetry_sdk::metrics::SdkMeterProvider, Metric
}

fn init_logs() -> Result<opentelemetry_sdk::logs::LoggerProvider, LogError> {
opentelemetry_otlp::new_pipeline()
.logging()
let exporter = opentelemetry_otlp::new_exporter()
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 does work, and is consistent with other exporter like stdout. However, the build_log_exporter() is called on something which is not advertised as a builder, which is weird!

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to merge this, without fixing the awkward API. Most likely this is something we'll have to address after the initial beta release.

Copy link
Contributor

Choose a reason for hiding this comment

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

new_exporter comment reads:

/// Create a builder to build OTLP metrics exporter or tracing exporter.

We can just rename the struct/function if it feels werid. But I think conceptually it's a builder

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, build_log_exporter() is not called on the exporter, but instead called on the TonicExporterBuilder. This makes more sense, and the name "TonicExporterBuilder" indicates it is a builder.. Even then, "build()
is more apt than "build_log_exporter", but this requires more refactoring to entire pipeline(s) structs in the OTLPExporter.

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.7%. Comparing base (bded598) to head (191684d).
Report is 68 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1811   +/-   ##
=====================================
  Coverage   73.7%   73.7%           
=====================================
  Files        123     123           
  Lines      19634   19634           
=====================================
+ Hits       14481   14482    +1     
+ Misses      5153    5152    -1     

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

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