Skip to content

Experimental WARP#4649

Open
cnderrauber wants to merge 3 commits into
masterfrom
warp
Open

Experimental WARP#4649
cnderrauber wants to merge 3 commits into
masterfrom
warp

Conversation

@cnderrauber

Copy link
Copy Markdown
Contributor

No description provided.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines 337 to 355
func IncrementParticipantRtcConnected(connected uint32) {
if connected > 0 {
participantRTCConnected.Add(uint64(connected))
promParticipantJoin.WithLabelValues("rtc_connected").Add(float64(connected))
promParticipantJoin.WithLabelValues("rtc_connected", "").Add(float64(connected))
}
}

func IncrementParticipantRtcActive(active uint32) {
func IncrementParticipantRtcActive(active uint32, warp bool) {
if active > 0 {
participantRTCActive.Add(uint64(active))
promParticipantJoin.WithLabelValues("rtc_active").Add(float64(active))
promParticipantJoin.WithLabelValues("rtc_active", strconv.FormatBool(warp)).Add(float64(active))
}
}

func IncrementParticipantRtcCanceled(canceled uint64) {
func IncrementParticipantRtcCanceled(canceled uint64, warp bool) {
if canceled > 0 {
participantRTCCanceled.Add(canceled)
promParticipantJoin.WithLabelValues("rtc_canceled").Add(float64(canceled))
promParticipantJoin.WithLabelValues("rtc_canceled", strconv.FormatBool(warp)).Add(float64(canceled))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Inconsistent warp label values across prometheus metric states

The promParticipantJoin counter now has a warp label, but its values are inconsistent across states: signal_connected, signal_failed, rtc_connected, etc. all use "" (empty string), while rtc_active and rtc_canceled use strconv.FormatBool(warp) producing "true" or "false". This means the warp label has three distinct values ("", "true", "false"), which could make Prometheus queries and dashboards harder to write correctly (e.g., sum by (state) would need to account for all three). Consider whether using "false" instead of "" for non-warp-aware states would simplify querying.

(Refers to lines 299-355)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only decide the warp state when trying to establish the peer connection. The empty value of warp represents an unknown state in those functions, as we don't know the warp state there.

@boks1971 boks1971 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

How different are the pion forks? Would it be hard to keep syncing?

Also, the Devin suggestion looks good to apply.

@cnderrauber

Copy link
Copy Markdown
Contributor Author

lgtm!

How different are the pion forks? Would it be hard to keep syncing?

Also, the Devin suggestion looks good to apply.

The pion/webrtc,ice's changes are clean and not hard to apply when syncing. Pion/dtls has more lines, but the dtls1.2 is stable and the development is focus on dtls1.3 now, so we don't need to sync it frequently.

Comment thread go.mod
google.golang.org/grpc v1.81.1 // indirect
)

replace github.com/pion/webrtc/v4 => github.com/livekit/webrtc-pion/v4 v4.2.16-warp.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make sure these forks have proper ownership (cs-devs or devs)?

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

ConstLabels: prometheus.Labels{"node_id": nodeID, "node_type": nodeType.String()},
Buckets: prometheus.ExponentialBucketsRange(100, 10000, 15),
}, []string{"protocol_version"})
}, []string{"protocol_version", "warp"})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Breaking change to promSessionStartTime histogram labels

Adding the "warp" label to promSessionStartTime at pkg/telemetry/prometheus/rooms.go:116 changes the metric's label set. Existing Prometheus queries, alerts, and Grafana dashboards that reference livekit_session_start_time_ms without the warp label will need to be updated. The old time series (without the warp label) and new time series (with it) will coexist during a rolling upgrade, which could cause double-counting in aggregation queries until the old series expire. This is a deployment consideration rather than a code bug.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants