Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mux Data Monitoring Samples #18

Merged
merged 8 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ version: v1
lint:
use:
- DEFAULT
except:
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
13 changes: 13 additions & 0 deletions monitoring_samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p align="center">
<a href="https://mux.com/">
<img src="https://avatars.githubusercontent.com/u/16199997?s=200&v=4" alt="Mux Logo">
</a>
</p>

# Mux Data Monitoring Samples

Mux provides a mechanism for partners to subscribe to real-time video view level datastream of events and measurements related to the quality of service for integrated customers. Monitoring Samples are provided with 30 second granularity. This can be used to identify service-level problems, such as widespread rebuffering or playback failures. Monitoring Samples includes information about the CDN, so another common use case is to analyze traffic and perform CDN optimization on poorly performing groups of views.

The data is delivered in nested Protobuf format. A single stream samples “payload” may contain multiple samples from both time ranges and customer id’s.

Each sample corresponds to a single active video view. The sample can contain multiple records, where each record contains metrics for a point in time for the video view. A record specifies a time period and Metrics measured over that time period. All Metrics inside a single record will apply to the time range implied by the “start” timestamp field plus the “duration_ms” field. If the duration field is zero, the Record includes instantaneous Metrics. A Record MUST contain at least one Metric.
84 changes: 84 additions & 0 deletions monitoring_samples/v1/monitoring_samples.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
syntax = "proto2";

package monitoring_samples.v1;

message Timestamp {
optional int64 seconds = 1;
optional int32 nanos = 2;
}

message Samples {
repeated Sample samples = 1;
}

message Sample {
// A v4 UUID Mux used to identify this view. Use the view_id field instead.
optional bytes view_id_raw = 1 [deprecated = true];
// The IP address of the client as seen by Mux servers. Use the ip field instead.
// Either 4 or 8 bytes.
optional bytes ip_raw = 2 [deprecated = true];
// The mask applied to the IP address. If omitted, /24 was used.
optional uint32 ip_mask = 3 [deprecated = true];
optional uint64 customer_id = 4;
repeated Record records = 5;
optional Source source = 6;
// A v4 UUID string Mux used to identify this view.
optional string view_id = 7;
// The IP address string of the client as seen by Mux servers.
optional string ip = 8;
// Provides ASN to aid in troubleshooting ISP/CDN issues
optional int64 asn = 9;
// Operating System
optional string viewer_os_family = 10;
// Operating System Version
optional string viewer_os_version = 11;
// Unused
optional string player_source_stream_type = 12 [deprecated = true];
// Player Name
optional string player_name = 13;
// Device Category (tv, mobile, etc)
optional string viewer_device_category = 14;
// Has Ads
optional bool view_has_ad = 15;
// Video Startup Failure
optional bool video_startup_failure = 16;
optional bool exit_before_video_start = 17;
optional string sub_property_id = 18;
// Stream Type (VOD/Live)
optional string stream_type = 19;
}

message Record {
// Timestamp representing the start time of the sample
optional Timestamp start = 1;
// Duration of the sample window
optional uint32 duration_ms = 2;
repeated Metric metrics = 3;
}

message Source {
// The hostname including the protocol used to serve such as:
// https://cdn.domain.com
optional string hostname = 1;
// The IP address that the client resolved, if available.
optional bytes ip = 2;
// If we are able to identify additional CDN information such as the
// X-Served-By, X-Cache or Via headers, it may be included here.
optional string host_id = 3;
}

message Metric {
enum Type {
UNKNOWN = 0;
START_LATENCY_MS = 1;
EXIT_BEFORE_VIDEO_START = 2;
WATCH_DURATION_MS = 3;
SEEK_LATENCY_MS = 4;
REBUFFER_DURATION_MS = 5;
REBUFFER_COUNT = 6;
PLAYBACK_ERROR = 7;
TOTAL_BITS = 8; // currently unused
}
optional Type type = 1;
optional int64 value = 2;
}
Loading