diff --git a/bpf/go_common.h b/bpf/go_common.h index 12ebd57b7..4a5d8443c 100644 --- a/bpf/go_common.h +++ b/bpf/go_common.h @@ -54,7 +54,8 @@ struct { __uint(type, BPF_MAP_TYPE_LRU_HASH); __type(key, void *); // key: pointer to the request goroutine __type(value, connection_info_t); - __uint(max_entries, MAX_CONCURRENT_REQUESTS); + __uint(max_entries, MAX_CONCURRENT_SHARED_REQUESTS); + __uint(pinning, LIBBPF_PIN_BY_NAME); } ongoing_server_connections SEC(".maps"); struct { @@ -273,4 +274,19 @@ static __always_inline u8 get_conn_info(void *conn_ptr, connection_info_t *info) return 0; } +static __always_inline void* unwrap_tls_conn_info(void *conn_ptr, void *tls_state) { + if (conn_ptr && tls_state) { + void *c_ptr = 0; + bpf_probe_read(&c_ptr, sizeof(c_ptr), (void *)(conn_ptr)); // unwrap conn + + bpf_dbg_printk("unwrapped conn ptr %llx", c_ptr); + + if (c_ptr) { + return c_ptr + 8; + } + } + + return conn_ptr; +} + #endif // GO_COMMON_H diff --git a/bpf/go_grpc.c b/bpf/go_grpc.c index d42021027..9f2c8891e 100644 --- a/bpf/go_grpc.c +++ b/bpf/go_grpc.c @@ -42,6 +42,25 @@ typedef struct grpc_client_func_invocation { u64 flags; } grpc_client_func_invocation_t; +typedef struct grpc_transports { + u8 type; + connection_info_t conn; +} grpc_transports_t; + +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __type(key, void *); // key: pointer to the transport pointer + __type(value, grpc_transports_t); + __uint(max_entries, MAX_CONCURRENT_REQUESTS); +} ongoing_grpc_transports SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_LRU_HASH); + __type(key, void *); // key: goroutine + __type(value, void *); // the transport * + __uint(max_entries, MAX_CONCURRENT_REQUESTS); +} ongoing_grpc_operate_headers SEC(".maps"); + struct { __uint(type, BPF_MAP_TYPE_LRU_HASH); __type(key, void *); // key: pointer to the request goroutine @@ -72,6 +91,9 @@ struct { } ongoing_grpc_header_writes SEC(".maps"); +#define TRANSPORT_HTTP2 1 +#define TRANSPORT_HANDLER 2 + // To be Injected from the user space during the eBPF program load & initialization volatile const u64 grpc_stream_st_ptr_pos; @@ -84,6 +106,7 @@ volatile const u64 grpc_stream_ctx_ptr_pos; volatile const u64 value_context_val_ptr_pos; volatile const u64 grpc_st_conn_pos; volatile const u64 grpc_t_conn_pos; +volatile const u64 grpc_t_scheme_pos; // Context propagation volatile const u64 http2_client_next_id_pos; @@ -104,7 +127,7 @@ int uprobe_server_handleStream(struct pt_regs *ctx) { grpc_srv_func_invocation_t invocation = { .start_monotime_ns = bpf_ktime_get_ns(), .stream = (u64)stream_ptr, - .tp = {0} + .tp = {0}, }; if (stream_ptr) { @@ -124,6 +147,69 @@ int uprobe_server_handleStream(struct pt_regs *ctx) { return 0; } +// Sets up the connection info to be grabbed and mapped over the transport to operateHeaders +SEC("uprobe/netFdReadGRPC") +int uprobe_netFdReadGRPC(struct pt_regs *ctx) { + void *goroutine_addr = GOROUTINE_PTR(ctx); + bpf_dbg_printk("=== uprobe/proc netFD read goroutine %lx === ", goroutine_addr); + + void *tr = bpf_map_lookup_elem(&ongoing_grpc_operate_headers, &goroutine_addr); + bpf_dbg_printk("tr %llx", tr); + if (tr) { + grpc_transports_t *t = bpf_map_lookup_elem(&ongoing_grpc_transports, tr); + bpf_dbg_printk("t %llx", t); + if (t) { + void *fd_ptr = GO_PARAM1(ctx); + get_conn_info_from_fd(fd_ptr, &t->conn); // ok to not check the result, we leave it as 0 + } + } + + return 0; +} + +// Handles finding the connection information for http2 servers in grpc +SEC("uprobe/http2Server_operateHeaders") +int uprobe_http2Server_operateHeaders(struct pt_regs *ctx) { + void *goroutine_addr = GOROUTINE_PTR(ctx); + void *tr = GO_PARAM1(ctx); + bpf_dbg_printk("=== uprobe/http2Server_operateHeaders tr %llx goroutine %lx === ", tr, goroutine_addr); + + grpc_transports_t t = { + .type = TRANSPORT_HTTP2, + .conn = {0}, + }; + + bpf_map_update_elem(&ongoing_grpc_operate_headers, &goroutine_addr, &tr, BPF_ANY); + bpf_map_update_elem(&ongoing_grpc_transports, &tr, &t, BPF_ANY); + + return 0; +} + +// Handles finding the connection information for grpc ServeHTTP +SEC("uprobe/serverHandlerTransport_HandleStreams") +int uprobe_server_handler_transport_handle_streams(struct pt_regs *ctx) { + void *tr = GO_PARAM1(ctx); + void *goroutine_addr = GOROUTINE_PTR(ctx); + bpf_printk("=== uprobe/serverHandlerTransport_HandleStreams tr %llx goroutine %lx === ", tr, goroutine_addr); + + void *parent_go = (void *)find_parent_goroutine(goroutine_addr); + if (parent_go) { + bpf_dbg_printk("found parent goroutine for transport handler [%llx]", parent_go); + connection_info_t *conn = bpf_map_lookup_elem(&ongoing_server_connections, &parent_go); + bpf_dbg_printk("conn %llx", conn); + if (conn) { + grpc_transports_t t = { + .type = TRANSPORT_HANDLER, + }; + __builtin_memcpy(&t.conn, conn, sizeof(connection_info_t)); + + bpf_map_update_elem(&ongoing_grpc_transports, &tr, &t, BPF_ANY); + } + } + + return 0; +} + SEC("uprobe/server_handleStream") int uprobe_server_handleStream_return(struct pt_regs *ctx) { bpf_dbg_printk("=== uprobe/server_handleStream return === "); @@ -138,10 +224,11 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { goto done; } - u16 *status = bpf_map_lookup_elem(&ongoing_grpc_request_status, &goroutine_addr); - if (status == NULL) { + u16 *status_ptr = bpf_map_lookup_elem(&ongoing_grpc_request_status, &goroutine_addr); + u16 status = 0; + if (status_ptr != NULL) { bpf_dbg_printk("can't read grpc invocation status"); - goto done; + status = *status_ptr; } void *stream_ptr = (void *)invocation->stream; @@ -155,7 +242,7 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { task_pid(&trace->pid); trace->type = EVENT_GRPC_REQUEST; trace->start_monotime_ns = invocation->start_monotime_ns; - trace->status = *status; + trace->status = status; trace->content_length = 0; trace->method[0] = 0; @@ -181,19 +268,18 @@ int uprobe_server_handleStream_return(struct pt_regs *ctx) { bpf_dbg_printk("st_ptr %llx", st_ptr); if (st_ptr) { - void *conn_ptr = st_ptr + grpc_st_conn_pos; - bpf_dbg_printk("conn_ptr %llx", conn_ptr); - if (conn_ptr) { - void *conn_conn_ptr = 0; - bpf_probe_read(&conn_conn_ptr, sizeof(conn_conn_ptr), conn_ptr + 8); - bpf_dbg_printk("conn_conn_ptr %llx", conn_conn_ptr); - if (conn_conn_ptr) { - found_conn = get_conn_info(conn_conn_ptr, &trace->conn); - } - } + grpc_transports_t *t = bpf_map_lookup_elem(&ongoing_grpc_transports, &st_ptr); + + bpf_dbg_printk("found t %llx", t); + if (t) { + bpf_dbg_printk("setting up connection info from grpc handler"); + __builtin_memcpy(&trace->conn, &t->conn, sizeof(connection_info_t)); + found_conn = 1; + } } if (!found_conn) { + bpf_dbg_printk("can't find connection info for st_ptr %llx", st_ptr); __builtin_memset(&trace->conn, 0, sizeof(connection_info_t)); } @@ -422,11 +508,29 @@ int uprobe_transport_http2Client_NewStream(struct pt_regs *ctx) { bpf_dbg_printk("goroutine_addr %lx, t_ptr %llx, t.conn_pos %x", goroutine_addr, t_ptr, grpc_t_conn_pos); if (t_ptr) { - void *conn_ptr = t_ptr + grpc_t_conn_pos; - bpf_dbg_printk("conn_ptr %llx", conn_ptr); + void *conn_ptr = t_ptr + grpc_t_conn_pos + 8; + u8 buf[16]; + u64 is_secure = 0; + + if (!read_go_str("transport scheme", t_ptr, grpc_t_scheme_pos, &buf, sizeof(buf))) { + bpf_dbg_printk("can't read grpc transport.Stream.Method"); + } + + bpf_dbg_printk("scheme %s", buf); + + if (buf[0] == 'h' && buf[1] == 't' && buf[2] == 't' && buf[3] == 'p' && buf[4] == 's') { + is_secure = 1; + } + + if (is_secure) { + // double wrapped in grpc + conn_ptr = unwrap_tls_conn_info(conn_ptr, (void *)is_secure); + conn_ptr = unwrap_tls_conn_info(conn_ptr, (void *)is_secure); + } + bpf_dbg_printk("conn_ptr %llx is_secure %lld", conn_ptr, is_secure); if (conn_ptr) { void *conn_conn_ptr = 0; - bpf_probe_read(&conn_conn_ptr, sizeof(conn_conn_ptr), conn_ptr + 8); + bpf_probe_read(&conn_conn_ptr, sizeof(conn_conn_ptr), conn_ptr); bpf_dbg_printk("conn_conn_ptr %llx", conn_conn_ptr); if (conn_conn_ptr) { connection_info_t conn = {0}; @@ -480,6 +584,11 @@ SEC("uprobe/grpcFramerWriteHeaders") int uprobe_grpcFramerWriteHeaders(struct pt_regs *ctx) { bpf_dbg_printk("=== uprobe/proc grpc Framer writeHeaders === "); + if (framer_w_pos == 0) { + bpf_dbg_printk("framer w not found"); + return 0; + } + void *framer = GO_PARAM1(ctx); u64 stream_id = (u64)GO_PARAM2(ctx); diff --git a/bpf/go_nethttp.c b/bpf/go_nethttp.c index 828137834..cf6d3a72e 100644 --- a/bpf/go_nethttp.c +++ b/bpf/go_nethttp.c @@ -107,6 +107,12 @@ int uprobe_ServeHTTP(struct pt_regs *ctx) { goto done; } + // Ignore gRPC ServeHTTP + if (invocation.method[0] == 'P' && invocation.method[1] == 'R' && invocation.method[2] == 'I') { + bpf_dbg_printk("ignoring grpc ServeHTTP wrapper"); + goto done; + } + // Get path from Request.URL void *url_ptr = 0; int res = bpf_probe_read(&url_ptr, sizeof(url_ptr), (void *)(req + url_ptr_pos)); @@ -134,6 +140,39 @@ int uprobe_ServeHTTP(struct pt_regs *ctx) { return 0; } +SEC("uprobe/readRequest") +int uprobe_readRequestStart(struct pt_regs *ctx) { + bpf_dbg_printk("=== uprobe/proc readRequest === "); + + void *goroutine_addr = GOROUTINE_PTR(ctx); + bpf_dbg_printk("goroutine_addr %lx", goroutine_addr); + + connection_info_t *existing = bpf_map_lookup_elem(&ongoing_server_connections, &goroutine_addr); + + if (!existing) { + void *c_ptr = GO_PARAM1(ctx); + if (c_ptr) { + void *conn_conn_ptr = c_ptr + 8 + c_rwc_pos; // embedded struct + void *tls_state = 0; + bpf_probe_read(&tls_state, sizeof(tls_state), (void *)(c_ptr + c_tls_pos)); + conn_conn_ptr = unwrap_tls_conn_info(conn_conn_ptr, tls_state); + bpf_dbg_printk("conn_conn_ptr %llx, tls_state %llx, c_tls_pos = %d, c_tls_ptr = %llx", conn_conn_ptr, tls_state, c_tls_pos, c_ptr + c_tls_pos); + if (conn_conn_ptr) { + void *conn_ptr = 0; + bpf_probe_read(&conn_ptr, sizeof(conn_ptr), (void *)(conn_conn_ptr + net_conn_pos)); // find conn + bpf_dbg_printk("conn_ptr %llx", conn_ptr); + if (conn_ptr) { + connection_info_t conn = {0}; + get_conn_info(conn_ptr, &conn); // initialized to 0, no need to check the result if we succeeded + bpf_map_update_elem(&ongoing_server_connections, &goroutine_addr, &conn, BPF_ANY); + } + } + } + } + + return 0; +} + SEC("uprobe/readRequest") int uprobe_readRequestReturns(struct pt_regs *ctx) { bpf_dbg_printk("=== uprobe/proc readRequest returns === "); @@ -219,62 +258,16 @@ int uprobe_ServeHTTPReturns(struct pt_regs *ctx) { bpf_dbg_printk("Resp ptr %llx", resp_ptr); - if (invocation->http2) { - void *conn_ptr = 0; - bpf_probe_read(&conn_ptr, sizeof(conn_ptr), resp_ptr + rws_conn_pos); - bpf_dbg_printk("conn_ptr %llx", conn_ptr); - u8 found_conn = 0; - if (conn_ptr) { - void *conn_conn_ptr = 0; - bpf_probe_read(&conn_conn_ptr, sizeof(conn_conn_ptr), conn_ptr + http2_server_conn_pos + 8); - bpf_dbg_printk("conn_conn_ptr %llx", conn_conn_ptr); - if (conn_conn_ptr) { - void *conn_conn_conn_ptr = 0; - bpf_probe_read(&conn_conn_conn_ptr, sizeof(conn_conn_conn_ptr), conn_conn_ptr + 8); - bpf_dbg_printk("conn_conn_conn_ptr %llx", conn_conn_conn_ptr); + connection_info_t *info = bpf_map_lookup_elem(&ongoing_server_connections, &goroutine_addr); - found_conn = get_conn_info(conn_conn_conn_ptr, &trace->conn); - } - } - - if (!found_conn) { - __builtin_memset(&trace->conn, 0, sizeof(connection_info_t)); - } + if (info) { + //dbg_print_http_connection_info(info); + __builtin_memcpy(&trace->conn, info, sizeof(connection_info_t)); } else { - connection_info_t *info = bpf_map_lookup_elem(&ongoing_server_connections, &goroutine_addr); - - if (info) { - //dbg_print_http_connection_info(info); - __builtin_memcpy(&trace->conn, info, sizeof(connection_info_t)); - } else { - // We can't find the connection info, this typically means there are too many requests per second - // and the connection map is too small for the workload. - bpf_dbg_printk("Can't find connection info for %llx", goroutine_addr); - - // Attempt last resort read, in case the connection info is one of the standard http ones and not - // overloaded by the client app - void *c_ptr = 0; - u8 found = 0; - bpf_probe_read(&c_ptr, sizeof(c_ptr), (void *)(resp_ptr)); // load c - if (c_ptr) { - void *rwc_ptr = c_ptr + 8 + c_rwc_pos; // load rwc, embedded struct - if (rwc_ptr) { - void *conn_ptr = 0; - bpf_probe_read(&conn_ptr, sizeof(conn_ptr), (void *)(rwc_ptr + rwc_conn_pos)); // find conn - if (conn_ptr) { - found = get_conn_info(conn_ptr, &trace->conn); - if (found) { - bpf_dbg_printk("found backup connection info"); - } - //dbg_print_http_connection_info(&conn); - } - } - } - - if (!found) { - __builtin_memset(&trace->conn, 0, sizeof(connection_info_t)); - } - } + // We can't find the connection info, this typically means there are too many requests per second + // and the connection map is too small for the workload. + bpf_dbg_printk("Can't find connection info for %llx", goroutine_addr); + __builtin_memset(&trace->conn, 0, sizeof(connection_info_t)); } // Server connections have opposite order, source port is the server port @@ -532,6 +525,36 @@ int uprobe_http2ResponseWriterStateWriteHeader(struct pt_regs *ctx) { return 0; } +// HTTP 2.0 server support +SEC("uprobe/http2serverConn_runHandler") +int uprobe_http2serverConn_runHandler(struct pt_regs *ctx) { + bpf_dbg_printk("=== uprobe/proc http2serverConn_runHandler === "); + + void *goroutine_addr = GOROUTINE_PTR(ctx); + bpf_dbg_printk("goroutine_addr %lx", goroutine_addr); + + + void *sc = GO_PARAM1(ctx); + + if (sc) { + void *conn_ptr = 0; + bpf_probe_read(&conn_ptr, sizeof(void *), sc + sc_conn_pos + 8); + bpf_dbg_printk("conn_ptr %llx", conn_ptr); + if (conn_ptr) { + void *conn_conn_ptr = 0; + bpf_probe_read(&conn_conn_ptr, sizeof(void *), conn_ptr + 8); + bpf_dbg_printk("conn_conn_ptr %llx", conn_conn_ptr); + if (conn_conn_ptr) { + connection_info_t conn = {0}; + get_conn_info(conn_conn_ptr, &conn); + bpf_map_update_elem(&ongoing_server_connections, &goroutine_addr, &conn, BPF_ANY); + } + } + } + + return 0; +} + // HTTP 2.0 client support #ifndef NO_HEADER_PROPAGATION struct { @@ -608,6 +631,11 @@ SEC("uprobe/http2FramerWriteHeaders") int uprobe_http2FramerWriteHeaders(struct pt_regs *ctx) { bpf_dbg_printk("=== uprobe/proc http2 Framer writeHeaders === "); + if (framer_w_pos == 0) { + bpf_dbg_printk("framer w not found"); + return 0; + } + void *framer = GO_PARAM1(ctx); u64 stream_id = (u64)GO_PARAM2(ctx); @@ -810,9 +838,16 @@ int uprobe_persistConnRoundTrip(struct pt_regs *ctx) { void *pc_ptr = GO_PARAM1(ctx); if (pc_ptr) { void *conn_conn_ptr = pc_ptr + 8 + pc_conn_pos; // embedded struct + void *tls_state = 0; + bpf_probe_read(&tls_state, sizeof(tls_state), (void *)(pc_ptr + pc_tls_pos)); // find tlsState + bpf_dbg_printk("conn_conn_ptr %llx, tls_state %llx", conn_conn_ptr, tls_state); + + conn_conn_ptr = unwrap_tls_conn_info(conn_conn_ptr, tls_state); + if (conn_conn_ptr) { void *conn_ptr = 0; - bpf_probe_read(&conn_ptr, sizeof(conn_ptr), (void *)(conn_conn_ptr + rwc_conn_pos)); // find conn + bpf_probe_read(&conn_ptr, sizeof(conn_ptr), (void *)(conn_conn_ptr + net_conn_pos)); // find conn + bpf_dbg_printk("conn_ptr %llx", conn_ptr); if (conn_ptr) { connection_info_t conn = {0}; get_conn_info(conn_ptr, &conn); // initialized to 0, no need to check the result if we succeeded diff --git a/bpf/go_nethttp.h b/bpf/go_nethttp.h index 18433b14f..020facd3e 100644 --- a/bpf/go_nethttp.h +++ b/bpf/go_nethttp.h @@ -30,11 +30,12 @@ volatile const u64 rws_status_pos; volatile const u64 cc_next_stream_id_pos; volatile const u64 framer_w_pos; -volatile const u64 c_rwc_pos; volatile const u64 pc_conn_pos; -volatile const u64 rwc_conn_pos; -volatile const u64 rws_conn_pos; -volatile const u64 http2_server_conn_pos; +volatile const u64 pc_tls_pos; +volatile const u64 net_conn_pos; volatile const u64 cc_tconn_pos; +volatile const u64 sc_conn_pos; +volatile const u64 c_rwc_pos; +volatile const u64 c_tls_pos; #endif diff --git a/configs/offsets/tracker_input.json b/configs/offsets/tracker_input.json index 793056c96..c59b084ba 100644 --- a/configs/offsets/tracker_input.json +++ b/configs/offsets/tracker_input.json @@ -33,9 +33,6 @@ "vendor/golang.org/x/net/http2/hpack.Encoder": [ "w" ], - "net/http.conn": [ - "rwc" - ], "net.TCPConn": [ "conn" ], @@ -47,7 +44,12 @@ "raddr" ], "net/http.persistConn": [ - "conn" + "conn", + "tlsState" + ], + "net/http.conn": [ + "rwc", + "tlsState" ] } }, @@ -57,11 +59,7 @@ "fields": { "golang.org/x/net/http2.responseWriterState": [ "req", - "status", - "conn" - ], - "golang.org/x/net/http2.serverConn": [ - "conn" + "status" ], "golang.org/x/net/http2/hpack.Encoder": [ "w" @@ -72,6 +70,9 @@ ], "golang.org/x/net/http2.Framer": [ "w" + ], + "golang.org/x/net/http2.serverConn": [ + "conn" ] } }, @@ -91,7 +92,8 @@ ], "google.golang.org/grpc/internal/transport.http2Client": [ "nextID", - "conn" + "conn", + "scheme" ], "google.golang.org/grpc/internal/transport.bufWriter": [ "buf", diff --git a/pkg/export/attributes/attr_defs.go b/pkg/export/attributes/attr_defs.go index b2182ff4e..78591020b 100644 --- a/pkg/export/attributes/attr_defs.go +++ b/pkg/export/attributes/attr_defs.go @@ -119,6 +119,8 @@ func getDefinitions(groups AttrGroups) map[Section]AttrReportGroup { var serverInfo = AttrReportGroup{ Attributes: map[attr.Name]Default{ attr.ClientAddr: Default(peerInfoEnabled), + attr.ServerAddr: true, + attr.ServerPort: true, }, } var httpClientInfo = AttrReportGroup{ diff --git a/pkg/internal/ebpf/goredis/bpf_bpfel_arm64.o b/pkg/internal/ebpf/goredis/bpf_bpfel_arm64.o index 944e161fe..d16d5ab15 100644 Binary files a/pkg/internal/ebpf/goredis/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/goredis/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/goredis/bpf_bpfel_x86.o b/pkg/internal/ebpf/goredis/bpf_bpfel_x86.o index e0a27c9f7..385f2938e 100644 Binary files a/pkg/internal/ebpf/goredis/bpf_bpfel_x86.o and b/pkg/internal/ebpf/goredis/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/goredis/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/goredis/bpf_debug_bpfel_arm64.o index 9eca2ec74..10198c1a9 100644 Binary files a/pkg/internal/ebpf/goredis/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/goredis/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/goredis/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/goredis/bpf_debug_bpfel_x86.o index 7ed4d7eb8..d61fbf565 100644 Binary files a/pkg/internal/ebpf/goredis/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/goredis/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o b/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o index 9aa83483d..55d96169b 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/goruntime/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o b/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o index 58b647d25..ebfce8364 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o and b/pkg/internal/ebpf/goruntime/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o index 63b51cc12..9a289466c 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o index 8e323f9cd..4e1dc8644 100644 Binary files a/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/goruntime/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.go b/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.go index ccdf5ec71..81f802525 100644 --- a/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.go +++ b/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.go @@ -39,6 +39,12 @@ type bpfGrpcSrvFuncInvocationT struct { Tp bpfTpInfoT } +type bpfGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpfConnectionInfoT +} + type bpfTpInfoPidT struct { Tp bpfTpInfoT Pid uint32 @@ -96,18 +102,21 @@ type bpfSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpfMapSpecs contains maps before they are loaded into the kernel. @@ -121,8 +130,10 @@ type bpfMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -154,8 +165,10 @@ type bpfMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -170,8 +183,10 @@ func (m *bpfMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -182,18 +197,21 @@ func (m *bpfMaps) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpfPrograms) Close() error { @@ -206,8 +224,11 @@ func (p *bpfPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o index 81f20c226..604c04631 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_bpfel_x86.go b/pkg/internal/ebpf/grpc/bpf_bpfel_x86.go index 20a4bb351..b0fc9cd5d 100644 --- a/pkg/internal/ebpf/grpc/bpf_bpfel_x86.go +++ b/pkg/internal/ebpf/grpc/bpf_bpfel_x86.go @@ -39,6 +39,12 @@ type bpfGrpcSrvFuncInvocationT struct { Tp bpfTpInfoT } +type bpfGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpfConnectionInfoT +} + type bpfTpInfoPidT struct { Tp bpfTpInfoT Pid uint32 @@ -96,18 +102,21 @@ type bpfSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpfProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpfMapSpecs contains maps before they are loaded into the kernel. @@ -121,8 +130,10 @@ type bpfMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -154,8 +165,10 @@ type bpfMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -170,8 +183,10 @@ func (m *bpfMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -182,18 +197,21 @@ func (m *bpfMaps) Close() error { // // It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. type bpfPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpfPrograms) Close() error { @@ -206,8 +224,11 @@ func (p *bpfPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o index 64e23b756..68f081ad9 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.go b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.go index 54de44374..1921eb5d5 100644 --- a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.go +++ b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.go @@ -39,6 +39,12 @@ type bpf_debugGrpcSrvFuncInvocationT struct { Tp bpf_debugTpInfoT } +type bpf_debugGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpf_debugConnectionInfoT +} + type bpf_debugTpInfoPidT struct { Tp bpf_debugTpInfoT Pid uint32 @@ -96,18 +102,21 @@ type bpf_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpf_debugMapSpecs contains maps before they are loaded into the kernel. @@ -122,8 +131,10 @@ type bpf_debugMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -156,8 +167,10 @@ type bpf_debugMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -173,8 +186,10 @@ func (m *bpf_debugMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -185,18 +200,21 @@ func (m *bpf_debugMaps) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpf_debugPrograms) Close() error { @@ -209,8 +227,11 @@ func (p *bpf_debugPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o index f1177476b..ea106cd5e 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.go b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.go index 02b13f126..5766c2d07 100644 --- a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.go +++ b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.go @@ -39,6 +39,12 @@ type bpf_debugGrpcSrvFuncInvocationT struct { Tp bpf_debugTpInfoT } +type bpf_debugGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpf_debugConnectionInfoT +} + type bpf_debugTpInfoPidT struct { Tp bpf_debugTpInfoT Pid uint32 @@ -96,18 +102,21 @@ type bpf_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_debugProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpf_debugMapSpecs contains maps before they are loaded into the kernel. @@ -122,8 +131,10 @@ type bpf_debugMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -156,8 +167,10 @@ type bpf_debugMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -173,8 +186,10 @@ func (m *bpf_debugMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -185,18 +200,21 @@ func (m *bpf_debugMaps) Close() error { // // It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_debugPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpf_debugPrograms) Close() error { @@ -209,8 +227,11 @@ func (p *bpf_debugPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o index 2650c42c5..14d1c0f91 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.go b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.go index ade423668..adba9dfed 100644 --- a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.go +++ b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.go @@ -45,6 +45,12 @@ type bpf_tpGrpcSrvFuncInvocationT struct { Tp bpf_tpTpInfoT } +type bpf_tpGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpf_tpConnectionInfoT +} + type bpf_tpTpInfoPidT struct { Tp bpf_tpTpInfoT Pid uint32 @@ -102,18 +108,21 @@ type bpf_tpSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tpProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpf_tpMapSpecs contains maps before they are loaded into the kernel. @@ -128,8 +137,10 @@ type bpf_tpMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -162,8 +173,10 @@ type bpf_tpMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -179,8 +192,10 @@ func (m *bpf_tpMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -191,18 +206,21 @@ func (m *bpf_tpMaps) Close() error { // // It can be passed to loadBpf_tpObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tpPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpf_tpPrograms) Close() error { @@ -215,8 +233,11 @@ func (p *bpf_tpPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o index 763d58cd8..0bba29ba5 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.go b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.go index 412e7d24a..fedb301d5 100644 --- a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.go +++ b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.go @@ -45,6 +45,12 @@ type bpf_tpGrpcSrvFuncInvocationT struct { Tp bpf_tpTpInfoT } +type bpf_tpGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpf_tpConnectionInfoT +} + type bpf_tpTpInfoPidT struct { Tp bpf_tpTpInfoT Pid uint32 @@ -102,18 +108,21 @@ type bpf_tpSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tpProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpf_tpMapSpecs contains maps before they are loaded into the kernel. @@ -128,8 +137,10 @@ type bpf_tpMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -162,8 +173,10 @@ type bpf_tpMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -179,8 +192,10 @@ func (m *bpf_tpMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -191,18 +206,21 @@ func (m *bpf_tpMaps) Close() error { // // It can be passed to loadBpf_tpObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tpPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpf_tpPrograms) Close() error { @@ -215,8 +233,11 @@ func (p *bpf_tpPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o index d4ebb1f4f..68ab6d78a 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.go b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.go index bf574c7fa..42f644b73 100644 --- a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.go +++ b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.go @@ -45,6 +45,12 @@ type bpf_tp_debugGrpcSrvFuncInvocationT struct { Tp bpf_tp_debugTpInfoT } +type bpf_tp_debugGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpf_tp_debugConnectionInfoT +} + type bpf_tp_debugTpInfoPidT struct { Tp bpf_tp_debugTpInfoT Pid uint32 @@ -102,18 +108,21 @@ type bpf_tp_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tp_debugProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpf_tp_debugMapSpecs contains maps before they are loaded into the kernel. @@ -129,8 +138,10 @@ type bpf_tp_debugMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -164,8 +175,10 @@ type bpf_tp_debugMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -182,8 +195,10 @@ func (m *bpf_tp_debugMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -194,18 +209,21 @@ func (m *bpf_tp_debugMaps) Close() error { // // It can be passed to loadBpf_tp_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tp_debugPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpf_tp_debugPrograms) Close() error { @@ -218,8 +236,11 @@ func (p *bpf_tp_debugPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o index 9a6636a64..f04420e1d 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o and b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.go b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.go index b782688e2..947456a18 100644 --- a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.go +++ b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.go @@ -45,6 +45,12 @@ type bpf_tp_debugGrpcSrvFuncInvocationT struct { Tp bpf_tp_debugTpInfoT } +type bpf_tp_debugGrpcTransportsT struct { + Type uint8 + _ [1]byte + Conn bpf_tp_debugConnectionInfoT +} + type bpf_tp_debugTpInfoPidT struct { Tp bpf_tp_debugTpInfoT Pid uint32 @@ -102,18 +108,21 @@ type bpf_tp_debugSpecs struct { // // It can be passed ebpf.CollectionSpec.Assign. type bpf_tp_debugProgramSpecs struct { - UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.ProgramSpec `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.ProgramSpec `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.ProgramSpec `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.ProgramSpec `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.ProgramSpec `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.ProgramSpec `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.ProgramSpec `ebpf:"uprobe_transport_writeStatus"` } // bpf_tp_debugMapSpecs contains maps before they are loaded into the kernel. @@ -129,8 +138,10 @@ type bpf_tp_debugMapSpecs struct { OngoingGoroutines *ebpf.MapSpec `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.MapSpec `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.MapSpec `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.MapSpec `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.MapSpec `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.MapSpec `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.MapSpec `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.MapSpec `ebpf:"ongoing_streams"` TraceMap *ebpf.MapSpec `ebpf:"trace_map"` @@ -164,8 +175,10 @@ type bpf_tp_debugMaps struct { OngoingGoroutines *ebpf.Map `ebpf:"ongoing_goroutines"` OngoingGrpcClientRequests *ebpf.Map `ebpf:"ongoing_grpc_client_requests"` OngoingGrpcHeaderWrites *ebpf.Map `ebpf:"ongoing_grpc_header_writes"` + OngoingGrpcOperateHeaders *ebpf.Map `ebpf:"ongoing_grpc_operate_headers"` OngoingGrpcRequestStatus *ebpf.Map `ebpf:"ongoing_grpc_request_status"` OngoingGrpcServerRequests *ebpf.Map `ebpf:"ongoing_grpc_server_requests"` + OngoingGrpcTransports *ebpf.Map `ebpf:"ongoing_grpc_transports"` OngoingServerConnections *ebpf.Map `ebpf:"ongoing_server_connections"` OngoingStreams *ebpf.Map `ebpf:"ongoing_streams"` TraceMap *ebpf.Map `ebpf:"trace_map"` @@ -182,8 +195,10 @@ func (m *bpf_tp_debugMaps) Close() error { m.OngoingGoroutines, m.OngoingGrpcClientRequests, m.OngoingGrpcHeaderWrites, + m.OngoingGrpcOperateHeaders, m.OngoingGrpcRequestStatus, m.OngoingGrpcServerRequests, + m.OngoingGrpcTransports, m.OngoingServerConnections, m.OngoingStreams, m.TraceMap, @@ -194,18 +209,21 @@ func (m *bpf_tp_debugMaps) Close() error { // // It can be passed to loadBpf_tp_debugObjects or ebpf.CollectionSpec.LoadAndAssign. type bpf_tp_debugPrograms struct { - UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` - UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` - UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` - UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` - UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` - UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` - UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` - UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` - UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` - UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` - UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` - UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` + UprobeClientConnClose *ebpf.Program `ebpf:"uprobe_ClientConn_Close"` + UprobeClientConnInvoke *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke"` + UprobeClientConnInvokeReturn *ebpf.Program `ebpf:"uprobe_ClientConn_Invoke_return"` + UprobeClientConnNewStream *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream"` + UprobeClientConnNewStreamReturn *ebpf.Program `ebpf:"uprobe_ClientConn_NewStream_return"` + UprobeClientStreamRecvMsgReturn *ebpf.Program `ebpf:"uprobe_clientStream_RecvMsg_return"` + UprobeGrpcFramerWriteHeaders *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders"` + UprobeGrpcFramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_grpcFramerWriteHeaders_returns"` + UprobeHttp2ServerOperateHeaders *ebpf.Program `ebpf:"uprobe_http2Server_operateHeaders"` + UprobeNetFdReadGRPC *ebpf.Program `ebpf:"uprobe_netFdReadGRPC"` + UprobeServerHandleStream *ebpf.Program `ebpf:"uprobe_server_handleStream"` + UprobeServerHandleStreamReturn *ebpf.Program `ebpf:"uprobe_server_handleStream_return"` + UprobeServerHandlerTransportHandleStreams *ebpf.Program `ebpf:"uprobe_server_handler_transport_handle_streams"` + UprobeTransportHttp2ClientNewStream *ebpf.Program `ebpf:"uprobe_transport_http2Client_NewStream"` + UprobeTransportWriteStatus *ebpf.Program `ebpf:"uprobe_transport_writeStatus"` } func (p *bpf_tp_debugPrograms) Close() error { @@ -218,8 +236,11 @@ func (p *bpf_tp_debugPrograms) Close() error { p.UprobeClientStreamRecvMsgReturn, p.UprobeGrpcFramerWriteHeaders, p.UprobeGrpcFramerWriteHeadersReturns, + p.UprobeHttp2ServerOperateHeaders, + p.UprobeNetFdReadGRPC, p.UprobeServerHandleStream, p.UprobeServerHandleStreamReturn, + p.UprobeServerHandlerTransportHandleStreams, p.UprobeTransportHttp2ClientNewStream, p.UprobeTransportWriteStatus, ) diff --git a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o index defb9b888..355cc42b8 100644 Binary files a/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o and b/pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/grpc/grpc.go b/pkg/internal/ebpf/grpc/grpc.go index a67f07e33..5237b7b45 100644 --- a/pkg/internal/ebpf/grpc/grpc.go +++ b/pkg/internal/ebpf/grpc/grpc.go @@ -103,6 +103,7 @@ func (p *Tracer) Constants(_ *exec.FileInfo, offsets *goexec.Offsets) map[string "tcp_addr_ip_ptr_pos", "grpc_stream_ctx_ptr_pos", "grpc_t_conn_pos", + "grpc_t_scheme_pos", "value_context_val_ptr_pos", "http2_client_next_id_pos", "framer_w_pos", @@ -114,6 +115,16 @@ func (p *Tracer) Constants(_ *exec.FileInfo, offsets *goexec.Offsets) map[string } { constants[s] = offsets.Field[s] } + + // fix-up optional + for _, s := range []string{ + "framer_w_pos", + } { + if constants[s] == nil { + constants[s] = uint64(0) + } + } + return constants } @@ -159,6 +170,15 @@ func (p *Tracer) GoProbes() map[string]ebpfcommon.FunctionPrograms { "google.golang.org/grpc/internal/transport.(*http2Client).NewStream": { Start: p.bpfObjects.UprobeTransportHttp2ClientNewStream, }, + "google.golang.org/grpc/internal/transport.(*http2Server).operateHeaders": { + Start: p.bpfObjects.UprobeHttp2ServerOperateHeaders, + }, + "google.golang.org/grpc/internal/transport.(*serverHandlerTransport).HandleStreams": { + Start: p.bpfObjects.UprobeServerHandlerTransportHandleStreams, + }, + "net.(*netFD).Read": { + Start: p.bpfObjects.UprobeNetFdReadGRPC, + }, } if p.supportsContextPropagation() { diff --git a/pkg/internal/ebpf/kafkago/bpf_bpfel_arm64.o b/pkg/internal/ebpf/kafkago/bpf_bpfel_arm64.o index 5f20936d1..ad723731a 100644 Binary files a/pkg/internal/ebpf/kafkago/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/kafkago/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/kafkago/bpf_bpfel_x86.o b/pkg/internal/ebpf/kafkago/bpf_bpfel_x86.o index c8437b513..45460f257 100644 Binary files a/pkg/internal/ebpf/kafkago/bpf_bpfel_x86.o and b/pkg/internal/ebpf/kafkago/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_arm64.o index 497d53cbf..741433775 100644 Binary files a/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_x86.o index d4ec3b32f..4c2f2b2ba 100644 Binary files a/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/kafkago/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go index 93f9d6317..0d0c7ebe1 100644 --- a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.go @@ -127,11 +127,13 @@ type bpfProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -215,11 +217,13 @@ type bpfPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -236,11 +240,13 @@ func (p *bpfPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o index 52403deff..1c57053fb 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go index f0bb71eaf..1aa2e0b84 100644 --- a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.go @@ -127,11 +127,13 @@ type bpfProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -215,11 +217,13 @@ type bpfPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -236,11 +240,13 @@ func (p *bpfPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o index 7589a4089..78c866135 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go index 726ab6b0d..91906db81 100644 --- a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.go @@ -127,11 +127,13 @@ type bpf_debugProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -218,11 +220,13 @@ type bpf_debugPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -239,11 +243,13 @@ func (p *bpf_debugPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o index 673928270..54cbf27af 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go index a9d759052..a42433164 100644 --- a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.go @@ -127,11 +127,13 @@ type bpf_debugProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -218,11 +220,13 @@ type bpf_debugPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -239,11 +243,13 @@ func (p *bpf_debugPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o index 61c3e56c6..2c6bacafe 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go index a92c639b8..86174bab8 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.go @@ -133,11 +133,13 @@ type bpf_tpProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -230,11 +232,13 @@ type bpf_tpPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -251,11 +255,13 @@ func (p *bpf_tpPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o index cb2c49829..dc2dadec1 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go index a8d396949..817c4aee6 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.go @@ -133,11 +133,13 @@ type bpf_tpProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -230,11 +232,13 @@ type bpf_tpPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -251,11 +255,13 @@ func (p *bpf_tpPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o index 365cd535f..6832eac7c 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go index f3b070c05..2eca395fa 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.go @@ -133,11 +133,13 @@ type bpf_tp_debugProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -233,11 +235,13 @@ type bpf_tp_debugPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -254,11 +258,13 @@ func (p *bpf_tp_debugPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o index c470b3006..895aef8e8 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o and b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go index 7e78c639c..cd3f3365d 100644 --- a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go +++ b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.go @@ -133,11 +133,13 @@ type bpf_tp_debugProgramSpecs struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.ProgramSpec `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.ProgramSpec `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.ProgramSpec `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.ProgramSpec `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.ProgramSpec `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.ProgramSpec `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.ProgramSpec `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.ProgramSpec `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.ProgramSpec `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.ProgramSpec `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.ProgramSpec `ebpf:"uprobe_writeSubset"` @@ -233,11 +235,13 @@ type bpf_tp_debugPrograms struct { UprobeHttp2FramerWriteHeadersReturns *ebpf.Program `ebpf:"uprobe_http2FramerWriteHeaders_returns"` UprobeHttp2ResponseWriterStateWriteHeader *ebpf.Program `ebpf:"uprobe_http2ResponseWriterStateWriteHeader"` UprobeHttp2RoundTrip *ebpf.Program `ebpf:"uprobe_http2RoundTrip"` + UprobeHttp2serverConnRunHandler *ebpf.Program `ebpf:"uprobe_http2serverConn_runHandler"` UprobeNetFdRead *ebpf.Program `ebpf:"uprobe_netFdRead"` UprobePersistConnRoundTrip *ebpf.Program `ebpf:"uprobe_persistConnRoundTrip"` UprobeQueryDC *ebpf.Program `ebpf:"uprobe_queryDC"` UprobeQueryReturn *ebpf.Program `ebpf:"uprobe_queryReturn"` UprobeReadRequestReturns *ebpf.Program `ebpf:"uprobe_readRequestReturns"` + UprobeReadRequestStart *ebpf.Program `ebpf:"uprobe_readRequestStart"` UprobeRoundTrip *ebpf.Program `ebpf:"uprobe_roundTrip"` UprobeRoundTripReturn *ebpf.Program `ebpf:"uprobe_roundTripReturn"` UprobeWriteSubset *ebpf.Program `ebpf:"uprobe_writeSubset"` @@ -254,11 +258,13 @@ func (p *bpf_tp_debugPrograms) Close() error { p.UprobeHttp2FramerWriteHeadersReturns, p.UprobeHttp2ResponseWriterStateWriteHeader, p.UprobeHttp2RoundTrip, + p.UprobeHttp2serverConnRunHandler, p.UprobeNetFdRead, p.UprobePersistConnRoundTrip, p.UprobeQueryDC, p.UprobeQueryReturn, p.UprobeReadRequestReturns, + p.UprobeReadRequestStart, p.UprobeRoundTrip, p.UprobeRoundTripReturn, p.UprobeWriteSubset, diff --git a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o index 3975e9f49..211147b0d 100644 Binary files a/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o and b/pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/nethttp/nethttp.go b/pkg/internal/ebpf/nethttp/nethttp.go index ac7c624c5..ed664c185 100644 --- a/pkg/internal/ebpf/nethttp/nethttp.go +++ b/pkg/internal/ebpf/nethttp/nethttp.go @@ -104,9 +104,11 @@ func (p *Tracer) Constants(_ *exec.FileInfo, offsets *goexec.Offsets) map[string "io_writer_n_pos", "tcp_addr_port_ptr_pos", "tcp_addr_ip_ptr_pos", - "c_rwc_pos", "pc_conn_pos", - "rwc_conn_pos", + "pc_tls_pos", + "c_rwc_pos", + "c_tls_pos", + "net_conn_pos", "conn_fd_pos", "fd_laddr_pos", "fd_raddr_pos", @@ -119,9 +121,8 @@ func (p *Tracer) Constants(_ *exec.FileInfo, offsets *goexec.Offsets) map[string "rws_status_pos", "cc_next_stream_id_pos", "framer_w_pos", - "rws_conn_pos", - "http2_server_conn_pos", "cc_tconn_pos", + "sc_conn_pos", } { constants[s] = offsets.Field[s] if constants[s] == nil { @@ -147,7 +148,8 @@ func (p *Tracer) GoProbes() map[string]ebpfcommon.FunctionPrograms { End: p.bpfObjects.UprobeServeHTTPReturns, }, "net/http.(*conn).readRequest": { - End: p.bpfObjects.UprobeReadRequestReturns, + Start: p.bpfObjects.UprobeReadRequestStart, + End: p.bpfObjects.UprobeReadRequestReturns, }, "net/http.(*Transport).roundTrip": { // HTTP client, works with Client.Do as well as using the RoundTripper directly Start: p.bpfObjects.UprobeRoundTrip, @@ -161,9 +163,22 @@ func (p *Tracer) GoProbes() map[string]ebpfcommon.FunctionPrograms { Start: p.bpfObjects.UprobeHttp2RoundTrip, End: p.bpfObjects.UprobeRoundTripReturn, // return is the same as for http 1.1 }, + "net/http.(*http2ClientConn).RoundTrip": { // http2 client vendored in Go + Start: p.bpfObjects.UprobeHttp2RoundTrip, + End: p.bpfObjects.UprobeRoundTripReturn, // return is the same as for http 1.1 + }, "golang.org/x/net/http2.(*responseWriterState).writeHeader": { // http2 server request done, capture the response code Start: p.bpfObjects.UprobeHttp2ResponseWriterStateWriteHeader, }, + "net/http.(*http2responseWriterState).writeHeader": { // same as above, vendored in go + Start: p.bpfObjects.UprobeHttp2ResponseWriterStateWriteHeader, + }, + "golang.org/x/net/http2.(*serverConn).runHandler": { + Start: p.bpfObjects.UprobeHttp2serverConnRunHandler, // http2 server connection tracking + }, + "net/http.(*http2serverConn).runHandler": { + Start: p.bpfObjects.UprobeHttp2serverConnRunHandler, // http2 server connection tracking, vendored in go + }, // tracking of tcp connections for black-box propagation "net/http.(*conn).serve": { // http server Start: p.bpfObjects.UprobeConnServe, @@ -194,6 +209,10 @@ func (p *Tracer) GoProbes() map[string]ebpfcommon.FunctionPrograms { Start: p.bpfObjects.UprobeHttp2FramerWriteHeaders, End: p.bpfObjects.UprobeHttp2FramerWriteHeadersReturns, } + m["net/http.(*http2Framer).WriteHeaders"] = ebpfcommon.FunctionPrograms{ // http2 context propagation + Start: p.bpfObjects.UprobeHttp2FramerWriteHeaders, + End: p.bpfObjects.UprobeHttp2FramerWriteHeadersReturns, + } } return m diff --git a/pkg/internal/ebpf/sarama/bpf_bpfel_arm64.o b/pkg/internal/ebpf/sarama/bpf_bpfel_arm64.o index accc01385..5a7ac2cde 100644 Binary files a/pkg/internal/ebpf/sarama/bpf_bpfel_arm64.o and b/pkg/internal/ebpf/sarama/bpf_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/sarama/bpf_bpfel_x86.o b/pkg/internal/ebpf/sarama/bpf_bpfel_x86.o index 11dbae467..abcb0e2ea 100644 Binary files a/pkg/internal/ebpf/sarama/bpf_bpfel_x86.o and b/pkg/internal/ebpf/sarama/bpf_bpfel_x86.o differ diff --git a/pkg/internal/ebpf/sarama/bpf_debug_bpfel_arm64.o b/pkg/internal/ebpf/sarama/bpf_debug_bpfel_arm64.o index 1720a2285..dfc50980d 100644 Binary files a/pkg/internal/ebpf/sarama/bpf_debug_bpfel_arm64.o and b/pkg/internal/ebpf/sarama/bpf_debug_bpfel_arm64.o differ diff --git a/pkg/internal/ebpf/sarama/bpf_debug_bpfel_x86.o b/pkg/internal/ebpf/sarama/bpf_debug_bpfel_x86.o index 0a98278f2..1d02d21a3 100644 Binary files a/pkg/internal/ebpf/sarama/bpf_debug_bpfel_x86.o and b/pkg/internal/ebpf/sarama/bpf_debug_bpfel_x86.o differ diff --git a/pkg/internal/goexec/offsets.json b/pkg/internal/goexec/offsets.json index f773f641c..cf48c349e 100755 --- a/pkg/internal/goexec/offsets.json +++ b/pkg/internal/goexec/offsets.json @@ -253,18 +253,6 @@ } }, "golang.org/x/net/http2.responseWriterState": { - "conn": { - "versions": { - "oldest": "0.12.0", - "newest": "0.27.0" - }, - "offsets": [ - { - "offset": 16, - "since": "0.12.0" - } - ] - }, "req": { "versions": { "oldest": "0.12.0", @@ -470,6 +458,26 @@ "since": "1.64.0" } ] + }, + "scheme": { + "versions": { + "oldest": "1.40.0", + "newest": "1.65.0" + }, + "offsets": [ + { + "offset": 184, + "since": "1.40.0" + }, + { + "offset": 256, + "since": "1.52.0" + }, + { + "offset": 248, + "since": "1.58.0" + } + ] } }, "google.golang.org/grpc/internal/transport.http2Server": { @@ -646,6 +654,18 @@ "since": "1.17.0" } ] + }, + "tlsState": { + "versions": { + "oldest": "1.17.0", + "newest": "1.22.5" + }, + "offsets": [ + { + "offset": 48, + "since": "1.17.0" + } + ] } }, "net/http.persistConn": { @@ -660,6 +680,18 @@ "since": "1.17.0" } ] + }, + "tlsState": { + "versions": { + "oldest": "1.17.0", + "newest": "1.22.5" + }, + "offsets": [ + { + "offset": 96, + "since": "1.17.0" + } + ] } }, "net/http.response": { diff --git a/pkg/internal/goexec/structmembers.go b/pkg/internal/goexec/structmembers.go index 55ef2218a..33147110a 100644 --- a/pkg/internal/goexec/structmembers.go +++ b/pkg/internal/goexec/structmembers.go @@ -109,19 +109,13 @@ var structMembers = map[string]structInfo{ fields: map[string]string{ "nextID": "http2_client_next_id_pos", "conn": "grpc_t_conn_pos", + "scheme": "grpc_t_scheme_pos", }, }, "golang.org/x/net/http2.responseWriterState": { lib: "golang.org/x/net", fields: map[string]string{ "status": "rws_status_pos", - "conn": "rws_conn_pos", - }, - }, - "golang.org/x/net/http2.serverConn": { - lib: "golang.org/x/net", - fields: map[string]string{ - "conn": "http2_server_conn_pos", }, }, "golang.org/x/net/http2.ClientConn": { @@ -137,16 +131,16 @@ var structMembers = map[string]structInfo{ "w": "framer_w_pos", }, }, - "net/http.conn": { - lib: "go", + "golang.org/x/net/http2.serverConn": { + lib: "golang.org/x/net", fields: map[string]string{ - "rwc": "c_rwc_pos", + "conn": "sc_conn_pos", }, }, "net.TCPConn": { lib: "go", fields: map[string]string{ - "conn": "rwc_conn_pos", + "conn": "net_conn_pos", }, }, "net.conn": { @@ -165,7 +159,15 @@ var structMembers = map[string]structInfo{ "net/http.persistConn": { lib: "go", fields: map[string]string{ - "conn": "pc_conn_pos", + "conn": "pc_conn_pos", + "tlsState": "pc_tls_pos", + }, + }, + "net/http.conn": { + lib: "go", + fields: map[string]string{ + "rwc": "c_rwc_pos", + "tlsState": "c_tls_pos", }, }, "google.golang.org/grpc/internal/transport.bufWriter": { diff --git a/pkg/internal/pipe/instrumenter_test.go b/pkg/internal/pipe/instrumenter_test.go index 32c8a3afc..ae8e2bca6 100644 --- a/pkg/internal/pipe/instrumenter_test.go +++ b/pkg/internal/pipe/instrumenter_test.go @@ -104,6 +104,8 @@ func TestBasicPipeline(t *testing.T) { string(attr.ClientAddr): "1.1.1.1", string(semconv.ServiceNameKey): "foo-svc", string(semconv.ServiceNamespaceKey): "ns", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): event.Attributes["server.address"], }, ResourceAttributes: map[string]string{ string(semconv.HostNameKey): "the-host", @@ -308,6 +310,8 @@ func TestRouteConsolidation(t *testing.T) { string(attr.HTTPRequestMethod): "GET", string(attr.HTTPResponseStatusCode): "200", string(semconv.HTTPRouteKey): "/user/{id}", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): events["/user/{id}"].Attributes["server.address"], }, ResourceAttributes: map[string]string{ string(semconv.HostNameKey): "the-host", @@ -329,6 +333,8 @@ func TestRouteConsolidation(t *testing.T) { string(attr.HTTPRequestMethod): "GET", string(attr.HTTPResponseStatusCode): "200", string(semconv.HTTPRouteKey): "/products/{id}/push", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): events["/products/{id}/push"].Attributes["server.address"], }, ResourceAttributes: map[string]string{ string(semconv.HostNameKey): "the-host", @@ -350,6 +356,8 @@ func TestRouteConsolidation(t *testing.T) { string(attr.HTTPRequestMethod): "GET", string(attr.HTTPResponseStatusCode): "200", string(semconv.HTTPRouteKey): "/**", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): events["/**"].Attributes["server.address"], }, ResourceAttributes: map[string]string{ string(semconv.HostNameKey): "the-host", @@ -408,6 +416,8 @@ func TestGRPCPipeline(t *testing.T) { string(semconv.RPCGRPCStatusCodeKey): "3", string(semconv.RPCMethodKey): "/foo/bar", string(attr.ClientAddr): "1.1.1.1", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): event.Attributes["server.address"], }, ResourceAttributes: map[string]string{ string(semconv.HostNameKey): "the-host", @@ -498,6 +508,8 @@ func TestBasicPipelineInfo(t *testing.T) { string(attr.ClientAddr): "1.1.1.1", string(semconv.ServiceNameKey): "comm", string(semconv.ServiceNamespaceKey): "", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): event.Attributes["server.address"], }, ResourceAttributes: map[string]string{ string(semconv.HostNameKey): "the-host", @@ -594,6 +606,8 @@ func TestSpanAttributeFilterNode(t *testing.T) { string(attr.HTTPRequestMethod): "GET", string(attr.HTTPResponseStatusCode): "201", string(attr.HTTPUrlPath): "/user/1234", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): events["/user/1234"]["server.address"], }, "/user/4321": { string(semconv.ServiceNameKey): "svc-3", @@ -602,6 +616,8 @@ func TestSpanAttributeFilterNode(t *testing.T) { string(attr.HTTPRequestMethod): "GET", string(attr.HTTPResponseStatusCode): "203", string(attr.HTTPUrlPath): "/user/4321", + string(attr.ServerPort): "8080", + string(attr.ServerAddr): events["/user/1234"]["server.address"], }, }, events) } diff --git a/test/integration/components/testserver/Dockerfile b/test/integration/components/testserver/Dockerfile index 86c42a832..85c25c0f3 100644 --- a/test/integration/components/testserver/Dockerfile +++ b/test/integration/components/testserver/Dockerfile @@ -1,6 +1,6 @@ # Build the testserver binary # Docker command must be invoked from the projec root directory -FROM golang:1.22 as builder +FROM golang:1.22 AS builder ARG TARGETARCH @@ -21,7 +21,10 @@ RUN go build -o testserver ./test/integration/components/testserver/testserver.g FROM debian:bookworm-slim WORKDIR / +RUN mkdir -p x509 COPY --from=builder /src/testserver . +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_cert.pem x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_key.pem x509 USER 0:0 CMD [ "/testserver" ] \ No newline at end of file diff --git a/test/integration/components/testserver/Dockerfile_duplicate b/test/integration/components/testserver/Dockerfile_duplicate index 9968df530..224f8f11b 100644 --- a/test/integration/components/testserver/Dockerfile_duplicate +++ b/test/integration/components/testserver/Dockerfile_duplicate @@ -21,6 +21,9 @@ RUN go build -o testserver ./test/integration/components/testserver/testserver.g FROM debian:bookworm-slim WORKDIR / +RUN mkdir -p x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_cert.pem x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_key.pem x509 COPY --from=builder /src/test/integration/components/testserver/duplicate_testserver.sh . COPY --from=builder /src/testserver duped_service USER 0:0 diff --git a/test/integration/components/testserver/Dockerfile_nodebug b/test/integration/components/testserver/Dockerfile_nodebug index 7f2c7d9f1..92b17ec59 100644 --- a/test/integration/components/testserver/Dockerfile_nodebug +++ b/test/integration/components/testserver/Dockerfile_nodebug @@ -21,6 +21,9 @@ RUN go build -o testserver -ldflags="-s -w" ./test/integration/components/testse FROM debian:bookworm-slim WORKDIR / +RUN mkdir -p x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_cert.pem x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_key.pem x509 COPY --from=builder /src/testserver . USER 0:0 diff --git a/test/integration/components/testserver/Dockerfile_rename1 b/test/integration/components/testserver/Dockerfile_rename1 index 0349df3ec..26c313422 100644 --- a/test/integration/components/testserver/Dockerfile_rename1 +++ b/test/integration/components/testserver/Dockerfile_rename1 @@ -21,6 +21,9 @@ RUN go build -o testserver ./test/integration/components/testserver/testserver.g FROM debian:bookworm-slim WORKDIR / +RUN mkdir -p x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_cert.pem x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_key.pem x509 COPY --from=builder /src/testserver /rename1 USER 0:0 diff --git a/test/integration/components/testserver/Dockerfile_static b/test/integration/components/testserver/Dockerfile_static index ae0c03151..5c02c8dba 100644 --- a/test/integration/components/testserver/Dockerfile_static +++ b/test/integration/components/testserver/Dockerfile_static @@ -23,6 +23,9 @@ RUN go build -tags -a -ldflags '-linkmode external -extldflags "-static"' -o tes FROM debian:12 WORKDIR / +RUN mkdir -p x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_cert.pem x509 +COPY --from=builder /src/test/integration/components/testserver/x509/server_test_key.pem x509 COPY --from=builder /src/testserver . USER 0:0 diff --git a/test/integration/components/testserver/duplicate_testserver.sh b/test/integration/components/testserver/duplicate_testserver.sh index a6d16ed2b..0a7a7ac9f 100644 --- a/test/integration/components/testserver/duplicate_testserver.sh +++ b/test/integration/components/testserver/duplicate_testserver.sh @@ -4,7 +4,7 @@ run_testserver() { # prefix for start ports. E.g. 808 sp=$1 - STD_PORT=${1}0 GIN_PORT=${1}1 GORILLA_PORT=${1}2 GORILLA_MID_PORT=${1}3 GORILLA_MID2_PORT=${1}7 ./duped_service -port ${1}4 + STD_PORT=${1}0 GIN_PORT=${1}1 GORILLA_PORT=${1}2 GORILLA_MID_PORT=${1}3 GRPC_PORT=${1}4 GRPC_TLS_PORT=${1}5 GORILLA_MID2_PORT=${1}7 STD_TLS_PORT=${1}8 ./duped_service } # runs testserver twice diff --git a/test/integration/components/testserver/grpc/server/server.go b/test/integration/components/testserver/grpc/server/server.go index aea694b47..455f9a188 100644 --- a/test/integration/components/testserver/grpc/server/server.go +++ b/test/integration/components/testserver/grpc/server/server.go @@ -33,11 +33,7 @@ import ( ) var ( - tls = flag.Bool("tls", false, "Connection uses TLS if true, else plain TCP") - certFile = flag.String("cert_file", "", "The TLS cert file") - keyFile = flag.String("key_file", "", "The TLS key file") jsonDBFile = flag.String("json_db_file", "", "A json file containing a list of features") - port = flag.Int("port", 5051, "The server port") ) var log = slog.With("component", "grpc.Server") @@ -220,31 +216,44 @@ func newServer() *routeGuideServer { return s } -func Setup() error { +func Setup(port int) error { flag.Parse() - lis, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", *port)) + lis, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", port)) if err != nil { log.Error("failed to listen", err) return err } var opts []grpc.ServerOption - if *tls { - if *certFile == "" { - *certFile = "x509/server_test_cert.pem" - } - if *keyFile == "" { - *keyFile = "x509/server_test_key.pem" - } - creds, err := credentials.NewServerTLSFromFile(*certFile, *keyFile) - if err != nil { - log.Error("Failed to generate credentials", err) - return err - } - opts = []grpc.ServerOption{grpc.Creds(creds)} + grpcServer := grpc.NewServer(opts...) + pb.RegisterRouteGuideServer(grpcServer, newServer()) + log.Info("GRPC listening and serving", "port", port) + err = grpcServer.Serve(lis) + if err != nil { + log.Error("failed to serve", err) + return err + } + return nil +} + +func SetupTLS(port int) error { + flag.Parse() + lis, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", port)) + if err != nil { + log.Error("failed to listen", err) + return err + } + var opts []grpc.ServerOption + certFile := "x509/server_test_cert.pem" + keyFile := "x509/server_test_key.pem" + creds, err := credentials.NewServerTLSFromFile(certFile, keyFile) + if err != nil { + log.Error("Failed to generate credentials", err) + return err } + opts = []grpc.ServerOption{grpc.Creds(creds)} grpcServer := grpc.NewServer(opts...) pb.RegisterRouteGuideServer(grpcServer, newServer()) - log.Info("GRPC listening and serving", "port", *port) + log.Info("GRPC listening and serving", "port", port) err = grpcServer.Serve(lis) if err != nil { log.Error("failed to serve", err) diff --git a/test/integration/components/testserver/std/std.go b/test/integration/components/testserver/std/std.go index e47478704..52c4a01ee 100644 --- a/test/integration/components/testserver/std/std.go +++ b/test/integration/components/testserver/std/std.go @@ -173,7 +173,7 @@ func echoCall(rw http.ResponseWriter) { defer cancel() _, err = client.GetFeature(ctx, point) if err != nil { - slog.Error("client.GetFeature failed", err) + slog.Error("client.GetFeature failed", "error", err) rw.WriteHeader(500) return } @@ -185,5 +185,13 @@ func Setup(port int) { address := fmt.Sprintf(":%d", port) log.Info("starting HTTP server", "address", address) err := http.ListenAndServe(address, HTTPHandler(log, port)) - log.Error("HTTP server has unexpectedly stopped", err) + log.Error("HTTP server has unexpectedly stopped", "error", err) +} + +func SetupTLS(port int) { + log := slog.With("component", "std.Server") + address := fmt.Sprintf(":%d", port) + log.Info("starting HTTPS server", "address", address) + err := http.ListenAndServeTLS(address, "x509/server_test_cert.pem", "x509/server_test_key.pem", HTTPHandler(log, port)) + log.Error("HTTPS server has unexpectedly stopped", "error", err) } diff --git a/test/integration/components/testserver/testserver.go b/test/integration/components/testserver/testserver.go index e2d369c81..0e4122b15 100644 --- a/test/integration/components/testserver/testserver.go +++ b/test/integration/components/testserver/testserver.go @@ -24,6 +24,8 @@ that allow modifying its behavior (duration, response...) type config struct { // STDPort to listen connections using the standard library STDPort int `env:"STD_PORT" envDefault:"8080"` + // STDPort to listen connections using the standard library + STDTLSPort int `env:"STD_TLS_PORT" envDefault:"8383"` // GinPort to listen connections using the Gin framework GinPort int `env:"GIN_PORT" envDefault:"8081"` // GorillaPort to listen connections using the Gorilla Mux framework @@ -31,6 +33,8 @@ type config struct { // GorillaPort to listen connections using the Gorilla Mux framework, but using a middleware that has custom ResposeWriter GorillaMidPort int `env:"GORILLA_MID_PORT" envDefault:"8083"` GorillaMid2Port int `env:"GORILLA_MID2_PORT" envDefault:"8087"` + GRPCPort int `env:"GRPC_PORT" envDefault:"5051"` + GRPCTLSPort int `env:"GRPC_TLS_PORT" envDefault:"50051"` LogLevel string `env:"LOG_LEVEL" envDefault:"INFO"` } @@ -47,6 +51,10 @@ func main() { std.Setup(cfg.STDPort) close(wait) }() + go func() { + std.SetupTLS(cfg.STDTLSPort) + close(wait) + }() go func() { gin2.SetMode(gin2.ReleaseMode) gin.Setup(cfg.GinPort) @@ -65,9 +73,17 @@ func main() { close(wait) }() go func() { - err := grpctest.Setup() + err := grpctest.Setup(cfg.GRPCPort) + if err != nil { + slog.Error("HTTP server has unexpectedly stopped", "error", err) + } + close(wait) + }() + + go func() { + err := grpctest.SetupTLS(cfg.GRPCTLSPort) if err != nil { - slog.Error("HTTP server has unexpectedly stopped", err) + slog.Error("HTTP server has unexpectedly stopped", "error", err) } close(wait) }() diff --git a/test/integration/components/testserver/x509/server_test_cert.pem b/test/integration/components/testserver/x509/server_test_cert.pem new file mode 100644 index 000000000..5850257a0 --- /dev/null +++ b/test/integration/components/testserver/x509/server_test_cert.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC5DCCAmqgAwIBAgIURJOLBAXtLbrgWjCOgXWgE4s8Rs4wCgYIKoZIzj0EAwIw +gagxCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYDVQQHDAdUb3Jv +bnRvMRUwEwYDVQQKDAxHcmFmYW5hIExhYnMxGDAWBgNVBAsMD0luc3RydW1lbnRh +dGlvbjEYMBYGA1UEAwwPTmlrb2xhIEdyY2V2c2tpMSowKAYJKoZIhvcNAQkBFhtu +aWtvbGEuZ3JjZXZza2lAZ3JhZmFuYS5jb20wHhcNMjMwMzEzMTYzMDIyWhcNMzMw +MzEwMTYzMDIyWjCBqDELMAkGA1UEBhMCQ0ExEDAOBgNVBAgMB09udGFyaW8xEDAO +BgNVBAcMB1Rvcm9udG8xFTATBgNVBAoMDEdyYWZhbmEgTGFiczEYMBYGA1UECwwP +SW5zdHJ1bWVudGF0aW9uMRgwFgYDVQQDDA9OaWtvbGEgR3JjZXZza2kxKjAoBgkq +hkiG9w0BCQEWG25pa29sYS5ncmNldnNraUBncmFmYW5hLmNvbTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABF84+J+3L1fXQRqFw5fmZEZE53JVQboSrFV7EHdz/huAvbxL +BUvnUk89tJcSGAPYEKb4JwxObQYG7cKHXJf1k4LI128xMyQnqt56vr3F3IDzv603 +NVf5ois6euiax9klpqNTMFEwHQYDVR0OBBYEFBPlaMFf5HJRywiM9lCoEiMxj3ta +MB8GA1UdIwQYMBaAFBPlaMFf5HJRywiM9lCoEiMxj3taMA8GA1UdEwEB/wQFMAMB +Af8wCgYIKoZIzj0EAwIDaAAwZQIxAL/buJMHFooTvMMhQWdKRXGe/9VmMVHmqidl +wXLGAIQjhQe/FIkcVnuRWagLkFhXmQIwKZVRI/Z3Ak0c7vDspQQPjSl48jgKW6lA +2bgNuH+KdGtzLmw93D0BFGClMtDKKzOT +-----END CERTIFICATE----- \ No newline at end of file diff --git a/test/integration/components/testserver/x509/server_test_key.pem b/test/integration/components/testserver/x509/server_test_key.pem new file mode 100644 index 000000000..22b4faa99 --- /dev/null +++ b/test/integration/components/testserver/x509/server_test_key.pem @@ -0,0 +1,9 @@ +-----BEGIN EC PARAMETERS----- +BgUrgQQAIg== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDDiOjBgjik3AKIMYsARlCOC4Iitvpi2pCaemAr0FLMgrrc5CM/vhQFo +qAw3qavvLjegBwYFK4EEACKhZANiAARfOPifty9X10EahcOX5mRGROdyVUG6EqxV +exB3c/4bgL28SwVL51JPPbSXEhgD2BCm+CcMTm0GBu3Ch1yX9ZOCyNdvMTMkJ6re +er69xdyA87+tNzVX+aIrOnromsfZJaY= +-----END EC PRIVATE KEY----- \ No newline at end of file diff --git a/test/integration/configs/instrumenter-config-multiexec.yml b/test/integration/configs/instrumenter-config-multiexec.yml index 15b500067..302113dcd 100644 --- a/test/integration/configs/instrumenter-config-multiexec.yml +++ b/test/integration/configs/instrumenter-config-multiexec.yml @@ -44,4 +44,10 @@ discovery: - namespace: multi-k name: rust-service open_ports: 8090 - +attributes: + kubernetes: + enable: true + cluster_name: my-kube + select: + http_server_request_duration_seconds_count: + exclude: ["server_address"] diff --git a/test/integration/docker-compose.yml b/test/integration/docker-compose.yml index 082cfc559..d478e7b5c 100644 --- a/test/integration/docker-compose.yml +++ b/test/integration/docker-compose.yml @@ -12,7 +12,9 @@ services: - "8082:8082" - "8083:8083" - "8087:8087" + - "8383:8383" - "5051:5051" + - "50051:50051" environment: LOG_LEVEL: DEBUG diff --git a/test/integration/red_test.go b/test/integration/red_test.go index 6cd267f77..17102ab63 100644 --- a/test/integration/red_test.go +++ b/test/integration/red_test.go @@ -6,6 +6,7 @@ import ( "fmt" "math/rand" "strconv" + "strings" "testing" "time" @@ -23,6 +24,7 @@ const ( instrumentedServiceGorillaURL = "http://localhost:8082" instrumentedServiceGorillaMidURL = "http://localhost:8083" instrumentedServiceGorillaMid2URL = "http://localhost:8087" + instrumentedServiceStdTLSURL = "https://localhost:8383" prometheusHostPort = "localhost:9090" jaegerQueryURL = "http://localhost:16686/api/traces" @@ -48,6 +50,7 @@ func testREDMetricsHTTP(t *testing.T) { instrumentedServiceGinURL, instrumentedServiceGorillaMidURL, instrumentedServiceGorillaMid2URL, + instrumentedServiceStdTLSURL, } { t.Run(testCaseURL, func(t *testing.T) { waitForTestComponents(t, testCaseURL) @@ -141,6 +144,13 @@ func testSpanMetricsForHTTPLibrary(t *testing.T, svcName, svcNs string) { func testREDMetricsForHTTPLibrary(t *testing.T, url, svcName, svcNs string) { path := "/basic/" + rndStr() + parts := strings.Split(url, ":") + assert.LessOrEqual(t, 3, len(parts)) + + lastPart := parts[len(parts)-1] + parts = strings.Split(lastPart, "/") + serverPort := parts[0] + // Call 3 times the instrumented service, forcing it to: // - take at least 30ms to respond // - returning a 404 code @@ -163,6 +173,7 @@ func testREDMetricsForHTTPLibrary(t *testing.T, url, svcName, svcNs string) { `http_response_status_code="404",` + `service_namespace="` + svcNs + `",` + `service_name="` + svcName + `",` + + `server_port="` + serverPort + `",` + `http_route="/basic/:rnd",` + `url_path="` + path + `"}`) require.NoError(t, err) @@ -174,6 +185,7 @@ func testREDMetricsForHTTPLibrary(t *testing.T, url, svcName, svcNs string) { res := results[0] addr := res.Metric["client_address"] assert.NotNil(t, addr) + assert.NotNil(t, res.Metric["server_port"]) } }) @@ -350,11 +362,19 @@ func testREDMetricsForHTTPLibrary(t *testing.T, url, svcName, svcNs string) { } func testREDMetricsGRPC(t *testing.T) { + testREDMetricsGRPCInternal(t, nil, "5051") +} + +func testREDMetricsGRPCTLS(t *testing.T) { + testREDMetricsGRPCInternal(t, []grpcclient.PingOption{grpcclient.WithSSL(), grpcclient.WithServerAddr("localhost:50051")}, "50051") +} + +func testREDMetricsGRPCInternal(t *testing.T, opts []grpcclient.PingOption, serverPort string) { // Call 300 times the instrumented service, an overkill to make sure // we get some of the metrics to be visible in Prometheus. This test is // currently the last one that runs. for i := 0; i < 300; i++ { - err := grpcclient.Ping() + err := grpcclient.Ping(opts...) require.NoError(t, err) } @@ -368,6 +388,7 @@ func testREDMetricsGRPC(t *testing.T) { `service_namespace="integration-test",` + `client_address!="127.0.0.1",` + // discard the metrics from testREDMetricsForHTTPLibrary/GorillaURL `service_name="testserver",` + + `server_port="` + serverPort + `",` + `rpc_method="/routeguide.RouteGuide/GetFeature"}`) require.NoError(t, err) // check duration_count has at least 3 calls and all the arguments @@ -378,6 +399,7 @@ func testREDMetricsGRPC(t *testing.T) { res := results[0] addr := res.Metric["client_address"] assert.NotNil(t, addr) + assert.NotNil(t, res.Metric["server_port"]) } }) } diff --git a/test/integration/suites_test.go b/test/integration/suites_test.go index c7ef60e22..c3382d22c 100644 --- a/test/integration/suites_test.go +++ b/test/integration/suites_test.go @@ -25,6 +25,7 @@ func TestSuite(t *testing.T) { t.Run("HTTP traces (no traceID)", testHTTPTracesNoTraceID) t.Run("GRPC traces", testGRPCTraces) t.Run("GRPC RED metrics", testREDMetricsGRPC) + t.Run("GRPC TLS RED metrics", testREDMetricsGRPCTLS) t.Run("Internal Prometheus metrics", testInternalPrometheusExport) t.Run("BPF pinning folder mounted", testBPFPinningMounted)