opentelemetry-ruby icon indicating copy to clipboard operation
opentelemetry-ruby copied to clipboard

Error and unable to export logs due to invalid UTF-8

Open wsmoak opened this issue 4 months ago • 4 comments

I am seeing this error occasionally despite already aggressively sanitizing output before logging.

I'm using the latest releases of all the gems and haven't been able to intentionally reproduce it.

I assume that one of the log lines has something invalid, is there any way to preserve the rest of them or get any additional information to debug this?

ERROR -- : Result code: 1

OpenTelemetry error: Unable to export 10 log records

OpenTelemetry error: unexpected error in OTLP::Exporter#encode - String is invalid UTF-8 - /path/to/ruby/3.3.0/gems/opentelemetry-exporter-otlp-logs-0.2.0/lib/opentelemetry/exporter/otlp/logs/logs_exporter.rb:329:in `method_missing'

wsmoak avatar Aug 24 '25 13:08 wsmoak

Thanks for calling this out! I have some ideas of what we could try and can take a deeper look this week.

kaylareopelle avatar Aug 25 '25 23:08 kaylareopelle

@kaylareopelle Logs may receive attributes or log statements that are encoded as String ASCII-8BIT i.e. binary encoded.

I have seen this in Rack values and some Kafka or RabbitMQ message keys.

https://github.com/open-telemetry/opentelemetry-ruby/issues/1649

arielvalentin avatar Aug 26 '25 12:08 arielvalentin

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

github-actions[bot] avatar Sep 26 '25 02:09 github-actions[bot]

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

github-actions[bot] avatar Oct 31 '25 02:10 github-actions[bot]