Collect sum of written bytes in Internal Input plugin
Feature Request
Collect sum of written bytes in Internal Input plugin.
Proposal:
It will be good for meta-monitoring purposes to understand how much data Telegraf instance was sent to InfluxDB, or any other output. Currently such info is not available. For example, InfluxDB has following metric for the same purpose:
"writeReqBytes" // Sum of all bytes in write requests.
Current behavior:
Currently Internal Input plugin only collects and exports metrics_written metric, but it does not give an idea about size of the data.
Desired behavior:
Internal Input plugin provides "metrics_written_bytes" metric that collects and exports lengths of data successfully sent by each output (with "output" name as tag).
Use case:
Main use case is meta-monitoring, i.e. monitoring for resources (i.e. network bandwidth) associated with TSDB.
For some of the outputs it may not be possible to get this value, but we could add it on some outputs. Another option might be to report the number of fields sent. We should also think about if we want to include failed writes.
It would be really nice to at least have this for the influxdb_v2 output. Honestly, it would be nice to have a bytes_gathered field on the internal_gather measurement, even if that's an estimated value based on the how many bytes the gathered metrics would take up when represented in line protocol.
@nikolay-t and @philomory please test the binary in #17548 adding bytes_written to the InfluxDB (v1) output plugin! Let me know if this is what you expect!