Backend: Add event tracking when AI Catalog items are enabled, disabled, etc.
About
We want to add event tracking to our ItemConsumer mutations, which are when projects and groups enable, or disabled. This happens through the create, update, or destroy. We can track enabled state in the additional properties.
Proposal
See https://docs.gitlab.com/development/internal_analytics/internal_event_instrumentation/quick_start/ for technical guide.
Note, the additional_properties keys are recommended to start with label, property and value regardless of the actual meaning of the data https://docs.gitlab.com/development/internal_analytics/internal_event_instrumentation/quick_start/#additional-properties.
Create:
track_internal_event(
"create_ai_catalog_item_consumer",
user: current_user,
project: <project|nil>, # will be nil when associated with group
namespace: <group|nil>, # will be nil when associated with project
additional_properties: {
label: <enabled state>,
property: <locked state>
}
)
Update:
track_internal_event(
"update_ai_catalog_item_consumer",
user: current_user,
project: <project|nil>, # will be nil when associated with group
namespace: <group|nil>, # will be nil when associated with project
additional_properties: {
label: <enabled state>,
property: <locked state>
}
)
Delete:
track_internal_event(
"delete_ai_catalog_item_consumer",
user: current_user,
project: <project|nil>, # will be nil when associated with group
namespace: <group|nil> # will be nil when associated with project)
)
Edited by 🤖 GitLab Bot 🤖