Skip to content

Conversation

@javiergarea
Copy link

Description

Currently, log record bodies are encoded as integer arrays before exporting. This causes downstream log backends to render the logs as raw byte lists rather than human-readable text strings.
e.g.,
image

This change switches the regex replacement to use {return, binary}, ensuring the exporter generates a string_value.

Root cause

As seen in the shell output below, otel_otlp_common:to_any_value/1 converts a list string into an array_value of integers, while a binary becomes a string_value.

Erlang/OTP 28 [erts-16.1.1] [source] [64-bit] [smp:22:22] [ds:22:22:10] [async-threads:1] [jit:ns]

Eshell V16.1.1 (press Ctrl+G to abort, type help(). for help)
1> otel_otlp_common:to_any_value("test").
#{value =>
      {array_value,#{values =>
                         [#{value => {int_value,116}},
                          #{value => {int_value,101}},
                          #{value => {int_value,115}},
                          #{value => {int_value,116}}]}}}
2> otel_otlp_common:to_any_value(<<"test">>).
#{value => {string_value,<<"test">>}}

@javiergarea javiergarea requested a review from a team as a code owner February 4, 2026 11:21
@javiergarea javiergarea force-pushed the fix/log-record-string-body-encoding branch from 7c57ef2 to 1cbcd98 Compare February 4, 2026 11:24
Copy link
Member

@tsloughter tsloughter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.66%. Comparing base (98be90e) to head (1cbcd98).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #952   +/-   ##
=======================================
  Coverage   17.66%   17.66%           
=======================================
  Files          24       24           
  Lines         719      719           
=======================================
  Hits          127      127           
  Misses        592      592           
Flag Coverage Δ
api 17.66% <ø> (ø)
elixir 17.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@javiergarea javiergarea force-pushed the fix/log-record-string-body-encoding branch from 1cbcd98 to 06ab5e1 Compare February 5, 2026 12:51
@javiergarea
Copy link
Author

Amended commit scope from otel_otlp_logs to exporter to pass commit validation.
@tsloughter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants