open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.34k stars 1.08k forks source link

Span attributes are truncated by number of bytes not number of characters #5996

Closed MrAlias closed 2 hours ago

MrAlias commented 3 days ago

Adding an attribute of a span with the string value こんにちは and an attribute value length of 3 set will result in the attribute value being . It should be こんに according to the OTel specification:

  • set an attribute value length limit such that for each attribute value:
    • if it is a string, if it exceeds that limit (counting any character in it as 1), SDKs MUST truncate that value, so that its length is at most equal to the limit,