メインコンテンツまでスキップ
バージョン: User Guides (Cloud)

Prometheusと統合する

Prometheusは、指定された間隔で設定されたターゲットからメトリックを収集し、ルール式を評価し、結果を表示し、特定の条件に基づいてアラートをトリガーできる監視システムです。

Zilliz CloudをPrometheusと統合することで、Zilliz Cloudの展開に関連するメトリックを収集し、監視することができます。

📘ノート

Prometheusの統合は、Dedicated-EnterpriseまたはBYOCプランを実行しているZilliz Cloudクラスターでのみサポートされています。

Zilliz CloudメトリクスをスクレイピングするためにPrometheusを設定する

PrometheusでZilliz Cloudクラスタを監視するには、次の手順に従ってください:

  1. Prometheusサーバー上のPrometheus. yml設定ファイルにアクセスします。詳細については、設定を参照してください。

  2. Prometheus. ymlファイルのscrape_configsセクションに次のスニペットを追加しす。プレースホルダを適切な値に置き換えます。

    • {{apiKey}}:クラスタメトリクスにアクセスするためのZilliz Cloud APIキー。

    • {{cluster terId}}:監視したいZilliz CloudクラスタのID。

    scrape_configs:
    - job_name: in01-06b8404b623xxxx
    scheme: https
    metrics_path: /v2/clusters/{{clusterId}}/metrics/export
    authorization:
    type: Bearer
    credentials: {{apiKey}}

    static_configs:
    - targets: ["api.cloud.zilliz.com"]

    パラメータ

    説明する

    job_name

    スクレイピングされたメトリックに割り当てられた人間が読めるラベル。

    schema

    Zilliz Cloudエンドポイントからメトリックをスクレイピングするために使用されるプロトコルスキームはhttpsに設定されています。

    metrics_path

    メトリックデータを提供するターゲットサービス上のパス。

    authorization.type

    Zilliz Cloudのメトリックにアクセスするために使用される認証タイプ。値をBearerに設定してください。

    authorization.credentials

    Zilliz Cloudメトリクスエンドポイントにアクセスするために使用されるAPIキー。

    static_configs.targets

    Prometheusがスクレイピングする静的ターゲットは、Zilliz Cloud RESTful APIのホストアドレスをapi.cloud.zilliz.comする必要があります。

  3. 変更をPrometheus. ymlファイルに保存ます。

詳細については、Prometheus公式ドキュメントを参照してください。

スクレイピングされたメトリックの例

以下は、Zilliz Cloud/metrics/exportエンドポイントからスクレイピングされたPrometheusメトリクスの例です。

# HELP zilliz_cluster_capacity Cluster capacity ratio
# TYPE zilliz_cluster_capacity gauge
zilliz_cluster_capacity 0.88
# HELP zilliz_cluster_computation Cluster computation ratio
# TYPE zilliz_cluster_computation gauge
zilliz_cluster_computation 0.1
# HELP zilliz_cluster_storage_bytes Cluster storage usage
# TYPE zilliz_cluster_storage_bytes gauge
zilliz_cluster_storage_bytes 8.9342782E7
# HELP zilliz_request_vectors_total Total number of vectors in requests
# TYPE zilliz_request_vectors_total counter
zilliz_request_vectors_total{request_type="bulk_insert"} 1.0
zilliz_request_vectors_total{request_type="delete"} 1.0
zilliz_request_vectors_total{request_type="insert"} 1.0
zilliz_request_vectors_total{request_type="search"} 1.0
zilliz_request_vectors_total{request_type="upsert"} 1.0

Zilliz Cloudのメトリックラベル

Zilliz Cloudによって公開されるメトリックは、以下の識別子でラベル付けされています。

レーベル名

説明する

価値観

cluster_id

メトリックが含まれるZilliz CloudクラスターのID。

-

org_id

Zilliz Cloudクラスターを所有する組織のID。

-

project_id

クラスターが属する組織内のプロジェクトのID。

-

collection_name

監視されているコレクションの名前。

-

request_type

データに対して実行される操作の種類。

insert, upsert, delete, bulk_insert, flush, search, query

status

データ操作の結果。

success, fail

利用可能なメトリック

以下の表は、Zilliz Cloudで利用可能なメトリクス、その種類、説明、および関連するラベルをリストしています。

メトリック名

タイプ

説明する

ラベル

zilliz_cluster_computation

Gauge

現在の計算容量の利用率。

cluster_id, org_id, project_id

zilliz_cluster_capacity

Gauge

現在のストレージ容量の利用率。

cluster_id, org_id, project_id

zilliz_storage_bytes

Gauge

使用された総ストレージスペース。

cluster_id, org_id, project_id

zilliz_cluster_write_capacity

Gauge

現在の書き込みスループット。

cluster_id, org_id, project_id

zilliz_requests_total

Counter

処理されたリクエストの総数。

cluster_id, org_id, project_id, request_type, status

zilliz_request_vectors_total

Counter

すべての要求で操作されたベクトルの総数。

cluster_id, org_id, project_id, request_type

zilliz_request_duration_seconds_bucket

Histogram

処理されたリクエストのレイテンシ分布。

cluster_id, org_id, project_id, request_type

zilliz_slow_queries_total

Counter

遅延のしきい値を超えるクエリの数。

cluster_id, org_id, project_id

zilliz_entities

Gauge

格納されているエンティティの総数。

cluster_id, org_id, project_id, collection_name

zilliz_loaded_entities

Gauge

現在メモリにロードされているエンティティの数。

cluster_id, org_id, project_id, collection_name

zilliz_indexed_entities

Gauge

インデックス化されたエンティティの数。

cluster_id, org_id, project_id, collection_name

zilliz_collections

Gauge

コレクションの総数。

cluster_id, org_id, project_id

zilliz_unloaded_collections

Gauge

アンロードされたコレクションの数。

cluster_id, org_id, project_id

Prometheusクエリの例

以下は、Prometheusを使用してZilliz Cloudメトリックスを分析するために使用できるクエリの例です。

  • インサートQPSを計算する

    rate(zilliz_requests_total{cluster_id='in01-xxxxx',request_type='insert'}[$__rate_interval])
  • インサートVPSを計算する

    rate(zilliz_request_vectors_total{cluster_id='in01-xxxxx',request_type='insert'}[$__rate_interval])
  • 70パーセンタイルの挿入レイテンシを計算する

    histogram_quantile(
    0.70,
    sum(
    rate(zilliz_request_duration_seconds_bucket{cluster_id='in01-xxxxx',request_type='insert'}[$__rate_interval])
    ) by (le)
    )
  • 挿入要求の失敗率を計算する

    rate(zilliz_requests_total{cluster_id=?,status!='success'}[$__rate_interval])
    /
    rate(zilliz_requests_total{cluster_id=?}[$__rate_interval])
  • 1分あたりの遅いクエリ数を計算する

    sum(increase(zilliz_slow_queries_total{cluster_id=?}[1m]))
  • 5分あたりの遅いクエリの数を計算してください

    sum(increase(zilliz_slow_queries_total{cluster_id=?}[5m]))