初めて質問致します。
前提・実現したいこと
Dockerコンテナを用いたwebポータルシステムを構築をゴールとして
Docker関連技術の検証を行っております。
現在の構成としては
■VM 1(監視側)
RHEL 7.5
Prometheus(Dockerコンテナ上)
grafana(Dockerコンテナ上)
Alertmanager(Dockerコンテナ上)
node-exporter
■VM 2(監視側)
RHEL 7.5
apache(Dockerコンテナ上)
tomcat(Dockerコンテナ上)
cadvisor(Dockerコンテナ上)
node-exporter
となっております。
現在
Prometheus(grafana)側からは
VM 2のCPU、メモリ、リソース(node-exporter経由)
VM 2のDockerコンテナ上のCPU使用率メモリ、リソースが参照できる状態です。(cadvisor経由)
また、アラートに関してはnode-exporterを用いたノード死活のみできております。
しかし
メトリクスのフォーマットや計算記法がいまいちよくわからず
Dockerコンテナの死活監視、リソース監視がうまくできないため
質問させていただきます。
Promrtheusがcadvisorメトリクスを拾っている前提として
apacheコンテナのCPU使用率90超えでアラート等行う場合
どのようにalertrulesを書けば良いのでしょうか。(アラート登録であってアラート送信ではないです)
Dockerコンテナの死活やリソースを監視もしくはアラート設定している知見が
ありましたらご教授ください。
alerts.rule(記法がわからず下記の内容のみ)
ALERT InstanceDown IF up == 0 FOR 5m LABELS { severity = "page" } ANNOTATIONS { summary = "Instance {{ $labels.instance }} down", description = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes." }
prometheus.yml
global: scrape_interval: 15s # By default, scrape targets every 15 seconds. rule_files: - alerts.rule scrape_configs: - job_name: node static_configs: #VM_1 - targets: ['xxx.xx.x.x:9100'] #VM_2 - targets: ['xxx.xx.x.x:9100'] - job_name: cAdvisor static_configs: - targets: ['xxx.xx.x.x:8080']
補足情報(FW/ツールのバージョンなど)
Dockerは
Docker version 1.13.1, build 94f4240/1.13.1
他のミドルウェア、コンテナは現時点で最新バージョンを使用しております。
あなたの回答
tips
プレビュー