# Telegraf plugin help needed

**URL:** <https://community.netdata.cloud/t/telegraf-plugin-help-needed/890>\
**Category:** Help\
**Tags:** agent\
**Created:** [February 6, 2021, 10:45am UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890 "2021-02-06T10:45:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![borpin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/borpin/32/451_2.png) [@borpin](https://community.netdata.cloud/u/borpin)\
**Post date:** [February 6, 2021, 10:45am UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/1 "2021-02-06T10:45:36Z")

</div>

There is a PR on GitHub for a Telegraf plugin for Netdata - this would be a brilliant addition to Telegraf.

Is there anyone here who could help development? It is not one of my skill sets but I’d love to see it so I could use it 🙂

> <https://github.com/influxdata/telegraf/pull/2039>
>
> \[Netdata\](https://github.com/firehol/netdata) plugin reads all metrics generated… by a Netdata instance.
> 
> \### Required for all PRs:
> 
> \- \[\] CHANGELOG.md updated (we recommend not updating this until the PR has been approved by a maintainer)
> \- \[X\] Sign \[CLA\](https://influxdata.com/community/cla/) (if not already signed)
> \- \[X\] README.md updated (if adding a new plugin)

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [February 8, 2021, 8:08am UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/2 "2021-02-08T08:08:10Z")

</div>

Hi @borpin

[Netdata Agent exposes metrics in prometheus format](https://learn.netdata.cloud/docs/agent/exporting/prometheus).

I think it is possible to use [telegraf prometheus input](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus#prometheus-input-plugin) to gather them. Looks like it will do.

Why do you think we need a dedicated netdata input? What am i missing?

---

<div class="post-metadata">

**Author:** ![borpin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/borpin/32/451_2.png) [@borpin](https://community.netdata.cloud/u/borpin)\
**Post date:** [February 10, 2021, 6:57pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/3 "2021-02-10T18:57:05Z")

</div>

I had no idea about prometheus! I’ll have a look.

[edit]

My argument against Prometheus and why a native plugin is needed, is that Prometheus is yet another install and adds an additional (u and potentially unnecessary) step NetData → Prometheus → Telegraf → InfluxDB. It also yet another system to learn and maintain.

With a Telegraf plugin, the Telegraf agent can run on a remote server (in my case the InfluxDB server), and get the data directly.

Seems a much neater solution. As most of the work has already been done, it seems a good idea 🙂

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [February 10, 2021, 9:41pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/4 "2021-02-10T21:41:48Z")

</div>

If i understand it correctly you need no Prometheus.

Telegraf has `prometheus` input, it collects data from any http endpoint that exposes data in prometheus format - Netdata is able to do it.

So it is:

Server \<-[collects server metrics] Netdata ← [pulls metrics via http] Telegraf → InfluxDB

---

<div class="post-metadata">

**Author:** ![borpin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/borpin/32/451_2.png) [@borpin](https://community.netdata.cloud/u/borpin)\
**Post date:** [February 12, 2021, 4:54pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/5 "2021-02-12T16:54:45Z")

</div>

> [@ilyam8](#):
>
> If i understand it correctly you need no Prometheus.

I think that is not correct.

From the page you directed me to, it wants me to install the Prometheus client [Using Netdata with Prometheus | Learn Netdata](https://learn.netdata.cloud/docs/agent/exporting/prometheus#installing-prometheus)

Telegraf can **connect to** a Prometheus client and scrape the data, but that is still an intermediate step rather than a native Netdata plugin for Telegraf that would then be a connector in it’s own right.

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [February 12, 2021, 5:15pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/6 "2021-02-12T17:15:40Z")

</div>

Ok, by bad, i wasn’t clear, i meant to highlight the following:

> [Using Netdata with Prometheus | Learn Netdata](https://learn.netdata.cloud/docs/agent/exporting/prometheus#querying-metrics)

```auto
Querying Metrics
Fetch with your web browser this URL:

http://your.netdata.ip:19999/api/v1/allmetrics?format=prometheus&help=yes

```

So it is native. Telegraf scrapes Netdata Agent directly.

I am trying to understand why we need something else.

---

<div class="post-metadata">

**Author:** ![borpin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/borpin/32/451_2.png) [@borpin](https://community.netdata.cloud/u/borpin)\
**Post date:** [February 12, 2021, 8:24pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/7 "2021-02-12T20:24:46Z")

</div>

OK thanks.

> [@ilyam8](#):
>
> `api/v1/allmetrics?format=prometheus&help=yes`

For anyone finding this by search the configuartion that will work…

```auto
[[inputs.prometheus]]
  urls = ["http://<IP>:19999/api/v1/allmetrics?format=prometheus"]
  name_override = "netdata-pve"

```

Where the `name-override` is the measurment you want the metrics to go to.

---

<div class="post-metadata">

**Author:** ![borpin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/borpin/32/451_2.png) [@borpin](https://community.netdata.cloud/u/borpin)\
**Post date:** [February 14, 2021, 4:30pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/8 "2021-02-14T16:30:35Z")

</div>

@ilyam8, Telegraf is complaining

```auto
[inputs.prometheus] Use of deprecated configuration: 'metric_version = 1'; please update to 'metric_version = 2'

```

There is no mention if the Netdata output is V1 or V2. As the URL is V1, I’m thinking it is the V1 version (it certainly works).

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [February 14, 2021, 5:02pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/9 "2021-02-14T17:02:58Z")

</div>

That is telegraf configuration option - [`metric_version`](https://github.com/influxdata/telegraf/blob/a790529bdd9c0f097ce6e7889d8b01bdeb85a4a2/plugins/inputs/prometheus/prometheus.go#L49)

Default is != 2. [It complains about `prometheus` input configuration](https://github.com/influxdata/telegraf/blob/a790529bdd9c0f097ce6e7889d8b01bdeb85a4a2/plugins/inputs/prometheus/prometheus.go#L135-L141), try to set `metric_version` to 2.

---

<div class="post-metadata">

**Author:** ![borpin](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/borpin/32/451_2.png) [@borpin](https://community.netdata.cloud/u/borpin)\
**Post date:** [February 14, 2021, 5:07pm UTC](https://community.netdata.cloud/t/telegraf-plugin-help-needed/890/10 "2021-02-14T17:07:28Z")

</div>

OK thanks. I don’t know what the difference between the `metric_version`s is. I wondered if the format the data was presented differently.
