How to monitor multiple aws account ec2 node on single prometheus server.

26 views
Skip to first unread message

Shivali Chauhan

unread,
May 1, 2020, 1:11:16 PM5/1/20
to Prometheus Users
Hi Team,

i need one help

I am trying to monitoring multiple AWS account on  one server

so i did VPC peering and its working fine.
But its not pulling the data from different account ??

my prometheus.yml file
=========================

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    static_configs:
    - targets: ['localhost:9090']
  - job_name: 'node'
    ec2_sd_configs:
      - region: eu-west-1
        access_key: 'Key Account A'
        secret_key: 'Key Account A'
        port: 9100
    relabel_configs:
      - source_labels:
        - '__meta_ec2_tag_Name'
        target_label: 'instance'
      - source_labels:
        - '__meta_ec2_tag_Environment'
        regex: 'staging'
        action: 'keep'
      - source_labels:
        - '__meta_ec2_tag_Environment'
        target_label:  'Environment'
  - job_name: 'node exporter ops'
    ec2_sd_configs:
      - region: eu-west-1
        access_key: 'Key account B'
        secret_key: 'Key Account B'
        port: 9100
    relabel_configs:
      - source_labels:
        - '__meta_ec2_tag_Name'
        target_label: 'instance'
      - source_labels:
        - '__meta_ec2_tag_Environment'
        regex: 'staging'
        action: 'keep'
      - source_labels:
        - '__meta_ec2_tag_Environment'
        target_label:  'Environment'



this is my configuration

could you please help me on this where i am going wrong ??
  could you please help me on that 

Regards
Shivali Chauhan
Reply all
Reply to author
Forward
0 new messages