1. Managed Cloudの構成

カスタムのPrometheusアラートを追加する

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Prometheusは、Grafanaがすぐに使用できるサポートを提供するオープンソースのシステム監視システムです。Managed Cloud Containerソリューションは、カスタムPrometheusアラートで拡張できます。

カスタムPrometheusアラートを作成するには:

  1. alertsフォルダに移動し、custom-alerts.yamlファイルを作成します。

  2. custom-alerts.yamlファイルを開き、カスタムアラートを追加します。たとえば、ノードのメモリ使用量が95% を超えたときに起動するアラート ルールを追加できます。

    apiVersion: monitoring.coreos.com/v1
    kind: PrometheusRule
    metadata:
      labels:
        prometheus: prometheus-service
        role: alert-rules
      name: prometheus-k8s-custom-alerting-rules
      namespace: monitoring
    spec:
      groups:
      - name: custom statistic
        rules:
        - alert: Memory percentage is >95%
          annotations:
            description: "Node memory utilization is > 95%"
            message: "Out of memory (instance {{ $labels.node }})"
          expr: label_replace(sum(kube_metrics_server_nodes_mem) by (exported_instance), "node""$1""exported_instance""(.*)")  / on(node) ((sum(kube_node_status_allocatable_memory_bytes) by (node)) / 1024) * 100 > 95
          for: 10m
          labels:
            severity: P3
            resource: '{{ $labels.node }}'
  3. アプリケーション パイプラインを実行します。

この記事を改善するための提案がある場合は、 お知らせください!