From 685df39d8f50dc00b634a25458d82d7e13a4d063 Mon Sep 17 00:00:00 2001 From: Taka Nishida Date: Fri, 13 Jun 2025 15:22:48 +0900 Subject: [PATCH 1/3] Define new event "register_agentw_at_kas" --- config/events/register_agent_at_kas.yml | 2 +- config/events/register_agentw_at_kas.yml | 25 +++++++++++++++++++ ...project_id_from_register_agentw_at_kas.yml | 23 +++++++++++++++++ .../count_total_register_agentw_at_kas.yml | 22 ++++++++++++++++ lib/api/internal/kubernetes.rb | 1 + 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 config/events/register_agentw_at_kas.yml create mode 100644 config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml create mode 100644 config/metrics/counts_all/count_total_register_agentw_at_kas.yml diff --git a/config/events/register_agent_at_kas.yml b/config/events/register_agent_at_kas.yml index 5c9eabfaa7b243..8be4db6b364047 100644 --- a/config/events/register_agent_at_kas.yml +++ b/config/events/register_agent_at_kas.yml @@ -1,5 +1,5 @@ --- -description: Agents send the register request to KAS periodically (default every 5 min). KAS registers the agent to keep track of connected agents. +description: Gitlab Agent for Kubernetes (agentk) registered at KAS internal_events: true action: register_agent_at_kas identifiers: diff --git a/config/events/register_agentw_at_kas.yml b/config/events/register_agentw_at_kas.yml new file mode 100644 index 00000000000000..9ac570a3616ce7 --- /dev/null +++ b/config/events/register_agentw_at_kas.yml @@ -0,0 +1,25 @@ +--- +description: Gitlab Agent for Workspace (agentw) registered at KAS +internal_events: true +status: active +action: register_agentw_at_kas +identifiers: +- project +- namespace +- user +additional_properties: + label: + description: Gitlab Agent version + property: + description: CPU architecture of the agent, e.g. x86_64 + value: + description: GitLab Agent unique id +product_group: environments +product_categories: +- continuous_delivery +milestone: '18.2' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/194418 +tiers: +- free +- premium +- ultimate diff --git a/config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml b/config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml new file mode 100644 index 00000000000000..0a3461dee9f90b --- /dev/null +++ b/config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml @@ -0,0 +1,23 @@ +--- +key_path: redis_hll_counters.count_distinct_project_id_from_register_agentw_at_kas +description: Count of unique projects that GitLab agent workspace (agentw) was registered at KAS +product_group: environments +product_categories: +- continuous_delivery +performance_indicator_type: [] +value_type: number +status: active +milestone: '18.2' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/194418 +time_frame: +- 28d +- 7d +data_source: internal_events +data_category: optional +tiers: +- free +- premium +- ultimate +events: +- name: register_agentw_at_kas + unique: project.id diff --git a/config/metrics/counts_all/count_total_register_agentw_at_kas.yml b/config/metrics/counts_all/count_total_register_agentw_at_kas.yml new file mode 100644 index 00000000000000..a51c91fe3e9090 --- /dev/null +++ b/config/metrics/counts_all/count_total_register_agentw_at_kas.yml @@ -0,0 +1,22 @@ +--- +key_path: counts.count_total_register_agentw_at_kas +description: Count of Gitlab agent workspace (agentw) registered at KAS +product_group: environments +product_categories: +- continuous_delivery +performance_indicator_type: [] +value_type: number +status: active +milestone: '18.2' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/194418 +time_frame: +- 28d +- 7d +data_source: internal_events +data_category: optional +tiers: +- free +- premium +- ultimate +events: +- name: register_agentw_at_kas diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb index 0db9484d3f0bba..f1564b14cecbbd 100644 --- a/lib/api/internal/kubernetes.rb +++ b/lib/api/internal/kubernetes.rb @@ -168,6 +168,7 @@ class Kubernetes < ::API::Base optional :register_agent_at_kas, type: Array, desc: 'An array of events that indicate an agent has been registered' do optional :project_id, type: Integer, desc: 'Project ID' optional :agent_version, type: String, desc: 'Agent version' + optional :agent_type, type: String, desc: 'Agent type' optional :architecture, type: String, desc: 'CPU architecture of the agent' optional :agent_id, type: Integer, desc: 'Agent ID' optional :kubernetes_version, type: String, desc: 'Kubernetes version of the agent' -- GitLab From 814001c258f584ea5e8bda8f108edb238a08bb92 Mon Sep 17 00:00:00 2001 From: Taka Nishida Date: Mon, 16 Jun 2025 13:55:33 +0900 Subject: [PATCH 2/3] Remove agent_type field --- lib/api/internal/kubernetes.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb index f1564b14cecbbd..0db9484d3f0bba 100644 --- a/lib/api/internal/kubernetes.rb +++ b/lib/api/internal/kubernetes.rb @@ -168,7 +168,6 @@ class Kubernetes < ::API::Base optional :register_agent_at_kas, type: Array, desc: 'An array of events that indicate an agent has been registered' do optional :project_id, type: Integer, desc: 'Project ID' optional :agent_version, type: String, desc: 'Agent version' - optional :agent_type, type: String, desc: 'Agent type' optional :architecture, type: String, desc: 'CPU architecture of the agent' optional :agent_id, type: Integer, desc: 'Agent ID' optional :kubernetes_version, type: String, desc: 'Kubernetes version of the agent' -- GitLab From 11036406fdb0224c780e677931ad3dad1e849cda Mon Sep 17 00:00:00 2001 From: Taka Nishida Date: Mon, 16 Jun 2025 14:00:06 +0900 Subject: [PATCH 3/3] Minor fix for texts --- config/events/register_agentw_at_kas.yml | 4 ++-- .../count_distinct_project_id_from_register_agentw_at_kas.yml | 2 +- .../metrics/counts_all/count_total_register_agentw_at_kas.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/events/register_agentw_at_kas.yml b/config/events/register_agentw_at_kas.yml index 9ac570a3616ce7..5148273868d6f8 100644 --- a/config/events/register_agentw_at_kas.yml +++ b/config/events/register_agentw_at_kas.yml @@ -1,5 +1,5 @@ --- -description: Gitlab Agent for Workspace (agentw) registered at KAS +description: GitLab Agent for Workspace (agentw) registered at KAS internal_events: true status: active action: register_agentw_at_kas @@ -9,7 +9,7 @@ identifiers: - user additional_properties: label: - description: Gitlab Agent version + description: GitLab Agent version property: description: CPU architecture of the agent, e.g. x86_64 value: diff --git a/config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml b/config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml index 0a3461dee9f90b..21505e2eb3d426 100644 --- a/config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml +++ b/config/metrics/counts_all/count_distinct_project_id_from_register_agentw_at_kas.yml @@ -1,6 +1,6 @@ --- key_path: redis_hll_counters.count_distinct_project_id_from_register_agentw_at_kas -description: Count of unique projects that GitLab agent workspace (agentw) was registered at KAS +description: Count of unique projects that GitLab Agent for Workspace (agentw) was registered at KAS product_group: environments product_categories: - continuous_delivery diff --git a/config/metrics/counts_all/count_total_register_agentw_at_kas.yml b/config/metrics/counts_all/count_total_register_agentw_at_kas.yml index a51c91fe3e9090..301004c1c6712f 100644 --- a/config/metrics/counts_all/count_total_register_agentw_at_kas.yml +++ b/config/metrics/counts_all/count_total_register_agentw_at_kas.yml @@ -1,6 +1,6 @@ --- key_path: counts.count_total_register_agentw_at_kas -description: Count of Gitlab agent workspace (agentw) registered at KAS +description: Count of GitLab Agent for Workspace (agentw) registered at KAS product_group: environments product_categories: - continuous_delivery -- GitLab