Telegraf + exec plugin + python writing the data into cloudwatch issues


I am using s3 boto3 framework in python to print the bucket name and object details and printed in the o/p format as

metadata, file_creation_date=“2022-08-10”,file_creation_time=“13:44:25”,file_storage_size=7679i, source_bucket=from

The values file_creation_date, file_creation_time and source_bucket are not appearing in cloud watch as metric, only fname and file_storage_size are appearing

This is python program is called by input plugin exe and writes the data into AWS cloud watch. The issue I am having is how to distinguish between the tags and values in the print statement( in python). or else can I print the output in JSON and ingested required keys into cloudwatch.

What is the expected format of print in python to send the data into cloud watch ?


The Cloudwatch plugin will only write fields that can be converted to float64; other fields, like strings are skipped. This is why the file creation date and time, and source bucket are ignored.

Thanks for your reply. Is there any workaround to solve this problem statement please ?.

How about the outputting same thing in JSON and writing into cloud watch ?

My experience with Cloudwatch is very limited, but what I can say is if you want those string fields, you may want to make them tags when you send them in to Telegraf. As tags, I believe CloudWatch turns them into properties of the metric.

That would mean turning this:

metadata, file_creation_date=“2022-08-10”,file_creation_time=“13:44:25”,file_storage_size=7679i,source_bucket=from

into this

metadata,,file_creation_date=“2022-08-10”,file_creation_time=“13:44:25”,source_bucket=from file_storage_size=7679i
1 Like