github.com/livekit/protocol@v1.39.3/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/timestamp.proto";
    23  import "livekit_models.proto";
    24  import "livekit_egress.proto";
    25  import "livekit_ingress.proto";
    26  import "livekit_sip.proto";
    27  import "livekit_room.proto";
    28  
    29  enum StreamType {
    30    UPSTREAM = 0;
    31    DOWNSTREAM = 1;
    32  }
    33  
    34  message AnalyticsVideoLayer {
    35    int32 layer = 1;
    36    uint32 packets = 2;
    37    uint64 bytes = 3;
    38    uint32 frames = 4;
    39  }
    40  
    41  message AnalyticsStream {
    42    uint32 ssrc = 1;
    43    uint32 primary_packets = 2;
    44    uint64 primary_bytes = 3;
    45    uint32 retransmit_packets = 4;
    46    uint64 retransmit_bytes = 5;
    47    uint32 padding_packets = 6;
    48    uint64 padding_bytes = 7;
    49    uint32 packets_lost = 8;
    50    uint32 frames = 9;
    51    uint32 rtt = 10;
    52    uint32 jitter = 11;
    53    uint32 nacks = 12;
    54    uint32 plis = 13;
    55    uint32 firs = 14;
    56    repeated AnalyticsVideoLayer video_layers = 15;
    57    google.protobuf.Timestamp start_time = 17;
    58    google.protobuf.Timestamp end_time = 18;
    59    uint32 packets_out_of_order = 19;
    60  }
    61  
    62  message AnalyticsStat {
    63    // unique id for this stat
    64    string id = 14;
    65    string analytics_key = 1;
    66    StreamType kind = 2;
    67    google.protobuf.Timestamp time_stamp = 3;
    68    string node = 4;
    69    string room_id = 5;
    70    string room_name = 6;
    71    string participant_id = 7;
    72    string track_id = 8;
    73    float score = 9; // average score
    74    repeated AnalyticsStream streams = 10;
    75    string mime = 11;
    76    float min_score = 12;
    77    float median_score = 13;
    78  
    79    // NEXT_ID: 15
    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    SIP_INBOUND_TRUNK_CREATED = 30;
   116    SIP_INBOUND_TRUNK_DELETED = 31;
   117    SIP_OUTBOUND_TRUNK_CREATED = 32;
   118    SIP_OUTBOUND_TRUNK_DELETED = 33;
   119    SIP_DISPATCH_RULE_CREATED = 34;
   120    SIP_DISPATCH_RULE_DELETED = 35;
   121    SIP_PARTICIPANT_CREATED = 36;
   122    SIP_CALL_INCOMING = 37;
   123    SIP_CALL_STARTED = 38;
   124    SIP_CALL_ENDED = 39;
   125    SIP_TRANSFER_REQUESTED = 43;
   126    SIP_TRANSFER_COMPLETE = 44;
   127    REPORT = 40;
   128    API_CALL = 41;
   129    WEBHOOK = 42;
   130  
   131    // NEXT_ID: 45
   132  }
   133  
   134  message AnalyticsClientMeta {
   135    string region = 1;
   136    string node = 2;
   137    string client_addr = 3;
   138    uint32 client_connect_time = 4;
   139    // udp, tcp, turn
   140    string connection_type = 5;
   141    ReconnectReason reconnect_reason = 6;
   142    optional string geo_hash = 7;
   143    optional string country = 8;
   144    optional uint32 isp_asn = 9;
   145  }
   146  
   147  message AnalyticsEvent {
   148    // unique id for this event
   149    string id = 25;
   150    AnalyticsEventType type = 1;
   151    google.protobuf.Timestamp timestamp = 2;
   152    string room_id = 3;
   153    Room room = 4;
   154    string participant_id = 5;
   155    ParticipantInfo participant = 6;
   156    string track_id = 7;
   157    TrackInfo track = 8;
   158    string analytics_key = 10;
   159    ClientInfo client_info = 11;
   160    AnalyticsClientMeta client_meta = 12;
   161    string egress_id = 13;
   162    string ingress_id = 19;
   163    VideoQuality max_subscribed_video_quality = 14;
   164    ParticipantInfo publisher = 15;
   165    string mime = 16;
   166    EgressInfo egress = 17;
   167    IngressInfo ingress = 18;
   168    string error = 20;
   169    RTPStats rtp_stats = 21;
   170    int32 video_layer = 22;
   171    string node_id = 24;
   172    string sip_call_id = 26;
   173    SIPCallInfo sip_call = 27;
   174    string sip_trunk_id = 28;
   175    SIPInboundTrunkInfo sip_inbound_trunk = 29;
   176    SIPOutboundTrunkInfo sip_outbound_trunk = 30;
   177    string sip_dispatch_rule_id = 31;
   178    SIPDispatchRuleInfo sip_dispatch_rule = 32;
   179    SIPTransferInfo sip_transfer = 36;
   180    ReportInfo report = 33;
   181    APICallInfo api_call = 34;
   182    WebhookInfo webhook = 35;
   183  
   184    // NEXT_ID: 37
   185  }
   186  
   187  message AnalyticsEvents {
   188    repeated AnalyticsEvent events = 1;
   189  }
   190  
   191  message AnalyticsRoomParticipant {
   192    string id = 1;
   193    string identity = 2;
   194    string name = 3;
   195    ParticipantInfo.State state = 4;
   196    google.protobuf.Timestamp joined_at = 5;
   197  }
   198  
   199  message AnalyticsRoom {
   200    string id = 1;
   201    string name = 2;
   202    string project_id = 5;
   203    google.protobuf.Timestamp created_at = 3;
   204    repeated AnalyticsRoomParticipant participants = 4;
   205  
   206    // NEXT_ID: 6
   207  }
   208  
   209  message AnalyticsNodeRooms {
   210    string node_id = 1;
   211    uint64 sequence_number = 2;
   212    google.protobuf.Timestamp timestamp = 3;
   213    repeated AnalyticsRoom rooms = 4;
   214  }
   215  
   216  message ReportInfo {
   217    oneof message {
   218      FeatureUsageInfo feature_usage = 1;
   219    }
   220  }
   221  
   222  message TimeRange {
   223    google.protobuf.Timestamp started_at = 1;
   224    google.protobuf.Timestamp ended_at = 2;
   225  }
   226  
   227  message FeatureUsageInfo {
   228    enum Feature {
   229      KRISP_NOISE_CANCELLATION = 0;
   230      KRISP_BACKGROUND_VOICE_CANCELLATION = 1;
   231    }
   232    Feature feature = 1;
   233    string project_id = 2;
   234    string room_name = 3;
   235    string room_id = 4;
   236    string participant_identity = 5;
   237    string participant_id = 6;
   238    string track_id = 7;
   239    // time ranges during which the feature was enabled.
   240    // for e. g., noise cancellation may not be applied when a media track is paused/muted,
   241    // this allows reporting only periods during which a feature is avtive.
   242    repeated TimeRange time_ranges = 8;
   243  }
   244  
   245  message APICallRequest {
   246    oneof message {
   247      CreateRoomRequest create_room_request = 1;
   248      ListRoomsRequest list_rooms_request = 2;
   249      DeleteRoomRequest delete_room_request = 3;
   250      ListParticipantsRequest list_participants_request = 4;
   251      RoomParticipantIdentity room_participant_identity = 5;
   252      MuteRoomTrackRequest mute_room_track_request = 6;
   253      UpdateParticipantRequest update_participant_request = 7;
   254      UpdateSubscriptionsRequest update_subscriptions_request = 8;
   255      SendDataRequest send_data_request = 9;
   256      UpdateRoomMetadataRequest  update_room_metadata_request = 10;
   257    }
   258  }
   259  
   260  message APICallInfo {
   261    string project_id = 1;
   262    APICallRequest request = 2;
   263    string service = 3;
   264    string method = 4;
   265    string node_id = 5;
   266    int32 status = 6;
   267    string twirp_error_code = 7;
   268    string twirp_error_message = 8;
   269    string room_name = 9;
   270    string room_id = 10;
   271    string participant_identity = 11;
   272    string participant_id = 12;
   273    string track_id = 13;
   274    google.protobuf.Timestamp started_at = 14;
   275    int64 duration_ns = 15;
   276  }
   277  
   278  message WebhookInfo {
   279    string event_id = 1;
   280    string event = 2;
   281    string project_id = 3;
   282    string room_name = 4;
   283    string room_id = 5;
   284    string participant_identity = 6;
   285    string participant_id = 7;
   286    string track_id = 8;
   287    string egress_id = 9;
   288    string ingress_id = 10;
   289    google.protobuf.Timestamp created_at = 11;
   290    google.protobuf.Timestamp queued_at = 12;
   291    int64 queue_duration_ns = 13;
   292    google.protobuf.Timestamp sent_at = 14;
   293    int64 send_duration_ns = 15;
   294    string url = 16;
   295    int32 num_dropped = 17;
   296    bool is_dropped = 18;
   297    string service_status = 19;
   298    int32 service_error_code = 20;
   299    string service_error = 21;
   300    string send_error = 22;
   301  }