open-telemetry / open-telemetry/opentelemetry-ruby

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

Open
#1,903 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

keep logs
Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

Description

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'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting opentelemetry-exporter-otlp-logs/lib/opentelemetry/exporter/otlp/logs/logs_exporter.rb around line 329 and the OTLP log encoding path. Try to construct a minimal case containing invalid UTF-8, then determine whether valid records can still be exported or whether the exporter can report which record failed. Done should include a reproducible test or clearer diagnostic behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.