ホスト・メトリクス・レシーバー
Splunk Observability Cloud インテグレーションをホストメトリクスモニターに使用します。メリット、インストール、設定、メトリクスを参照してください
ホストメトリクスレシーバは、Collector がエージェントとしてデプロイされたときに、ホストシステムからスクレイピングされたメトリクスを生成します。サポートされているパイプラインのタイプは metrics です。
デフォルトでは、Splunk Distribution of OpenTelemetry Collector でホストメトリクスレシーバーが有効化され、以下のメトリクスを収集します:
-
システム・メトリクス
-
CPU使用率メトリクス
-
ディスクI/Oメトリクス
-
CPU負荷メトリクス
-
ファイル・システム使用量メトリクス
-
メモリ使用量メトリクス
-
ネットワーク・インターフェイスとTCPコネクション・メトリクス
-
プロセス・カウント・メトリクス(Linuxのみ)
Infrastructure Monitoring 上にホストレシーバメトリクスが表示されます。これをもとにダッシュボードとアラートを作成できます。詳しくは「アラートをトリガーするディテクタの作成」をご確認ください。
はじめに
以下の手順に従って、コンポーネントの設定とアクティベーションを行ってください:
-
Splunk Distribution of OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:
-
次のセクションで説明するようにレシーバーを設定します。
-
Collector を再起動します。
コンテナ・ホストのメトリクスを収集する(Linux)
ホストメトリクスレシーバは、Linux システムディレクトリからメトリクスを収集します。コンテナではなくホストのメトリクスを収集するには、次の手順に従います。
-
コンテナを実行するときに、ホストファイルシステム全体をマウントします。次に例を示します。
docker run -v /:/hostfsホストファイルシステムのどの部分をマウントするか選択することもできます。例:docker run -v /proc:/hostfs/proc -
root_pathを設定して、ホストメトリクスレシーバがルートファイルシステムの場所を認識できるようにします。例:receivers: hostmetrics: root_path: /hostfsホスト・メトリクス・レシーバーの複数のインスタンスを実行している場合は、すべてのインスタンスに同じ
root_pathを設定します。
サンプル構成
次の例に示すように、収集間隔とスクレイピングするメトリクスのカテゴリを構成できます:
hostmetrics:
collection_interval: <duration> # The default is 1m.
scrapers:
<scraper1>:
<scraper2>:
...
スクレーパはエンドポイントからデータを抽出し、そのデータを指定されたターゲットに送信します。利用可能なスクレーパを以下の表に記載します。
|
Scraper |
説明 |
|---|---|
|
|
システム・メトリクス |
|
|
CPU使用率メトリクス |
|
|
ディスクI/Oメトリクス |
|
|
CPU負荷メトリクス |
|
|
ファイル・システム利用率メトリクス |
|
|
メモリ利用率メトリクス |
|
|
ネットワーク・インターフェイスのI/OメトリクスとTCPコネクション・メトリクス |
|
|
ページングまたはスワップ領域の使用率とI/Oメトリクス |
|
|
プロセスカウントメトリクス。Linux でのみ使用可能です。 |
|
|
プロセスごとのCPU、メモリ、ディスクI/Oメトリクス |
スクレーパーの構成については、以下のセクションを参照してください。
ディスク
disk:
<include|exclude>:
devices: [ <device name>, ... ]
match_type: <strict|regexp>
ファイルシステム
filesystem:
<include_devices|exclude_devices>:
devices: [ <device name>, ... ]
match_type: <strict|regexp>
<include_fs_types|exclude_fs_types>:
fs_types: [ <filesystem type>, ... ]
match_type: <strict|regexp>
<include_mount_points|exclude_mount_points>:
mount_points: [ <mount point>, ... ]
match_type: <strict|regexp>
以下の例では、Linuxシステムの一般的なマウント・ポイントとして、フォワード・スラッシュ( / )を使用しています:
filesystem:
include_mount_points:
mount_points: ["/"]
match_type: strict
同様に、以下の例では、Windowsシステムの一般的なマウントポイントとして C: を示しています:
filesystem:
include_mount_points:
mount_points: ["C:"]
match_type: strict
仮想ファイルシステムを含めるには、include_virtual_filesystems を true に設定します。
filesystem:
include_virtual_filesystems: true
GitHubのdaemonset.yamlファイルに、より多くの例があります。
ネットワーク
network:
<include|exclude>:
interfaces: [ <interface name>, ... ]
match_type: <strict|regexp>
プロセス
process:
<include|exclude>:
names: [ <process name>, ... ]
match_type: <strict|regexp>
mute_process_name_error: <true|false>
mute_process_exe_error: <true|false>
mute_process_io_error: <true|false>
scrape_process_delay: <time>
以下の例では、デフォルトに加えて2つのメトリクスを収集し、リソース属性を使用して収集データにプロセスオーナを含めるプロセススクレーパーの設定方法を示します:
receivers:
hostmetrics:
scrapers:
process:
resource_attributes:
process.owner:
enabled: true
metrics:
process.memory.usage:
enabled: true
process.disk.io:
enabled: true
プロセススクレーパを使用したメトリクスとリソース属性の有効化と無効化の詳細については、OpenTelemetry ドキュメントの hostmetricsreceiver/process を参照してください。
プロセスの読み取りに関するエラーが継続的に表示される場合は、mute_process_name_error、mute_process_exe_error、または mute_process_io_error を true に設定することを検討してください。
フィルターリング
特定のソースからのメトリクスのサブセットのみを収集するには、filter プロセッサーでホスト・メトリクス・レシーバーを使用します。
さまざまな頻度
あるメトリクスを他のメトリクスとは異なる頻度でスクレイピングするには、異なる collection_interval 値で複数のホストメトリクスレシーバを構成してください。例:
receivers:
hostmetrics:
collection_interval: 30s
scrapers:
cpu:
memory:
hostmetrics/disk:
collection_interval: 1m
scrapers:
disk:
filesystem:
service:
pipelines:
metrics:
receivers: [hostmetrics, hostmetrics/disk]
メトリクス
以下のメトリクス、リソース属性、および属性が使用できます。
CPUスクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/cpuscraper.yaml
詳しくは、GitHub の「cpu scraper documentation」を参照してください。
ディスクスクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/diskscraper.yaml
詳細については、GitHub の「disk scraper documentation」を参照してください。
ファイルシステムスクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/filesystemscraper.yaml
詳細については、GitHub の「filesystem scraper documentation」を参照してください。
ロードスクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/loadscraper.yaml
詳細については、GitHub の「load scraper documentation」を参照してください。
メモリスクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/memoryscraper.yaml
詳細については、GitHub の「memory scraper documentation」を参照してください。
ネットワークスクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/networkscraper.yaml
詳細については、GitHub の「network scraper documentation」を参照してください。
ページングスクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/pagingscraper.yaml
詳細については、GitHub の「paging scraper documentation」を参照してください。
プロセススクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/processscraper.yaml
詳細については、GitHub の「process scraper documentation」を参照してください。
プロセススクレーパー
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/processesscraper.yaml
詳細については、GitHub の「processes scraper documentation」を参照してください。
デフォルトの変換ルールと生成されたメトリクス
SignalFx エクスポータは、デフォルトで translation/constants.go で定義された変換ルールを使用します。
デフォルトのルールは、Infrastructure Monitoring に直接レポートされるメトリクスを作成します。その属性または値を変更する場合は、変換ルールまたはその構成要素であるホストのメトリクスを変更する必要があります。
デフォルトでは、SignalFx エクスポータは、ホストメトリクスレシーバーから以下の集約メトリクスを作成します。
-
cpu.idle -
cpu.interrupt -
cpu.nice -
cpu.num_processors -
cpu.softirq -
cpu.steal -
cpu.system -
cpu.user -
cpu.utilization -
cpu.utilization_per_core -
cpu.wait -
disk.summary_utilization -
disk.utilization -
disk_ops.pending -
disk_ops.total -
memory.total -
memory.utilization -
network.total -
process.cpu_time_seconds -
system.disk.io.total -
system.disk.operations.total -
system.network.io.total -
system.network.packets.total -
vmpage_io.memory.in -
vmpage_io.memory.out -
vmpage_io.swap.in -
vmpage_io.swap.out
集約されたメトリクスに加えて、デフォルトのルールでは、以下の「コアごとの」カスタムホストメトリクスが利用可能です。CPU 番号はディメンション cpu に割り当てられます。
-
cpu.interrupt -
cpu.nice -
cpu.softirq -
cpu.steal -
cpu.system -
cpu.user -
cpu.wait
リソース属性
ホストメトリクスレシーバーは、エクスポートされたメトリクスにリソース属性を設定しません。
リソース属性を設定するには、OTEL_RESOURCE_ATTRIBUTES 環境変数を使用します。例:
export OTEL_RESOURCE_ATTRIBUTES="service.name=<name_of_service>,service.version=<version_of_service>" 特定のメトリクスをアクティブまたは非アクティブにする
各メトリクスの metrics セクションの enabled フィールドを設定することで、特定のメトリクスをアクティブまたは非アクティブにできます。例:
receivers:
samplereceiver:
metrics:
metric-one:
enabled: true
metric-two:
enabled: false
以下は、アクティブ化されたメトリクスを持つホスト・メトリクス・レシーバーの構成例です:
receivers:
hostmetrics:
scrapers:
process:
metrics:
process.cpu.utilization:
enabled: true
-
MTS ベースのサブスクリプションの場合、すべてのメトリックがメトリックの使用にカウントされます。
-
ホストベースのプランを使用している場合、このドキュメントでアクティブ(アクティブ:はい)としてリストされているメトリックはデフォルトと見なされ、無料で含まれています。
詳細については、「Infrastructure Monitoringのサブスクリプション使用状況(ホストとメトリクスのプラン)」を参照してください。
設定
以下の表に、ホスト・メトリクス・レシーバーの構成オプションを示します:
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/receiver/hostmetrics.yaml
トラブルシューティング
__ ___ ___ _ ______ _____________ _____ ________ ___ ___ ___ ____ __ ___ ____ ____ __ ______ _____________ ______ ___ ___ ___ ____ __ ___ _________ _____
_________ __ ______ _____________ _____ _________
-
______ _ ____ __ ___ ______ _______ _______
-
_______ ______ ________
_________ __ ___________ _________ ___ ____ _____ _____
-
___ _ ________ ___ ___ _______ _______ _________ _______ __ ______ ________
-
____ ___ ______ ______________ ____ _____ _____ _______ __ ___________ ____ __________ _________ ___ ______ _________ __________ __ _____ ___ ____ _______