Skip to content

feat: Adds distributed tracing for dial-in/dial-out call setup. - #646

Open
aaronkvanmeerten wants to merge 3 commits into
masterfrom
tracing-call-setup
Open

feat: Adds distributed tracing for dial-in/dial-out call setup.#646
aaronkvanmeerten wants to merge 3 commits into
masterfrom
tracing-call-setup

Conversation

@aaronkvanmeerten

Copy link
Copy Markdown
Member

What

Adds OpenTelemetry-based distributed tracing via jicoco-tracing, following the model established in jicofo (jitsi/jicofo#1294): tracing.{enabled,service-name,otlp-endpoint,otlp-protocol} in reference.conf, disabled by default (no-op tracer when off).

A span covers the setup of each call — from the dial request (dial-out/transcription) or SIP INVITE (dial-in) until media is established or setup fails — with milestone events for MUC join, focus invite, lobby join, SIP INVITE sent, and each leg establishing. The span is carried in CallContext since call setup crosses many threads, and its ctx.id attribute matches the [ctx=...] tag in log lines so traces correlate with logs.

Trace context propagation

  • dial-out: the root span parents from a traceparent extension on the incoming dial IQ when present, or from an X-Traceparent rayo header holding a W3C trace context value. The header form is what actually round-trips today: RayoIqProvider only parses header children, so a traceparent child element is dropped at parse time. The header is re-emitted with jigasi's span id and forwarded on the outgoing SIP INVITE (X- headers pass through intermediaries such as VoxImplant).
  • dial-in: parents from a Traceparent/X-Traceparent SIP INVITE header when the SIP frontend provides one (all INVITE headers reach onJoinJitsiMeetRequest).
  • The outgoing ConferenceIq to jicofo carries a traceparent extension so jicofo can join the trace (jicofo-side change to parent from it is separate).

Notes

  • Bumps jicoco to 1.1-178-ga09ed33 (for jicoco-tracing) and jitsi-xmpp-extensions to 1.0-119-gc67bc81 (for TraceParent). The latter removed MuteIqProvider.registerMuteIqProvider(); replaced with an explicit ProviderManager registration.
  • Companion change: jitsi-meet mod_trace.lua gains a rayo.dial hop span (PR in jitsi-meet).
  • Destination numbers are intentionally not recorded as span attributes.

Testing

mvn verify passes (checkstyle + all tests). New TracingUtilTest covers W3C traceparent parsing/formatting round-trip and malformed input.

Adds OpenTelemetry-based tracing via jicoco-tracing, following the same
model as jicofo (tracing.{enabled,service-name,otlp-endpoint,otlp-protocol}
in reference.conf, disabled by default).

A span covers the setup of each call, from the dial request or SIP INVITE
until media is established (or setup fails), with milestone events for MUC
join, focus invite, lobby, SIP INVITE sent and both legs establishing. The
span is carried in CallContext (setup crosses many threads, so the
thread-local OTel context cannot be used) and its ctx.id attribute matches
the [ctx=...] tag in log lines.

Trace context propagation:
- dial-out: parented from a traceparent extension on the dial IQ if
  present, or from an X-Traceparent rayo header in W3C trace context
  format (which survives RayoIqProvider parsing, unlike child extension
  elements). The X-Traceparent header is re-emitted with our span id and
  forwarded to the outgoing SIP INVITE.
- dial-in: parented from a Traceparent/X-Traceparent SIP INVITE header
  when the SIP frontend (e.g. VoxImplant) provides one.
- The outgoing ConferenceIq to jicofo carries a traceparent extension so
  jicofo can join the trace.

The jitsi-xmpp-extensions bump removed MuteIqProvider.registerMuteIqProvider,
replaced with an explicit ProviderManager registration.
ConferenceIqProvider only parses property children of the conference
element, so a traceparent extension on the ConferenceIq is dropped at
parse time on the jicofo side. Send the context also as a 'traceparent'
property in W3C format, which round-trips through the existing provider.
Keep the extension form for when the provider learns to parse it.
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.70492% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.38%. Comparing base (6fbf4f2) to head (89855f8).

Files with missing lines Patch % Lines
.../main/java/org/jitsi/jigasi/SipGatewaySession.java 83.33% 1 Missing and 3 partials ⚠️
.../org/jitsi/jigasi/TranscriptionGatewaySession.java 0.00% 3 Missing ⚠️
src/main/java/org/jitsi/jigasi/CallContext.java 89.47% 0 Missing and 2 partials ⚠️
src/main/java/org/jitsi/jigasi/JvbConference.java 77.77% 2 Missing ⚠️
...c/main/java/org/jitsi/jigasi/xmpp/CallControl.java 92.00% 0 Missing and 2 partials ⚠️
...n/java/org/jitsi/jigasi/JigasiBundleActivator.java 50.00% 1 Missing ⚠️
...c/main/java/org/jitsi/jigasi/util/TracingUtil.java 97.43% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #646      +/-   ##
============================================
+ Coverage     19.10%   20.38%   +1.28%     
- Complexity      310      344      +34     
============================================
  Files            84       85       +1     
  Lines          7225     7347     +122     
  Branches        958      974      +16     
============================================
+ Hits           1380     1498     +118     
+ Misses         5613     5612       -1     
- Partials        232      237       +5     
Files with missing lines Coverage Δ
...rc/main/java/org/jitsi/jigasi/AbstractGateway.java 65.55% <100.00%> (+0.38%) ⬆️
...n/java/org/jitsi/jigasi/JigasiBundleActivator.java 55.91% <50.00%> (+0.47%) ⬆️
...c/main/java/org/jitsi/jigasi/util/TracingUtil.java 97.43% <97.43%> (ø)
src/main/java/org/jitsi/jigasi/CallContext.java 61.80% <89.47%> (+4.20%) ⬆️
src/main/java/org/jitsi/jigasi/JvbConference.java 33.76% <77.77%> (+0.29%) ⬆️
...c/main/java/org/jitsi/jigasi/xmpp/CallControl.java 57.89% <92.00%> (+21.93%) ⬆️
.../org/jitsi/jigasi/TranscriptionGatewaySession.java 0.00% <0.00%> (ø)
.../main/java/org/jitsi/jigasi/SipGatewaySession.java 45.97% <83.33%> (+1.82%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fbf4f2...89855f8. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Extends the mock telephony/JitsiMeetTools to pass INVITE headers so a
dial-in with a Traceparent header can be exercised end to end, and adds
tests covering:
- dial-in joining an upstream trace via the Traceparent SIP header
- dial-out joining an upstream trace via the X-Traceparent rayo header,
  and re-emitting the context towards the SIP leg
- dial IQ rejection paths (missing JvbRoomName, disabled gateways)
- TracingUtil traceparent extension extraction/attachment and malformed
  trace-flags fallback

Raises patch coverage for the tracing change from ~49% to ~94%; the
remaining uncovered lines are environment-gated (lobby join event,
real-XMPP-provider branch in inviteFocus, start-muted provider
registration, transcriber established event).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants