# Write to victoriametrics as influxdb or curl or prometheus?

**URL:** https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075
**Category:** General
**Created:** [18 May 2024 07:00 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075 "2024-05-18T07:00:16Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [18 May 2024 07:00 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/1 "2024-05-18T07:00:16Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/b/7b394c17bb3a07879ba0cfecde6a0b09cb469ec6.png)

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [18 May 2024 08:04 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/2 "2024-05-18T08:04:01Z")

</div>

> [@realtime](#):
>
> Grafana adds the 'database' tag to the **name** since the influxdb-contrib-node is enforcing that option.

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.

---

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [18 May 2024 10:04 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/3 "2024-05-18T10:04:43Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/eae86b09824b7f87b6fa67b31cf6d0cc33d15f14.png)

with influx node it looks like  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/3/23ddc70f743a9c71d924d4ae586dd4ceab3d970d.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [18 May 2024 14:41 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/4 "2024-05-18T14:41:12Z")

</div>

> [@realtime](#):
>
> influxdb-out-node is enforcing database option

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

---

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [18 May 2024 16:18 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/5 "2024-05-18T16:18:02Z")

</div>

> [@Colin](#):
>
> What exactly is it enforcing?

the "Database" option  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/051d392622c2a3b9092fac5a89e4e44feec536e6.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bc0eee2cc67f7417b13240902b5b22bb55039da1.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [18 May 2024 17:07 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/6 "2024-05-18T17:07:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [18 May 2024 17:49 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/7 "2024-05-18T17:49:05Z")

</div>

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.

> **[VictoriaMetrics](https://docs.victoriametrics.com/#how-to-send-data-from-influxdb-compatible-agents-such-as-telegraf)**
>
> Documentation for VictoriaMetrics, VictoriaLogs, Operator, Managed VictoriaMetrics and vmanomaly

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)

---

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [18 May 2024 17:51 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/8 "2024-05-18T17:51:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [18 May 2024 18:00 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/9 "2024-05-18T18:00:51Z")

</div>

> [@realtime](#):
>
> Grafana adds the 'database' tag to the **name** since

I have to correct this:  
_victoriametrics' InfluxDB line protocol_ adds the 'database' tag to the _data point_

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [18 May 2024 18:07 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/10 "2024-05-18T18:07:05Z")

</div>

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

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

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [18 May 2024 18:36 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/11 "2024-05-18T18:36:52Z")

</div>

> [@realtime](#):
>
> `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?

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

```auto
[{"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.

---

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [18 May 2024 18:48 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/12 "2024-05-18T18:48:12Z")

</div>

> [@E1cid](#):
>
> You can convert the curl to a http request node.

That did the trick! i didn't figure out where to put the headers.  
Thank yo very much.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a4c37e2fa02c78437afd886ededadec7811eb715.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [18 May 2024 18:51 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/13 "2024-05-18T18:51:06Z")

</div>

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

 ![chrome_screenshot_18 May 2024 19_49_56 BST](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/26198cc6e94e361e4ce85dec68afec8a45d64c8c.png)  
Most common headers are there and selectable.

---

<div class="post-metadata">

### Author: ![realtime](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@realtime](https://discourse.nodered.org/u/realtime)
#### Post date: [19 May 2024 06:50 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/14 "2024-05-19T06:50:59Z")

</div>

> [@E1cid](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [2 June 2024 06:51 UTC](https://discourse.nodered.org/t/write-to-victoriametrics-as-influxdb-or-curl-or-prometheus/88075/15 "2024-06-02T06:51:50Z")

</div>

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