This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第5章 メトリックの管理
メトリクスを使用すると、クラスターコンポーネントおよび独自のワークロードのパフォーマンスをモニターできます。
5.1. メトリクスについて
OpenShift Container Platform 4.9 では、クラスターコンポーネントはサービスエンドポイントで公開されるメトリクスを収集することによりモニターされます。ユーザー定義プロジェクトのメトリクスのコレクションを設定することもできます。
Prometheus クライアントライブラリーをアプリケーションレベルで使用することで、独自のワークロードに指定するメトリクスを定義できます。
OpenShift Container Platform では、メトリクスは /metrics
の正規名の下に HTTP サービスエンドポイント経由で公開されます。curl
クエリーを http://<endpoint>/metrics
に対して実行して、サービスの利用可能なすべてのメトリクスを一覧表示できます。たとえば、prometheus-example-app
サンプルサービスへのルートを公開し、以下を実行して利用可能なすべてのメトリクスを表示できます。
curl http://<example_app_endpoint>/metrics
$ curl http://<example_app_endpoint>/metrics
出力例
HELP http_requests_total Count of all HTTP requests TYPE http_requests_total counter HELP version Version information about this binary TYPE version gauge
# HELP http_requests_total Count of all HTTP requests
# TYPE http_requests_total counter
http_requests_total{code="200",method="get"} 4
http_requests_total{code="404",method="get"} 2
# HELP version Version information about this binary
# TYPE version gauge
version{version="v0.1.0"} 1
関連情報
- Prometheus クライアントライブラリーについての詳細は、Prometheus ドキュメント を参照してください。