Description
Problem Statement
I am trying to write a custom Log Record Processor that will look at the record attributes for a KeyValue containing an error
, and, if the record severity >= Error and it found an error
Value that matches criteria included when configuring the processor, downgrade the severity to a Warn.
This is something I've done in other logging solutions with hooks or handlers. But I'm unable to write an otel Log Processor because there is no way to pull the error
that was used as a log attribute, because the error
value is converted to a string.
example: If the error is a context.Canceled, downgrade the severity of the log to a Warn
Proposed Solution
Would it be alright to add a new KindError
to the log KeyValue Kinds
With supported func Error(key string, value error) KeyValue
and func ErrorValue(v error) Value
and func (v Value) AsError() error
functions.