Merge pull request #981 from vector-im/dbkr/call_events_to_call_span

Move call events to the call span
This commit is contained in:
David Baker 2023-04-04 17:52:41 +01:00 committed by GitHub
commit 28196a2e9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,13 +209,19 @@ export class OTelGroupCallMembership {
const eventType = event.eventType as string;
if (!eventType.startsWith("m.call")) return;
const callTrackingInfo = this.callsByCallId.get(call.callId);
if (!callTrackingInfo) {
logger.error(`Got call send event for unknown call ID ${call.callId}`);
return;
}
if (event.type === "toDevice") {
this.callMembershipSpan?.addEvent(
callTrackingInfo.span.addEvent(
`matrix.sendToDeviceEvent_${event.eventType}`,
flattenVoipEvent(event)
);
} else if (event.type === "sendEvent") {
this.callMembershipSpan?.addEvent(
callTrackingInfo.span.addEvent(
`matrix.sendToRoomEvent_${event.eventType}`,
flattenVoipEvent(event)
);