Remote write API


I have a several closed proprietary systems that pushes some metrics in a text format on a cloud.
The format looks like this :

<timestamp> <device> <key> <value>

Then once a day, I want to fetch those data and push them into prometheus, and then monitor them with grafana.
I want to be able to keep the timestamp informations for graphs, and apparently according to what I could find on google, the only way to do this is using the remote write API.

so I’ve enabled the feature in my docker instance of prometheus, but I can’t find any documentation on how to define the metric and push it on my prometheus instance.

So I tried with a small python snippet to push a random metric :

import requests
import snappy

query='temperature{device="HpLx360", id="12345"} 25.4 1680014429'
result =, data=snappy.compress(query))

I tried also without the timestamp for a first try, but everytime I get the error

proto: WriteRequest: wiretype end group for non-group

I can’t find any documentation about this error, I’m not sure if it’s due to snappy or an error in the syntax I’m using, any advice ?

1 Like

I think remote_write uses protobuf to define the protocol, that should be the definition:

You might use protobuf to create a python client somehow.