Skip to content

Commit

Permalink
Add prometheus keys to access aws instances
Browse files Browse the repository at this point in the history
  • Loading branch information
LDiazN committed Jan 31, 2025
1 parent 8b4645f commit 10e5bbb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ansible/roles/prometheus/templates/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,16 @@ scrape_configs:
static_configs:
- targets:
- backend-hel.ooni.org:444

# EC2 instances monitoring:
- job_name: 'ooni-api-ec2'
scrape_interval: 5s
scheme: https
metrics_path: "/metrics"
ec2_sd_configs:
- access_key: "{{prometheus_aws_access_key}}"
secret_key: "{{prometheus_aws_secret_key}}"
region: "eu-central-1"
port: 80 # should be the proxy
# relabel_configs: # Change the host to the proxy host with relabeling
...
3 changes: 3 additions & 0 deletions ansible/roles/prometheus/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ blackbox_jobs:
- name: icmp
module: icmp
targets: "{{ dom0_hosts | list }}"

prometheus_aws_access_key: "{{ lookup('amazon.aws.aws_ssm', '/oonidevops/secrets/ooni_monitoring/access_key', profile='oonidevops_user_dev') }}"
prometheus_aws_secret_key: "{{ lookup('amazon.aws.aws_ssm', '/oonidevops/secrets/ooni_monitoring/secret_key', profile='oonidevops_user_dev') }}"

0 comments on commit 10e5bbb

Please sign in to comment.