I'm just configuring promtail and testing it out on my EC2 instance, running this
./promtail-linux-amd64 -config.file=./ec2-promtail.yaml --dry-run
I get the following error
<ErrorResponse “http://webservices.amazon.com/AWSFault/200. Sender. InvalidAction. <|Message>Could not find operation DescribeInstances for version 2. . | 2bbe..caused by: expected element type but have ”
I'm checking if my config is wrong and if anyone has faced this issue.
I'm configuring Promtail on an AML Linux 2 Instance. My instance has no internet connection (security reasons) so I am using STS endpoint in my region to authenticate the role.
Promtail version: 2.7.1
AWS Role: Has DescribeInstance
, DescribeAvailabilityZone
permissions
The following is my ec2_sd_config
http_listen_port: 3100
grpc_listen_port: 0
clients:
- url: https://loki.dev.fdp.internal/loki/api/v1/push
positions:
filename: /opt/promtail/positions.yaml
scrape_configs:
- job_name: ec2-logs
ec2_sd_configs:
- region: ap-southeast-1
role_arn: arn:aws:iam::xxxxxx:role/promtail_role
endpoint: sts.ap-southeast-1.amazonaws.com # define to use regional endpoint instead of the default global
relabel_configs:
- source_labels: [__meta_ec2_tag_Name]
target_label: name
action: replace
- source_labels: [__meta_ec2_instance_id]
target_label: instance
action: replace
- source_labels: [__meta_ec2_availability_zone]
target_label: zone
action: replace
- action: replace
replacement: /var/log/**.log
target_label: __path__
- source_labels: [__meta_ec2_private_dns_name]
regex: "(.*)"
target_label: __host__