debian-mirror-gitlab/config/initializers/gitlab_experiment.rb
2021-09-30 23:02:18 +05:30

16 lines
620 B
Ruby

# frozen_string_literal: true
Gitlab::Experiment.configure do |config|
config.base_class = 'ApplicationExperiment'
config.mount_at = '/-/experiment'
config.cache = Gitlab::Experiment::Cache::RedisHashStore.new(
pool: ->(&block) { Gitlab::Redis::SharedState.with { |redis| block.call(redis) } }
)
config.tracking_behavior = lambda do |action, event_args|
Gitlab::Tracking.event(name, action.to_s, **event_args.merge(
context: (event_args[:context] || []) << SnowplowTracker::SelfDescribingJson.new(
'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0', signature
)
))
end
end