@@ -3,6 +3,7 @@ use std::error::Error;
3
3
use std:: net:: IpAddr ;
4
4
5
5
use bytes:: Bytes ;
6
+ use relay_base_schema:: project:: ProjectId ;
6
7
use relay_dynamic_config:: { Feature , GlobalConfig , ProjectConfig } ;
7
8
use relay_event_normalization:: replay:: { self , ReplayError } ;
8
9
use relay_event_normalization:: RawUserAgentInfo ;
@@ -28,6 +29,8 @@ pub fn process(
28
29
let replays_disabled = state. should_filter ( Feature :: SessionReplay ) ;
29
30
let scrubbing_enabled = project_state. has_feature ( Feature :: SessionReplayRecordingScrubbing ) ;
30
31
let replay_video_disabled = project_state. has_feature ( Feature :: SessionReplayVideoDisabled ) ;
32
+ let project_id = project_state. project_id ;
33
+ let organization_id = project_state. organization_id ;
31
34
32
35
let meta = state. envelope ( ) . meta ( ) . clone ( ) ;
33
36
let client_addr = meta. client_addr ( ) ;
@@ -79,6 +82,8 @@ pub fn process(
79
82
global_config,
80
83
client_addr,
81
84
user_agent,
85
+ project_id,
86
+ organization_id,
82
87
) ?;
83
88
item. set_payload ( ContentType :: Json , replay_event) ;
84
89
}
@@ -101,6 +106,8 @@ pub fn process(
101
106
user_agent,
102
107
scrubbing_enabled,
103
108
& mut scrubber,
109
+ project_id,
110
+ organization_id,
104
111
) ?;
105
112
item. set_payload ( ContentType :: OctetStream , replay_video) ;
106
113
}
@@ -113,13 +120,16 @@ pub fn process(
113
120
114
121
// Replay Event Processing.
115
122
123
+ #[ allow( clippy:: too_many_arguments) ]
116
124
fn handle_replay_event_item (
117
125
payload : Bytes ,
118
126
event_id : & Option < EventId > ,
119
127
config : & ProjectConfig ,
120
128
global_config : & GlobalConfig ,
121
129
client_ip : Option < IpAddr > ,
122
130
user_agent : & RawUserAgentInfo < & str > ,
131
+ project_id : Option < ProjectId > ,
132
+ organization_id : Option < u64 > ,
123
133
) -> Result < Bytes , ProcessingError > {
124
134
let filter_settings = & config. filter_settings ;
125
135
@@ -151,6 +161,8 @@ fn handle_replay_event_item(
151
161
relay_log:: warn!(
152
162
error = & error as & dyn Error ,
153
163
?event_id,
164
+ project_id = project_id. map( |v| v. value( ) ) ,
165
+ organization_id = organization_id,
154
166
"invalid replay event"
155
167
) ;
156
168
Err ( match error {
@@ -259,6 +271,8 @@ fn handle_replay_video_item(
259
271
user_agent : & RawUserAgentInfo < & str > ,
260
272
scrubbing_enabled : bool ,
261
273
scrubber : & mut RecordingScrubber ,
274
+ project_id : Option < ProjectId > ,
275
+ organization_id : Option < u64 > ,
262
276
) -> Result < Bytes , ProcessingError > {
263
277
let ReplayVideoEvent {
264
278
replay_event,
@@ -282,6 +296,8 @@ fn handle_replay_video_item(
282
296
global_config,
283
297
client_ip,
284
298
user_agent,
299
+ project_id,
300
+ organization_id,
285
301
) ?;
286
302
287
303
// Process as a replay-recording envelope item.
0 commit comments