Repository navigation
optable-targeting new features: non-blocking early network call + hid + id5 - #4601
justadreamer wants to merge 90 commits into
Conversation
return early from the hook if (hasRawAuctionRequestHook && hasBidderRequestHook) - the new mode
random is 0-99, percentage is 0-100. enrich when random < (strictly less than) percentage. so if we specify percentage 0 we never enrich, if we specify percentage 100 we always enrich.
…ntage property is specified and it's value is 100%
The account config node is deserialized with the prebid mapper, which uses SNAKE_CASE, so the unannotated fields bound to enrich_web and enrich_app while the documented account keys are enrich-web and enrich-app. Per-account overrides of both were silently dropped and the global value kept.
…change Core changed ExecutionPlan.endpoints key type from Endpoint to HookHttpEndpoint. Map.get accepts Object, so the stale lookup kept compiling but always returned null against the EnumMap: the module read a bidder-request hook timeout of 0, so the targeting API call inherited only the raw-auction-request stage budget (50ms) instead of the configured 500ms and timed out on every auction.
…n API call is deffered
Bidders from stored imps are never enriched when other imps name bidders inline. If one imp lists its bidders and another only references a stored imp, the raw hook doesn't defer. This affects mixed Prebid Mobile and web setups.
…execution-plan lookup
There was a problem hiding this comment.
Please apply masking to user and device before extracting sensitive data (like IP or user agent). This code is now being called from raw auction request hook, before masking is applied, so it has to be applied here manually. Example code: https://docs.prebid.org/prebid-server/developers/add-a-module-java.html#interaction-with-activity-infrastructure
…taining Optable hook
…larify execution-time
| private static final int DEFAULT_ENRICHMENT_PERCENTAGE = 100; | ||
|
|
||
| private final AliasesResolver aliasesResolver; | ||
| private final IntSupplier randomSupplier; |
There was a problem hiding this comment.
Please change IntSupplier randomSupplier field to Random random. The caller should be able to just supply the generic source of randomness (Random object) and it should be the responsibility of the current class to call .nextInt(100) on it to obtain random ints, not the responsibility of the caller. This way the logic is better encapsulated inside this class.
Type of changes
What's the context?
Two related improvements to the
optable-targetingmodule: the Optable API call no longer blocks the auction pipeline, and the Targeting API request now carries the parameters needed for mobile in-app resolution (hid, bundle/ver, ID5).Latency: non-blocking early network call
The API call starts at
raw-auction-requestand runs in parallel with the rest of the auction. The result is consumed per bidder atbidder-request, where enrichment is actually injected, so the pipeline never waits on the network.Stored requests and stored imps are merged after
raw-auction-request, so for requests whose bidders orsite/applive there (f.e. Prebid Mobile SDK traffic) the call is started byprocessed-auction-requeston the merged request instead. Bidders are read from bothimp.ext.prebid.bidderand the old-styleimp.ext.<bidder>.Traffic controls
enrichment-percentage/bidder-enrichment-percentages: sampling rate (0-100) applied per bidder. A bidder with no entry falls back to the account default;0disables it entirely.enrich-web/enrich-app: select which traffic sources are enriched.Sampling applies to the split plan only. The legacy
processed-auction-requesthook enriches the whole bid request before bidders split out, so it cannot sample per bidder.Targeting API request parameters
hid-prefixes(new config entry): comma-separated id prefixes to emit ashid=, in the given order (e.g."e,p,i6,a,g,c"). Independent ofid-prefix-order, and selective rather than merely ordering: only the listed prefixes are sent ashid.bundle/ver: emitted frombidRequest.appwhen present.id5_signaturein: read fromuser.ext.optable, forwarded as a Targeting API query attribute alongside email/phone/zip/vid.id5_signatureout: returned inext.prebid.passthrough.optable.id5_signature. PBS cannot persist the signature between requests, so it round-trips through the client, which caches it and replays it on the next auction.Backwards compatibility
No breaking changes. The
processed-auction-requesthook stays in the plan. When theraw-auction-requestandbidder-requesthooks are present it no longer blocks and only starts the call for stored-request traffic; otherwise it keeps the previous synchronous behavior.Configuration (recommended)
The
bidder-requestgroup timeout bounds the wait on the API call, so it must accommodate round-trip latency to the Optable edge. Theraw-auction-requestandprocessed-auction-requesttimeouts only cover dispatch.To migrate from the legacy plan, keep the
processed-auction-requesthook and add theraw-auction-requestandbidder-requesthooks.Test plan
Quality check
cc: @jrosendahl-opt @softcoder594