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

Loki Exporter - lokiexporter.convertLogBodyToEntry fails to quote value when there are whitespace characters #11827

Closed
alanhe opened this issue Jun 30, 2022 · 2 comments · Fixed by #12116
Assignees
Labels
bug Something isn't working exporter/loki Loki Exporter good first issue Good for newcomers priority:p3 Lowest

Comments

@alanhe
Copy link

alanhe commented Jun 30, 2022

Describe the bug
For the unit test: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/lokiexporter/exporter_test.go#L294-L308,

If I replace line 301,

lr.Attributes().InsertString("random.attribute", "random")

with

lr.Attributes().InsertString("hello", "new world")

Then, it converts to:

hello=new world log message

When running the LogQL, {...} | logfmt, Loki is not able to treat new world as a unit.

What did you expect to see?
I think new world should be quoted instead:

hello="new world" log message
@alanhe alanhe added the bug Something isn't working label Jun 30, 2022
@TylerHelmuth
Copy link
Member

pinging @gramidt @jpkrohling as code owners

@TylerHelmuth TylerHelmuth added priority:p3 Lowest exporter/loki Loki Exporter labels Jul 1, 2022
@jpkrohling jpkrohling self-assigned this Jul 5, 2022
@jpkrohling jpkrohling added the good first issue Good for newcomers label Jul 5, 2022
@jpkrohling
Copy link
Member

This seems to be a good first issue. I'm adding this to my queue, but if someone wants to grab it, just do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/loki Loki Exporter good first issue Good for newcomers priority:p3 Lowest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants