Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ConsoleLogExporter with bytes in body fails #4606

Closed
Labels
bugSomething isn't working
@aabmass

Description

@aabmass

Describe your environment

No response

What happened?

When exporting a log with bytes in the body, the exporter fails withTypeError: Object of type bytes is not JSON serializable when trying tojson.dumps() it.

Steps to Reproduce

fromtimeimporttime_nsfromopentelemetry.sdk._logs.exportimportConsoleLogExporterfromopentelemetry.sdk._logsimportLogData,LogRecordfromopentelemetry.sdk.util.instrumentationimportInstrumentationScopeexporter=ConsoleLogExporter()exporter.export(    [LogData(instrumentation_scope=InstrumentationScope(name="foo"),log_record=LogRecord(timestamp=time_ns(),body={"foo":b"bar"}),        )    ])

Expected Result

bytes are a validAnyValue so it should be encoded and exported properly. Check the specification for details.

Actual Result

TypeError: Object of type bytes is not JSON serializable

Additional context

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp