Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add Opentelemetry module tracing the OpenSIPS routes execution and the logs they produce
Details
Opentelemetry is providing a standardized, vendor-neutral framework (APIs, SDKs, tools) to collect, process, and export telemetry data (traces, metrics, logs) from distributed systems, enabling deep insights into application performance, faster debugging, and preventing vendor lock-in by routing data to multiple observability backends.
Solution
Each new message processing produce a new root span ( with the full SIP message attached to it ), and then a new child span is added for each route execution the SIP message goes through. A new log_level parameter is introduced to the opentelemetry module, and logs will be attached to the respective child span.
The module also supports async & resume route script jumping ( maintaining the parent span and the total execution duration ) so you can get a clear view of the full script execution even when using async().
Compatibility
New module, no backwards compatibility issues
Future Notes
We can later integrate the metrics part by exporting a list of statistics as well to the otel spans ( similar to prometheus ), as well as attaching a list of AVPs to the spans, to get a better idea of the 'route code path' that the SIP messages are taking
Examples
Testing with
an opentelemetry reader produces the following spans showing the 1s execution duration through the full script execution path ( with script lines numbers attached as tags )
with the logs attached to the respective route child spans