Skip to content

Commit a8a93f7

Browse files
committed
add prometheus and grfana with more disk space
1 parent 7d85209 commit a8a93f7

File tree

5 files changed

+78
-0
lines changed

5 files changed

+78
-0
lines changed

grafana.repo

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[grafana]
2+
name=grafana
3+
baseurl=https://packages.grafana.com/oss/rpm
4+
repo_gpgcheck=1
5+
enabled=1
6+
gpgcheck=1
7+
gpgkey=https://packages.grafana.com/gpg.key
8+
sslverify=1
9+
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

prometheus.repo

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[prometheus]
2+
name=prometheus
3+
baseurl=https://packagecloud.io/prometheus-rpm/release/el/7/$basearch
4+
repo_gpgcheck=1
5+
enabled=1
6+
gpgkey=https://packagecloud.io/prometheus-rpm/release/gpgkey
7+
https://raw.githubusercontent.com/lest/prometheus-rpm/master/RPM-GPG-KEY-prometheus-rpm
8+
gpgcheck=1
9+
sslverify=1
10+
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
11+
metadata_expire=300

prometheus.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Page up
2+
# my global config
3+
global:
4+
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
5+
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
6+
# scrape_timeout is set to the global default (10s).
7+
# Attach these labels to any time series or alerts when communicating with
8+
# external systems (federation, remote storage, Alertmanager).
9+
external_labels:
10+
monitor: 'codelab-monitor'
11+
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
12+
rule_files:
13+
# - "first.rules"
14+
# - "second.rules"
15+
# A scrape configuration containing exactly one endpoint to scrape:
16+
# Here it's Prometheus itself.
17+
scrape_configs:
18+
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
19+
- job_name: 'prometheus'
20+
# metrics_path defaults to '/metrics'
21+
# scheme defaults to 'http'.
22+
static_configs:
23+
- targets: ['localhost:9090']
24+
# scrape Redis Enterprise central
25+
- job_name: redis-enterprise
26+
scrape_interval: 30s
27+
scrape_timeout: 30s
28+
metrics_path: /
29+
scheme: https
30+
tls_config:
31+
insecure_skip_verify: true
32+
static_configs:

templates/MasterWithRedis.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ Resources:
356356
Tags:
357357
- Key: 'Name'
358358
Value: !Join ['', [!Ref AWS::StackName, 'APPEC2'] ]
359+
BlockDeviceMappings:
360+
- DeviceName: "/dev/xvda"
361+
Ebs:
362+
DeleteOnTermination: 'true'
363+
VolumeSize: '60'
364+
VolumeType: gp2
359365
UserData:
360366
Fn::Base64:
361367
!Sub |
@@ -377,6 +383,18 @@ Resources:
377383
make install
378384
cd /home/ec2-user
379385
chown -R ec2-user:ec2-user memtier_benchmark
386+
cp redisSMSLuaA-A/grafana.repo /etc/yum.repos.d
387+
cp redisSMSLuaA-A/prometheus.repo /etc/yum.repos.d
388+
cp redisSMSLuaA-A/prometheus.yml /etc/prometheus
389+
echo " - targets: [${RedisNSRecord}:${RedisDatabasePort}]">> /etc/prometheus/prometheus.yml
390+
yum -y makecache fast
391+
yum install -y grafana
392+
systemctl enable --now grafana-server.service
393+
systemctl enable --now prometheus.service
394+
yum install -y prometheus2.x86_64
395+
grafana-cli plugins install redis-datasource
396+
systemctl restart grafana
397+
380398

381399
RedisARecord1E:
382400
Type: AWS::Route53::RecordSet

templates/VPCStack.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ Resources:
120120
CidrIp: !Join ['', [!Ref LocalIp, "/32"] ]
121121
FromPort: 22
122122
ToPort: 22
123+
- IpProtocol: "tcp"
124+
CidrIp: !Join ['', [!Ref LocalIp, "/32"] ]
125+
FromPort: 3000
126+
ToPort: 3000
123127
- IpProtocol: "tcp"
124128
CidrIp: "0.0.0.0/0"
125129
FromPort: 9443
@@ -128,6 +132,10 @@ Resources:
128132
CidrIp: "0.0.0.0/0"
129133
FromPort: 8080
130134
ToPort: 8080
135+
- IpProtocol: "tcp"
136+
CidrIp: "0.0.0.0/0"
137+
FromPort: 9081
138+
ToPort: 9081
131139
- IpProtocol: "tcp"
132140
CidrIp: "0.0.0.0/0"
133141
FromPort: 8443

0 commit comments

Comments
 (0)