Skip to content

Commit bd579b8

Browse files
committed
🧱 Modify files to fit ECS environment
1 parent 2987d48 commit bd579b8

2 files changed

Lines changed: 10 additions & 30 deletions

File tree

‎prometheus/Dockerfile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM prom/prometheus:latest
22

3+
COPY prometheus.yml /etc/prometheus/prometheus.yml
4+
35
EXPOSE 9090
46

5-
CMD [ "--config.file=/etc/prometheus/prometheus.yml" ]
7+
HEALTHCHECK --interval=15s --timeout=3s --start-period=10s --retries=3 \
8+
CMD ["curl", "-f", "http://localhost:9090/-/healthy"]

‎prometheus/prometheus.yml‎

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,8 @@
1+
global:
2+
scrape_interval: 15s
3+
14
scrape_configs:
2-
- job_name: prometheus
3-
metrics_path: /metrics
4-
scheme: http
5+
- job_name: 'spring-boot-app'
6+
metrics_path: '/actuator/prometheus'
57
static_configs:
6-
- targets:
7-
- localhost:9090
8-
9-
- job_name: spring-actuator
10-
metrics_path: /actuator/prometheus
11-
scheme: http
12-
scrape_interval: 15s
13-
ec2_sd_configs:
14-
- region: ap-northeast-2
15-
port: 80
16-
filters:
17-
- name: tag:Monitoring
18-
values:
19-
- enabled
20-
relabel_configs:
21-
- source_labels: [__meta_ec2_tag_Name]
22-
target_label: instance
23-
- source_labels: [__meta_ec2_private_ip]
24-
regex: (.*)
25-
replacement: ${1}:10090
26-
action: replace
27-
target_label: __address__
28-
- source_labels: [__meta_ec2_tag_group]
29-
target_label: group
30-
- source_labels: [__meta_ec2_instance_type]
31-
target_label: instance_type
8+
- targets: ['localhost:8080']

0 commit comments

Comments
 (0)