Topic: Socket Monitoring & Instrumentation
Tags: serversocket, socket, instrumentation, bytecode, byteman, aop
SocketTracingLevel: The level of granularity of the collected data.
- CONNECTIONS: Traces the number of connections per discrete address each interval:
- Accepted and connected by server sockets to this JVM
- Connected to remote sockets
- ADDRESS_TRAFFIC: Traces the number of bytes read and written per discrete address each interval
- From remote connections
- To remote connections
- PORT_TRAFFIC: Traces the number of bytes read and written per discrete socket each interval
- From remote connections
- To remote connections
Note: Tracing level actions are cummulative with respect to traced data.
SocketTracingLevel | ServerSockets | Sockets | Notes |
CONNECTIONS | - Increment counter keyed by remote address on accepted connect
- Decrement counter keyed by remote address on server side
| - Increment counter keyed by remote address on socket connect
- Decrement counter keyed by remote address on socket connect
| ServerSocket.accept is tracked toeasilly and efficiently differentiate between socket instances created from ServerSockets and Client Sockets. |
ADDRESS_TRAFFIC | - Accumulate input and output byte counts from server side socket streams, keyed by the remote address of the streams' socket.
| - Accumulate input and output byte counts from client side socket streams, keyed by the remote address of the streams' socket.
| |
PORT_TRAFFIC | - Accumulate input and output byte counts from server side socket streams, keyed by the remote socket of the streams' socket
| - Accumulate input and output byte counts from client side socket streams, keyed by the remote socket of the streams' socket
| |
Byteman Helpers
Byteman Instrumentation Rules
Issues:
- UDP and Multicast Instrumentation
- Identify and link with meta-data about connected processes
- Skip internal codepaths of agent to avoid feedback loop