Project: SkyWalking (Observability and Analysis / Observability)
File: backend-k8s-network-monitoring.md

SkyWalking leverages to measure network performance for particular pods on-demand, including metrics of L4(TCP) and L7(HTTP) traffic and raw data of HTTP requests and responses. Underlying, SkyWalking Rover converts data from socket data to metrics using eBPF technology. SkyWalking OAP server observes which specific k8s pod needs to monitor the network. SkyWalking Rover receives tasks from SkyWalking OAP server and executes them, and converts the network data into metrics send to the backend service. The SkyWalking OAP Server accesses K8s's `API Server` to fetch meta info and parses the expression with to aggregate. Setup . Enable the network profiling MAL file in the OAP server. ```yaml agent-analyzer: selector: ${SWAGENTANALYZER:default} default: meterAnalyzerActiveFiles: ${SWMETERANALYZERACTIVEFILES:network-profiling} ``` Notice the precondition, the HTTP request must have the trace header in SkyWalking(`sw8` header) or Zipkin(`b3` header(s)) format. The sampling configurations define the sampling boundaries for the HTTP traffic. When a HTTP calling is sampled, the SkyWalking Rover could collect the HTTP request/response raw data and upload it to the span attached event. The sampling config contains multiple rules, and each of rules has the following configurations: `URI Regex`: The match pattern for HTTP requests is HTTP URI-oriented. Match all requests if the URI regex is not set. `Minimal Request Duration (ms)`: Sample the HTTP requests with slower latency than this threshold. `Sample HTTP requests and responses with tracing when the response code is between 400 and 499`: This is OFF by default. `Sample HTTP requests and responses with tracing when the response code is between 500 and 599`: This is ON by default. After SkyWalking OAP server receives the metrics from the SkyWalking Rover, it supports to analysis the following data: Topology: Based on the process and peer address, the following topology data is supported: Relation: Analyze the relationship between local processes, or local process with external pods or services. SSL: The socket read or write package with SSL. Protocol: The protocols for write or read data. TCP socket read and write metrics, including following types: Call Per Minute: The count of the socket read or write. Bytes: The package size of the socket data. Execute Time: The executed time of the socket read or write. Connect: The socket connect/accept with peer address count and execute time. Close: The socket close the socket count and execute time. RTT: The RTT(Round Trip Time) of socket communicate with peer address. Local process communicate with peer address exception data, including following types: Retransmit: The count of TCP package is retransmitted. Drop: The count of TCP package is dropped. HTTP/1.x request/response related metrics, including following types: Request CPM: The calls per minute of requests. Response CPM: The calls per minute of responses with status code. Request Package Size: The size(KB) of the request package. Response Package Size: The size(KB) of the response package. Client Side Response Duration: The duration(ms) of the client receive the response. Server Side Response Duration: The duration(ms) of the server send the response. HTTP sampled request with traces, including following types: Slow traces: The traces which have slow duration. Traces from HTTP Code in [400, 500) (ms): The traces which response status code in [400, 500). Traces from HTTP Code in [500, 600) (ms): The traces which response status code in [500, 600).