Commit ca876916 authored by Catalin Irimie's avatar Catalin Irimie

Remove Geo proxying metrics feature flag

Changelog: other
EE: true
parent 7ac35d76
---
name: track_geo_proxy_events
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76587
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/348414
milestone: '14.7'
type: development
group: group::geo
default_enabled: true
...@@ -8,8 +8,7 @@ module GeoInstrumentation ...@@ -8,8 +8,7 @@ module GeoInstrumentation
end end
def track_geo_proxy_event def track_geo_proxy_event
return unless Feature.enabled?(:track_geo_proxy_events, default_enabled: :yaml) && ::Gitlab::Geo.proxied_request?(request.env) return unless ::Gitlab::Geo.proxied_request?(request.env) && current_user
return unless current_user
Gitlab::UsageDataCounters::HLLRedisCounter.track_event('g_geo_proxied_requests', values: current_user.id) Gitlab::UsageDataCounters::HLLRedisCounter.track_event('g_geo_proxied_requests', values: current_user.id)
end end
......
...@@ -19,9 +19,9 @@ RSpec.describe GeoInstrumentation do ...@@ -19,9 +19,9 @@ RSpec.describe GeoInstrumentation do
end end
describe '.track_geo_proxy_event' do describe '.track_geo_proxy_event' do
context 'when the track_geo_proxy feature flag is disabled' do context 'when the request is not proxied' do
before do before do
stub_feature_flags(track_geo_proxy_events: false) allow(::Gitlab::Geo).to receive(:proxied_request?).and_return(false)
end end
it 'does not track an event' do it 'does not track an event' do
...@@ -30,38 +30,25 @@ RSpec.describe GeoInstrumentation do ...@@ -30,38 +30,25 @@ RSpec.describe GeoInstrumentation do
end end
end end
context 'when the track_geo_proxy feature flag is enabled' do context 'when the request is proxied' do
context 'when the request is not proxied' do before do
before do allow(::Gitlab::Geo).to receive(:proxied_request?).and_return(true)
allow(::Gitlab::Geo).to receive(:proxied_request?).and_return(false) end
end
it 'does not track an event' do context 'when logged in' do
expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event) it 'tracks a HLL event for unique geo proxied requests' do
expect(Gitlab::UsageDataCounters::HLLRedisCounter)
.to receive(:track_event).with('g_geo_proxied_requests', values: user.id)
get :show get :show
end end
end end
context 'when the request is proxied' do context 'when not logged in' do
before do let(:user) { nil }
allow(::Gitlab::Geo).to receive(:proxied_request?).and_return(true)
end
context 'when logged in' do
it 'tracks a HLL event for unique geo proxied requests' do
expect(Gitlab::UsageDataCounters::HLLRedisCounter)
.to receive(:track_event).with('g_geo_proxied_requests', values: user.id)
get :show
end
end
context 'when not logged in' do
let(:user) { nil }
it 'does not track an event' do it 'does not track an event' do
expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event) expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event)
get :show get :show
end
end end
end end
end end
......
...@@ -382,7 +382,6 @@ ...@@ -382,7 +382,6 @@
category: geo category: geo
redis_slot: geo redis_slot: geo
aggregation: daily aggregation: daily
feature_flag: track_geo_proxy_events
# Growth # Growth
- name: users_clicking_registration_features_offer - name: users_clicking_registration_features_offer
category: growth category: growth
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment