Add additional Prebid debug flags to OpenRTB requests#377
Open
ChristianPavilonis wants to merge 4 commits intomainfrom
Open
Add additional Prebid debug flags to OpenRTB requests#377ChristianPavilonis wants to merge 4 commits intomainfrom
ChristianPavilonis wants to merge 4 commits intomainfrom
Conversation
Collaborator
Author
|
Do we want this in the /auction response, or are debug logs good? |
Collaborator
|
Let's return response if prebid integration is enabled with debug = |
f204475 to
3d752dc
Compare
…se_metadata with tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds additional debug flags to Prebid/OpenRTB bid requests when
debug: trueis set in the prebid integration config, and surfaces Prebid Server debug response data in the/auctionendpoint response.Changes
OpenRTB request debug flags (
openrtb.rs,prebid.rs)When
config.debugis enabled, the outgoing OpenRTB request now includes:{ "test": 1, "ext": { "prebid": { "debug": true, "returnallbidstatus": true } } }test: 1— standard OpenRTB 2.x test mode flagext.prebid.debug: true— enables Prebid Server debug output (already existed)ext.prebid.returnallbidstatus: true— includes all bid statuses (rejected/no-bid reasons) in the responseAll three fields are
Noneand omitted from serialization when debug is disabled (default).Response debug logging (
prebid.rs)Added
log::debug!of the full Prebid Server response JSON inparse_response(), gated on bothconfig.debugandlog::log_enabled!(Level::Debug)to avoid wasted serialization.Debug data in
/auctionresponse (prebid.rs)Extracted
enrich_response_metadata()method that attaches Prebid Server response metadata toAuctionResponse.metadata, which flows throughProviderSummary→provider_detailsin the/auctionresponseext:Always-on fields (present whenever PBS returns them):
responsetimemillis— per-bidder response timeserrors— per-bidder errorswarnings— per-bidder warnings (new)Debug-gated fields (only when
config.debugis true):debug— fullext.debugblob (httpcalls, resolvedrequest)bidstatus— per-bid status array fromext.prebid.bidstatusSafety
log::warn!emitted whendebug: trueis configured, alerting operators that debug data will be included in/auctionresponsesNone/omitted — no behavior change when debug is disabledTests
to_openrtb_includes_debug_flags_when_enabled— verifies struct values and serialized JSON shapeto_openrtb_omits_debug_flags_when_disabled— verifies fields areNoneand omitted from JSONenrich_response_metadata_attaches_always_on_fields— verifies always-on metadata present, debug-gated fields absentenrich_response_metadata_includes_debug_fields_when_enabled— verifies debug + bidstatus present with correct valuesTested and working on my test site