Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

分析

最終更新 Markdown で表示Agent セットアップ

ロードバランシング分析では、次のことができます。

  • トラフィックの流れを評価する
  • プール内エンドポイントの健全性ステータスを確認する
  • プールとプール健全性の変化を時系列で確認する

ダッシュボードの分析

Overview メトリクス

ロードバランサーの Overview メトリクスを見るには、Traffic > Load Balancing Analytics を開きます。

これらのメトリクスは、ロードバランサー内の特定プールへルーティングされたリクエスト数を示します。次の判断に役立ちます。

  • プールの追加や削除の影響を評価する
  • 新しいプールを作るタイミングを決める
  • ピーク時の需要と将来のインフラ要件を計画する

特定のプール、時間、リージョン、エンドポイントでフィルターを追加できます。

Latency

Latency メトリクスはインタラクティブな地図を表示し、Unhealthy または Slow のプールがあるリージョンを見つけやすくします。

ロードバランサーのレイテンシ情報を見るには、Traffic > Load Balancing Analytics > Latency を開きます。

Logs

Logs は、エンドポイントのステータス変更と、それがロードバランシングプールへ与える影響の履歴です。Load Balancing が記録するのは、エンドポイントのステータスが healthy から unhealthy へ、またはその逆へ変わったイベントだけです。

プールに Monitor Group が接続されている場合、記録される各ヘルスイベントには monitors フィールドが含まれます。 このフィールドは、グループ内の各モニターとその結果を列挙し、どのモニターがステータス変更に寄与したかを確認しやすくします。

イベントの例(抜粋):

{
	"id": <id>,
	"timestamp": "2025-09-22 19:22:00",
	"pool": {
		"id": "<id>",
		"name": "example-monitor-group-test-pool-us",
		"healthy": true,
		"changed": false,
		"minimum_origins": 1
	},
	"origins": [
		{
			"name": "origin-a",
			"ip": "192.0.2.10",
			"enabled": true,
			"healthy": true,
			"failure_reason": "No failures",
			"response_code": 200,
			"monitors": [
				{
					"id": "<id>",
					"healthy": true,
					"failure_reason": "No failures",
					"response_code": 200,
					"must_be_healthy": true,
					"monitoring_only": false
				},
				{
					"id": "<id>",
					"healthy": true,
					"failure_reason": "No failures",
					"response_code": 200,
					"must_be_healthy": true,
					"monitoring_only": false
				},
				{
					"id": "<id>",
					"healthy": false,
					"failure_reason": "HTTP timeout occurred",
					"must_be_healthy": false,
					"monitoring_only": true
				}
			]
		},
		{
			"name": "origin-b",
			"ip": "198.51.100.25",
			"enabled": true,
			"healthy": false,
			"failure_reason": "TCP connection failed",
			"changed": true,
			"monitors": [
				{
					"id": "<id>",
					"healthy": false,
					"failure_reason": "TCP connection failed",
					"must_be_healthy": true,
					"monitoring_only": false
				},
				{
					"id": "<id>",
					"healthy": true,
					"failure_reason": "No failures",
					"response_code": 200,
					"must_be_healthy": true,
					"monitoring_only": false
				},
				{
					"id": "<id>",
					"healthy": false,
					"failure_reason": "HTTP timeout occurred",
					"must_be_healthy": false,
					"monitoring_only": true
				}
			]
		}
	]
}

この例では、次の点がわかります。

  • 各オリジンには、接続されたグループ内の全モニターを列挙する monitors 配列があります。
  • must_be_healthymonitoring_only などのフィールドは、オリジン全体の健全性判定における各モニターの役割を示します。
  • healthyfailure_reason フィールドは、個々のモニターチェックの成功または失敗を示します。

ダッシュボードでログを見るには、Traffic > Load Balancing Analytics を開きます。

GraphQL 分析

より柔軟に扱うには、GraphQL Analytics API からロードバランシングのメトリクスを直接取得します。

次のサンプルクエリから始めてください。

プールごとのリクエスト数

このクエリは、Cloudflare のグローバルネットワーク上の各ロケーションから、各プールが受け取ったリクエスト数を示します。

クエリgraphql
query RequestsPerPool($zoneTag: string, $start: Time, $end: Time) {
	viewer {
		zones(filter: { zoneTag: $zoneTag }) {
			loadBalancingRequestsAdaptiveGroups(
				limit: 100
				filter: {
					datetime_geq: $start
					datetime_leq: $end
					lbName: "lb.example.com"
				}
				orderBy: [datetimeFifteenMinutes_DESC]
			) {
				count
				dimensions {
					datetimeFifteenMinutes
					coloCode
					selectedPoolName
				}
			}
		}
	}
}
レスポンス(抜粋)json
{
    "data": {
        "viewer": {
            "zones": [
                {
                    "loadBalancingRequestsAdaptiveGroups": [
                        {
                            "count": 4,
                            "dimensions": {
                                "coloCode": "IAD",
                                "datetimeFifteenMinutes": "2021-06-26T00:45:00Z",
                                "selectedPoolName": "us-east"
                            }
                        },
                        ...
                    ]
                }
            ]
        }
    }
}

データセンターごとのリクエスト数

このクエリは、特定のデータセンター(例: シンガポール、SIN)から、特定のロードバランサー内の各プールへのモニターリクエストについて、重み付きラウンドトリップ時間(RTT)の測定値(avgRttMs)を示します。

クエリgraphql
query RequestsPerDataCenter($zoneTag: string, $start: Time, $end: Time) {
	viewer {
		zones(filter: { zoneTag: $zoneTag }) {
			loadBalancingRequestsAdaptive(
				limit: 100
				filter: {
					datetime_geq: $start
					datetime_leq: $end
					lbName: "lb.example.com"
					coloCode: "SIN"
				}
				orderBy: [datetime_DESC]
			) {
				selectedPoolName
				pools {
					poolName
					healthy
					healthCheckEnabled
					avgRttMs
				}
			}
		}
	}
}
レスポンス(抜粋)json
{
    "data": {
        "viewer": {
            "zones": [
                {
                    "loadBalancingRequestsAdaptive": [
                        {
                            "pools": [
                                {
                                    "avgRttMs": 67,
                                    "healthCheckEnabled": 1,
                                    "healthy": 1,
                                    "poolName": "asia-ne"
                                },
                                {
                                    "avgRttMs": 156,
                                    "healthCheckEnabled": 1,
                                    "healthy": 1,
                                    "poolName": "us-east_and_asia-ne"
                                },
                                {
                                    "avgRttMs": 237,
                                    "healthCheckEnabled": 1,
                                    "healthy": 1,
                                    "poolName": "us-east"
                                },
                            ],
                            "selectedPoolName": "asia-ne"
                        },
                    ...
                    ]
                }
            ]
        }
    }
}

役に立ちましたか?