概要
Network Path のセットアップには、サービスとエンドポイントの間のネットワークルートを監視およびトレースするための環境の構成が含まれます。これは、ネットワークインフラストラクチャーにおけるボトルネック、レイテンシーの問題、および潜在的な障害点を特定する上で役立ちます。Network Path では、ニーズに応じて、個々のネットワークパスを手動で構成するか、自動的に検出するか、両方の方法を同時に使用することができます。
注: ネットワーク構成でアウトバウンドトラフィックを制限している場合は、Agent プロキシの構成 ドキュメントのセットアップ手順に従ってください。
セットアップ
Datadog には、Agent ベースの収集方法が 3 つあります。1 つの方法を単独で使用することも、複数の方法を組み合わせることもできます。
スケジュールテスト
特定のネットワークパスを Agent 構成ファイルで定義することで監視できます。ファイルは /etc/datadog-agent/conf.d/network_path.d/conf.yaml にあります。
開始するには、構成例 をコピーして .example 拡張子を削除し、希望の設定で更新するか、下記の環境固有の構成のいずれかを使用します。大規模な環境でのパフォーマンス最適化については、ワーカーの数を増やすを参照してください。
Agent v7.59+ が必要です。
/etc/datadog-agent/system-probe.yaml で次の内容を追加して system-probe traceroute モジュールを有効にします。
traceroute:
enabled: true
この Agent で新しい宛先を監視するために、/etc/datadog-agent/conf.d/network_path.d/conf.yaml ファイルを作成または編集して network_path を有効にします。
init_config:
min_collection_interval: 60 # in seconds, default 60 seconds
instances:
# configure the endpoints you want to monitor, one check instance per endpoint
# warning: Do not set the port when using UDP. Setting the port when using UDP can cause traceroute calls to fail and falsely report an unreachable destination.
- hostname: api.datadoghq.eu # endpoint hostname or IP
protocol: TCP
port: 443
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
min_collection_interval: 120 # set min_collection_interval at the instance level
## optional configs:
# max_ttl: 30 # max traceroute TTL, default is 30
# timeout: 1000 # timeout in milliseconds per hop, default is 1s
# tcp_method: syn # TCP probing method, default is syn, options: syn, sack, prefer_sack
# traceroute_queries: 3 # number of traceroutes to send per check run, default is 3
# e2e_queries: 50 # number of end-to-end probes to send per check run, default is 50
# more endpoints
- hostname: 1.1.1.1 # endpoint hostname or IP
protocol: UDP
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
これらの構成を変更した後、Agent を再起動します。ネットワークパスが表示されるようになります。
Agent v7.75+ が必要です。
/opt/datadog-agent/etc/system-probe.yaml で次の内容を追加して system-probe traceroute モジュールを有効にします。
traceroute:
enabled: true
この Agent で新しい宛先を監視するために、/opt/datadog-agent/etc/conf.d/network_path.d/conf.yaml ファイルを作成または編集して network_path を有効にします。
init_config:
min_collection_interval: 60 # in seconds, default 60 seconds
instances:
# configure the endpoints you want to monitor, one check instance per endpoint
# warning: Do not set the port when using UDP. Setting the port when using UDP can cause traceroute calls to fail and falsely report an unreachable destination.
- hostname: api.datadoghq.eu # endpoint hostname or IP
protocol: TCP
port: 443
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
min_collection_interval: 120 # set min_collection_interval at the instance level
## optional configs:
# max_ttl: 30 # max traceroute TTL, default is 30
# timeout: 1000 # timeout in milliseconds per hop, default is 1s
# tcp_method: syn # TCP probing method, default is syn, options: syn, sack, prefer_sack
# traceroute_queries: 3 # number of traceroutes to send per check run, default is 3
# e2e_queries: 50 # number of end-to-end probes to send per check run, default is 50
# more endpoints
- hostname: 1.1.1.1 # endpoint hostname or IP
protocol: UDP
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
これらの構成を変更した後、Agent を再起動します。ネットワークパスが表示されるようになります。
Agent v7.72+ が必要です。
%ProgramData%\Datadog\system-probe.yaml で次の内容を追加して system-probe traceroute モジュールを有効にします。
traceroute:
enabled: true
この Agent で新しい宛先を監視するために、%ProgramData%\Datadog\conf.d\network_path.d\conf.yaml ファイルを作成または編集して network_path を有効にします。
init_config:
min_collection_interval: 60 # in seconds, default 60 seconds
instances:
# configure the endpoints you want to monitor, one check instance per endpoint
# warning: Do not set the port when using UDP. Setting the port when using UDP can cause traceroute calls to fail and falsely report an unreachable destination.
- hostname: api.datadoghq.eu # endpoint hostname or IP
protocol: TCP
port: 443
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
min_collection_interval: 120 # set min_collection_interval at the instance level
## optional configs:
# max_ttl: 30 # max traceroute TTL, default is 30
# timeout: 1000 # timeout in milliseconds per hop, default is 1s
# tcp_method: syn # TCP probing method, default is syn, options: syn, sack, prefer_sack, syn_socket (Windows only)
# traceroute_queries: 3 # number of traceroutes to send per check run, default is 3
# e2e_queries: 50 # number of end-to-end probes to send per check run, default is 50
# more endpoints
- hostname: 1.1.1.1 # endpoint hostname or IP
protocol: TCP
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
これらの構成を変更した後、Agent を再起動します。ネットワークパスが表示されるようになります。
Agent v7.59+ が必要です。
Kubernetes で Helm を使用して Network Path を有効にするには、values.yaml ファイルに次の内容を追加します。
datadog:
traceroute:
enabled: true
confd:
network_path.yaml: |-
init_config:
min_collection_interval: 60 # in seconds, default 60 seconds
instances:
# configure the endpoints you want to monitor, one check instance per endpoint
# warning: Do not set the port when using UDP. Setting the port when using UDP can cause traceroute calls to fail and falsely report an unreachable destination.
- hostname: api.datadoghq.eu # endpoint hostname or IP
protocol: TCP
port: 443
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
min_collection_interval: 120 # set min_collection_interval at the instance level
## optional configs:
# max_ttl: 30 # max traceroute TTL, default is 30
# timeout: 1000 # timeout in milliseconds per hop, default is 1s
# tcp_method: syn # TCP probing method, default is syn, options: syn, sack, prefer_sack
# traceroute_queries: 3 # number of traceroutes to send per check run, default is 3
# e2e_queries: 50 # number of end-to-end probes to send per check run, default is 50
# more endpoints
- hostname: 1.1.1.1 # endpoint hostname or IP
protocol: UDP
tags:
- "tag_key:tag_value"
- "tag_key2:tag_value2"
Datadog Autodiscovery allows you to enable Network Path on a per-service basis through Kubernetes annotations.
Enable the traceroute module in the Datadog values.yaml file, which the Network Path integration depends on.
datadog:
traceroute:
enabled: true
After the module is enabled, Datadog automatically detects Network Path annotations added to your Kubernetes pod. For more information, see Kubernetes and Integrations.
apiVersion: v1
kind: Pod
# (...)
metadata:
name: '<POD_NAME>'
annotations:
ad.datadoghq.com/<CONTAINER_NAME>.checks: |
{
"network_path": {
"init_config": {
"min_collection_interval": 300
},
"instances": [
{
"protocol": "TCP",
"port": 443,
"source_service": "<CONTAINER_NAME>",
"tags": [
"tag_key:tag_value",
"tag_key2:tag_value2"
],
"hostname": "api.datadoghq.eu"
},
{
"protocol": "UDP",
"source_service": "<CONTAINER_NAME>",
"tags": [
"tag_key:tag_value",
"tag_key2:tag_value2"
],
"hostname": "1.1.1.1"
},
]
}
}
# (...)
spec:
containers:
- name: '<CONTAINER_NAME>'
# (...)
If you define pods indirectly (with deployments, ReplicaSets, or ReplicationControllers), add pod annotations under spec.template.metadata.
Increase the number of workers
Network Path monitoring for individual paths runs as an Agent Integration. The number of concurrent workers is controlled by the check_runners setting in the datadog.yaml file.
To increase the number of workers, add the following configuration to your datadog.yaml file:
## @param check_runners - integer - optional - default: 4
## @env DD_CHECK_RUNNERS - integer - optional - default: 4
## The `check_runners` refers to the number of concurrent check runners available for check instance execution.
## The scheduler attempts to spread the instances over the collection interval and will _at most_ be
## running the number of check runners instances concurrently.
##
## The level of concurrency has effects on the Agent's: RSS memory, CPU load, resource contention overhead, etc.
#
check_runners: <NUMBER_OF_WORKERS>
Dynamic tests
Prerequisites: CNM must be enabled.
Configure dynamic tests to allow the Agent to automatically discover and monitor network paths based on actual network traffic, eliminating the need to manually configure individual endpoints. See filter syntax to include/exclude domain or IPs.
Agent v7.73+ が必要です。
/etc/datadog-agent/system-probe.yaml で次の内容を追加して system-probe traceroute モジュールを有効にします。
traceroute:
enabled: true
CNM の接続を監視するために、/etc/datadog-agent/datadog.yaml ファイルを作成または編集して network_path を有効にします。
network_path:
connections_monitoring:
enabled: true
# collector:
# workers: <NUMBER OF WORKERS> # default 4
For full configuration details, reference the example config, or use the following:
network_path:
connections_monitoring:
## @param enabled - bool - required - default:false
## Enable network path collection
#
enabled: true
collector:
## @param workers - int - optional - default:4
## Number of workers that can collect paths in parallel
## Recommendation: leave at default
#
# workers: <NUMBER OF WORKERS> # default 4
#@env DD_NETWORK_PATH_COLLECTOR_PATHTEST_INTERVAL - integer - optional - default: 10m
# The `pathtest_interval` refers to the traceroute run interval for monitored connections.
# pathtest_interval: 10m
# @param pathtest_ttl - integer - optional - default: 35m
# @env DD_NETWORK_PATH_COLLECTOR_PATHTEST_TTL - integer - optional - default: 35m
# The `pathtest_ttl` refers to the duration (time-to-live) a connection will be monitored when it's not seen anymore.
# The TTL is reset each time the connection is seen again.
# pathtest_ttl: 35m
## @param filters - list - optional
## Include or exclude specific domains or IP ranges from dynamic monitoring.
## Filters are applied sequentially, with later filters taking precedence.
## See the "Filter syntax" section for details and examples: https://docs.datadoghq.com/network_monitoring/network_path/setup/#filter-syntax
#
# filters:
# - match_domain: '*.example.com'
# type: exclude
# - match_ip: 10.0.0.0/8
# type: exclude
# - match_domain: 'api.datadoghq.com'
# type: include
これらの構成を変更した後、Agent を再起動します。ネットワークパスが表示されるようになります。
Agent v7.73+ が必要です。
%ProgramData%\Datadog\system-probe.yaml で次の内容を追加して system-probe traceroute モジュールを有効にします。
traceroute:
enabled: true
CNM の接続を監視するために、%ProgramData%\Datadog\datadog.yaml ファイルを作成または編集して network_path を有効にします。
network_path:
connections_monitoring:
enabled: true
# collector:
# workers: <NUMBER OF WORKERS> # default 4
構成の詳細については、構成例 を参照するか、以下を使用してください。
network_path:
connections_monitoring:
## @param enabled - bool - required - default:false
## Enable network path collection
#
enabled: true
collector:
## @param workers - int - optional - default:4
## Number of workers that can collect paths in parallel
## Recommendation: leave at default
#
# workers: <NUMBER OF WORKERS> # default 4
#@env DD_NETWORK_PATH_COLLECTOR_PATHTEST_INTERVAL - integer - optional - default: 10m
# The `pathtest_interval` refers to the traceroute run interval for monitored connections.
# pathtest_interval: 10m
# @param pathtest_ttl - integer - optional - default: 35m
# @env DD_NETWORK_PATH_COLLECTOR_PATHTEST_TTL - integer - optional - default: 35m
# The `pathtest_ttl` refers to the duration (time-to-live) a connection will be monitored when it's not seen anymore.
# The TTL is reset each time the connection is seen again.
# pathtest_ttl: 35m
## @param filters - list - optional
## Include or exclude specific domains or IP ranges from dynamic monitoring.
## Filters are applied sequentially, with later filters taking precedence.
## See the "Filter syntax" section for details and examples: https://docs.datadoghq.com/network_monitoring/network_path/setup/#filter-syntax
#
# filters:
# - match_domain: '*.example.com'
# type: exclude
# - match_ip: 10.0.0.0/8
# type: exclude
# - match_domain: 'api.datadoghq.com'
# type: include
これらの構成を変更した後、Agent を再起動します。ネットワークパスが表示されるようになります。
Agent v7.73+ が必要です。
Kubernetes で Helm を使用して Network Path を有効にするには、values.yaml ファイルに次の内容を追加します。
注: Helm Chart v3.124.0 以降が必要です。詳細については、Datadog Helm チャートのドキュメント および Kubernetes とインテグレーション のドキュメントを参照してください。
datadog:
networkPath:
connectionsMonitoring:
enabled: true
## Set to true to enable the Traceroute Module of the System Probe
traceroute:
enabled: true
## @param collector - custom object - optional
## Configuration related to Network Path Collector.
#
collector:
## @param workers - integer - optional - default: 4
## @env DD_WORKERS - integer - optional - default: 4
## The `workers` refers to the number of concurrent workers available for network path execution.
#
# workers: 4
## @param pathtest_interval - integer - optional - default: 35m
## @env DD_NETWORK_PATH_COLLECTOR_PATHTEST_INTERVAL - integer - optional - default: 30m
## The `pathtest_interval` refers to the traceroute run interval for monitored connections.
#
# pathtest_interval: 30m
## @param pathtest_ttl - integer - optional - default: 35m
## @env DD_NETWORK_PATH_COLLECTOR_PATHTEST_TTL - integer - optional - default: 35m
## The `pathtest_ttl` refers to the duration (time-to-live) a connection will be monitored when it's not seen anymore.
## The TTL is reset each time the connection is seen again.
#
# pathtest_ttl: 35m
## @param filters - list - optional
## Include or exclude specific domains or IP ranges from dynamic monitoring.
## Filters are applied sequentially, with later filters taking precedence.
## See the "Filter syntax" section for details and examples: https://docs.datadoghq.com/network_monitoring/network_path/setup/#filter-syntax
#
# filters:
# - match_domain: '*.example.com'
# type: exclude
# - match_ip: 10.0.0.0/8
# type: exclude
# - match_domain: 'api.datadoghq.com'
# type: include
Dynamic Tests for NetFlow (試験)
Dynamic Tests for NetFlow は試験機能であり、Agent が必要です v7.81+。この機能を有効にするには、Datadog Support またはアカウントチームにお問い合わせください。
Dynamic Tests for NetFlow を構成して、Agent ホストから NetFlow レコードで観測された宛先 IP への Network Path のテストを実行します。Dynamic Tests for NetFlow には、Cloud Network Monitoring や network_path.connections_monitoring.enabled は必要ありません。
Dynamic Tests for NetFlow は、NetFlow トラフィックを収集する Datadog Agent から実行されます。これらは、NetFlow エクスポーター、ルーター、または元のフローソースからは実行されません。その Agent からの traceroute が調査対象のパスを表すように、観測されたフローソースに近い場所に Agent をデプロイしてください。
前提条件:
system-probe で次の内容を追加して /etc/datadog-agent/system-probe.yaml traceroute モジュールを有効にします。
traceroute:
enabled: true
で Dynamic Tests for NetFlow を有効にする/etc/datadog-agent/datadog.yaml:
network_path:
netflow_monitoring:
enabled: true
collector:
monitor_ip_without_domain: true
Dynamic Tests for NetFlow が観測された宛先 IP アドレスをターゲットとし、Network Path collector がデフォルトで IP のみのターゲットをスキップするため、monitor_ip_without_domain: true が必要です。
これらの構成を変更した後、Agent を再起動します。
system-probe で次の内容を追加して %ProgramData%\Datadog\system-probe.yaml traceroute モジュールを有効にします。
traceroute:
enabled: true
で Dynamic Tests for NetFlow を有効にします%ProgramData%\Datadog\datadog.yaml。
network_path:
netflow_monitoring:
enabled: true
collector:
monitor_ip_without_domain: true
Dynamic Tests for NetFlow が観測された宛先 IP アドレスをターゲットとし、Network Path collector がデフォルトで IP のみのターゲットをスキップするため、monitor_ip_without_domain: true が必要です。
これらの構成を変更した後、Agent を再起動します。
Agent がパスを報告した後、Network Path UI を開き、origin:netflow でフィルタリングして、NetFlow トラフィックから生成されたパスを表示します。
フィルター構文
ドメインや IP を含めたり除外したりするフィルターを構成します。次のことが可能になります。
- 内部ネットワークの監視オーバーヘッドを削減する
- 外部トラフィックパターンに焦点を当てる
- 監視が不要な既知のインフラストラクチャー範囲を除外する
同じ network_path.collector.filters リストが動的テストおよび Dynamic Tests for NetFlow に適用されます。Dynamic Tests for NetFlow では、Dynamic Tests for NetFlow が観測された宛先 IP アドレスをターゲットとするため、match_ip フィルターを使用してください。
動的テストから特定のドメインや IP 範囲を含めたり除外したりするには、/etc/datadog-agent/datadog.yaml ファイルに次の内容を追加します。
network_path:
collector:
filters:
# exclude single domain
- match_domain: 'api.slack.com'
type: exclude
# exclude domain using `*` wildcard
- match_domain: '*.datadoghq.com' # this translates to regex '.*\.datadoghq\.com
type: exclude
- match_domain: '*.zoom.us'
match_domain_strategy: wildcard # use simple wildcard matching (wildcard matching is the default)
type: exclude
# exclude single IP or using CIDR notation
- match_ip: 10.10.10.10
type: exclude
- match_ip: 10.20.0.0/24
type: exclude
# exclude using regex
- match_domain: '.*\.zoom\.us'
match_domain_strategy: regex # use regex matching strategy
type: exclude
# include
- match_domain: 'api.datadoghq.com'
type: include
注:
フィルターは順番に適用され、後のフィルターが前のフィルターより優先されます。
たとえば、*.datadoghq.com に一致するドメインは api.datadoghq.com を除いてすべて無視されます。
network_path:
collector:
filters:
- match_domain: '*.datadoghq.com'
type: exclude
- match_domain: 'api.datadoghq.com'
type: include
送信元パブリック IP の解決
Agent v7.75 以降では、送信元パブリック IP の解決が可能です。
Network Path は、送信元ホストのパブリック IP アドレスを解決し、インターネット向けトラフィックの正確なパスを可視化します。Agent は、送信元のパブリック IP を特定するために、HTTPS 経由で外部 IP チェックサービスに接続します。
この機能は、Network Path が機能するために必須ではありません。これらのサービスにアクセスできない場合でも、Network Path は通常どおり動作しますが、送信元のパブリック IP は解決されず、パスの可視化で送信元 IP メタデータが表示されません。
ネットワークでアウトバウンドトラフィックが制限されている場合に送信元のパブリック IP の解決を行うには、次の URL をファイアウォールの許可リストに追加してください。
| URL | プロバイダー |
|---|
https://icanhazip.com | Cloudflare |
https://ipinfo.io/ip | IPinfo |
https://checkip.amazonaws.com | Amazon |
https://api.ipify.org | ipify |
https://whatismyip.akamai.com | Akamai |
Agent は、各サービスを順番に試し、最初に成功した応答を使用します。リクエストはすべて HTTPS (ポート 443) 経由で行われます。
トラブルシューティング
Network Path の問題のトラブルシューティングには、次のガイドラインを使用してください。さらにサポートが必要な場合は、Datadog サポート にお問い合わせください。
Network Path のデータが UI に表示されない
Network Path UI にデータが表示されない場合、機能が完全に有効になっていない可能性があります。Network Path には、次のものが必要です。
traceroute モジュールが system-probe.yaml ファイルで有効になっている必要があります。
traceroute:
enabled: true
Network Path の機能が少なくとも 1 つはアクティブになっている必要があります。次に例を示します。
UI に Dynamic Tests for NetFlow のデータが表示されない
origin:netflow を含むパスが Network Path UI に表示されない場合は、以下を確認してください。
- Agent のバージョンが
7.81+ であること。 - NetFlow Monitoring が有効になっており、フローを受信していること。
- traceroute モジュールが
system-probe.yaml で有効になっていること。 network_path.netflow_monitoring.enabledおよび network_path.collector.monitor_ip_without_domain が datadog.yaml で true に設定されていること。network_path.collector.filters 構成で監視対象とする宛先 IP アドレスが除外されていないこと。
Dynamic Tests for NetFlow は、宛先フィルターが評価される前に、送信元 IP が Agent ホストに割り当てられている NetFlow レコードを自動的にスキップします。これは自己スケジューリングループを防ぐためのものであり、想定内の動作です。NAT やエイリアスの場合で、Agent を送信元とするトラフィックが別の送信元 IP から発生しているように見えるときは、network_path.collector.source_excludes を使用してそれらの送信元 IP を除外してください。
その後、origin:netflow の Network Path UI をフィルタリングします。
エラー: ステータスコード: 404
次のようなエラーが発生した場合:
Error: failed to trace path: traceroute request failed: Probe Path <path>, url: <url>, status code: 404
- これは、traceroute モジュールが有効になっていないことを示しています。traceroute モジュールが
system-probe.yaml ファイルで有効になっていることを確認してください。
参考資料