正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。

Activation engine

一貫した開発プロセスとドキュメントを確保するため、GitLabへのすべての貢献は英語で提出する必要があります。そのため、GitLabへの貢献に関するドキュメント(https://docs.gitlab.com/development/に掲載)も英語でのみ提供されています。

以下を希望される場合:

  • コードの貢献を提出する
  • バグの報告または修正
  • 機能や改善の提案
  • ドキュメントへの貢献

これらのページの英語版のガイドラインに従ってください。

このページの英語版にアクセスしてください。

The activation engine tracks user activation milestones (Setup, Aha, Habit) for personalization experiments on GitLab.com. It integrates with the internal events system through the extra_trackers mechanism, following the same pattern used by AI tracking (ee/lib/gitlab/tracking/ai_tracking.rb) and contribution analytics tracking (lib/gitlab/tracking/contribution_analytics_tracking.rb).

The activation engine is EE-only and gated behind the activation_tracking feature flag (:wip type).

Architecture

When application code calls Gitlab::InternalEvents.track_event, the internal events router reads the event YAML definition. If the definition includes an extra_trackers entry for Gitlab::Tracking::ActivationTracking, the router calls ActivationTracking.track_event. That adapter delegates to Activation::Metric.track, which writes a record to the activation_metrics table.

flowchart LR
  A["Gitlab::InternalEvents.track_event"] --> B["Event YAML<br/>(extra_trackers)"]
  B --> C["ActivationTracking.track_event"]
  C --> D["Activation::Metric.track"]
  D --> E["activation_metrics table"]

The activation_metrics table stores one record per user, per metric, per namespace. A database-level unique constraint (with NULLS NOT DISTINCT) prevents duplicate records.

ComponentPathPurpose
Tracking adapteree/lib/gitlab/tracking/activation_tracking.rbReceive events from the Internal Events router and delegate to the model.
Event definitionee/config/events/merged_mr.ymlDeclare extra_trackers to wire an internal event to activation tracking.
Modelee/app/models/activation/metric.rbRecord, query, and check activation metrics.
Finderee/app/finders/activation/metrics_finder.rbFilter metrics by user, namespace, and metric type.
Feature flagee/config/feature_flags/wip/activation_tracking.ymlControls whether tracking is active.
Factoryee/spec/factories/activation/metrics.rbTest factory for activation_metric.

Available metric types

Metric types are defined in the Activation::Metric enum. Each enum value corresponds to an internal event name routed through ActivationTracking. For example, the merged_mr event defined in ee/config/events/merged_mr.yml maps to the merged_mr enum value.

enum :metric, {
  merged_mr: 0
}

To add a new metric type, see the quick start guide.

Guides