How to Add JSON-RPC Protocol Support #1566
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey @4406arthur, thanks a lot for your interest in Beyla and will to contribute. Indeed touching Beyla is not easy and it could be intimidating in the beginning. What you want to do it's not straightforward, but not crazy to implement. I can give you some steps to provide some guidance, but you would need to do some research by your own. If you want to add generic suport for JSON-RPC, you have to know how the protocol works. In So basically you will need to see if there's any easy way to identify JSON-RPC packets from other packets. Once you have that, you need to know where in the packets the rest information is. In cases like SQL is easy, because it's just plain text. But if it's a binary protocol it gets more complicated as you need to understand when the frames start and end in the sequence of bytes. Once you have this done (the hard part!) you have to create a new Also, is always good to check if there's already semantic conventions defined in OpenTelemetry spec for those attributes. I hope this explanation it helps. I you need clarification, let us know or reach us in our community slack. |
Beta Was this translation helpful? Give feedback.
-
Great idea @4406arthur, I would start perhaps by adding a test example in our test/integration/components and then as Marc suggested, we can add JSON-RPC detector like we've done for other programs in tcp_detect_transform.go. |
Beta Was this translation helpful? Give feedback.
-
Added docs explaining this: #1618 |
Beta Was this translation helpful? Give feedback.
Hey @4406arthur, thanks a lot for your interest in Beyla and will to contribute. Indeed touching Beyla is not easy and it could be intimidating in the beginning. What you want to do it's not straightforward, but not crazy to implement. I can give you some steps to provide some guidance, but you would need to do some research by your own.
If you want to add generic suport for JSON-RPC, you have to know how the protocol works. In
pkg/internal/ebpf/common/tcp_detect_transform.go
any TCP packet captured from BPF passes through theReadTCPRequestIntoSpan
function, and depending what's in the bytes, you can identify if the packet is sql, redis, kafka or grpc.So basically you will need to see i…