Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lokiexporter: support serialization of all body types into JSON #6639

Merged
merged 2 commits into from
Dec 10, 2021

Conversation

gregoryfranklin
Copy link
Contributor

#5846 added support for encoding log entries as json but only worked if the Body was a string.

This expands that all supported types.

@gregoryfranklin gregoryfranklin requested review from a team and Aneurysm9 December 8, 2021 15:57
@jpkrohling jpkrohling self-requested a review December 10, 2021 09:42
@jpkrohling
Copy link
Member

@gillg, are you interested in taking a look at this as well?

@jpkrohling jpkrohling changed the title [lokiexporter] Support serialization of all body types into json lokiexporter: support serialization of all body types into JSON Dec 10, 2021
Copy link
Contributor

@gillg gillg left a comment

Choose a reason for hiding this comment

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

Very happy to see this improvement ! I was completly lost on how to return a consistent string type and create fake data for tests when I tried it !
Many thanks for this very fast improvement. I think now lokiexporter can fully handle any OTEL log entry !

The only anoying thing is how to extract a body attribute (in case of map body, like generated by syslogreceiver) to a loki label, but it's more a missing logprocessor to be able moving attributes from body to otel attributes or resources I think.

exporter/lokiexporter/encode_json_test.go Outdated Show resolved Hide resolved
@jpkrohling jpkrohling merged commit 20f6cea into open-telemetry:main Dec 10, 2021
PaurushGarg referenced this pull request in open-o11y/opentelemetry-collector-contrib Dec 11, 2021
)

* [lokiexporter] Support serialization of all body types into json

* Test that complex, nested bodies are serialized correctly
PaurushGarg referenced this pull request in open-o11y/opentelemetry-collector-contrib Dec 11, 2021
)

* [lokiexporter] Support serialization of all body types into json

* Test that complex, nested bodies are serialized correctly
PaurushGarg referenced this pull request in open-o11y/opentelemetry-collector-contrib Dec 14, 2021
)

* [lokiexporter] Support serialization of all body types into json

* Test that complex, nested bodies are serialized correctly
povilasv referenced this pull request in coralogix/opentelemetry-collector-contrib Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants