Class: OpenTelemetry::Instrumentation::Rage::LogContext
- Inherits:
-
Object
- Object
- OpenTelemetry::Instrumentation::Rage::LogContext
- Defined in:
- lib/opentelemetry/instrumentation/rage/log_context.rb
Overview
The class provides a custom log context to enrich Rage logs with the current OpenTelemetry trace and span IDs.
Class Method Summary collapse
Class Method Details
.call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/opentelemetry/instrumentation/rage/log_context.rb', line 14 def call current_span = OpenTelemetry::Trace.current_span return unless current_span.recording? { trace_id: current_span.context.hex_trace_id, span_id: current_span.context.hex_span_id } rescue => e OpenTelemetry.handle_error(exception: e) nil end |