Skip to content

Commit 3d752dc

Browse files
Surface Prebid debug data (httpcalls, bidstatus, warnings) in /auction response metadata
1 parent 8e58450 commit 3d752dc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/common/src/integrations/prebid.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,24 @@ impl AuctionProvider for PrebidAuctionProvider {
876876
if let Some(errors) = ext.and_then(|e| e.get("errors")) {
877877
auction_response = auction_response.with_metadata("errors", errors.clone());
878878
}
879+
if let Some(warnings) = ext.and_then(|e| e.get("warnings")) {
880+
auction_response = auction_response.with_metadata("warnings", warnings.clone());
881+
}
882+
883+
// When debug is enabled, surface the additional Prebid Server debug
884+
// data: httpcalls, resolvedrequest, and per-bid status.
885+
if self.config.debug {
886+
if let Some(debug) = ext.and_then(|e| e.get("debug")) {
887+
auction_response = auction_response.with_metadata("debug", debug.clone());
888+
}
889+
if let Some(bidstatus) = ext
890+
.and_then(|e| e.get("prebid"))
891+
.and_then(|p| p.get("bidstatus"))
892+
{
893+
auction_response =
894+
auction_response.with_metadata("bidstatus", bidstatus.clone());
895+
}
896+
}
879897

880898
log::info!(
881899
"Prebid returned {} bids in {}ms",

0 commit comments

Comments
 (0)