I have been trying to call remote_write() function of Prometheus via java/python/postman. I have configured a Prometheus server with remote receiver configuration and I have another Prometheus agent running from where I am trying to make an API call to do remote_write().
I have been getting the below error and I believe we need to do a snappy compression and call the APIs?
Any samples or help on how we can call this /api/v1/write
API via java or python or maybe via postman by doing a snappy compression ?
Sample I am trying:
curl --location --request POST 'http://<prometheus-host>/api/v1/write' \
--header 'Content-Type: text/plain' \
--data-raw 'metrics_app_20221201091829_0000_driver_BlockManager_memory_diskSpaceUsed_MB_Number{type="gauges"} 0
Error:
snappy: corrupt input
snappy is a kind of compression.
try this (python code):
* should probably
pip install python-snappy