tencent cloud

Cloud Log Service

指標

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-10-12 14:07:52
AI翻訳
メトリック(Metric)は、システムとアプリケーションのパフォーマンスおよび動作状況を測定するための測定値です。例えばCPU使用率、メモリ使用率、アクセススループット、レスポンス時間、レスポンス成功率などがあります。メトリックは通常、定期的に生成され、各時点で値を持ち、時間の経過とともに系列を形成します。この系列は一般に時系列(time series)と呼ばれ、略してタイムシリーズとも呼ばれます。
CLS(Cloud Log Service)は、Prometheus指標データモデルと互換性があり、同じ指標名(metric name)と同じ次元(labels)を持つタイムスタンプ付きの指標データを時系列(time series)として保存します。時系列内の各データポイントはサンプル(sample)と呼ばれ、サンプルはタイムスタンプとサンプル値で構成されます。
例
例えば、システムが2020/12/30 15:35:23.123に、あるインターフェースのリクエスト総量は1つのサンプルであり、そのデータは以下の通りです:
requests_total{method="POST", handler="/messages"} 217
これは以下のいくつかの部分で構成されています:
指標名:requests_total
ディメンション:{method="POST", handler="/messages"}、つまりインターフェース名はmessages、リクエスト方法はPOSTです。
タイムスタンプ:2020/12/30 15:35.123
サンプル値:217
監視対象システムには実際には通常、同時に複数のメトリックが存在します。ある時点では多数の異なるメトリック名とディメンションを持ちます。例えば、Nginx監視メトリックは以下の通りです:
# HELP nginx_http_requests_total The total number of HTTP requests
# TYPE nginx_http_requests_total counter
nginx_http_requests_total 10234

# HELP nginx_http_requests_duration_seconds The HTTP request duration in seconds
# TYPE nginx_http_requests_duration_seconds histogram
nginx_http_requests_duration_seconds_bucket{le="0.005"} 2405
nginx_http_requests_duration_seconds_bucket{le="0.01"} 5643
nginx_http_requests_duration_seconds_bucket{le="0.025"} 7890
nginx_http_requests_duration_seconds_bucket{le="0.05"} 9234
nginx_http_requests_duration_seconds_bucket{le="0.1"} 10021
nginx_http_requests_duration_seconds_bucket{le="0.25"} 10234
nginx_http_requests_duration_seconds_bucket{le="0.5"} 10234
nginx_http_requests_duration_seconds_bucket{le="1"} 10234
nginx_http_requests_duration_seconds_bucket{le="2.5"} 10234
nginx_http_requests_duration_seconds_bucket{le="5"} 10234
nginx_http_requests_duration_seconds_bucket{le="10"} 10234
nginx_http_requests_duration_seconds_bucket{le="+Inf"} 10234
nginx_http_requests_duration_seconds_sum 243.56
nginx_http_requests_duration_seconds_count 10234

# HELP nginx_http_connections Number of HTTP connections
# TYPE nginx_http_connections gauge
nginx_http_connections{state="active"} 23
nginx_http_connections{state="reading"} 5
nginx_http_connections{state="writing"} 7
nginx_http_connections{state="waiting"} 11

# HELP nginx_http_response_count_total The total number of HTTP responses sent
# TYPE nginx_http_response_count_total counter
nginx_http_response_count_total{status="1xx"} 123
nginx_http_response_count_total{status="2xx"} 9123
nginx_http_response_count_total{status="3xx"} 456
nginx_http_response_count_total{status="4xx"} 567
nginx_http_response_count_total{status="5xx"} 65

# HELP nginx_up Is the Nginx server up
# TYPE nginx_up gauge
nginx_up 1
そのうち、指標の意味は以下の通りです:
nginx_http_requests_total:Nginxが処理したHTTPリクエストの総数です。
nginx_http_requests_duration_seconds:HTTPリクエストの継続時間であり、Histogramタイプを使用して異なる区間のリクエスト数を提供します。
nginx_http_connections:現在のNginxのHTTP接続数であり、active、reading、writing、waitingの状態に分けられます。
nginx_http_response_count_total:Nginxが返すHTTPレスポンスの総数であり、ステータスコード別に分類されます。
nginx_up:Nginxサーバーの稼働状態です。1は稼働中を示し、0は未稼働を示します。
ログ(Log)と指標(Metric)は、いずれもシステムやアプリケーションにおいてデータを収集・記録する方法ですが、データの種類や用途が異なります。CLSにおける主な違いは以下の通りです:
データ型
ログ(Log)
指標(Metric)
データ形式
厳格な制限はありません。通常のテキストおよびjson形式で記録された構造化データは、いずれもログとしてアップロードできます。
Prometheusメトリクスデータモデルに準拠する必要があります。
データ収集
LogListener、API、SDKを使用したログ収集をサポートします。
定時SQL分析を通じて元のログを指標に変換する必要があります。詳細はログから指標への変換を参照してください。
データストレージ
標準ストレージ、低頻度ストレージ、およびログ沉降をサポートしています。ストレージタイプによって機能、性能、価格が異なります。
ストレージタイプを区別しません。
インデックス設定
インデックスを設定する必要があります。フィールド名、タイプ、トークナイザなどが含まれます。
インデックスを設定する必要はありません。
データクエリ
検索条件を使用して生ログをフィルタリングし、SQLを使用して生ログを統計分析します。
PromQLを使用して指標を照会します。



ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック