- 重要な情報
- はじめに
- 用語集
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Cloudflare と統合することで、Web トラフィック、DNS クエリ、脅威に関するインサイトなど、ゾーンのメトリクスを取得できます。インテグレーションは、Cloudflare の分析 API を通じて行われます。
作業を開始するには、Datadog アカウントのほか、API キーと Cloudflare Logpush へのアクセス権が必要です。なお、Logpush へのアクセスには、Enterprise アカウントプランの購入が必要です。
Cloudflare API トークンを使用する場合は、Zone > Zone > Read および Zone > Analytics > Read の権限を保有していることを確認してください。
Datadog の Cloudflare インテグレーションタイルを使用して、インテグレーションをインストールします。
account
タグ内で使用されます。Cloudflareでは、Cloudflare Logpush を使用してログを直接 Datadog にプッシュすることができます。Logpush のジョブは Cloudflare API または Cloudflare ダッシュボードで管理できます。
Cloudflare インテグレーションパイプラインをインストールすると、特定の属性が自動的にリマップされます。どの属性がリマップされるかを確認するには
Cloudflare
と入力します。Logpush ジョブエンドポイントへ POST をリクエストし、Logpush ジョブを作成します。以下のフィールドを含めます。
name
(任意): ドメイン名をジョブ名として使用。destination_conf
: 以下のパラメーターからなるログの出力先。<DATADOG_ENDPOINT_URL>
: Datadog HTTP ログのインテークエンドポイント。エンドポイントは、http-intake.logs./v1/input
になります<DATADOG_API_KEY>
: 使用する Datadog API キー。ddsource
: cloudflare
に設定。service
(任意): サービス名を指定。host
(任意): ホスト名を指定。ddtags
(任意): タグを指定。dataset
: 受信するログのカテゴリー。サポートされるデータセットについては、Cloudflare のログフィールドを参照。logpull_options
(オプション): フィールド、サンプルレート、タイムスタンプの形式を構成するには、Logpush API オプションを参照。リクエスト例:
curl -s -X POST 'https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/logpush/jobs' \
--header 'X-Auth-Key: <CLOUDFLARE_AUTH_KEY>' \
--header 'X-Auth-Email: <CLOUDFLARE_AUTH_EMAIL>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "<NAME>",
"destination_conf": "datadog://<DATADOG_ENDPOINT_URL>?header_DD-API-KEY=<DATADOG_API_KEY>&ddsource=cloudflare&service=cloudflare&ddtags=env:dev",
"logpull_options": "fields=RayID,EdgeStartTimestamp×tamps=rfc3339",
"dataset": "http_requests"
}'
応答例:
{
"errors": [],
"messages": [],
"result": {
"id": 100,
"dataset": "http_requests",
"enabled": false,
"name": "<DOMAIN_NAME>",
"logpull_options": "fields=RayID,EdgeStartTimestamp×tamps=rfc3339",
"destination_conf": "datadog://http-intake.logs./v1/input?header_DD-API-KEY=<DD-API-KEY>&ddsource=cloudflare&service=cloudflare&ddtags=env:dev",
"last_complete": null,
"last_error": null,
"error_message": null
},
"success": true
}
id
の値をメモしておきます。上記の例では、100
です。
ジョブを有効にします。応答で返されたジョブ ID を使用してリクエスト本文で {"enabled": true}
を送信します。
リクエスト例:
curl -s -X PUT \
https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/logpush/jobs/<JOB_ID> -d'{"enabled":true}' | jq .
応答例:
{
"errors": [],
"messages": [],
"result": {
"id": 100,
"dataset": "http_requests",
"enabled": true,
"name": "<DOMAIN_NAME>",
"logpull_options": "fields=RayID,EdgeStartTimestamp×tamps=rfc3339",
"destination_conf": "datadog://?header_DD-API-KEY=<DATADOG-API-KEY>",
"last_complete": null,
"last_error": null,
"error_message": null
},
"success": true
}
Cloudflare ダッシュボードの Logpush セクションでサービスを接続したら、データセットとデータフィールドを選択し、宛先として Datadog を選択します。
Enter destination information の下で Datadog の URL エンドポイントを入力します。
http-intake.logs./v1/input?ddsource=cloudflare
注: ddsource=cloudflare
は必須です。ログを区別するために、オプションで service
、host
、ddtags
などのパラメーターを追加することもできます。
例:
http-intake.logs./v1/input?service=<SERVICE>&host=<HOST>&ddsource=cloudflare
Datadog Cloudflare インテグレーションタイルのセットアップに使用した Datadog API キーを入力します。
アクセスを確認すると、Prove ownership の下に “Ready to push!” と表示されます。Push
をクリックして完了します。
cloudflare.requests.all (count) | Total request count Shown as request |
cloudflare.requests.cached (count) | Cached requests count Shown as request |
cloudflare.requests.uncached (count) | Uncached requests count Shown as request |
cloudflare.requests.ssl.encrypted (count) | SSL encrypted requests count Shown as request |
cloudflare.requests.ssl.unencrypted (count) | Unencrypted requests count Shown as request |
cloudflare.requests.country (count) | Request count, tagged by IATA country code Shown as request |
cloudflare.requests.status (count) | Request count, tagged by HTTP response code Shown as request |
cloudflare.requests.content_type (count) | Request count, tagged by Content-Type Shown as request |
cloudflare.requests.ip_class (count) | Request count, tagged by IP class Shown as request |
cloudflare.bandwidth.all (count) | Total bandwidth Shown as byte |
cloudflare.bandwidth.cached (count) | Cached bandwidth Shown as byte |
cloudflare.bandwidth.uncached (count) | Uncached bandwidth Shown as byte |
cloudflare.bandwidth.ssl.encrypted (count) | SSL encrypted bandwidth Shown as byte |
cloudflare.bandwidth.ssl.unencrypted (count) | Unencrypted bandwidth Shown as byte |
cloudflare.bandwidth.country (count) | Bandwidth tagged by IATA country code Shown as byte |
cloudflare.bandwidth.content_type (count) | Bandwidth tagged by Content-Type Shown as byte |
cloudflare.threats.all (count) | Total threats Shown as operation |
cloudflare.threats.type (count) | Threats tagged by type Shown as operation |
cloudflare.threats.country (count) | Threats tagged by IATA country code Shown as operation |
cloudflare.pageviews.all (count) | Total page views Shown as page |
cloudflare.pageviews.search_engine (count) | Page views tagged by search engine Shown as page |
cloudflare.uniques.all (count) | Unique visitors count Shown as connection |
cloudflare.dns.query.all (count) | DNS query count Shown as request |
cloudflare.dns.query.uncached (count) | Uncached DNS query count Shown as request |
cloudflare.dns.query.stale (count) | Stale DNS query count Shown as request |
cloudflare.dns.response_time.avg (gauge) | DNS query average response time Shown as millisecond |
cloudflare.dns.response_time.median (gauge) | DNS query median response time Shown as millisecond |
cloudflare.dns.response_time.90p (gauge) | DNS query response time to the 90th percentile Shown as millisecond |
cloudflare.dns.response_time.99p (gauge) | DNS query response time to the 99th percentile Shown as millisecond |
cloudflare.workers.requests.all (count) | The request count to the worker script (metrics may not show without enabled API Key permissions) Shown as request |
cloudflare.workers.requests.errors (count) | The error count to the worker script (metrics may not show without enabled API Key permissions) Shown as request |
cloudflare.workers.requests.subrequests (count) | The subrequest count to the worker script (metrics may not show without enabled API Key permissions) Shown as request |
cloudflare.workers.response_time.75p (gauge) | The worker response time to the 75th percentile (metrics may not show without enabled API Key permissions) Shown as microsecond |
cloudflare.workers.response_time.99p (gauge) | The worker response time to the 99th percentile (metrics may not show without enabled API Key permissions) Shown as microsecond |
cloudflare.load_balancer.pool.round_trip_time.average (gauge) | The average round trip time to reach the load balancer pool Shown as millisecond |
cloudflare.load_balancer.pool.health.status (count) | The load balancer pool health status Shown as request |
Cloudflare API トークンでこれらのアクセス許可が有効になっていることを確認します。
スコープ | アクセス許可 | ステータス |
---|---|---|
アカウント | アカウント分析 | 読み取り |
アカウント | アカウント設定 | 読み取り |
アカウント | ワーカースクリプト | 読み取り |
Zone | Zone | 読み取り |
Zone | 分析 | 読み取り |
Zone | ワーカールート | 読み取り |
Zone | ロードバランサー | 読み取り |
Cloudflare インテグレーションには、イベントは含まれません。
Cloudflare インテグレーションには、サービスのチェック機能は含まれません。
ご不明な点は、Datadog のサポートチームまでお問合せください。