Skip to content

Commit

Permalink
silly binding test
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle committed Nov 22, 2023
1 parent 715c054 commit 4b16ba3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/lib/opentelemetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def logger
# @return [Callable] configured error handler or a default that logs the
# exception and message at ERROR level.
def error_handler
@error_handler ||= ->(exception: nil, message: nil) { logger.error("OpenTelemetry error: #{[message, exception&.message].compact.join(' - ')}\n#{exception.backtrace}\n#{exception.class}") }
@error_handler ||= ->(exception: nil, message: nil) { logger.error("OpenTelemetry error: #{[message, exception&.message].compact.join(' - ')}\n#{exception.class}") }
end

# Handles an error by calling the configured error_handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def export_batch(batch, timeout: @exporter_timeout_seconds)
report_result(result_code, batch)
result_code
rescue StandardError => e
binding.irb
report_result(FAILURE, batch, e)
OpenTelemetry.handle_error(exception: e, message: 'unexpected error in BatchLogRecordProcessor#export_batch')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def export_batch(batch, timeout: @exporter_timeout_seconds)
report_result(result_code, batch)
result_code
rescue StandardError => e
binding.irb
report_result(FAILURE, batch, e)
@metrics_reporter.add_to_counter('otel.bsp.error', labels: { 'reason' => e.class.to_s })
FAILURE
Expand Down

0 comments on commit 4b16ba3

Please sign in to comment.