Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions opentelemetry-sdk/src/logs/batch_log_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ type LogsData = Box<(SdkLogRecord, InstrumentationScope)>;
///
/// ### Using a BatchLogProcessor:
///
/// ```rust
/// ```
/// # #[cfg(feature = "testing")]
/// # {
/// use opentelemetry_sdk::logs::{BatchLogProcessor, BatchConfigBuilder, SdkLoggerProvider};
/// use opentelemetry::global;
/// use std::time::Duration;
Expand All @@ -124,7 +126,8 @@ type LogsData = Box<(SdkLogRecord, InstrumentationScope)>;
/// let provider = SdkLoggerProvider::builder()
/// .with_log_processor(processor)
/// .build();
///
/// # }
/// ```
pub struct BatchLogProcessor {
logs_sender: SyncSender<LogsData>, // Data channel to store log records and instrumentation scopes
message_sender: SyncSender<BatchMessage>, // Control channel to store control messages for the worker thread
Expand Down
6 changes: 4 additions & 2 deletions opentelemetry-sdk/src/logs/simple_log_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ use std::time::Duration;
///
/// ### Using a SimpleLogProcessor
///
/// ```rust
/// ```
/// # #[cfg(feature = "testing")]
/// # {
/// use opentelemetry_sdk::logs::{SimpleLogProcessor, SdkLoggerProvider, LogExporter};
/// use opentelemetry::global;
/// use opentelemetry_sdk::logs::InMemoryLogExporter;
Expand All @@ -56,7 +58,7 @@ use std::time::Duration;
/// let provider = SdkLoggerProvider::builder()
/// .with_simple_exporter(exporter)
/// .build();
///
/// # }
/// ```
///
#[derive(Debug)]
Expand Down
3 changes: 3 additions & 0 deletions opentelemetry-sdk/src/metrics/instrument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ impl Instrument {
/// # Example
///
/// ```
/// # #[cfg(feature = "spec_unstable_metrics_views")]
/// # {
/// use opentelemetry_sdk::metrics::{Aggregation, Stream};
/// use opentelemetry::Key;
///
Expand All @@ -143,6 +145,7 @@ impl Instrument {
/// .with_cardinality_limit(100)
/// .build()
/// .unwrap();
/// # }
/// ```
#[derive(Default, Debug)]
pub struct StreamBuilder {
Expand Down
5 changes: 4 additions & 1 deletion opentelemetry-sdk/src/trace/span_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ impl<T: SpanExporter> SpanProcessor for SimpleSpanProcessor<T> {
/// with a custom configuration. Note that a dedicated thread is used internally
/// to manage the export process.
///
/// ```rust
/// ```
/// # #[cfg(all(feature = "testing", feature = "experimental_async_runtime"))]
/// # {
/// use opentelemetry::global;
/// use opentelemetry_sdk::{
/// trace::{BatchSpanProcessor, BatchConfigBuilder, SdkTracerProvider},
Expand Down Expand Up @@ -234,6 +236,7 @@ impl<T: SpanExporter> SpanProcessor for SimpleSpanProcessor<T> {
/// // Step 5: Ensure all spans are flushed before exiting.
/// provider.shutdown();
/// }
/// # }
/// ```
use std::sync::mpsc::sync_channel;
use std::sync::mpsc::Receiver;
Expand Down