How to use curl for remote write? #2489
-
Hello. Is there an example of how to use the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 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.
-
I appreciate this is an old thread, but I've come across this as I'm wanting to create custom SLI metrics using python, and write them into Grafana Cloud - The above curl works with the zero byte send, but I'm hitting Wiretype issues when trying to send snappy compressed payloads. Did anyone get this working with a native python approach? |
Beta Was this translation helpful? Give feedback.
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: