Skip to content

Commit a1de8a3

Browse files
authored
Merge pull request #26 from aws-samples/region-fix
Add region to ec2_instance exporter
2 parents 2a27a42 + 1dd3403 commit a1de8a3

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

parallelcluster-setup/install-monitoring.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ case "${cfn_node_type}" in
6363
sed -i "s/__LOG_GROUP__NAMES__/${log_group_names}/g" ${monitoring_home}/grafana/dashboards/logs.json
6464

6565
sed -i "s/__Application__/${stack_name}/g" ${monitoring_home}/prometheus/prometheus.yml
66+
sed -i "s/__AWS_REGION__/${cfn_region}/g" ${monitoring_home}/prometheus/prometheus.yml
6667

6768
sed -i "s/__INSTANCE_ID__/${master_instance_id}/g" ${monitoring_home}/grafana/dashboards/master-node-details.json
6869
sed -i "s/__INSTANCE_ID__/${master_instance_id}/g" ${monitoring_home}/grafana/dashboards/compute-node-list.json

parallelcluster-setup/pcluster.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ Scheduling:
4141
LocalStorage:
4242
RootVolume:
4343
VolumeType: gp3
44+
CustomActions:
45+
OnNodeConfigured:
46+
Script: https://raw.githubusercontent.com/aws-samples/aws-parallelcluster-monitoring/main/post-install.sh
47+
Args:
48+
- https://github.com/aws-samples/aws-parallelcluster-monitoring/tarball/main
49+
- aws-parallelcluster-monitoring
50+
- install-monitoring.sh
51+
Iam:
52+
AdditionalIamPolicies:
53+
- Policy: arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
54+
- Policy: arn:aws:iam::aws:policy/CloudWatchFullAccess
55+
- Policy: arn:aws:iam::aws:policy/AWSPriceListServiceFullAccess
56+
- Policy: arn:aws:iam::aws:policy/AmazonSSMFullAccess
57+
- Policy: arn:aws:iam::aws:policy/AWSCloudFormationReadOnlyAccess
4458
Region: us-east-2
4559
Image:
4660
Os: alinux2

prometheus/prometheus.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ scrape_configs:
2727
scrape_interval: 5s
2828
ec2_sd_configs:
2929
- port: 9100
30+
region: __AWS_REGION__
3031
refresh_interval: 10s
3132
- port: 9400
33+
region: __AWS_REGION__
3234
refresh_interval: 10s
3335
filters:
3436
- name: instance-state-name

0 commit comments

Comments
 (0)