Problem/Question
I want to export metrics to a prometheus server, but I can’t use the pull system prometheus uses by default. So I thought I could use prometheus remote write to push metrics to the prometheus server. Is this possible?
Relevant docs you followed/actions you took to solve the issue
This is how I have it set up:
prometheus server on IP_SERVER:9090
netdata on IP_CLIENT
My netdata exporting.conf file looks like this:
[prometheus_remote_write:prometheus_receiver]
enabled = yes
destination = IP_SERVER:9090
remote write URL path = /write
data source = average
prefix = netdata
Environment/Browser/Agent’s version etc
Ubuntu
What I expected to happen
I expected to be able to see the netdata metrics in my prometheus server in IP_SERVER:9090, but it’s empty
Thank you in advance for your time.
I think you need to enable Remote Write Receiver.
Storage overview:
The built-in remote write receiver can be enabled by setting the --web.enable-remote-write-receiver
command line flag. When enabled, the remote write receiver endpoint is /api/v1/write
.
Thank you for your reply.
I tried that as you suggested, but I’m getting a blank web page that says "“Method Not Allowed”.
I dont’t know if this will give you any clue, but if I send a POST request via terminal I get:
~$ curl -X POST localhost:9090/api/v1/write
snappy: corrupt input
It looks like a valid message because the remote write protocol is a binary one. You can’t make requests/get responses as plain text.
You can test your Netdata exporting configuration using a write adapter example.
git clone https://github.com/prometheus/prometheus.git
cd documentation/examples/remote_storage/example_write_adapter
go build
./example_write_adapter
and configure your remote write exporting connector to send data to http://localhost:1234/receive
Unfortunately, I can’t help you with the configuration of the Remote Write Receiver feature on a Prometheus server - I’m not a specialist in Prometheus
2 Likes
OK I can actually see the metrics are being sent.
I will ask for help in the prometheus forums.
Thank you very much!