Class: Foam::Otel::GuardedSpanProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/foam/otel/pipelines.rb

Overview

A tenant span/log processor supplied via additional_* — wrapped so a throwing tenant instance is skipped with a loud warning and breaks neither the app nor foam's export (rule 18 C / rule 9). Never-throw is foam's guarantee for foam-invoked calls; the wrapper enforces it.

Instance Method Summary collapse

Constructor Details

#initialize(inner) ⇒ GuardedSpanProcessor

Returns a new instance of GuardedSpanProcessor.



158
# File 'lib/foam/otel/pipelines.rb', line 158

def initialize(inner) = @inner = inner

Instance Method Details

#force_flush(timeout: nil) ⇒ Object



161
# File 'lib/foam/otel/pipelines.rb', line 161

def force_flush(timeout: nil) = guarded { @inner.force_flush(timeout: timeout) } || OpenTelemetry::SDK::Trace::Export::SUCCESS

#on_finish(span) ⇒ Object



160
# File 'lib/foam/otel/pipelines.rb', line 160

def on_finish(span) = guarded { @inner.on_finish(span) }

#on_start(span, context) ⇒ Object



159
# File 'lib/foam/otel/pipelines.rb', line 159

def on_start(span, context) = guarded { @inner.on_start(span, context) }

#shutdown(timeout: nil) ⇒ Object



162
# File 'lib/foam/otel/pipelines.rb', line 162

def shutdown(timeout: nil) = guarded { @inner.shutdown(timeout: timeout) } || OpenTelemetry::SDK::Trace::Export::SUCCESS