Skip to content

Add additional Prebid debug flags to OpenRTB requests#377

Open
ChristianPavilonis wants to merge 4 commits intomainfrom
feature/additional-prebid-debug-flags
Open

Add additional Prebid debug flags to OpenRTB requests#377
ChristianPavilonis wants to merge 4 commits intomainfrom
feature/additional-prebid-debug-flags

Conversation

@ChristianPavilonis
Copy link
Collaborator

@ChristianPavilonis ChristianPavilonis commented Feb 25, 2026

Summary

Adds additional debug flags to Prebid/OpenRTB bid requests when debug: true is set in the prebid integration config, and surfaces Prebid Server debug response data in the /auction endpoint response.

Changes

OpenRTB request debug flags (openrtb.rs, prebid.rs)

When config.debug is enabled, the outgoing OpenRTB request now includes:

{
  "test": 1,
  "ext": {
    "prebid": {
      "debug": true,
      "returnallbidstatus": true
    }
  }
}
  • test: 1 — standard OpenRTB 2.x test mode flag
  • ext.prebid.debug: true — enables Prebid Server debug output (already existed)
  • ext.prebid.returnallbidstatus: true — includes all bid statuses (rejected/no-bid reasons) in the response

All three fields are None and omitted from serialization when debug is disabled (default).

Response debug logging (prebid.rs)

Added log::debug! of the full Prebid Server response JSON in parse_response(), gated on both config.debug and log::log_enabled!(Level::Debug) to avoid wasted serialization.

Debug data in /auction response (prebid.rs)

Extracted enrich_response_metadata() method that attaches Prebid Server response metadata to AuctionResponse.metadata, which flows through ProviderSummaryprovider_details in the /auction response ext:

Always-on fields (present whenever PBS returns them):

  • responsetimemillis — per-bidder response times
  • errors — per-bidder errors
  • warnings — per-bidder warnings (new)

Debug-gated fields (only when config.debug is true):

  • debug — full ext.debug blob (httpcalls, resolvedrequest)
  • bidstatus — per-bid status array from ext.prebid.bidstatus

Safety

  • Startup log::warn! emitted when debug: true is configured, alerting operators that debug data will be included in /auction responses
  • All debug fields default to None/omitted — no behavior change when debug is disabled

Tests

  • to_openrtb_includes_debug_flags_when_enabled — verifies struct values and serialized JSON shape
  • to_openrtb_omits_debug_flags_when_disabled — verifies fields are None and omitted from JSON
  • enrich_response_metadata_attaches_always_on_fields — verifies always-on metadata present, debug-gated fields absent
  • enrich_response_metadata_includes_debug_fields_when_enabled — verifies debug + bidstatus present with correct values

Tested and working on my test site

@ChristianPavilonis ChristianPavilonis self-assigned this Feb 25, 2026
@ChristianPavilonis ChristianPavilonis requested review from aram356 and removed request for aram356 February 25, 2026 21:14
@ChristianPavilonis ChristianPavilonis marked this pull request as draft February 25, 2026 21:23
@ChristianPavilonis
Copy link
Collaborator Author

Do we want this in the /auction response, or are debug logs good?
The no bids don't tell us a lot (no headers or anything comes back)

@aram356
Copy link
Collaborator

aram356 commented Feb 26, 2026

Let's return response if prebid integration is enabled with debug = true

@ChristianPavilonis ChristianPavilonis force-pushed the feature/additional-prebid-debug-flags branch from f204475 to 3d752dc Compare February 26, 2026 20:40
@ChristianPavilonis ChristianPavilonis marked this pull request as ready for review February 26, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants