From d999ac8711c4b39e45dd337abdc83c0bc2800d94 Mon Sep 17 00:00:00 2001 From: Chenghao Mou Date: Tue, 21 Jul 2026 14:59:23 +0100 Subject: [PATCH 1/4] feat: add simulation/redaction fields to MetricsRecordingHeader Lets the agent tag a recording upload as a simulation session and/or force PII redaction on, so the collector can skip (or force) redaction per session. `simulation` is derived agent-side from the job's lk.simulator.dispatch attribute; `redaction` from RecordingOptions. Reserves field 2 (removed observability field, #1294). AGT-3158 Co-Authored-By: Claude Opus 4.8 (1M context) --- protobufs/livekit_metrics.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protobufs/livekit_metrics.proto b/protobufs/livekit_metrics.proto index 98a69088c..5394f3d19 100644 --- a/protobufs/livekit_metrics.proto +++ b/protobufs/livekit_metrics.proto @@ -90,6 +90,7 @@ message EventMetric { } message MetricsRecordingHeader { + reserved 2; // was observability field, removed in #1294 string room_id = 1 [(logger.name) = "roomID"]; uint64 duration = 3; // milliseconds google.protobuf.Timestamp start_time = 4; @@ -97,4 +98,6 @@ message MetricsRecordingHeader { string room_name = 6; google.protobuf.Timestamp room_start_time = 7; string job_id = 8; + bool simulation = 9; // session is a simulation; the collector skips PII redaction for it unless redaction is set + bool redaction = 10; // force PII redaction on for this session (only ever enables, never disables) } From 976c7a5652926d2bcc65dbd937aaf6daa53033d4 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:00:30 +0000 Subject: [PATCH 2/4] generated protobuf --- livekit/livekit_metrics.pb.go | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/livekit/livekit_metrics.pb.go b/livekit/livekit_metrics.pb.go index ce4177caa..a6fd642c8 100644 --- a/livekit/livekit_metrics.pb.go +++ b/livekit/livekit_metrics.pb.go @@ -464,6 +464,8 @@ type MetricsRecordingHeader struct { RoomName string `protobuf:"bytes,6,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"` RoomStartTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=room_start_time,json=roomStartTime,proto3" json:"room_start_time,omitempty"` JobId string `protobuf:"bytes,8,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` + Simulation bool `protobuf:"varint,9,opt,name=simulation,proto3" json:"simulation,omitempty"` // session is a simulation; the collector skips PII redaction for it unless redaction is set + Redaction bool `protobuf:"varint,10,opt,name=redaction,proto3" json:"redaction,omitempty"` // force PII redaction on for this session (only ever enables, never disables) unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -547,6 +549,20 @@ func (x *MetricsRecordingHeader) GetJobId() string { return "" } +func (x *MetricsRecordingHeader) GetSimulation() bool { + if x != nil { + return x.Simulation + } + return false +} + +func (x *MetricsRecordingHeader) GetRedaction() bool { + if x != nil { + return x.Redaction + } + return false +} + var File_livekit_metrics_proto protoreflect.FileDescriptor const file_livekit_metrics_proto_rawDesc = "" + @@ -580,7 +596,7 @@ const file_livekit_metrics_proto_rawDesc = "" + "\bmetadata\x18\b \x01(\tR\bmetadata\x12\x10\n" + "\x03rid\x18\t \x01(\rR\x03ridB\x13\n" + "\x11_end_timestamp_msB\x1b\n" + - "\x19_normalized_end_timestamp\"\x94\x03\n" + + "\x19_normalized_end_timestamp\"\xd8\x03\n" + "\x16MetricsRecordingHeader\x12\"\n" + "\aroom_id\x18\x01 \x01(\tB\t\xbaP\x06roomIDR\x06roomId\x12\x1a\n" + "\bduration\x18\x03 \x01(\x04R\bduration\x129\n" + @@ -589,10 +605,15 @@ const file_livekit_metrics_proto_rawDesc = "" + "\troom_tags\x18\x05 \x03(\v2-.livekit.MetricsRecordingHeader.RoomTagsEntryR\broomTags\x12\x1b\n" + "\troom_name\x18\x06 \x01(\tR\broomName\x12B\n" + "\x0froom_start_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\rroomStartTime\x12\x15\n" + - "\x06job_id\x18\b \x01(\tR\x05jobId\x1a;\n" + + "\x06job_id\x18\b \x01(\tR\x05jobId\x12\x1e\n" + + "\n" + + "simulation\x18\t \x01(\bR\n" + + "simulation\x12\x1c\n" + + "\tredaction\x18\n" + + " \x01(\bR\tredaction\x1a;\n" + "\rRoomTagsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*\x81\a\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\x02\x10\x03*\x81\a\n" + "\vMetricLabel\x12\x13\n" + "\x0fAGENTS_LLM_TTFT\x10\x00\x12\x13\n" + "\x0fAGENTS_STT_TTFT\x10\x01\x12\x13\n" + From de6f7494cbf77d5354b16755608bc42c5dc78219 Mon Sep 17 00:00:00 2001 From: Chenghao Mou Date: Tue, 21 Jul 2026 15:33:25 +0100 Subject: [PATCH 3/4] feat: add simulated/redaction_enabled fields to MetricsRecordingHeader Lets the agent tag a recording upload as a simulation session and/or force PII redaction on, so the collector can skip (or force) redaction per session. simulated is derived agent-side from the job's lk.simulator.dispatch attribute; redaction_enabled from RecordingOptions. Reserves field 2 (removed observability field, #1294). AGT-3158 Co-Authored-By: Claude Opus 4.8 (1M context) --- livekit/livekit_metrics.pb.go | 44 ++++++++++++++++----------------- protobufs/livekit_metrics.proto | 4 +-- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/livekit/livekit_metrics.pb.go b/livekit/livekit_metrics.pb.go index a6fd642c8..5b29b86fb 100644 --- a/livekit/livekit_metrics.pb.go +++ b/livekit/livekit_metrics.pb.go @@ -456,18 +456,18 @@ func (x *EventMetric) GetRid() uint32 { } type MetricsRecordingHeader struct { - state protoimpl.MessageState `protogen:"open.v1"` - RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` - Duration uint64 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` // milliseconds - StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - RoomTags map[string]string `protobuf:"bytes,5,rep,name=room_tags,json=roomTags,proto3" json:"room_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - RoomName string `protobuf:"bytes,6,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"` - RoomStartTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=room_start_time,json=roomStartTime,proto3" json:"room_start_time,omitempty"` - JobId string `protobuf:"bytes,8,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` - Simulation bool `protobuf:"varint,9,opt,name=simulation,proto3" json:"simulation,omitempty"` // session is a simulation; the collector skips PII redaction for it unless redaction is set - Redaction bool `protobuf:"varint,10,opt,name=redaction,proto3" json:"redaction,omitempty"` // force PII redaction on for this session (only ever enables, never disables) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` + Duration uint64 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` // milliseconds + StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + RoomTags map[string]string `protobuf:"bytes,5,rep,name=room_tags,json=roomTags,proto3" json:"room_tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + RoomName string `protobuf:"bytes,6,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"` + RoomStartTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=room_start_time,json=roomStartTime,proto3" json:"room_start_time,omitempty"` + JobId string `protobuf:"bytes,8,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` + Simulated bool `protobuf:"varint,9,opt,name=simulated,proto3" json:"simulated,omitempty"` // session is a simulation; the collector skips PII redaction for it unless redaction_enabled is set + RedactionEnabled bool `protobuf:"varint,10,opt,name=redaction_enabled,json=redactionEnabled,proto3" json:"redaction_enabled,omitempty"` // force PII redaction on for this session (only ever enables, never disables) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *MetricsRecordingHeader) Reset() { @@ -549,16 +549,16 @@ func (x *MetricsRecordingHeader) GetJobId() string { return "" } -func (x *MetricsRecordingHeader) GetSimulation() bool { +func (x *MetricsRecordingHeader) GetSimulated() bool { if x != nil { - return x.Simulation + return x.Simulated } return false } -func (x *MetricsRecordingHeader) GetRedaction() bool { +func (x *MetricsRecordingHeader) GetRedactionEnabled() bool { if x != nil { - return x.Redaction + return x.RedactionEnabled } return false } @@ -596,7 +596,7 @@ const file_livekit_metrics_proto_rawDesc = "" + "\bmetadata\x18\b \x01(\tR\bmetadata\x12\x10\n" + "\x03rid\x18\t \x01(\rR\x03ridB\x13\n" + "\x11_end_timestamp_msB\x1b\n" + - "\x19_normalized_end_timestamp\"\xd8\x03\n" + + "\x19_normalized_end_timestamp\"\xe5\x03\n" + "\x16MetricsRecordingHeader\x12\"\n" + "\aroom_id\x18\x01 \x01(\tB\t\xbaP\x06roomIDR\x06roomId\x12\x1a\n" + "\bduration\x18\x03 \x01(\x04R\bduration\x129\n" + @@ -605,12 +605,10 @@ const file_livekit_metrics_proto_rawDesc = "" + "\troom_tags\x18\x05 \x03(\v2-.livekit.MetricsRecordingHeader.RoomTagsEntryR\broomTags\x12\x1b\n" + "\troom_name\x18\x06 \x01(\tR\broomName\x12B\n" + "\x0froom_start_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\rroomStartTime\x12\x15\n" + - "\x06job_id\x18\b \x01(\tR\x05jobId\x12\x1e\n" + - "\n" + - "simulation\x18\t \x01(\bR\n" + - "simulation\x12\x1c\n" + - "\tredaction\x18\n" + - " \x01(\bR\tredaction\x1a;\n" + + "\x06job_id\x18\b \x01(\tR\x05jobId\x12\x1c\n" + + "\tsimulated\x18\t \x01(\bR\tsimulated\x12+\n" + + "\x11redaction_enabled\x18\n" + + " \x01(\bR\x10redactionEnabled\x1a;\n" + "\rRoomTagsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\x02\x10\x03*\x81\a\n" + diff --git a/protobufs/livekit_metrics.proto b/protobufs/livekit_metrics.proto index 5394f3d19..b288ce6c0 100644 --- a/protobufs/livekit_metrics.proto +++ b/protobufs/livekit_metrics.proto @@ -98,6 +98,6 @@ message MetricsRecordingHeader { string room_name = 6; google.protobuf.Timestamp room_start_time = 7; string job_id = 8; - bool simulation = 9; // session is a simulation; the collector skips PII redaction for it unless redaction is set - bool redaction = 10; // force PII redaction on for this session (only ever enables, never disables) + bool simulated = 9; // session is a simulation; the collector skips PII redaction for it unless redaction_enabled is set + bool redaction_enabled = 10; // force PII redaction on for this session (only ever enables, never disables) } From 08663fcafee6d5cc9090a68d19389f1dbeff57b3 Mon Sep 17 00:00:00 2001 From: Chenghao Mou Date: Tue, 21 Jul 2026 15:46:43 +0100 Subject: [PATCH 4/4] Add simulation/redaction fields to MetricsRecordingHeader --- .changeset/wise-steaks-eat.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/wise-steaks-eat.md diff --git a/.changeset/wise-steaks-eat.md b/.changeset/wise-steaks-eat.md new file mode 100644 index 000000000..b09741ac4 --- /dev/null +++ b/.changeset/wise-steaks-eat.md @@ -0,0 +1,6 @@ +--- +"github.com/livekit/protocol": patch +"@livekit/protocol": patch +--- + +feat: add simulation/redaction fields to MetricsRecordingHeader