Cloud Storage FUSE 指標

このページでは、Cloud Storage FUSE の指標の概要と、指標データの収集、エクスポート、分析の方法について説明します。

概要

Cloud Storage FUSE を使用してバケットをファイル システムとして Cloud Storage にマウントすると、Cloud Storage は Cloud Storage FUSE に関する詳細な指標を提供します。指標を使ってパフォーマンスを継続的にモニタリングし、スループットとレイテンシに影響するおそれのあるボトルネックを特定することで、問題が発生したときに迅速に対処しやすくなります。

診断の目的で、Cloud Storage FUSE を使用するときにバックグラウンドで指標を収集できます。Cloud Storage には、指標の収集、エクスポート、分析の方法として次の 2 つがあります。

  • Cloud Monitoring エクスポータ: 指標は Cloud Storage FUSE から Cloud Monitoring に直接収集およびエクスポートされます。エクスポートされた指標は Google Cloud コンソールで確認できます。

  • Prometheus ポート: Prometheus オープンソースのモニタリングとアラート ツールキットを使用して、指定された Prometheus ポート(http://Host:prometheus-port/metrics など)で Prometheus 指標のテキストベースの形式で指標がエクスポートされます。指標は curl http://host:port/metrics などのクライアント URL を使用して出力として表示できます。

料金

Cloud Storage FUSE 指標は、使用量に基づいて課金されます。料金の詳細については、Google Cloud Observability の料金をご覧ください。

Cloud Monitoring エクスポータを使用する

Cloud Monitoring エクスポータを使用して Cloud Storage FUSE から Cloud Monitoring に指標をエクスポート、収集、分析するには、次のセクションで説明する手順を完了する必要があります。

必要なロールを取得する

Cloud Monitoring エクスポータを使用するのに必要な権限を取得するには、指標を収集するプロジェクトに Monitoring 指標書き込みroles/monitoring.metricWriter)IAM ロールを付与します。

この事前定義ロールには、Cloud Monitoring エクスポータの使用に必要な権限が含まれています。モニタリング指標の書き込みロールの詳細については、roles/monitoring.metricWriter に関する IAM のドキュメントをご覧ください。

プロジェクトにロールを付与する手順については、プロジェクトへのアクセス権を管理するをご覧ください。

始める前に

  1. Cloud Monitoring API を有効にします。

  2. Cloud Storage API を有効にします。

    Cloud Storage API に移動

Cloud Monitoring エクスポータを設定する

Cloud Storage FUSE 指標を収集、エクスポート、分析するように Cloud Monitoring エクスポータを設定するには、Cloud Storage FUSE 構成ファイルの metrics:cloud-metrics-export-interval-secs 構成フィールドまたは Cloud Storage FUSE CLI の --cloud-metrics-export-interval-secs を使用して、秒単位の整数値を指定します。

Google Cloud コンソールで指標を表示する

Google Cloud コンソールを使用して Cloud Storage FUSE 指標を表示するには、次の操作を行います。

  1. Google Cloud コンソールで、[Metrics Explorer] ページに移動します。

    [Metrics Explorer] に移動

  2. 指標を表示するプロジェクトを選択します。

  3. [指標] プルダウン メニューの [指標を選択] をクリックします。

  4. [VM インスタンス] を選択し、[カスタム] をクリックして、表示する指標の名前を入力します。Cloud Storage が Cloud Storage FUSE に提供する指標については、利用可能な指標をご覧ください。

Prometheus を使用して指標をエクスポート、収集、分析する

以下のセクションでは、Prometheus を構成して Cloud Storage FUSE 指標をエクスポート、収集、分析する方法について説明します。

Prometheus を構成する

Prometheus を構成するには、Ops エージェント用に Prometheus を構成するの手順に沿って操作します。

