Skip to content

Change purchase logic for product analytics

Max Woolf requested to merge mw/pa/update-add-on-logic into master

What does this MR do and why?

  • Updates the logic for calculating the number of events purchased for product analytics.
  • Previously purchasing quantity=3 would result in 2,000,000 results.
    • The values coming from CDot are now changed, so this MR changes quantity=3 resulting in 3,000,000 events.
    • There is no user-impact.
    • All current users are internal and billing is not enabled for any user.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

query {
  namespace(fullPath: "NAMESPACE NAME") {
    name
    productAnalyticsStoredEventsLimit
  }
}
  • The output should include "productAnalyticsStoredEventsLimit": null
  • Then enable the feature flag. :product_analytics_billing
  • Run the query again, this time the value should be 0.
  • Using an admin API token, add a few of the product_analytics add-ons to the namespace using the REST API.
POST /api/v4/namespaces/{GROUP NAME}/subscription_add_on_purchase/product_analytics

{"quantity":"3","expires_on":"2025-01-01","purchase_xid":"ANY STRING"}
  • Run the GraphQL query again, the value should be 3000000 (three million)

Merge request reports