Description
Describe your environment
Not related to env, any new version of otel-cpp
Steps to reproduce
Export span with non utf-8 attribute.
We have a large system with hundreds of traces per second, and see intermittent error logs due to non utf-8 attributes.
[libprotobuf ERROR google/protobuf/wire_format_lite.cc:577] String field 'opentelemetry.proto.trace.v1.Span.Event.name' contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.
But it's very hard to root cause this, to help in these cases we believe otel-cpp should add validations/debug logs for at least set_string_value here:
Currently there are no checks for any of the setter functions return values and what otel-cpp does is just discard the attribute that errored and export the rest.