From 4c5f45aea605b86ccb1eb3f8c5335d786a6f8327 Mon Sep 17 00:00:00 2001 From: Shivam Srivastava Date: Wed, 28 Feb 2024 13:24:36 +0530 Subject: [PATCH] grpc outgoing event --- runtime/events.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/runtime/events.go b/runtime/events.go index 0efb55356..64da717c9 100644 --- a/runtime/events.go +++ b/runtime/events.go @@ -28,6 +28,7 @@ const ( const ( EventThriftOutgoing = "event-thrift-outgoing" + EventGRPCOutgoing = "event-grpc-outgoing" EventHTTPIncoming = "event-http-incoming" EventHTTPOutgoing = "event-http-outgoing" ) @@ -62,6 +63,24 @@ func (tce *ThriftOutgoingEvent) Name() string { return EventThriftOutgoing } +// GRPCOutgoingEvent captures request and response data +type GRPCOutgoingEvent struct { + MethodName string + ServiceName string + + ReqHeaders map[string]string + Req []byte + + RspHeaders map[string]string + Rsp []byte + + Success bool +} + +func (gce *GRPCOutgoingEvent) Name() string { + return EventGRPCOutgoing +} + // HTTPIncomingEvent captures incoming request and response data received type HTTPIncomingEvent struct { EndpointName string // optional