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

current head of master: POST requests start to break with Content-Encoding "snappy" not supported #3407

Closed
jgehrcke opened this issue Mar 1, 2021 · 3 comments

Comments

@jgehrcke
Copy link
Contributor

jgehrcke commented Mar 1, 2021

In our CI we POST snappy-compressed protobuf messages to /loki/api/v1/push. In such POST HTTP requests we set these two headers:

      "Content-Type": "application/x-protobuf"
      "Content-Encoding": "snappy"

This has worked with all previously released versions of Loki.

Now we are testing with Loki's current head of master (cb59069). It emits a 400 Bad Request response, with the error message

Content-Encoding "snappy" not supported

The change in behavior is a side effect of this patch: https://github.com/grafana/loki/pull/3291/files

Should we change our HTTP request headers because they are obviously wrong, or is this a bug introduced with #3291?

The Prometheus remote_write HTTP API I believe "wants" to be used with this set of headers:

	httpReq.Header.Add("Content-Encoding", "snappy")
	httpReq.Header.Set("Content-Type", "application/x-protobuf")
	httpReq.Header.Set("X-Prometheus-Remote-Write-Version", "0.1.0")

(inferred from Proms' storage/remote/client.go)

Does X-Prometheus-Remote-Write-Version: 0.1.0 have any meaning for Loki?

jgehrcke added a commit to jgehrcke/loki that referenced this issue Mar 1, 2021
Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>
@cyriltovena
Copy link
Contributor

cyriltovena commented Mar 1, 2021

I'm even more impressed by the defer in this function closing the reader before returning.

Gzip might not even be working.

EDIT: the defer is fine.

@cyriltovena
Copy link
Contributor

btw to answer your question this is a bug.

cyriltovena pushed a commit that referenced this issue Mar 1, 2021
Signed-off-by: Dr. Jan-Philip Gehrcke <jp@opstrace.com>
@ukolovda
Copy link
Contributor

ukolovda commented Mar 2, 2021

@jgehrcke , I append several test for HTTP parser.
But I have no experience with Protobuf. Please append your test cases, if you can.

cyriltovena pushed a commit to cyriltovena/loki that referenced this issue Jun 11, 2021
* Created dedicated section to chunks storage in the doc

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed white noise

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Addressed review comments

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed links

Signed-off-by: Marco Pracucci <marco@pracucci.com>

* Fixed TestPurger_Restarts flakyness

Signed-off-by: Marco Pracucci <marco@pracucci.com>
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

No branches or pull requests

3 participants