Add end-to-end audio observability

This reports via OpenTelemetry when particular participants are speaking, as an easy way to observe the delivery of audio in calls.
This commit is contained in:
Robin Townsend
2023-03-22 14:23:26 -04:00
parent 48493a96e1
commit 313ebe258e
4 changed files with 76 additions and 29 deletions

View File

@@ -16,6 +16,7 @@ limitations under the License.
import React from "react";
import { OTelGroupCallMembership } from "../otel/OTelGroupCallMembership";
import { TileDescriptor } from "./TileDescriptor";
import { useCallFeed } from "./useCallFeed";
import { useMediaStream } from "./useMediaStream";
@@ -23,6 +24,7 @@ import { useMediaStream } from "./useMediaStream";
interface Props {
tileDescriptor: TileDescriptor;
audioOutput: string;
otelGroupCallMembership: OTelGroupCallMembership;
}
// Renders and <audio> element on the page playing the given stream
@@ -30,8 +32,12 @@ interface Props {
export const AudioSink: React.FC<Props> = ({
tileDescriptor,
audioOutput,
otelGroupCallMembership,
}: Props) => {
const { localVolume, stream } = useCallFeed(tileDescriptor.callFeed);
const { localVolume, stream } = useCallFeed(
tileDescriptor.callFeed,
otelGroupCallMembership
);
const audioElementRef = useMediaStream(
stream,