From d7274fed6df990a510984997ce6348758f62ed47 Mon Sep 17 00:00:00 2001 From: antonbabak Date: Thu, 12 Dec 2024 10:03:09 +0100 Subject: [PATCH 1/6] Module Configuration Documentation --- prebid-server/developers/add-a-module-java.md | 10 ++++++++++ prebid-server/pbs-modules/index.md | 7 ++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/prebid-server/developers/add-a-module-java.md b/prebid-server/developers/add-a-module-java.md index 72b43f3b14..fa0a631208 100644 --- a/prebid-server/developers/add-a-module-java.md +++ b/prebid-server/developers/add-a-module-java.md @@ -93,6 +93,16 @@ The structure of your module source code inside the modules directory must have +- README.md <- documentation ``` +## Module Configuration +There are several places to configure a module: +- **Host/Bean config** is stored in one of the YAML files, primarily used for enabling the module altogether (`hooks..enabled`). It should only contain static config which applies to the entire prebid server, potentially independently from account configuration, or no config at all, apart from enabled flag. +- **Default account config** is stored in one of the YAML files, only used when there is an actual account present. It is used to define defaults for all accounts globally. +- **Account/Runtime config** is stored in the database, or YAML file, or anywhere else depending on the backend used. It is used to define individual account configuration. + +Important Notes: +- Host config will be provided to module once on application start. +- Account config will be provided to module on each request. + ## Module Code The quick start is to take a look in two places: diff --git a/prebid-server/pbs-modules/index.md b/prebid-server/pbs-modules/index.md index c07d1de507..21a9267837 100644 --- a/prebid-server/pbs-modules/index.md +++ b/prebid-server/pbs-modules/index.md @@ -132,9 +132,10 @@ hooks: } ``` -{: .alert.alert-info : -Execution plans can be placed in account configuration, but depending on how modules are enabled in your environment, it can be inconvenient to provide instructions to place the highly technical execution plan into the account config. Some organizations have -chosen to keep all execution plans in host-level config, then enabling the `require-config-to-invoke` option as described in the next section. +{: .alert.alert-info :} +Execution plans can be placed in account configuration, but depending on how modules are enabled in your environment, it can be inconvenient to provide instructions to place the highly technical execution plan into the account config. +Besides if there is more than one execution plan (e.g. on the host level and on the account level) all of them will be triggered and the module mentioned in the plans might be processed several times because of that. +Some organizations have chosen to keep all execution plans in host-level config, **and we encourage everyone to do the same**, then enabling the `require-config-to-invoke` option as described in the next section. ### 3. Supply the module with configuration From 68c2c40a738c4cd075a8d9645575cc927543078c Mon Sep 17 00:00:00 2001 From: antonbabak Date: Thu, 12 Dec 2024 10:04:53 +0100 Subject: [PATCH 2/6] Fix style --- prebid-server/developers/add-a-module-java.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prebid-server/developers/add-a-module-java.md b/prebid-server/developers/add-a-module-java.md index fa0a631208..a8052c1ccb 100644 --- a/prebid-server/developers/add-a-module-java.md +++ b/prebid-server/developers/add-a-module-java.md @@ -95,11 +95,13 @@ The structure of your module source code inside the modules directory must have ## Module Configuration There are several places to configure a module: + - **Host/Bean config** is stored in one of the YAML files, primarily used for enabling the module altogether (`hooks..enabled`). It should only contain static config which applies to the entire prebid server, potentially independently from account configuration, or no config at all, apart from enabled flag. - **Default account config** is stored in one of the YAML files, only used when there is an actual account present. It is used to define defaults for all accounts globally. - **Account/Runtime config** is stored in the database, or YAML file, or anywhere else depending on the backend used. It is used to define individual account configuration. Important Notes: + - Host config will be provided to module once on application start. - Account config will be provided to module on each request. From 99d90b95c600c2459fddaf26a27b91e6d8b4236c Mon Sep 17 00:00:00 2001 From: antonbabak Date: Mon, 16 Dec 2024 10:44:21 +0100 Subject: [PATCH 3/6] Greenbids Analytics Tags --- .../pbs-modules/greenbids-real-time-data.md | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/prebid-server/pbs-modules/greenbids-real-time-data.md b/prebid-server/pbs-modules/greenbids-real-time-data.md index 5c6a25c4fa..ae8811da4a 100644 --- a/prebid-server/pbs-modules/greenbids-real-time-data.md +++ b/prebid-server/pbs-modules/greenbids-real-time-data.md @@ -145,22 +145,39 @@ per bid requests and is not filtered by the RTD module. Here's an example analytics tag that might be produced for use in an analytics adapter: ```json -[{ - "pub_banniere_haute": { - "greenbids": { - "fingerprint": "ad63524e-b13f-4359-a975-dba9b5dc08f4", - "keptInAuction": { - "improvedigital": false, - "appnexus": true, - "pubmatic": false, - "rubicon": true, - "teads": false - }, - "isExploration": false - }, - "tid": "2c445309-06b2-47b2-a724-4aeef15faeb8" +{ + "activities": [ + { + "name": "greenbids-filter", + "status": "success", + "results": [ + { + "status": "success", + "values": { + "pub_banniere_haute": { + "greenbids": { + "fingerprint": "ad63524e-b13f-4359-a975-dba9b5dc08f4", + "keptInAuction": { + "improvedigital": false, + "appnexus": true, + "pubmatic": false, + "rubicon": true, + "teads": false + }, + "isExploration": false + }, + "tid": "2c445309-06b2-47b2-a724-4aeef15faeb8" + } + }, + "appliedTo": { + "bidders": "bidderA", + "impIds": "impId1" + } + } + ] } -}] + ] +} ``` ## Maintainer contacts From 72d505030296898d319d38479dd4d956a3aa5cb0 Mon Sep 17 00:00:00 2001 From: bretg Date: Mon, 16 Dec 2024 12:23:18 -0500 Subject: [PATCH 4/6] wordsmithing --- prebid-server/pbs-modules/index.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prebid-server/pbs-modules/index.md b/prebid-server/pbs-modules/index.md index 21a9267837..8d8472ecdd 100644 --- a/prebid-server/pbs-modules/index.md +++ b/prebid-server/pbs-modules/index.md @@ -133,9 +133,11 @@ hooks: ``` {: .alert.alert-info :} -Execution plans can be placed in account configuration, but depending on how modules are enabled in your environment, it can be inconvenient to provide instructions to place the highly technical execution plan into the account config. -Besides if there is more than one execution plan (e.g. on the host level and on the account level) all of them will be triggered and the module mentioned in the plans might be processed several times because of that. -Some organizations have chosen to keep all execution plans in host-level config, **and we encourage everyone to do the same**, then enabling the `require-config-to-invoke` option as described in the next section. +Execution plans may be placed in account configuration, but depending on how modules are enabled in your environment, it can be inconvenient to provide instructions to place the highly technical execution plan into the account config. Some organizations have chosen to keep all execution plans in host-level config, then enabling the `require-config-to-invoke` option as described in the next section. + +{: .alert.alert-warning :} +Note that if there is more than one execution plan (e.g. one the host level and one the account level) all of them will be triggered and the module invoked processed several times. + ### 3. Supply the module with configuration From de3d3cfcf03b2b1df384d0d9e420bb8d6be0c356 Mon Sep 17 00:00:00 2001 From: bretg Date: Mon, 16 Dec 2024 12:27:03 -0500 Subject: [PATCH 5/6] wordsmithing --- prebid-server/developers/add-a-module-java.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prebid-server/developers/add-a-module-java.md b/prebid-server/developers/add-a-module-java.md index a8052c1ccb..cdb00f8815 100644 --- a/prebid-server/developers/add-a-module-java.md +++ b/prebid-server/developers/add-a-module-java.md @@ -96,9 +96,9 @@ The structure of your module source code inside the modules directory must have ## Module Configuration There are several places to configure a module: -- **Host/Bean config** is stored in one of the YAML files, primarily used for enabling the module altogether (`hooks..enabled`). It should only contain static config which applies to the entire prebid server, potentially independently from account configuration, or no config at all, apart from enabled flag. -- **Default account config** is stored in one of the YAML files, only used when there is an actual account present. It is used to define defaults for all accounts globally. -- **Account/Runtime config** is stored in the database, or YAML file, or anywhere else depending on the backend used. It is used to define individual account configuration. +- **Host/Bean config** is stored in one of the YAML files (generally application.yaml), primarily used for enabling the module at the server level with `hooks..enabled`. It should only contain static config which applies to initial startup independent from any account. Most modules have no host-level config at all, apart from enabled flag. +- **Default account config** is stored in a YAML file, but only used when account config is available (i.e. it's not seen at the entrypoint stage). It is used to define defaults for all accounts. +- **Account/Runtime config** is stored in the database, YAML file, or whatever other account backend used. It is used to define individual account configuration. Important Notes: From 2b0bf021b11324616456d99280b7878a410cb278 Mon Sep 17 00:00:00 2001 From: bretg Date: Mon, 16 Dec 2024 12:28:03 -0500 Subject: [PATCH 6/6] lint --- prebid-server/pbs-modules/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/prebid-server/pbs-modules/index.md b/prebid-server/pbs-modules/index.md index 8d8472ecdd..bae04a3aa3 100644 --- a/prebid-server/pbs-modules/index.md +++ b/prebid-server/pbs-modules/index.md @@ -138,7 +138,6 @@ Execution plans may be placed in account configuration, but depending on how mod {: .alert.alert-warning :} Note that if there is more than one execution plan (e.g. one the host level and one the account level) all of them will be triggered and the module invoked processed several times. - ### 3. Supply the module with configuration Modules may require configuration at startup or during the request: