When using variable for role_arn no metrics are coming.
Below are the details:
1.) prometheus config:
- job_name: 'sample_redshift'
metrics_path: '/scrape'
ec2_sd_configs:
- region: us-east-2
static_configs:
- targets: ['arn:aws:iam::xxxxxxxxxxxx:role/cloudwatch-role']
relabel_configs:
- source_labels: [address]
target_label: __param_targetrole
- target_label: address
replacement: 'localhost:9042'
2.) Target Url:
curl 'http://localhost:9042/metrics?targetrole=arn%3Aaws%3Aiam%3A%3Axxxxxxxxxxxxxx%3Arole%2Fcloudwatch-role®ion=us-east-2'
3.) Ouptut from exporter:
HELP cloudwatch_requests_total API requests made to CloudWatch
TYPE cloudwatch_requests_total counter
cloudwatch_requests_total 0
4.) sample.yml config:
tasks:
- name: redshift_cloudwatch
default_region: us-east-2
role_arn: [$_targetrole]
metrics:
- aws_namespace: AWS/Redshift
aws_metric_name: DatabaseConnections
aws_dimensions: [ClusterIdentifier]
aws_statistics: [Average]
5.) from aws-cli everything is working fine when switching between the roles.