I’ve a question, I’m running Telegraf Version 1.27.1.
On that I got a input mqtt_consumer configured with data_format = value and data_type = float.
The topic and subtopic I’m parsing is full of numeric values except two. Can I exclude them so that they won’t get processed?
Right now I’m experiencing that Telegraf will stop at all after an amount of time because it’s complaining that:
E! [inputs.mqtt_consumer] Error in plugin: strconv.ParseFloat: parsing “offline”: invalid syntax
When I restart telegraf it will continue to work.
So I tried with topic_parsing and other things I found on the net but didn’t get it working.
That “offline” part is one of the subtopics which is indeed string. See the below screenshot of the structure.
Yes it will stop to process. For testing I separated the mqtt input topic with the string float mix from the others and only that is not processing anymore. Here is the the log taken right now:
These were the last lines. As you can the the input processing stopped at the 24th. And as of today it’s the 30th.
The other inputs in the configuration (also mqtt) are still working without an error.
Hi sorry for the late reply.
Can you provide or update the repo with a Dockerfile so that I can build a image for testing?
I’ve checked the makefile, there is a
docker-image
directive with points to
scripts/buster.docker
but that Dockerfile doesn’t exists in the folder.
I already build the versions but I like to swap the container on my hosting server which runs atm the official telegraf image. And because there must be a Dockerfile somewhere, maybe you can provide it before I’ve to write my own
We do not provide or build Docker images for every PR, that would be a lot
The official docker images use Telegraf from a repo, so that won’t be much use to you. What I do locally is use a Dockerfile like this when I want to take a local build and try it out:
FROM archlinux
COPY telegraf /usr/bin/telegraf
CMD ["/usr/bin/telegraf"]
Hey I saw that both PRs are merged into master and a new version is released.
I don’t know if your client debug part is in master but now I got this, when things stop working:
2023-07-12T11:36:26Z I! Loading config: /etc/telegraf/telegraf.conf
2023-07-12T11:36:26Z I! Starting Telegraf 1.27.2
2023-07-12T11:36:26Z I! Available plugins: 237 inputs, 9 aggregators, 28 processors, 23 parsers, 59 outputs, 4 secret-stores
2023-07-12T11:36:26Z I! Loaded inputs: mqtt_consumer (2x)
2023-07-12T11:36:26Z I! Loaded aggregators:
2023-07-12T11:36:26Z I! Loaded processors:
2023-07-12T11:36:26Z I! Loaded secretstores:
2023-07-12T11:36:26Z I! Loaded outputs: influxdb_v2
2023-07-12T11:36:26Z I! Tags enabled: host=telegrafProx
2023-07-12T11:36:26Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"telegrafProx", Flush Interval:10s
2023-07-12T11:36:26Z I! [inputs.mqtt_consumer] Connected [tcp://mqtt:1883]
2023-07-12T11:36:26Z I! [inputs.mqtt_consumer] Connected [tcp://mqtt:1883]
2023-07-12T11:49:41Z E! [inputs.mqtt_consumer] could not mark message delivered: 2718
2023-07-12T12:34:13Z E! [inputs.mqtt_consumer] could not mark message delivered: 11788
2023-07-12T13:21:14Z E! [inputs.mqtt_consumer] could not mark message delivered: 21324
2023-07-12T14:32:14Z E! [inputs.mqtt_consumer] could not mark message delivered: 35809
So what’s next to do? Increase debug level somewhere?
So I checked to logs on mosquitto side. I saw the telegraf connect and no disconnect so far.
Also I tried to connect to the server from the container via shell, and mosquitto is logging it.
So it seems not an network issue. The mosquitto server is also running for more than 2 years very stable without any issues.
So found out about the debug options you included with
[agent]
debug = on
and in the MQTT section. In the meantime we are at 1.27.4 and it’s working without issues! So something had been fixed!
Thanks for your effort @jpowers !
@srebhan I tried your auto_float implementation. Sadly it is not writing any values with that. Any Ideas how to track that down? I can also open an Issue at GitHub if you want.
Hey @srebhan you are absolutely correct I was not using 1.28.0 and were not aware of that it was just released in 1.28.0.
But since I didn’t get any warnings or error messages when I hat it configured in <1.28.0 I was at a state that it was implemented in the version.
tl;dr, Works now but one of my Datapoints seems to be float already and auto_float seems to try to put it in as string and Influx is throwing an error now because of that.
Had to figure that out…