Documentation
¶
Overview ¶
Package payload contains Network Path payload
Index ¶
- func ValidateNetworkPath(path *NetworkPath) error
- type CollectorType
- type E2eProbe
- type E2eProbeRttLatency
- type HopCountStats
- type ICMPMode
- type NetworkPath
- type NetworkPathDestination
- type NetworkPathSource
- type PathOrigin
- type Protocol
- type SourceProduct
- type TCPMethod
- type TestRunType
- type Traceroute
- type TracerouteDestination
- type TracerouteError
- type TracerouteErrorCode
- type TracerouteErrorResponse
- type TracerouteHop
- type TracerouteRun
- type TracerouteSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateNetworkPath ¶ added in v0.73.0
func ValidateNetworkPath(path *NetworkPath) error
ValidateNetworkPath validates a NetworkPath payload. Returns an error if any run does not have a valid destination IP address.
Types ¶
type CollectorType ¶ added in v0.75.0
type CollectorType string
CollectorType defines the type of collector
const ( // CollectorTypeAgent is an agent collector. CollectorTypeAgent CollectorType = "agent" // CollectorTypeManagedLocation is a managed location collector. CollectorTypeManagedLocation CollectorType = "managed_location" )
type E2eProbe ¶ added in v0.72.0
type E2eProbe struct {
RTTs []float64 `json:"rtts"` // ms
PacketsSent int `json:"packets_sent"`
PacketsReceived int `json:"packets_received"`
PacketLossPercentage float32 `json:"packet_loss_percentage"`
Jitter float64 `json:"jitter"` // ms
RTT E2eProbeRttLatency `json:"rtt"` // ms
}
E2eProbe contains e2e probe results
type E2eProbeRttLatency ¶ added in v0.72.0
type E2eProbeRttLatency struct {
Avg float64 `json:"avg"`
Min float64 `json:"min"`
Max float64 `json:"max"`
}
E2eProbeRttLatency contains e2e latency stats
type HopCountStats ¶ added in v0.72.0
HopCountStats contains hop count stats
type ICMPMode ¶ added in v0.71.0
type ICMPMode string
ICMPMode determines whether dynamic paths will run ICMP traceroutes for TCP/UDP traffic (instead of TCP/UDP traceroutes)
const ( // ICMPModeNone means to never use ICMP in dynamic path ICMPModeNone ICMPMode = "none" // ICMPModeTCP means to replace TCP traceroutes with ICMP ICMPModeTCP ICMPMode = "tcp" // ICMPModeUDP means to replace UDP traceroutes with ICMP ICMPModeUDP ICMPMode = "udp" // ICMPModeAll means to replace all traceroutes with ICMP ICMPModeAll ICMPMode = "all" )
const ICMPDefaultMode ICMPMode = ICMPModeNone
ICMPDefaultMode is what mode to use when nothing is specified
func MakeICMPMode ¶ added in v0.71.0
MakeICMPMode converts config strings into ICMPModes
func (ICMPMode) ShouldUseICMP ¶ added in v0.71.0
ShouldUseICMP returns whether ICMP mode should overwrite the given protocol
type NetworkPath ¶
type NetworkPath struct {
Timestamp int64 `json:"timestamp"`
AgentVersion string `json:"agent_version"`
Namespace string `json:"namespace"` // namespace used to resolve NDM resources
TestConfigID string `json:"test_config_id"` // ID represent the test configuration created in UI/backend/Agent
TestResultID string `json:"test_result_id"` // ID of specific test result (test run)
TestRunID string `json:"test_run_id"`
Origin PathOrigin `json:"origin"`
TestRunType TestRunType `json:"test_run_type"`
SourceProduct SourceProduct `json:"source_product"`
CollectorType CollectorType `json:"collector_type"`
Protocol Protocol `json:"protocol"`
Source NetworkPathSource `json:"source"`
Destination NetworkPathDestination `json:"destination"`
Traceroute Traceroute `json:"traceroute"`
E2eProbe E2eProbe `json:"e2e_probe"`
Tags []string `json:"tags,omitempty"`
}
NetworkPath encapsulates data that defines a path between two hosts as mapped by the agent
type NetworkPathDestination ¶
type NetworkPathDestination struct {
Hostname string `json:"hostname"`
Port uint16 `json:"port"`
Service string `json:"service,omitempty"`
}
NetworkPathDestination encapsulates information about the destination of a path
type NetworkPathSource ¶
type NetworkPathSource struct {
Name string `json:"name"`
DisplayName string `json:"display_name"`
Hostname string `json:"hostname"`
Via *payload.Via `json:"via,omitempty"`
NetworkID string `json:"network_id,omitempty"` // Today this will be a VPC ID since we only resolve AWS resources
Service string `json:"service,omitempty"`
ContainerID string `json:"container_id,omitempty"`
PublicIP string `json:"public_ip,omitempty"`
}
NetworkPathSource encapsulates information about the source of a path
type PathOrigin ¶
type PathOrigin string
PathOrigin origin of the path e.g. network_traffic, network_path_integration
const ( // PathOriginNetworkTraffic correspond to traffic from network traffic (NPM). PathOriginNetworkTraffic PathOrigin = "network_traffic" // PathOriginNetworkPathIntegration correspond to traffic from network_path integration. PathOriginNetworkPathIntegration PathOrigin = "network_path_integration" // PathOriginSynthetics correspond to traffic from synthetics. PathOriginSynthetics PathOrigin = "synthetics" )
type Protocol ¶
type Protocol string
Protocol defines supported network protocols Please define new protocols based on the Keyword from: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
type SourceProduct ¶ added in v0.75.0
type SourceProduct string
SourceProduct defines the product that originated the path
const ( // SourceProductNetworkPath is the network path product. SourceProductNetworkPath SourceProduct = "network_path" // SourceProductSynthetics is the synthetics product. SourceProductSynthetics SourceProduct = "synthetics" // SourceProductEndUserDevice is the end user device monitoring product. SourceProductEndUserDevice SourceProduct = "end_user_device" )
func GetSourceProduct ¶ added in v0.76.0
func GetSourceProduct(infraMode string) SourceProduct
GetSourceProduct returns the appropriate SourceProduct based on infrastructure mode. If infraMode is "end_user_device", returns SourceProductEndUserDevice. Otherwise, returns SourceProductNetworkPath.
type TCPMethod ¶ added in v0.66.0
type TCPMethod string
TCPMethod is the method used to run a TCP traceroute.
const ( // TCPConfigSYN means to only perform SYN traceroutes TCPConfigSYN TCPMethod = "syn" // TCPConfigSACK means to only perform SACK traceroutes TCPConfigSACK TCPMethod = "sack" // TCPConfigPreferSACK means to try SACK, and fall back to SYN if the remote doesn't support SACK TCPConfigPreferSACK TCPMethod = "prefer_sack" // TCPConfigSYNSocket means to use a SYN with TCP socket options to perform the traceroute (windows only) TCPConfigSYNSocket TCPMethod = "syn_socket" )
const TCPDefaultMethod TCPMethod = TCPConfigSYN
TCPDefaultMethod is what method to use when nothing is specified
func MakeTCPMethod ¶ added in v0.66.0
MakeTCPMethod converts a TCP traceroute method from config into a TCPMethod
type TestRunType ¶ added in v0.75.0
type TestRunType string
TestRunType defines the type of test run
const ( // TestRunTypeScheduled is a scheduled test run. TestRunTypeScheduled TestRunType = "scheduled" // TestRunTypeDynamic is a dynamic test run. TestRunTypeDynamic TestRunType = "dynamic" // TestRunTypeTriggered is a triggered test run. TestRunTypeTriggered TestRunType = "triggered" )
type Traceroute ¶ added in v0.72.0
type Traceroute struct {
Runs []TracerouteRun `json:"runs"`
HopCount HopCountStats `json:"hop_count"`
}
Traceroute contains traceroute results
type TracerouteDestination ¶ added in v0.72.0
type TracerouteDestination struct {
IPAddress net.IP `json:"ip_address"`
Port uint16 `json:"port"`
ReverseDNS []string `json:"reverse_dns,omitempty"`
}
TracerouteDestination contains result destination info
type TracerouteError ¶
type TracerouteError struct {
Code TracerouteErrorCode
Message string
}
TracerouteError is a classified error returned from the system-probe traceroute module. It is the agent-side mirror of the upstream library's TracerouteError type, kept local to avoid pulling the whole traceroute library into the main agent binary.
func (*TracerouteError) Error ¶
func (e *TracerouteError) Error() string
Error implements the error interface.
type TracerouteErrorCode ¶
type TracerouteErrorCode string
TracerouteErrorCode is a classifiable error code for traceroute failures, aligned with the codes emitted by the system-probe traceroute module. The wire values must match github.com/DataDog/datadog-traceroute/traceroute ErrorCode constants so responses can be decoded on the agent side without importing the heavy traceroute library.
const ( // TracerouteErrCodeDNS indicates a DNS resolution failure. TracerouteErrCodeDNS TracerouteErrorCode = "DNS" // TracerouteErrCodeTimeout indicates the operation timed out. TracerouteErrCodeTimeout TracerouteErrorCode = "TIMEOUT" // TracerouteErrCodeConnRefused indicates the target actively refused the connection. TracerouteErrCodeConnRefused TracerouteErrorCode = "CONNREFUSED" // TracerouteErrCodeHostUnreach indicates the target host is unreachable. TracerouteErrCodeHostUnreach TracerouteErrorCode = "HOSTUNREACH" // TracerouteErrCodeNetUnreach indicates the target network is unreachable. TracerouteErrCodeNetUnreach TracerouteErrorCode = "NETUNREACH" // TracerouteErrCodeDenied indicates a permission error or unsupported configuration. TracerouteErrCodeDenied TracerouteErrorCode = "DENIED" // TracerouteErrCodeInvalidRequest indicates bad parameters from the caller. TracerouteErrCodeInvalidRequest TracerouteErrorCode = "INVALID_REQUEST" // TracerouteErrCodeFailedEncoding indicates a failure to encode the response. TracerouteErrCodeFailedEncoding TracerouteErrorCode = "FAILED_ENCODING" // TracerouteErrCodeUnknown is the catch-all for unclassified errors. TracerouteErrCodeUnknown TracerouteErrorCode = "UNKNOWN" )
type TracerouteErrorResponse ¶
type TracerouteErrorResponse struct {
Code TracerouteErrorCode `json:"code"`
Message string `json:"message"`
}
TracerouteErrorResponse is the JSON body returned on error from the system-probe traceroute HTTP endpoint.
type TracerouteHop ¶ added in v0.72.0
type TracerouteHop struct {
TTL int `json:"ttl"`
IPAddress net.IP `json:"ip_address"`
ReverseDNS []string `json:"reverse_dns,omitempty"`
RTT float64 `json:"rtt,omitempty"`
Reachable bool `json:"reachable"`
}
TracerouteHop encapsulates information about a single hop in a traceroute
type TracerouteRun ¶ added in v0.72.0
type TracerouteRun struct {
RunID string `json:"run_id"`
Source TracerouteSource `json:"source"`
Destination TracerouteDestination `json:"destination"`
Hops []TracerouteHop `json:"hops"`
}
TracerouteRun contains traceroute results for a single run
type TracerouteSource ¶ added in v0.72.0
TracerouteSource contains result source info