Added optional OpenTelemetry tracing for RPC loader calls#699
Added optional OpenTelemetry tracing for RPC loader calls#699Codingisinmyblud wants to merge 3 commits intometacall:developfrom
Conversation
|
can you explain what are you tracing and how does it work? send a screenshot of it working in a telemetry environment |
|
Hi, hope you're doing well.
With regards to how it works, I added a C++ RAII abstraction that manages the OpenTelemetry span lifecycle. It automatically extracts the target URL and method names to attach as standard attributes The backend currently uses the built-in console exporter I have attached a screenshot of the structured JSON synchronus call span and the asynchronus call span (from running the native test suite For synchronous calls: For asynchronous calls: |
|
@Codingisinmyblud It looks great but I cannot merge it yet, I think we should discuss better how is the format and data we will use for tracing it. But it's a good start. For example I think we should serialize the body of the rpc call, so we know exactly how a function was called. Also the variable for enabling this should be: OPTION_BUILD_LOADERS_RPC_TELEMETRY Maybe, or *_TRACING. |
|
Sounds good. I'll get started on those changes for now. Thanks |
|
The CI is failing, I cannot merge it if it doesn't compile. |


Description
Added optional OpenTelemetry tracing for the RPC loader to improve observability across distributed systems paths.
When built with
-DOPTION_RPC_TRACING=ON, the RPC loader wraps both synchronous (function_rpc_interface_invoke) and asynchronous (function_rpc_interface_await) calls in an OpenTelemetryrpc_trace_scope. This emits spans that capture function name, target URLs, latency and also the success/failure resolution. I used a simple C++ RAII abstraction. When disabled (this is the default), a no-op implementation is linked which means there is absolute zero runtime overhead.Dependencies added:
Type of change
Checklist:
make testorctest -VV -R <test-name>)../docker-compose.sh test &> outputand attached the output.OPTION_BUILD_ADDRESS_SANITIZERor./docker-compose.sh test-address-sanitizer &> outputandOPTION_TEST_MEMORYCHECK.OPTION_BUILD_THREAD_SANITIZERor./docker-compose.sh test-thread-sanitizer &> output.Helgrindin case my code works with threading.make clang-formatin order to format my code and my code follows the style guidelines.If you are unclear about any of the above checks, have a look at our documentation here.