You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The strtuct opentelemetry::logs::LogRecord has a member called attributes that is of type Option<Vec<(Key, AnyValue)>>.
Key is coming from opentelemetry::common::Key and it is already deriving from PartialEq and Eq. But AnyValue is not.
This makes comparisons not possible among two Option<Vec<(Key, AnyValue)>> or Vec<(Key, AnyValue)>. This is not ergonomic, as for simple unit testing of exporters/providers has to be done by hand-written iterations and custom comparisons.
This is valid for any scenario where an AnyValue is likely to be compared against another.
Related Problems?
The strtuct
opentelemetry::logs::LogRecord
has a member calledattributes
that is of typeOption<Vec<(Key, AnyValue)>>
.Key
is coming fromopentelemetry::common::Key
and it is already deriving fromPartialEq
andEq
. ButAnyValue
is not.This makes comparisons not possible among two
Option<Vec<(Key, AnyValue)>>
orVec<(Key, AnyValue)>
. This is not ergonomic, as for simple unit testing of exporters/providers has to be done by hand-written iterations and custom comparisons.This is valid for any scenario where an AnyValue is likely to be compared against another.
Describe the solution you'd like:
In here:
https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry/src/logs/record.rs#L78
Change this:
By this:
Considered Alternatives
No response
Additional Context
AnyValue cannot derive from
Eq
, asf64
has not support for it.The text was updated successfully, but these errors were encountered: