Class: Foam::Otel::StampSpanProcessor

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

Instance Method Summary collapse

Instance Method Details

#force_flush(timeout: nil) ⇒ Object



51
52
53
# File 'lib/foam/otel/stamps.rb', line 51

def force_flush(timeout: nil)
  OpenTelemetry::SDK::Trace::Export::SUCCESS
end

#on_finish(span) ⇒ Object



49
# File 'lib/foam/otel/stamps.rb', line 49

def on_finish(span); end

#on_start(span, parent_context) ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/foam/otel/stamps.rb', line 39

def on_start(span, parent_context)
  # One frozen-clone read of the attributes to test presence against.
  current = span.attributes
  Stamping.candidates(parent_context).each do |key, value|
    span.set_attribute(key, value) if current[key].nil?
  end
rescue StandardError
  nil # stamping must never break telemetry
end

#shutdown(timeout: nil) ⇒ Object



55
56
57
# File 'lib/foam/otel/stamps.rb', line 55

def shutdown(timeout: nil)
  OpenTelemetry::SDK::Trace::Export::SUCCESS
end