Telegraf config for AWS erroring out

telegraf
#1

Hi,

My telegraf config has the following code to connect to AWS but finding the error in log. Can you please help?

Telegraf version is telegraf-1.1.2_linux

Config:

###############################################################################
#                            OUTPUT PLUGINS                                   #
###############################################################################

# # Configuration for AWS CloudWatch output.
# [[outputs.cloudwatch]]
# Amazon REGION
  region = "us-east-1"
  role_arn = "arn:aws:iam::ACC_NUMBER:role/ROLE_NAME"
  namespace = "my-jvmstats"

Error in telegraf.log

2017/03/22 20:38:32 E! Could not parse [agent] config
2017/03/22 20:38:32 E! Error parsing /opt/telegraf/telegraf.conf, line 87: field corresponding to `namespace' is not defined in `*config.AgentConfig'

Thanks
Karthik

#2

My wild guess would be that

# [[outputs.cloudwatch]]

needs to be uncommented.

2 Likes
#3

Thank You; that solved it. But I am getting the following error if I use Role ARN:

2017/03/23 18:00:44 E! cloudwatch: Error in ListMetrics API call : NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2017/03/23 18:00:44 E! Failed to connect to output cloudwatch, retrying in 15s, error was 'NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors’
2017/03/23 18:01:19 E! cloudwatch: Error in ListMetrics API call : NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
2017/03/23 18:01:19 E! NoCredentialProviders: no valid providers in chain. Deprecated.

If I use Profile, Below Error:

2017/03/23 18:17:01 E! cloudwatch: Error in ListMetrics API call : SharedCredsLoad: failed to load shared credentials file
caused by: open /root/.aws/credentials: no such file or directory
2017/03/23 18:17:01 E! Failed to connect to output cloudwatch, retrying in 15s, error was 'SharedCredsLoad: failed to load shared credentials file
caused by: open /root/.aws/credentials: no such file or directory’
2017/03/23 18:17:16 E! cloudwatch: Error in ListMetrics API call : SharedCredsLoad: failed to load shared credentials file
caused by: open /root/.aws/credentials: no such file or directory
2017/03/23 18:17:16 E! SharedCredsLoad: failed to load shared credentials file
caused by: open /root/.aws/credentials: no such file or directory

Any recommendation here as we want the telegraf to generate the tokens based on role/profile to keep it simple.

Thank You