- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Amazon CloudFront は、Web サイト、API、ビデオコンテンツなどの Web 資産の配信を高速化するグローバルなコンテンツ配信ネットワーク (CDN) サービスです。
このインテグレーションを有効にすると、Datadog にすべての CloudFront メトリクスを表示できます。
Amazon Web Services インテグレーションをまだセットアップしていない場合は、最初にセットアップします。
Metric Collection
タブの下にある CloudFront
が有効になっていることを確認します。ディストリビューションで CloudFront ログを有効にする際は、CloudFront がログファイルを格納するために使用する Amazon S3 バケットを指定します。Amazon S3 を発信元として使用する場合、Datadog ではログファイルに同じバケットを使用しないことをお勧めしています。別のバケットを使用することで、メンテナンスを簡略化できます。
注: Datadog は、ログ転送が 1 つのバケットにサブスクライブするだけでよいように、複数のディストリビューションのログファイルを同じバケットに格納することを推奨します。
cloudfront
を指定してください。それ以外の場合、ログは s3
に分類されます。All object create events
のままにしておきます。ログエクスプローラーに移動して、ログを確認します。
AWS Services のログを収集する方法については、Datadog Lambda 関数で AWS Services のログを送信するを参照してください。
リアルタイムのログコンフィギュレーションを作成する際、受信するログのフィールドを指定することができます。デフォルトでは、すべての利用可能なフィールドが選択されています。
Datadog は、このデフォルトのコンフィギュレーションを維持し、以下のカスタムパースルールを追加して、すべてのフィールドが有効な状態でログを自動的に処理することをおすすめします。
Pipelines ページに移動し、AWS CloudFront を検索し、[grok parser processor を作成または編集][7]し、Advanced Settings に以下のヘルパールールを追加します。
real_time_logs (%{number:timestamp:scale(1000)}|%{number:timestamp})\s+%{_client_ip}\s+%{_time_to_first_byte}\s+%{_status_code}\s+%{_bytes_write}\s+%{_method}\s+%{regex("[a-z]*"):http.url_details.scheme}\s+%{notSpace:http.url_details.host:nullIf("-")}\s+%{notSpace:http.url_details.path:nullIf("-")}\s+%{_bytes_read}\s+%{notSpace:cloudfront.edge-location:nullIf("-")}\s+%{_request_id}\s+%{_ident}\s+%{_duration}\s+%{_version}\s+IPv%{integer:network.client.ip_version}\s+%{_user_agent}\s+%{_referer}\s+%{notSpace:cloudfront.cookie}\s+(%{notSpace:http.url_details.queryString:querystring}|%{notSpace:http.url_details.queryString:nullIf("-")})\s+%{notSpace:cloudfront.edge-response-result-type:nullIf("-")}\s+%{_x_forwarded_for}\s+%{_ssl_protocol}\s+%{_ssl_cipher}\s+%{notSpace:cloudfront.edge-result-type:nullIf("-")}\s+%{_fle_encrypted_fields}\s+%{_fle_status}\s+%{_sc_content_type}\s+%{_sc_content_len}\s+%{_sc_range_start}\s+%{_sc_range_end}\s+%{_client_port}\s+%{_x_edge_detailed_result_type}\s+%{notSpace:network.client.country:nullIf("-")}\s+%{notSpace:accept-encoding:nullIf("-")}\s+%{notSpace:accept:nullIf("-")}\s+%{notSpace:cache-behavior-path-pattern:nullIf("-")}\s+%{notSpace:headers:nullIf("-")}\s+%{notSpace:header-names:nullIf("-")}\s+%{integer:headers-count}.*
リアルタイムログは、選択した Kinesis Data Stream へ配信され、Kinesis Firehose インテグレーションにより Datadog に直接転送することが可能です。
Amazon Kinesis Data Firehose などのコンシューマーを構成してリアルタイムログを S3 バケットに送信し、Datadog Lambda forwarder を使用してログを Datadog へ送信することもできます。
aws.cloudfront.401_error_rate (gauge) | The percentage of all viewer requests for which the response’s HTTP status code is 401 (Additional Metrics must be enabled). Shown as percent |
aws.cloudfront.403_error_rate (gauge) | The percentage of all viewer requests for which the response’s HTTP status code is 403 (Additional Metrics must be enabled). Shown as percent |
aws.cloudfront.404_error_rate (gauge) | The percentage of all viewer requests for which the response’s HTTP status code is 404 (Additional Metrics must be enabled). Shown as percent |
aws.cloudfront.4xx_error_rate (gauge) | The percentage of all requests for which the HTTP status code is 4xx. Shown as percent |
aws.cloudfront.502_error_rate (gauge) | The percentage of all viewer requests for which the response’s HTTP status code is 502 (Additional Metrics must be enabled). Shown as percent |
aws.cloudfront.503_error_rate (gauge) | The percentage of all viewer requests for which the response’s HTTP status code is 503 (Additional Metrics must be enabled). Shown as percent |
aws.cloudfront.504_error_rate (gauge) | The percentage of all viewer requests for which the response’s HTTP status code is 504 (Additional Metrics must be enabled). Shown as percent |
aws.cloudfront.5xx_error_rate (gauge) | The percentage of all requests for which the HTTP status code is 5xx. Shown as percent |
aws.cloudfront.bytes_downloaded (count) | The number of bytes downloaded by viewers for GET, HEAD, and OPTIONS requests. Shown as byte |
aws.cloudfront.bytes_uploaded (count) | The number of bytes uploaded to your origin with CloudFront using POST and PUT requests. Shown as byte |
aws.cloudfront.cache_hit_rate (gauge) | The percentage of all cacheable requests for which CloudFront served the content from its cache. HTTP POST and PUT requests (and errors) are not considered cacheable requests (Additional Metrics must be enabled). Shown as percent |
aws.cloudfront.function_execution_errors (gauge) | The number of execution errors that occurred in a given time period. Shown as error |
aws.cloudfront.function_execution_time (gauge) | The amount of time that the function took to run as a percentage of the maximum allowed time. Shown as percent |
aws.cloudfront.function_invocations (count) | The number of times the function was started in a given time period. Shown as invocation |
aws.cloudfront.function_validation_errors (gauge) | The number of validation errors produced by the function in a given time period. Shown as error |
aws.cloudfront.origin_latency (gauge) | The total time spent from when CloudFront receives a request to when it starts providing a response to the network (not the viewer) for requests that are served from the origin (not the CloudFront cache). This is also known as first byte latency or time-to-first-byte (Additional Metrics must be enabled). Shown as millisecond |
aws.cloudfront.requests (count) | The number of requests for all HTTP methods and for both HTTP and HTTPS requests. |
aws.cloudfront.total_error_rate (gauge) | The percentage of all requests for which the HTTP status code is 4xx or 5xx. Shown as percent |
AWS から取得される各メトリクスには、aws_account
、region
、distributionid
など、AWS コンソールに表示されるタグと同じタグが割り当てられます。
AWS Cloudfront インテグレーションには、イベントは含まれません。
AWS Cloudfront インテグレーションには、サービスのチェック機能は含まれません。
ご不明な点は、Datadog のサポートチームまでお問合せください。