feat: include backtrace first line for better debug info #1674
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Propose a solution/improvement for #1669.
Since we are passing the exception class into
handle_error
, I think it's beneficial to include the last line of the error in the log message for developers to track down the cause.I believe a full backtrace is too much information to show; however, the end user can always customize their
@error_handler
to include it.I didn't add error handling in the encoding function like
as_otlp_span
because:spans: sds.map { |sd| as_otlp_span(sd) }
; otherwise, theencode
function will raise another type of error, which I think is redundant information.Opentelemetry::Proto::Trace::V1::Span.new
likeas_otlp_key_value
does, it will raise a single error, but the encode will not throw an error and will export incorrect data (e.g., an empty span), which I think is misleading.