influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.58k stars 5.56k forks source link

Support for golang 1.22 #15987

Closed matejsp closed 1 week ago

matejsp commented 1 week ago

Use Case

Based on golang support, Golang 1.22 and 1.23 are supported. We have lots of microservices with its own upgrade cycle. Telegraf as a library requires latest Golang instead of supporting currently officially supported golang versions.

Expected behavior

Support for golang 1.22.

Actual behavior

It forces you to upgrade to 1.23.

Additional info

No response

srebhan commented 1 week ago

@matejsp I'm not exactly sure where the issue is. The official Telegraf binaries are built with the latest go-version usually, you don't need to install any go version on your machine. If you are talking about building Telegraf on your own with older versions of Go, you can modify the go.mod file and give it a try. Tested with current master and go-1.22.8 and this at least compiles...

Note: You will be on your own, as we cannot support two versions of Go simultaneously because all testing etc is done using the newer version.

matejsp commented 1 week ago

Maybe it is not how this project was intended to be used. Basically we are running telegraf agent on each node and this is using compiled version of telegraf. No problem there.

However from our own Go applications we are sending metrics to telegraf via UDP. And for that we use NewUDPClient from https://github.com/influxdata/telegraf/blob/master/plugins/outputs/influxdb/udp.go#L38

Now I understand that this may not be preferred way :D

Do you have any other Go telegraf udp client available?

srebhan commented 1 week ago

There really is no magic in this, if you need to, just copy that file (adhering to the license ;-))... You may also be interested in the Golang client libraries?

srebhan commented 1 week ago

@matejsp can we close this issue?

matejsp commented 1 week ago

The issue can be closed.

I cannot find UDP client in golang client libraries. Perhaps something that could be extended. But the line protocol is supported inside. Perhaps we can have our own UDP client and combine.

srebhan commented 1 week ago

Sorry my bad, the client-libs indeed do not offer UDP...