Socket
UDP/TCP ポート メトリクス データを収集します。
設定¶
前提条件¶
UDP メトリクスを使用するには、オペレーティング システムに nc プログラムが必要です
Info
ソケット コレクターは、イントラネット上の TCP/UDP ポート検出に適しています。パブリック ネットワーク サービスの場合は、ダイヤルテスト機能 を使用することをお勧めします。サービス アドレスがローカル マシンを指している場合は、コレクタの選択 (election: false) 機能をオフにしてください。オフにしないと、無効なコレクションが発生します。
コレクターの設定¶
DataKit インストール ディレクトリの下の conf.d/samples ディレクトリに入り、socket.conf.sample をコピーして、socket.conf という名前を付けます。例は次のとおりです。
[[inputs.socket]]
## Support TCP/UDP.
## If the quantity to be detected is too large, it is recommended to open more collectors
dest_url = [
"tcp://host:port",
"udp://host:port",
]
## @param interval - number - optional - default: 30
interval = "30s"
## @param interval - number - optional - default: 10
tcp_timeout = "10s"
## @param interval - number - optional - default: 10
udp_timeout = "10s"
## set false to disable election
election = true
[inputs.socket.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
設定後はDataKitを再起動するだけです。
現在、コレクタは コレクター設定を挿入するための ConfigMap メソッド を通じてオンにできます。
Kubernetes 環境では、DataKit ドメイン名は datakit-service.datakit.svc であり、ログ送信者は受信者として DataKit ドメイン名を指定できます。通常は、UDP プロトコルにドメイン名を使用することのみが推奨されます。 TCP プロトコルには、コンテキストのない複数行のデータが含まれる場合があります。
メトリクス¶
以下のすべてのメトリクス セットには、デフォルトで proto/dest_host/dest_port グローバル タグが追加されます。構成内の [inputs.socket.tags] を通じて他のタグを指定することもできます。
tcp¶
| Tags & Fields | Description |
|---|---|
| dest_host ( tag) |
Configured TCP destination domain name or IP address, such as www.google.com or 1.2.3.4. |
| dest_port ( tag) |
Configured TCP destination port, such as 80. |
| proto ( tag) |
Socket protocol. Always tcp for this measurement. |
| response_time | TCP connection duration excluding DNS lookup time. Type: int | (gauge) Unit: time,μs Tagged by: dest_host, dest_port, proto |
| response_time_with_dns | TCP connection duration including DNS lookup time. Type: int | (gauge) Unit: time,μs Tagged by: dest_host, dest_port, proto |
| success | Socket probe result: 1 for success and -1 for failure. Type: int | (gauge) Unit: N/A Tagged by: dest_host, dest_port, proto |
udp¶
| Tags & Fields | Description |
|---|---|
| dest_host ( tag) |
Configured UDP destination domain name or IP address. |
| dest_port ( tag) |
Configured UDP destination port. |
| proto ( tag) |
Socket protocol. Always udp for this measurement. |
| success | Socket probe result: 1 for success and -1 for failure. Type: int | (gauge) Unit: N/A Tagged by: dest_host, dest_port, proto |