Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upec2_sd_config IAM roles support #2244
Comments
This comment has been minimized.
This comment has been minimized.
|
It should just work out of the box. |
brian-brazil
added
the
kind/question
label
Dec 3, 2016
This comment has been minimized.
This comment has been minimized.
|
Run successfully with profile: parameter after pull fresh prom/prometheus:latest
|
This comment has been minimized.
This comment has been minimized.
|
So where is role_arn should be set? |
This comment has been minimized.
This comment has been minimized.
|
Looks like 'profile' parameter for ec2_sd_config not works or ignored for some reason rule_files:
scrape_configs:
docker compose for prometheus looks like AWS config files in /root/.aws folder: cat ~/.aws/credentials cat ~/.aws/config [profile devops] Any logs about connection to aws on prometheus side. And hosts does not appear under /targets tab on prometheus UI. |
This comment has been minimized.
This comment has been minimized.
rlees85
commented
Jan 31, 2017
•
|
I also cannot get prometheus to work with an IAM role. This is the error I get from trying to do so on an ec2 instance with the correct IAM role attached to it:
It seems like it is not even trying because the access key value is not set. A simple EDIT: This works in the latest prometheus. I did not check how old and crusty the version in the Ubuntu repositories were. Apologies! |
This comment has been minimized.
This comment has been minimized.
vacri
commented
Feb 15, 2017
•
|
@rlees85 what version is it working for you on? I'm using 1.5.0 from the debian/sid apt repo (built 20170126) and getting the EnvAccessKeyNotFound error, despite having a valid role on the instance. Just wondering if I need to build my own even newer version, or if it's something else. |
This comment has been minimized.
This comment has been minimized.
rlees85
commented
Feb 16, 2017
|
@vacri it was 1.5.2 from the Prometheus homepage: https://prometheus.io/download/ It was a case of manually extracting the file and finding a suitable systemd unit. I think I used this one: https://askubuntu.com/questions/818514/how-do-i-install-the-latest-version-of-prometheus-on-16-04 (Last post in the thread, NOT the unit for node-exporter) Make sure you change the path in |
This comment has been minimized.
This comment has been minimized.
vacri
commented
Feb 17, 2017
|
thanks @rlees85, I'll check it out! |
grobie
closed this
Mar 5, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
loky9000 commentedDec 2, 2016
•
edited
Is there are possibility to use AWS IAM roles in ec2_sd_config?
I test prometheus stack in docker (prom/prometheus:latest)
My aws user has no direct access to resources only through switch to correct IAM role so
i got
UnauthorizedOperation: You are not authorized to perform this operation.\n\tstatus code: 403
when access_key and secret_key params is set
i try set profile property (profile configured on docker host in ~/.aws/config so unclear how it can be used from inside prometheus container, if it should be mounted is unclear the target for this mount)
tls_config:
insecure_skip_verify: true
ec2_sd_configs:
- region: 'eu-east-1'
profile: "test-profile"
relabel_configs:
- source_labels: [__meta_ec2_tag_Name]
regex: dmz-haproxy*
action: keep
# Use the instance ID as the instance label
- source_labels: [__meta_ec2_instance_id]
target_label: instance
but got the error
"Error loading config: couldn't load configuration (-config.file=/etc/prometheus/prometheus.yml): unknown fields in ec2_sd_config: profile" source="main.go:149"