Remove the billing_event_tracking feature flag
What does this MR do and why?
Removes the billing_event_tracking feature flag (type: development, default_enabled: false, introduced in 19.2 by !240688 (merged)).
Cause. Gitlab::BillingEvents::Client#record_usage returned early unless the flag was enabled or local persistence applied:
return unless Feature.enabled?(:billing_event_tracking, :instance) || local_persistence_enabled?Local persistence only covers offline and legacy licences (!259911 (merged)). A self-managed instance on an online cloud licence hit neither branch, so every Secrets Manager billing event was dropped before it reached the collector. GitLab.com was unaffected only because the flag is enabled there through ChatOps.
Fix.
- Drop the guard in
lib/gitlab/billing_events/client.rband deleteconfig/feature_flags/development/billing_event_tracking.yml. The local-persistence path and the offlineemission_enabled?check are unchanged. - Move the invalid-quantity warning into a small
warn_invalid_quantityhelper, so the remaining guard is a one-linereturn ... if. Without this,Cop/LineBreakAroundConditionalBlockflags theifthat now directly follows the multi-line method signature. The behaviour is the same. - Remove the "flag disabled" contexts from the CE and EE client specs, and add an EE spec that an instance on an online cloud licence emits to the collector and does not persist locally.
- Update
billing_events_tracking.md, which still referred to the flag.
Scope / blast radius. Secrets Manager is the only caller of the billing client on master (SecretsReadEmitter, SecretsStoredEmitter). No extra queries or new code paths. Self-managed online instances now emit the same Snowplow billing event GitLab.com already emits.
Resolves https://gitlab.com/gitlab-org/gitlab/-/issues/632809
References
- Release readiness: https://gitlab.com/gitlab-org/gitlab/-/work_items/630965
- Secrets Manager flag-removal series (leaves this flag out of scope): !259222 (merged), !260092 (merged), !260110 (merged)
- Air-gapped default-on: !259911 (merged)
- Follow-up: billing events are still dropped when product usage data is disabled: #632871 (closed)
Needs groupanalytics instrumentation approval (flag owner, CE files). If they want to keep a kill switch for the collector, the fallback is converting it to an ops flag with default_enabled: true. Either way, it is on by default for 19.5.
After merge: /chatops gitlab run feature delete billing_event_tracking --dev --pre --staging --staging-ref --production
Screenshots or screen recordings
N/A, backend only.
How to set up and validate locally
- Use a GDK with an online cloud licence (
bin/run cloudin the sandbox), with no override forbilling_event_tracking. - Trigger a CI secret read, or run the secrets stored-count worker.
log/application_json.logshowsBillingEvents: billing event tracked. Before this MR the client returned early and logged nothing.- Air-gapped flow (
bin/run offline): localDailyNamespaceAggregaterows are still written, and no collector attempt is made.
Specs
- New:
ee/spec/lib/ee/gitlab/billing_events/client_spec.rb– "with an online cloud licence emits the event and does not persist it locally". Fails without the fix: with the guard restored and the YAML gone, it raisesFeature::InvalidFeatureFlagError. - Ran every non-feature spec that references the billing client: 163 examples, 0 failures.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.