[receiver/loki] fix Content-Type parsing#41195
Merged
songy23 merged 14 commits intoJul 11, 2025
Merged
Conversation
Contributor
Author
|
Hi Irina @mar4uk! The error that this PR fixes prevents clients to send log using valid json because of an error in the Please, let me know if I can help! |
andrzej-stencel
approved these changes
Jul 10, 2025
andrzej-stencel
left a comment
Member
There was a problem hiding this comment.
@Abuelodelanada thanks for this change; please add a changelog entry.
Contributor
Author
|
Hello @andrzej-stencel, Thanks for your review! Changelog entry added! |
mar4uk
approved these changes
Jul 11, 2025
Contributor
|
Hey! Thank you for the fix 👍 LGTM! |
andrzej-stencel
approved these changes
Jul 11, 2025
Member
|
@Abuelodelanada please run |
Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
Contributor
Author
|
Comments addressed. Linting fixed! |
Dylan-M
pushed a commit
to Dylan-M/opentelemetry-collector-contrib
that referenced
this pull request
Aug 5, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR correctly parses the `Content-Type` of a request in `newLokiReceiver` the same way it is done in [`push.go`](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/lokireceiver/internal/push.go#L49) <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes: open-telemetry#41192 <!--Describe what testing was performed and which tests were added.--> #### Testing Run this test ```shell $ go test -v -run TestNewLokiReceiver_SupportedContentTypeWithCharset === RUN TestNewLokiReceiver_SupportedContentTypeWithCharset --- PASS: TestNewLokiReceiver_SupportedContentTypeWithCharset (0.00s) PASS ok github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver 0.005s ``` --------- Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR correctly parses the
Content-Typeof a request innewLokiReceiverthe same way it is done inpush.goLink to tracking issue
Fixes: #41192
Testing
Run this test
$ go test -v -run TestNewLokiReceiver_SupportedContentTypeWithCharset === RUN TestNewLokiReceiver_SupportedContentTypeWithCharset --- PASS: TestNewLokiReceiver_SupportedContentTypeWithCharset (0.00s) PASS ok github.com/open-telemetry/opentelemetry-collector-contrib/receiver/lokireceiver 0.005s