-
Notifications
You must be signed in to change notification settings - Fork 457
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 doc-comment for SimpleLogProcessor and BatchLogProcessor #2468
Add doc-comment for SimpleLogProcessor and BatchLogProcessor #2468
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2468 +/- ##
=====================================
Coverage 77.1% 77.1%
=====================================
Files 124 124
Lines 23021 23021
=====================================
Hits 17771 17771
Misses 5250 5250 ☔ View full report in Codecov by Sentry. |
//! ## Types of Log Processors | ||
//! | ||
//! - **SimpleLogProcessor**: Forwards log records to the exporter immediately | ||
//! after they are emitted. This processor is **synchronous** and is designed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure of the wording "synchronous" as it may not be understood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll want to mention something closely related to this -
Exporter's Export() method is invoked in the same thread as the log is emitted. If exporter is OTLP/tonic, then this can work only if the provider was constructed in a tokio context?
//! - **SimpleLogProcessor**: Forwards log records to the exporter immediately | ||
//! after they are emitted. This processor is **synchronous** and is designed | ||
//! for debugging or testing purposes. It is **not suitable for production** | ||
//! environments due to its lack of batching, performance optimizations, or support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the last part(support for high throughput) is redundant and maybe omitted.
/// | ||
/// ```rust | ||
/// use opentelemetry_sdk::logs::{SimpleLogProcessor, LoggerProvider}; | ||
/// use opentelemetry::global; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
global is not required?
/// let exporter = InMemoryLogExporter::default(); // Replace with an actual exporter | ||
/// let processor = BatchLogProcessor::builder(exporter) | ||
/// .with_batch_config( | ||
/// BatchConfigBuilder::default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if we really need BatchConfigBuilder ? Can we make them part of the BatchLogProcessorBuilder itself?
Not for this PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good doc! I left some nits, good to be followed up later.
Changes
Inspired from SpanProcessor docs.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes