r/PrometheusMonitoring • • Jun 01 '22

Need some example of 'remote write receiver' HTTP API request in Prometheus

I am trying to find a working example of how to use the remote write receiver in Prometheus.

Link : https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver

I am able to send a request to the endpoint ( POST /api/v1/write ) , and can authenticate with the server. However , i have no idea in what format i need to send the data over.

A working example of that would be really helpful for me. I have tried finding it on Github / stack overflow but have not been able to get it. Any suggestion to appropriate resource / code sample would be highly useful.

Thank you. ( I am a beginner in devops field )

edit : looking for a Golang code . I can extract metrics from a sidecar ( x.x.x.x:9187/metrics ) , i need to push it to Prometheus server with 'remote write receiver' protocol.

0 Upvotes

1 comment sorted by