

# Prometheus メトリクスの表示
<a name="ContainerInsights-Prometheus-viewmetrics"></a>

App Mesh、NGINX、Java/JMX、Memcached、HAProxy、およびユーザーが追加した手動設定の他の Prometheus エクスポーターから選別された事前集計メトリクスを含む、すべての Prometheus メトリクスについてモニターリングし、アラームを受けることができます。他の Prometheus エクスポーターからのメトリクス収集の詳細については、「[新しい Prometheus スクレイピングターゲットを追加するためのチュートリアル: Prometheus API サーバーメトリクス](ContainerInsights-Prometheus-Setup-configure.md#ContainerInsights-Prometheus-Setup-new-exporters)」を参照してください。

CloudWatch コンソールでは、Container Insights は次の事前作成済みのレポートを提供します。
+ Amazon EKS および Kubernetes クラスターの場合、App Mesh、NGINX、HAProxy、Memcached、Java/JMX 用の事前作成済みのレポートが提供されます。
+ Amazon ECS クラスターの場合、App Mesh と Java/JMX 用の事前作成済みレポートが提供されます。

また、Container Insights は、Container Insights が厳選したメトリクスを収集するワークロードごとにカスタムダッシュボードを提供します。これらのダッシュボードは GitHub からダウンロードすることができます 

**Prometheus メトリクスをすべて表示するには**

1. CloudWatch コンソールの [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/) を開いてください。

1. ナビゲーションペインで [**Metrics (メトリクス)**] を選択してください。

1. 名前空間のリストで、[**ContainerInsights/Prometheus**] または [**ECS/ContainerInsights/Prometheus**] を選択します。

1. 次のリストで、ディメンションのセットの 1 つを選択します。次に、表示するメトリクスの横にあるチェックボックスを選択します。

**Prometheus メトリクスに関する事前作成済みのレポートを表示するには**

1. CloudWatch コンソールの [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/) を開いてください。

1. ナビゲーションペインで、[**パフォーマンスのモニターリング**] を選択します。

1. ページの上部近くのドロップダウンボックスで、Prometheus オプションのいずれかを選択します。

   もう 1 つのドロップダウンボックスで、表示するクラスターを選択します。

また、NGINX、App Mesh、Memcached、HAProxy、Java/JMX 用のカスタムダッシュボードも用意されています。

**Amazon が用意したカスタムダッシュボードを使用するには**

1. CloudWatch コンソールの [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/) を開いてください。

1. ナビゲーションペインで、**ダッシュボード**を選択します。

1. [**ダッシュボードの作成**] を選択します。新しいダッシュボードの名前を入力し、[**ダッシュボードの作成**] を選択します。

1. [**このダッシュボードに追加**] で、[**キャンセル**] を選択します。

1. [**アクション**]、[**ソースの表示/編集**] を選択します。

1. 次の JSON ファイルのいずれかをダウンロードします。
   + [ Github の NGINX カスタムダッシュボードソース](https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus/sample_cloudwatch_dashboards/nginx-ingress/cw_dashboard_nginx_ingress_controller.json)。
   + [Github の App Mesh カスタムダッシュボードソース](https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus/sample_cloudwatch_dashboards/appmesh/cw_dashboard_awsappmesh.json)。
   + [ Github の Memcached カスタムダッシュボードソース](https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus/sample_cloudwatch_dashboards/memcached/cw_dashboard_memcached.json)。
   + [ Github の HAProxy-Ingress カスタムダッシュボードソース](https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus/sample_cloudwatch_dashboards/haproxy-ingress/cw_dashboard_haproxy_ingress.json)
   + [ Github の Java/JMX カスタムダッシュボードソース](https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus/sample_cloudwatch_dashboards/javajmx/cw_dashboard_javajmx.json)。

1. ダウンロードした JSON ファイルをテキストエディタで開き、次の変更を加えます。
   + すべての `{{YOUR_CLUSTER_NAME}}` 文字列をクラスターの正確な名前に置き換えます。テキストの前後に空白を追加しないようにしてください。
   + すべての `{{YOUR_REGION}}` 文字列を、クラスターが実行されている AWS リージョンに置き換えます。例えば、**us-west-1** テキストの前後に空白を追加しないようにしてください。
   + すべての `{{YOUR_NAMESPACE}}` 文字列を、ワークロードとまったく同じ名前空間に置き換えます。
   + すべての `{{YOUR_SERVICE_NAME}}` 文字列を、ワークロードとまったく同じサービス名に置き換えます。例: **haproxy-haproxy-ingress-controller-metrics**

1. JSON BLOB 全体をコピーし、CloudWatch コンソールのテキストボックスに貼り付けて、ボックスに既に入力されている内容を置き換えます。

1. [**更新**]、[**ダッシュボードの保存**] の順に選択します。