Prometheus を使用する

  1. Cloud Storage FUSE 構成ファイルの prometheus-port 構成オプションを使用するか、Cloud Storage FUSE CLI の --prometheus-port CLI オプションを使用して、指標をエクスポートする HTTP ポートを指定します。

  2. 次のコマンドを使用して、Prometheus 指標エンドポイントを検証します。

     curl https://localhost:8080/metrics

    成功した場合、コマンドは次のようなテキストを含む出力を返します。

     # HELP file_cache_read_bytes_count The cumulative number of bytes read from file cache along with read type - Sequential/Random
     # TYPE file_cache_read_bytes_count counter
     file_cache_read_bytes_count{read_type="Random"} 0
     file_cache_read_bytes_count{read_type="Sequential"} 80
     # HELP file_cache_read_count Specifies the number of read requests made via file cache along with type - Sequential/Random and cache hit - true/false
     # TYPE file_cache_read_count counter
     file_cache_read_count{cache_hit="false",read_type="Random"} 215
     file_cache_read_count{cache_hit="false",read_type="Sequential"} 5
     # HELP file_cache_read_latencies The cumulative distribution of the file cache read latencies along with cache hit - true/false
     # TYPE file_cache_read_latencies histogram
     file_cache_read_latencies_bucket{cache_hit="false",le="1"} 215
     file_cache_read_latencies_bucket{cache_hit="false",le="2"} 216
     file_cache_read_latencies_bucket{cache_hit="false",le="3"} 216
     file_cache_read_latencies_bucket{cache_hit="false",le="4"} 216
     file_cache_read_latencies_bucket{cache_hit="false",le="5"} 216
     ...
     file_cache_read_latencies_sum{cache_hit="false"} 483.62783500000023
     file_cache_read_latencies_count{cache_hit="false"} 220
     # HELP fs_ops_count The cumulative number of ops processed by the file system.
     # TYPE fs_ops_count counter
     fs_ops_count{fs_op="FlushFile"} 9
     fs_ops_count{fs_op="GetInodeAttributes"} 91
     fs_ops_count{fs_op="LookUpInode"} 584
     fs_ops_count{fs_op="OpenDir"} 122
     fs_ops_count{fs_op="OpenFile"} 9
     fs_ops_count{fs_op="ReadDir"} 184
     fs_ops_count{fs_op="ReadFile"} 220
     fs_ops_count{fs_op="ReleaseDirHandle"} 122
     fs_ops_count{fs_op="ReleaseFileHandle"} 9
     fs_ops_count{fs_op="StatFS"} 10
     # HELP fs_ops_error_count The cumulative number of errors generated by file system operations
     # TYPE fs_ops_error_count counter
     fs_ops_error_count{fs_error_category="NOT_IMPLEMENTED",fs_op="GetXattr"} 1
     fs_ops_error_count{fs_error_category="NOT_IMPLEMENTED",fs_op="ListXattr"} 1
     fs_ops_error_count{fs_error_category="INTERRUPT_ERROR",fs_op="LookUpInode"} 58
     fs_ops_error_count{fs_error_category="NO_FILE_OR_DIR",fs_op="LookUpInode"} 6
     # HELP fs_ops_latency The cumulative distribution of file system operation latencies
     # TYPE fs_ops_latency histogram
     fs_ops_latency_bucket{fs_op="FlushFile",le="1"} 9
     fs_ops_latency_bucket{fs_op="FlushFile",le="2"} 9
     fs_ops_latency_bucket{fs_op="FlushFile",le="3"} 9
     fs_ops_latency_bucket{fs_op="FlushFile",le="4"} 9
     fs_ops_latency_bucket{fs_op="FlushFile",le="5"} 9
     ...
     fs_ops_latency_sum{fs_op="FlushFile"} 0.28800000000000003
     fs_ops_latency_count{fs_op="FlushFile"} 9
     # HELP gcs_download_bytes_count The cumulative number of bytes downloaded from GCS along with type - Sequential/Random
     # TYPE gcs_download_bytes_count counter
     gcs_download_bytes_count{read_type="Sequential"} 2.0971528e+08
     # HELP gcs_read_count Specifies the number of gcs reads made along with type - Sequential/Random
     # TYPE gcs_read_count counter
     gcs_read_count{read_type="Sequential"} 5
     ```

利用可能な指標

Cloud Storage FUSE は、次の指標を提供します。

ファイル システム指標

ファイル システム指標は、レイテンシやエラー率など、マウントされたバケットで実行されたオペレーションに関する分析情報を提供します。

指標名 指標の説明
fs/ops_count ファイル システムで処理されたオペレーションの数。この指標を使用すると、op_type でグループ化して個々のオペレーションのカウントを取得できます。
fs/ops_error_count ファイル システム オペレーションによって生成されたエラーの数。この指標は op_typeerror_category でグループ化できます。各エラーは多対 1 の関係で error_category にマッピングされます。
fs/ops_latency ファイル システム オペレーション レイテンシの累積分布。この指標は op_type でグループ化できます。

Cloud Storage 指標

Cloud Storage 指標は、Cloud Storage FUSE と Cloud Storage 間のインタラクションに関する分析情報を提供します。

指標名 指標の説明
gcs/download_bytes_count Cloud Storage からダウンロードされたバイト数と読み取りタイプ。読み取りタイプは、順次読み取り、ランダム読み取り、並列読み取りを指定します。
gcs/read_bytes_count Cloud Storage オブジェクトから読み取られたバイト数。download_bytes_count とは異なります。たとえば、アプリケーションで実際に使用されるデータよりも多くのデータが Cloud Storage から取得される場合があります。
gcs/read_count Cloud Storage からの読み取り回数と読み取りタイプ(順序、ランダム、または並列)。
gcs/reader_count 開いているか閉じている Cloud Storage オブジェクト リーダーの数。この指標のデータは、openedclosed などの入出力(I/O)メソッドタイプでグループ化されます。
gcs/request_count 処理された Cloud Storage リクエストの数。
gcs/request_latencies Cloud Storage リクエストのレイテンシの合計分布。

ファイル キャッシュ指標

ファイル キャッシュ指標は、Cloud Storage FUSE ファイル キャッシュ保存オペレーションのパフォーマンスと挙動に関する分析情報を提供します。

指標名 指標の説明
file_cache/read_bytes_count ファイル キャッシュから読み取られたバイト数と、読み取りタイプ(シーケンシャルまたはランダム)。
file_cache/read_latencies ファイル キャッシュ読み取りレイテンシとキャッシュヒットの合計分布(true または false)。
file_cache/read_count ファイル キャッシュを使用して行われた読み取りリクエストの数、リクエストの種類(連続またはランダムなど)、キャッシュ ヒット(true または false)。

次のステップ