Panic occure on running inputs.cloudwatch_metric_streams


I tried to collect data via inputs.cloudwatch_metric_streams. However, I couldn’t run Telegraf due to a panic error when I used this plugin.

I attempted to set the global address of my EC2 instance as the listening address. Should I use a different connection name? Can I use the DNS name of the EC2 instance’s connect endpoint for listening on port 443?

The debug message is shown below.

This message show version 1.29.0.
However I installed 1.30.3.

[root@ip-172-31-5-91 telegraf]# vi telegraf.confip a/usr/lib/telegraf/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d --test
2024-06-05T03:21:28Z I! Loading config: /etc/telegraf/telegraf.conf
2024-06-05T03:21:28Z I! Starting Telegraf 1.29.0 brought to you by InfluxData the makers of InfluxDB
2024-06-05T03:21:28Z I! Available plugins: 241 inputs, 9 aggregators, 30 processors, 24 parsers, 60 outputs, 6 secret-stores
2024-06-05T03:21:28Z I! Loaded inputs: cloudwatch_metric_streams
2024-06-05T03:21:28Z I! Loaded aggregators:
2024-06-05T03:21:28Z I! Loaded processors:
2024-06-05T03:21:28Z I! Loaded secretstores:
2024-06-05T03:21:28Z W! Outputs are not used in testing mode!
2024-06-05T03:21:28Z I! Tags enabled: host=ip-172-31-5-91.ap-northeast-1.compute.internal
2024-06-05T03:21:28Z D! [agent] Initializing plugins
2024-06-05T03:21:28Z D! [agent] Starting service inputs
2024-06-05T03:21:28Z I! [inputs.cloudwatch_metric_streams] Listening on :443
2024-06-05T03:21:28Z D! [agent] Stopping service inputs
2024-06-05T03:21:28Z D! [agent] Input channel closed
panic: close of nil channel

goroutine 52 [running]:*CloudWatchMetricStreams).Start.func1()
/go/src/ +0x125
created by*CloudWatchMetricStreams).Start in goroutine 1
/go/src/ +0x208

Any help is appreciated

Hello @yaaaaappie,
What do you get with

telegraf --version

For the cloudwatch_metric_streams plugin, you should configure the listening_address parameter in your telegraf.conf file.

  listening_address = ":443"
  ## Use a specific DNS name if needed
  # listening_address = ""

Also for debugging you can do:

telegraf --config /etc/telegraf/telegraf.conf --debug

Or set

debug = true

In the agent portion of the config.
Just fyi for anyone else who might encounter this issue as well.