Write to victoriametrics as influxdb or curl or prometheus?

Hallo,
I want to move away from influx and came across victoriametris.
By simply using the influxdb-contrib-node, Grafana adds the 'database' tag to the __name__ since the influxdb-contrib-node is enforcing that option.
I want to get rid of this because it disturbes the look in grafana.
I could overwrite the display name in Grafana, yes.
My final goal is to fill the database in a way so that grafana dashboard take less effort to beautify.
image

I achieved this by:
curl -d 'mycensus bees=23' -X POST 'http://192.168.x.x:8428/write'
How do I pass this in a node-red http-request msg.url?

or does anyone know how to get rid of the db= tag in victoria? should be doable by passing an empty db tag?
is there an other node, e.g. for filling in the prometeus way?
Is there an granafa option for prometheus input for dafault naming of the values?
thanks

Can you explain in more detail what you mean by that? I have not come across any such problem. I don't know what you mean by __name__ and I have never seen the name of the database attached to anything.

influxdb-out-node is enforcing database option
victoria metrics translates
influx: databaseYX measurementZY fieldWQ
victoria: measuementZY_fieldWQ {db=databaseYX}

with curl I am not forced to add a database
image

with influx node it looks like
image

What exactly is it enforcing? What is different in the database?

the "Database" option
image

image

Yes of course. When writing to influxdb you have to specify a database.

And no of course, when you write to victoriametric, with the influx-notation, you dont need a database, since victM has no database - seem my curl example.
And fair enough, the node is made for influx.
Thats why I ask for alternatives like http-request or prometheus.

you seem to be an influx expert here, but my request is "how to contact VictoriaMetrics"

can one set the databse dynamically?
msg.database didn't not work
like this I could 'misuse' the db as a dynamic tag; (a static tag for database is not useful)

my questions again:

I achieved this by:
curl -d 'mycensus bees=23' -X POST 'http://192.168.x.x:8428/write'
How do I produce this in a node-red http-request msg.url?
it seems to have something to do with POST multipart payload

can one set the databse dynamically?
is there an other node, e.g. for filling in the prometeus way?
Is there an granafa option for prometheus input for dafault naming of the values?
thanks

I have to correct this:
victoriametrics' InfluxDB line protocol adds the 'database' tag to the data point

OK, I understand now. I have never even heard of victoriametrics.

Show us what have you tried in the html request node.

You can convert the curl to a http request node.
e.g

[{"id":"6e41e0257eecd929","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"url","v":"http://192.168.1.10:8428/write","vt":"str"},{"p":"method","v":"POST","vt":"str"},{"p":"headers","v":"{\"Content-type\":\"multipart/form-data\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"mycensus bees=23","payloadType":"str","x":150,"y":4720,"wires":[["f4a3eee62f07deb4"]]},{"id":"f4a3eee62f07deb4","type":"http request","z":"d1395164b4eec73e","name":"","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":350,"y":4720,"wires":[["6a9b0119b36f07f7"]]},{"id":"6a9b0119b36f07f7","type":"debug","z":"d1395164b4eec73e","name":"debug 2490","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":4720,"wires":[]}]

You may require authorization headers to, as not sure what security you have on your DB.

1 Like

That did the trick! i didn't figure out where to put the headers.
Thank yo very much.
image

You can also add header direct in the http request node.


Most common headers are there and selectable.

I was there but missed the "+Add" button.
But even then I wouldn't have known that 'this is all'.
That gives me the chance to translate all the curl examples given anywhere.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.