Prometheus: Prometheusアラートルールの設定

このドキュメントはアラートガイドの一部です。完全なガイドはこちらからご覧いただけます:Prometheusアラートの仕組みと設定方法

👋 Stackheroのドキュメントへようこそ!

Stackheroは、数多くの利点を提供するPrometheusクラウドソリューションを提供しています。主な利点は以下の通りです:

  • Alert Managerが含まれており、SlackMattermostPagerDutyなどにアラートを送信できます。
  • 無制限のメールアラートを送信できる専用メールサーバー。
  • BlackboxHTTPICMPTCPなどをプローブ。
  • オンライン設定ファイルエディタによる簡単な設定
  • ワンクリックでの手間いらずの更新
  • プライベートで専用のVMによる最適なパフォーマンスと強固なセキュリティ

時間を節約し、生活を簡素化:StackheroのPrometheusクラウドホスティングソリューションを試すのに5分しかかかりません!

Prometheusアラートルールは、rules-alert.ymlファイルを編集することで調整できます。これを行うには、Stackheroダッシュボードにアクセスし、Prometheusサービスを選択し、「Prometheusアラートルールの設定」をクリックします。

Stackhero for Prometheusインスタンスには、すでにいくつかのデフォルトのアラートルールが追加されているため、カスタマイズが必要でない限り、通常はrules-alert.ymlファイルを変更する必要はありません。

以下は、ディスク使用率が90%を超えた場合にトリガーされるアラートの例です:

- alert: "HostOutOfDiskSpace"
  expr: (node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) node_filesystem_readonly == 0
  for: 2m
  labels:
    severity: "warning"
  annotations:
    summary: "Host out of disk space (instance {{ $labels.instance }})"
    description: "Disk is almost full (< 10% left)"
    value: "{{ $value }}"

次は、24時間以内にディスクスペースの飽和を予測する例です:

- alert: "HostDiskWillFillIn24Hours"
  expr: (node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) predict_linear(node_filesystem_avail_bytes{fstype!~"tmpfs"}[1h], 24 * 3600) < 0 and ON (instance, device, mountpoint) node_filesystem_readonly == 0
  for: 2m
  labels:
    severity: "warning"
  annotations:
    summary: "Host disk will fill in 24 hours (instance {{ $labels.instance }})"
    description: "Filesystem is predicted to run out of space within the next 24 hours at the current write rate"
    value: "{{ $value }}"

Awesome Prometheus Alertsウェブサイトで、さらに多くのアラートルールの例を見つけることができます。