Hello,
In my set up, I have 50k devices posting data to Influx every 5 minutes (via a bunch of stuff, then ultimately rabbitmq and telegraf). The number of fields in the data and destination measurement varies.
To check everything is working, I’d like to know how many lines of line protocol telegraf has processed every 5 minutes. If the answer is close to 50k, I can sleep at night.
I’m a bit confused about the metrics, especially measurement “internal_write”, field “metrics_written”.
If I send this (and only this) data to Influx via telegraf:
some_measurement,tag1=a,tag2=b,tag3=c,tag4=d marker_1=38,marker_2=6,marker_3=68,marker_4=44,marker_5=12,marker_6=14,marker_7=46,marker_8=97,marker_9=21,id="xyz"
The output of the following query is 21:
import "experimental/aggregate"
from(bucket: "some_bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "internal_write")
|> filter(fn: (r) => r["_field"] == "metrics_written")
|> filter(fn: (r) => r["host"] == "telegraf")
|> filter(fn: (r) => r["output"] == "influxdb_v2")
|> aggregate.rate(
every: 1m,
unit: 1m,
)
My data has 10 fields and 4 tags. Does each field/tag count as a “metric”? In which case perhaps I’m seeing 14 + 7 metrics written to something else, like telegraf’s own internal_ measurements?
For my purposes, I’d be more interested in knowing the number of lines of line protocol telegraf has sent - is it possible to get that?
Secondly, is there a way to add a host tag to only the health metrics?
If I set hostname="" in my agent config, the host tag in Influx contains the telegraf pod name (I’m running telegraf on kubernetes) but its applied to all measurements which is going to blow up my cardinality; if I have 10 telegraf pods, my cardinality is x10 what it was with hostname=“telegraf”.
I was hoping to monitor metrics (ideally lines of line protocol) written to Influx on a per pod basis.
Thanks,
Tom