Add telemetry events for agent profile usage and configuration (#56054)

Release Notes:

- N/A
This commit is contained in:
María Craig authored and GitHub committed 2026-05-07 14:41:30 +00:00
1 parent 5c0b33f72e
commit 07c1943b43
2 files changed
+30 -1

No files matched your search

@@ -218,6 +218,11 @@ impl ManageProfilesModal {
window: &mut Window,
cx: &mut Context<Self>,
) {
telemetry::event!(
"Agent Profile Default Model Configured",
profile_id = profile_id.as_str(),
is_builtin = builtin_profiles::is_builtin(&profile_id)
);
let fs = self.fs.clone();
let profile_id_for_closure = profile_id.clone();
@@ -314,6 +319,11 @@ impl ManageProfilesModal {
window: &mut Window,
cx: &mut Context<Self>,
) {
telemetry::event!(
"Agent Profile MCPs Configured",
profile_id = profile_id.as_str(),
is_builtin = builtin_profiles::is_builtin(&profile_id)
);
let settings = AgentSettings::get_global(cx);
let Some(profile) = settings.profiles.get(&profile_id).cloned() else {
return;
@@ -350,6 +360,11 @@ impl ManageProfilesModal {
window: &mut Window,
cx: &mut Context<Self>,
) {
telemetry::event!(
"Agent Profile Tools Configured",
profile_id = profile_id.as_str(),
is_builtin = builtin_profiles::is_builtin(&profile_id)
);
let settings = AgentSettings::get_global(cx);
let Some(profile) = settings.profiles.get(&profile_id).cloned() else {
return;
@@ -398,9 +413,16 @@ impl ManageProfilesModal {
Mode::ChooseProfile { .. } => {}
Mode::NewProfile(mode) => {
let name = mode.name_editor.read(cx).text(cx);
let base_profile_id = mode.base_profile_id.clone();
let profile_id =
AgentProfile::create(name, mode.base_profile_id.clone(), self.fs.clone(), cx);
AgentProfile::create(name, base_profile_id.clone(), self.fs.clone(), cx);
telemetry::event!(
"Agent Profile Created",
profile_id = profile_id.as_str(),
is_fork = base_profile_id.is_some(),
base_profile_id = base_profile_id.as_ref().map(|id| id.as_str())
);
self.view_profile(profile_id, window, cx);
}
Mode::ViewProfile(_) => {}
@@ -421,6 +443,8 @@ impl ManageProfilesModal {
return;
}
telemetry::event!("Agent Profile Deleted", profile_id = profile_id.as_str());
let fs = self.fs.clone();
update_settings_file(fs, cx, move |settings, _cx| {
+5
View File
@@ -95,6 +95,11 @@ impl ProfileSelector {
if let Some((next_profile_id, _)) = profiles.get_index(next_index) {
self.provider.set_profile(next_profile_id.clone(), cx);
telemetry::event!(
"Agent Profile Switched",
profile_id = next_profile_id.as_str(),
source = "cycle"
);
cx.notify();
}
}