Use Telegraf to write to InfluxDB in cloud instance

Hi,

What Grafana version and what operating system are you using?

I’m using the cloud instance of https://grafana.com/

What are you trying to achieve?

I would like to send data from a PC via telegraf to the InfluxDB of the Grafana cloud instance.

How are you trying to achieve it?

I’ve configured the inlufxdb section of Telegraf like shown in the following snippet:

[[outputs.influxdb_v2]]
  urls = ["https://influx-prod-24-prod-eu-west-2.grafana.net/api/v1/push/influx"]
  token = "..."
  organization = ""
  bucket = ""

What happened?

I’m getting the following error (by Telegraf):

2023-12-01T09:24:22Z E! [outputs.influxdb_v2] Failed to write metric to  (will be dropped: 404 Not Found): 404 Not Found
2023-12-01T09:24:22Z D! [outputs.influxdb_v2] Wrote batch of 211 metrics in 323.655062ms
2023-12-01T09:24:22Z D! [outputs.influxdb_v2] Buffer fullness: 18 / 10000 metrics
2023-12-01T09:24:31Z E! [outputs.influxdb_v2] Failed to write metric to  (will be dropped: 404 Not Found): 404 Not Found
2023-12-01T09:24:31Z D! [outputs.influxdb_v2] Wrote batch of 198 metrics in 58.152855ms
2023-12-01T09:24:31Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics

What did you expect to happen?

The data is written to the InfluxDB.

Did you follow any online instructions? If so, what is the URL?

Yes, I’ve followed this instruction: Push metrics from Influx Telegraf to Prometheus | Grafana Cloud documentation

I’m pretty new to Grafana, did I miss something to setup? Is it somehow required to prepare the database?
I was also wondering how the organization and bucket configuration needs to be done.

I appreciate any help!

Hi @feddischson and welcome to the forum.

The link you shared is actually for how to send data to Prometheus Cloud (hosted by Grafana Cloud) using Influx protocol. That approach works fine, but you end up with your data in Prometheus Cloud. Is that your intent?

If you want to send your data to Influx Cloud, which one that you just signed up for? (which is v3, while one from in early 2023 or prior, would be v2)

Hi @grant2,

yes my intention was to send it into the Prometheus Cloud by using the Influx protocol. I though that the Prometheus Cloud is based on an InfluxDB.

@feddischson Thanks for clarifying. InfluxDB and Prometheus are two separate storage databases. The only relation here is that Telegraf (a separate product by Influx Data) is compatible with Prometheus in that it can push data to Prometheus Cloud using Influx Line Protocol.

I think the question will be better answered on https://community.influxdata.com/ and use the category “Telegraf” when posting.

I have limited experience with Telegraf, but I did set up a test system whereby I am sending data to Prometheus Cloud hosted by Grafana. Your 404 error indicates something fundamental is wrong or missing. I do not specify an organization or bucket (I believe those are both InfluxDB terms, not Prometheus terms)

Your data that you shared:

[[outputs.influxdb_v2]]
  urls = ["https://influx-prod-24-prod-eu-west-2.grafana.net/api/v1/push/influx"]
  token = "..."
  organization = ""
  bucket = ""

My test system data:

[[outputs.influxdb]]
 urls = ["https://influx-prod-10-prod-us-central-0.grafana.net/api/v1/push/influx/write"]
 ## HTTP Basic Auth
 username = "my six digit instance ID number"
 password = "my Cloud Access Policy token"

(username & pwd found by clicking on Details in the Prometheus card of the Cloud Portal.)

Also, I am technically pushing from Node-RED, not Telegraf. The Telegraf plugin automatically appends “/write” to the URL provided, so it shouldn’t be specified in your configuration. I added it to my URL because it was needed in my setup