Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Dec 22, 2024
1 parent a062c9c commit 83f9d2e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/testing/trace/in_memory_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::sync::{Arc, Mutex};
///# async fn main() {
/// let exporter = InMemorySpanExporterBuilder::new().build();
/// let provider = TracerProvider::builder()
/// .with_span_processor(BatchSpanProcessor::builder(exporter.clone(), runtime::Tokio).build())
/// .with_span_processor(BatchSpanProcessor::builder(exporter.clone()).build())
/// .build();
///
/// global::set_tracer_provider(provider.clone());
Expand Down
1 change: 1 addition & 0 deletions opentelemetry-sdk/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mod span;
mod span_limit;
mod span_processor;
#[cfg(feature = "experimental_trace_batch_span_processor_with_async_runtime")]
/// Experimental feature to use async runtime with batch span processor.
pub mod span_processor_with_async_runtime;
mod tracer;

Expand Down
8 changes: 5 additions & 3 deletions opentelemetry-sdk/src/trace/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@
/// ```
#[cfg(feature = "experimental_trace_batch_span_processor_with_async_runtime")]
use crate::runtime::RuntimeChannel;
use crate::trace::{
BatchSpanProcessor, Config, RandomIdGenerator, Sampler, SimpleSpanProcessor, SpanLimits, Tracer,
};
#[cfg(feature = "experimental_trace_batch_span_processor_with_async_runtime")]
use crate::trace::span_processor_with_async_runtime::BatchSpanProcessor;
#[cfg(not(feature = "experimental_trace_batch_span_processor_with_async_runtime"))]
use crate::trace::BatchSpanProcessor;
use crate::trace::{Config, RandomIdGenerator, Sampler, SimpleSpanProcessor, SpanLimits, Tracer};
use crate::Resource;
use crate::{export::trace::SpanExporter, trace::SpanProcessor};
use opentelemetry::trace::TraceError;
Expand Down
3 changes: 3 additions & 0 deletions opentelemetry-sdk/src/trace/span_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,18 @@ pub struct BatchConfig {
/// of batches. The default value is 5 seconds.
pub(crate) scheduled_delay: Duration,

#[allow(dead_code)]
/// The maximum number of spans to process in a single batch. If there are
/// more than one batch worth of spans then it processes multiple batches
/// of spans one batch after the other without any delay. The default value
/// is 512.
pub(crate) max_export_batch_size: usize,

#[allow(dead_code)]
/// The maximum duration to export a batch of data.
pub(crate) max_export_timeout: Duration,

#[allow(dead_code)]
/// Maximum number of concurrent exports
///
/// Limits the number of spawned tasks for exports and thus memory consumed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ use std::sync::Arc;
/// use opentelemetry_sdk::{runtime, testing::trace::NoopSpanExporter, trace};
/// use opentelemetry_sdk::trace::BatchConfigBuilder;
/// use std::time::Duration;
/// use opentelemetry_sdk::trace::span_processor_with_async_runtime::BatchSpanProcessor;
///
/// #[tokio::main]
/// async fn main() {
/// // Configure your preferred exporter
/// let exporter = NoopSpanExporter::new();
///
/// // Create a batch span processor using an exporter and a runtime
/// let batch = trace::BatchSpanProcessor::builder(exporter, runtime::Tokio)
/// let batch = BatchSpanProcessor::builder(exporter, runtime::Tokio)
/// .with_batch_config(BatchConfigBuilder::default().with_max_queue_size(4096).build())
/// .build();
///
Expand Down

0 comments on commit 83f9d2e

Please sign in to comment.