From 1da36382fb4f6b5d4b7de16e66b046041a9a7db3 Mon Sep 17 00:00:00 2001 From: Rachel Klein Date: Thu, 29 Oct 2020 11:23:19 -0700 Subject: [PATCH] docs: add documentation on usage scenarios for span processors --- .../opentelemetry/sdk/trace/export/batch_span_processor.rb | 3 +++ .../opentelemetry/sdk/trace/export/simple_span_processor.rb | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/sdk/lib/opentelemetry/sdk/trace/export/batch_span_processor.rb b/sdk/lib/opentelemetry/sdk/trace/export/batch_span_processor.rb index 7a83f3282..e88264085 100644 --- a/sdk/lib/opentelemetry/sdk/trace/export/batch_span_processor.rb +++ b/sdk/lib/opentelemetry/sdk/trace/export/batch_span_processor.rb @@ -13,6 +13,9 @@ module Export # Implementation of the duck type SpanProcessor that batches spans # exported by the SDK then pushes them to the exporter pipeline. # + # Typically, the BatchSpanProcessor will be more suitable for + # production environments than the SimpleSpanProcessor. + # # All spans reported by the SDK implementation are first added to a # synchronized queue (with a {max_queue_size} maximum size, after the # size is reached spans are dropped) and exported every diff --git a/sdk/lib/opentelemetry/sdk/trace/export/simple_span_processor.rb b/sdk/lib/opentelemetry/sdk/trace/export/simple_span_processor.rb index 35d9993bc..2f95ae65b 100644 --- a/sdk/lib/opentelemetry/sdk/trace/export/simple_span_processor.rb +++ b/sdk/lib/opentelemetry/sdk/trace/export/simple_span_processor.rb @@ -12,6 +12,12 @@ module Export # {Span} to {io.opentelemetry.proto.trace.v1.Span} and passes it to the # configured exporter. # + # Typically, the SimpleSpanProcessor will be most suitable for use in testing; + # it should be used with caution in production. It may be appropriate for + # production use in scenarios where creating multiple threads is not desirable + # as well as scenarios where different custom attributes should be added to + # individual spans based on code scopes. + # # Only spans that are recorded are converted, {OpenTelemetry::Trace::Span#is_recording?} must # return true. class SimpleSpanProcessor