Update Product Analytics backend for Snowplow compatibility
Summary
With Integrate Product Analytics initialization work... (#398253 - closed), we'll soon be able to initialize projects with Product Analytics with Snowplow as the event collector.
There are a number of additions to be made for us to support Snowplow, and eventually remove Jitsu support:
- The
product_analytics_instrumentation_key
has been introduced in Add support for snowplow PA configurator (!117141 - merged), which will eventually replacejitsu_key
Proposal
- Update the Product Analytics state resolver to accommodate the new instrumentation key field:
-
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/graphql/resolvers/product_analytics/state_resolver.rb?ref_type=heads#L14, to return
create_instance
depending on whether the feature flagproduct_analytics_snowplow_support
is enabled.
-
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/graphql/resolvers/product_analytics/state_resolver.rb?ref_type=heads#L14, to return
- Expose the
product_analytics_instrumentation_key
as a field in GraphQL: https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/graphql/ee/types/project_type.rb
For the above, if the product_analytics_snowplow_support
feature flag is enabled, it should check for the product_analytics_instrumentation_key
project setting. Otherwise, the jitsu_key
project setting.
Feature flag
Please add any Snowplow-specific functionality in addition to what exists for Jitsu behind the product_analytics_snowplow_support
feature flag.
This is so we can coordinate a switchover with the external cluster changes and we'll remove the Jitsu-specific code when the feature flag is removed.