Skip to content

APP-14871: Add ReportConnectionMetadata RPC and client-side connection reporting#544

Open
danielbotros wants to merge 10 commits intoviamrobotics:mainfrom
danielbotros:APP-14871-report-ice-candidate-selected-rpc
Open

APP-14871: Add ReportConnectionMetadata RPC and client-side connection reporting#544
danielbotros wants to merge 10 commits intoviamrobotics:mainfrom
danielbotros:APP-14871-report-ice-candidate-selected-rpc

Conversation

@danielbotros
Copy link
Copy Markdown
Member

@danielbotros danielbotros commented Mar 13, 2026

Description

APP-14871 Track coturn usage

  • Adds ICECandidateType and SDKType enums and a ReportConnectionMetadata unary RPC to SignalingService proto
  • Inspects the WebRTC stats report to find the nominated candidate pair and classify the connection as host, stun, coturn_relay, or twilio_relay
    • Relay candidates are classified as coturn_relay if the TURN server URL contains viam.com/viaminternal, otherwise twilio_relay
  • After ICE successfully connects in dialWebRTC, calls ReportConnectionMetadata on the signaling server as a best-effort fire-and-forget operation to record the successful attempt, candidate type, and SDK type (Go)
  • App side changes found here

Testing

Some logs were added and dial options messed with to turn off mDNS / ensure we connect through the local signaling server for this test.

  • Had local app / signaling server running
  • Started a main viam-server with these changes + this change and a remote viam-server.
  • Connected to a remote viam-server
  • Observed the log:
2026-03-16T19:45:29.058Z        INFO    rdk.resource_manager.rdk:remote:/b-main.networking.networking.webrtc    rpc/wrtc_client.go:491  reported selected ICE candidate type    {"host":"b-main.q36hd3rdku.viam.cloud","candidate_type":"ICE_CANDIDATE_TYPE_HOST"}                       

The candidate type and SDK type are sent to app in the ReportConnectionMetadata RPC where they are recorded along with the org ID.

danielbotros and others added 2 commits March 13, 2026 12:17
Adds a new unary RPC and ICECandidateType enum to the signaling proto so
that RDK clients can report which ICE candidate type was selected for a
WebRTC connection. This enables the app to track per-org Twilio relay
fallthrough without requiring any changes to the core ICE negotiation flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er dial

After ICE successfully connects in dialWebRTC, calls the new
ReportICECandidateSelected RPC on the signaling server as a best-effort
fire-and-forget operation.

The selected candidate type is determined by inspecting the WebRTC stats
report for the nominated candidate pair. Relay candidates are classified as
coturn_relay (URL contains viam.com/viaminternal) or twilio_relay (all
other relay servers).

This gives the app per-org visibility into Twilio relay fallthrough without
changing ICE negotiation behavior. The RDK picks up this behavior
automatically when goutils is updated — no separate RDK change required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@viambot viambot added the safe to test Mark as safe to test label Mar 13, 2026
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Mar 16, 2026
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Mar 16, 2026
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Mar 16, 2026
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Mar 19, 2026
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Mar 31, 2026
@danielbotros danielbotros changed the title APP-14871: Add ReportICECandidateSelected RPC and client-side ICE reporting APP-14871: Add ReportConnectionMetadata RPC and client-side connection reporting Mar 31, 2026
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Mar 31, 2026
Removed check for unspecified ICE candidate type in reporting.
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Mar 31, 2026
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Mark as safe to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants