How to use curl for remote write? #2489
Answered
by
pstibrany
huy7070
asked this question in
Help and support
-
Hello. Is there an example of how to use the |
Beta Was this translation helpful? Give feedback.
Answered by
pstibrany
Jul 20, 2022
Replies: 1 comment 4 replies
-
To make remote write work from curl, you need to:
So this works: curl -v -X POST -H 'X-Scope-OrgID: anonymous' -H "Content-Type: application/x-protobuf" http://localhost:9009/api/v1/push --data-binary @/tmp/req
> POST /api/v1/push HTTP/1.1
> Host: localhost:9009
> User-Agent: curl/7.79.1
> Accept: */*
> X-Scope-OrgID: anonymous
> Content-Type: application/x-protobuf
> Content-Length: 1
>
< HTTP/1.1 200 OK
< Server: nginx/1.21.6
< Date: Tue, 07 Jun 2022 08:25:49 GMT
< Content-Length: 0
< Connection: keep-alive
< Where |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
huy7070
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To make remote write work from curl, you need to:
WriteRequest
protobuf message from this proto file: https://github.com/prometheus/prometheus/blob/main/prompb/remote.proto/api/v1/push
with "Content-Type: application/x-protobuf" header.So this works: