Skip to content

LogRecord Produces Invalid JSON Serialization of Resource #3345

@sernst

Description

@sernst

Describe your environment

Not Python version or environment specific.

Steps to reproduce

Use a console log exporter or create a lightweight log exporter that calls the LogRecord.to_json method to observe that the Resource object is a Python repr serialized object and not a JSON-compatible serialized object.

What is the expected behavior?

I expect the Resource object serialization to be valid JSON and match the serialization of the other two signal types from ReadableSpan.to_json and MetricsData.to_json.

What is the actual behavior?

The output displays a Python repr version of the Resource attributes and is not a compatible structure with the other signal type exports of the same data format.

Additional context

N/A

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions