Skip to content

Commit fc7b002

Browse files
add responsetimemillies to auction metadata response
1 parent 3884909 commit fc7b002

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

crates/common/src/integrations/prebid.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,19 @@ impl AuctionProvider for PrebidAuctionProvider {
837837
transform_prebid_response(&mut response_json, &request_host, &request_scheme)?;
838838
}
839839

840-
let auction_response = self.parse_openrtb_response(&response_json, response_time_ms);
840+
let mut auction_response = self.parse_openrtb_response(&response_json, response_time_ms);
841+
842+
// Attach per-bidder timing and errors from the Prebid Server response.
843+
// `responsetimemillis` contains an entry for every invited bidder, even
844+
// those that returned no bids, making it the canonical source for
845+
// "who was in the auction."
846+
let ext = response_json.get("ext");
847+
if let Some(rtm) = ext.and_then(|e| e.get("responsetimemillis")) {
848+
auction_response = auction_response.with_metadata("responsetimemillis", rtm.clone());
849+
}
850+
if let Some(errors) = ext.and_then(|e| e.get("errors")) {
851+
auction_response = auction_response.with_metadata("errors", errors.clone());
852+
}
841853

842854
log::info!(
843855
"Prebid returned {} bids in {}ms",

0 commit comments

Comments
 (0)