Module: MongoPatch::Subscriber

Defined in:
lib/helios/opentelemetry/sdk/patches/mongo_patch.rb

Instance Method Summary collapse

Instance Method Details

#extract_query_result(event) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/helios/opentelemetry/sdk/patches/mongo_patch.rb', line 11

def extract_query_result(event)
  span = get_span(event)
  return unless span

  span.set_attribute(Helios::OpenTelemetry::SemanticAttributes::DB_QUERY_RESULT, event.reply.to_json)
rescue StandardError => e
  ::OpenTelemetry.logger.debug("Error extracting mongo query result: #{e}")
end

#succeeded(event) ⇒ Object



6
7
8
9
# File 'lib/helios/opentelemetry/sdk/patches/mongo_patch.rb', line 6

def succeeded(event)
  extract_query_result(event)
  super(event)
end