第13章 Red Hat Process Automation Manager Kogito Operator と Prometheus および Grafana との対話
Red Hat Process Automation Manager の Red Hat build of Kogito は、Red Hat build of Kogito マイクロサービスの Prometheus メトリック監視を有効にする monitoring-prometheus-addon アドオンを提供し、アドオンによってエクスポートされたデフォルトのメトリックを使用する Grafana ダッシュボードを生成します。RHPAM Kogito Operator は Prometheus Operator を使用して、Prometheus からスクレープするプロジェクトからメトリックを公開します。この依存関係により、Prometheus Operator はプロジェクトと同じ namespace にインストールする必要があります。
Red Hat build of Kogito マイクロサービスの Prometheus メトリクス監視を有効にする場合は、使用するフレームワークに応じて、プロジェクトの pom.xml ファイルに以下の依存関係を追加します。
Prometheus Red Hat build of Quarkus アドオンの依存関係
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>monitoring-prometheus-quarkus-addon</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>monitoring-prometheus-quarkus-addon</artifactId>
</dependency>
Prometheus Spring Boot アドオンの依存関係
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>monitoring-prometheus-springboot-addon</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>monitoring-prometheus-springboot-addon</artifactId>
</dependency>
monitoring-prometheus-addon アドオンを使用し、Prometheus Operator がインストールされている Red Hat build of Kogito マイクロサービスをデプロイする場合、Red Hat Process Automation Manager Kogito Operator は ServiceMonitor カスタムリソースを作成し、以下の例のように Prometheus のメトリクスを公開します。
Prometheus の ServiceMonitor リソースの例
Prometheus Operator によって管理される Prometheus カスタムリソースを手作業で設定し、ServiceMonitor リソースを選択する必要があります。
Prometheus リソースの例
ServiceMonitor リソースで Prometheus リソースを設定した後に、Prometheus Web コンソールの Targets ページで Prometheus によってスクレープされたエンドポイントを表示できます。Red Hat Process Automation Manager サービスが公開するメトリックが Graph ビューに表示されます。
RHPAM Kogito Operator は、アドオンによって生成された Grafana ダッシュボードごとに、Grafana Operator によって定義される GrafanaDashboard カスタムリソースも作成します。ダッシュボードの app ラベルは、デプロイされた Red Hat build of Kogito マイクロサービスの名前です。Red Hat build of Kogito マイクロサービスに従い、Grafana カスタムリソースの dashboardLabelSelector プロパティーを設定する必要があります。
Grafana リソースの例