Skip to content

Need validation/debug logs for protobuf setters #3491

Open
@VivekSubr

Description

@VivekSubr

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:

void OtlpPopulateAttributeUtils::PopulateAnyValue(

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions