github.com/livekit/protocol@v1.16.1-0.20240517185851-47e4c6bba773/protobufs/livekit_analytics.proto (about) 1 // Copyright 2023 LiveKit, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 package livekit; 18 option go_package = "github.com/livekit/protocol/livekit"; 19 option csharp_namespace = "LiveKit.Proto"; 20 option ruby_package = "LiveKit::Proto"; 21 22 import "google/protobuf/empty.proto"; 23 import "google/protobuf/timestamp.proto"; 24 import "livekit_models.proto"; 25 import "livekit_egress.proto"; 26 import "livekit_ingress.proto"; 27 28 service AnalyticsRecorderService { 29 rpc IngestStats(stream AnalyticsStats) returns (google.protobuf.Empty){}; 30 rpc IngestEvents(stream AnalyticsEvents) returns (google.protobuf.Empty){}; 31 rpc IngestNodeRoomStates(stream AnalyticsNodeRooms) returns (google.protobuf.Empty){}; 32 } 33 34 enum StreamType { 35 UPSTREAM = 0; 36 DOWNSTREAM = 1; 37 } 38 39 message AnalyticsVideoLayer { 40 int32 layer = 1; 41 uint32 packets = 2; 42 uint64 bytes = 3; 43 uint32 frames = 4; 44 } 45 46 message AnalyticsStream { 47 uint32 ssrc = 1; 48 uint32 primary_packets = 2; 49 uint64 primary_bytes = 3; 50 uint32 retransmit_packets = 4; 51 uint64 retransmit_bytes = 5; 52 uint32 padding_packets = 6; 53 uint64 padding_bytes = 7; 54 uint32 packets_lost = 8; 55 uint32 frames = 9; 56 uint32 rtt = 10; 57 uint32 jitter = 11; 58 uint32 nacks = 12; 59 uint32 plis = 13; 60 uint32 firs = 14; 61 repeated AnalyticsVideoLayer video_layers = 15; 62 google.protobuf.Timestamp start_time = 17; 63 google.protobuf.Timestamp end_time = 18; 64 } 65 66 message AnalyticsStat { 67 string analytics_key = 1; 68 StreamType kind = 2; 69 google.protobuf.Timestamp time_stamp = 3; 70 string node = 4; 71 string room_id = 5; 72 string room_name = 6; 73 string participant_id = 7; 74 string track_id = 8; 75 float score = 9; // average score 76 repeated AnalyticsStream streams = 10; 77 string mime = 11; 78 float min_score = 12; 79 float median_score = 13; 80 } 81 82 message AnalyticsStats { 83 repeated AnalyticsStat stats = 1; 84 } 85 86 enum AnalyticsEventType { 87 ROOM_CREATED = 0; 88 ROOM_ENDED = 1; 89 PARTICIPANT_JOINED = 2; 90 PARTICIPANT_LEFT = 3; 91 TRACK_PUBLISHED = 4; 92 TRACK_PUBLISH_REQUESTED = 20; 93 TRACK_UNPUBLISHED = 5; 94 TRACK_SUBSCRIBED = 6; 95 TRACK_SUBSCRIBE_REQUESTED = 21; 96 TRACK_SUBSCRIBE_FAILED = 25; 97 TRACK_UNSUBSCRIBED = 7; 98 TRACK_PUBLISHED_UPDATE = 10; 99 TRACK_MUTED = 23; 100 TRACK_UNMUTED = 24; 101 TRACK_PUBLISH_STATS = 26; 102 TRACK_SUBSCRIBE_STATS = 27; 103 PARTICIPANT_ACTIVE = 11; 104 PARTICIPANT_RESUMED = 22; 105 EGRESS_STARTED = 12; 106 EGRESS_ENDED = 13; 107 EGRESS_UPDATED = 28; 108 TRACK_MAX_SUBSCRIBED_VIDEO_QUALITY = 14; 109 RECONNECTED = 15; 110 INGRESS_CREATED = 18; 111 INGRESS_DELETED = 19; 112 INGRESS_STARTED = 16; 113 INGRESS_ENDED = 17; 114 INGRESS_UPDATED = 29; 115 116 // NEXT_ID: 30 117 } 118 119 message AnalyticsClientMeta { 120 string region = 1; 121 string node = 2; 122 string client_addr = 3; 123 uint32 client_connect_time = 4; 124 // udp, tcp, turn 125 string connection_type = 5; 126 ReconnectReason reconnect_reason = 6; 127 optional string geo_hash = 7; 128 optional string country = 8; 129 optional uint32 isp_asn = 9; 130 } 131 132 message AnalyticsEvent { 133 AnalyticsEventType type = 1; 134 google.protobuf.Timestamp timestamp = 2; 135 string room_id = 3; 136 Room room = 4; 137 string participant_id = 5; 138 ParticipantInfo participant = 6; 139 string track_id = 7; 140 TrackInfo track = 8; 141 string analytics_key = 10; 142 ClientInfo client_info = 11; 143 AnalyticsClientMeta client_meta = 12; 144 string egress_id = 13; 145 string ingress_id = 19; 146 VideoQuality max_subscribed_video_quality = 14; 147 ParticipantInfo publisher = 15; 148 string mime = 16; 149 EgressInfo egress = 17; 150 IngressInfo ingress = 18; 151 string error = 20; 152 RTPStats rtp_stats = 21; 153 int32 video_layer = 22; 154 155 // NEXT_ID: 24 156 } 157 158 message AnalyticsEvents { 159 repeated AnalyticsEvent events = 1; 160 } 161 162 message AnalyticsRoomParticipant { 163 string id = 1; 164 string identity = 2; 165 string name = 3; 166 ParticipantInfo.State state = 4; 167 google.protobuf.Timestamp joined_at = 5; 168 } 169 170 message AnalyticsRoom { 171 string id = 1; 172 string name = 2; 173 string project_id = 5; 174 google.protobuf.Timestamp created_at = 3; 175 repeated AnalyticsRoomParticipant participants = 4; 176 177 // NEXT_ID: 6 178 } 179 180 message AnalyticsNodeRooms { 181 string node_id = 1; 182 uint64 sequence_number = 2; 183 google.protobuf.Timestamp timestamp = 3; 184 repeated AnalyticsRoom rooms = 4; 185 }