google-marketing-solutions / crmint

Reliable data integration & processing for advertisers
https://google-marketing-solutions.github.io/crmint/
Other
184 stars 77 forks source link

Include user agent for pseudoanonymized usage measurement #491

Closed tyroneschiff closed 8 months ago

tyroneschiff commented 8 months ago

This change was tested in a demonstration environment to confirm functionality. When a user opts in to tracking when first deploying the application, the requestMetadata of the BigQuery API request will include a callerSuppliedUserAgent which will include cloud-solutions/crmint-usage-v3. If the user is opted out, this information will not be added to the callerSuppliedUserAgent. Here is an example below of an opted in callerSuppliedUserAgent:

"requestMetadata": {
  "callerIp": "2600:1900:2000:a8::1:1401",
  "callerSuppliedUserAgent": "cloud-solutions/crmint-usage-v3 gl-python/3.9.5 grpc/1.54.0 gax/2.11.0 gapic/3.10.0 gccl/3.10.0,gzip(gfe)",
  "requestAttributes": {},
  "destinationAttributes": {}
},

The nomenclature of cloud-solutions is required in this case for pseudoanonymized measurement. crmint-usage-v3 was selected since it involves CRMint & usage and we refer to CRMint on Cloud Run as V3.

codecov-commenter commented 8 months ago

Codecov Report

Attention: Patch coverage is 88.88889% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 89.26%. Comparing base (dfa3539) to head (ca3f5d9).

Files Patch % Lines
backend/jobs/workers/bigquery/bq_worker.py 88.88% 0 Missing and 1 partial :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #491 +/- ## ========================================== - Coverage 89.26% 89.26% -0.01% ========================================== Files 80 80 Lines 4565 4573 +8 Branches 422 424 +2 ========================================== + Hits 4075 4082 +7 Misses 420 420 - Partials 70 71 +1 ``` | [Flag](https://app.codecov.io/gh/google-marketing-solutions/crmint/pull/491/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [backend](https://app.codecov.io/gh/google-marketing-solutions/crmint/pull/491/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `88.66% <88.88%> (-0.01%)` | :arrow_down: | | [cli](https://app.codecov.io/gh/google-marketing-solutions/crmint/pull/491/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `90.61% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.