Skip to content

Add instrumentation for resource group usage

If GDK is accessible, an alternative to using this guide is to directly establish event/metric definitions using our internal events generator

Objective

We need instrumentation for resource groups to know more about feature adoption and usage

Questions we'd like to answer:

  • What percentage of pipelines use resource groups?
  • How many resource groups are used per pipeline (when resource groups are used)?
  • How many projects run pipelines with resource groups?
  • What pricing tier do our users belong to?
  • How often (at what frequency) are jobs with resource groups run? (same project, same resource group)
  • Do jobs with resource groups use environments too?
  • What process_mode do resource groups use?

Events and Metrics

Definition of events and metrics | Sample metrics | Sample events

Details of events to be tracked:

Event Description Event Name Additional Properties Feature
A job with a resource group defined starts in a CI pipeline job_with_resource_group_created_in_pipeline project, root project group, pricing tier, process mode of resource group, pipeline id, job created datetime, name of resource group, job id, environment id (if exists) Pipeline Resource Groups - What percentage of pipelines use resource groups? How many projects run pipelines with resource groups? What pricing tier do our users belong to? How many resource groups are used per pipeline (when resource groups are used)? How often (at what frequency) are jobs with resource groups run? (same project, same resource group)
Job with environment defined starts in a CI pipeline job_with_environment_created_in_pipeline (this might already exist) project, root project group, pricing tier, pipeline id, job created datetime, job id, environment id, name of resource group (if exists) Pipeline Resource Groups - Do jobs with resource groups use environments too?

Details of metrics to be tracked:

Metric Description Event / DB column to base the Metric on Total or Unique Count of a Property Time Frame Feature
What percentage of pipelines use resource groups? job_with_resource_group_created_in_pipeline total dotcom - daily; other - monthly Pipeline Resource Groups
How many resource groups are used per pipeline (when resource groups are used)? job_with_resource_group_created_in_pipeline ? monthly Pipeline Resource Groups
How many projects run pipelines with resource groups? job_with_resource_group_created_in_pipeline per project dotcom - daily; other - monthly Pipeline Resource Groups
What pricing tier do our users belong to? job_with_resource_group_created_in_pipeline ? other - monthly Pipeline Resource Groups
How often (at what frequency) are jobs with resource groups run? (same project, same resource group) job_with_resource_group_created_in_pipeline Pipeline Resource Groups
Do jobs with resource groups use environments too? job_with_resource_group_created_in_pipeline and job_with_environment_created_in_pipeline ratio? monthly Pipeline Resource Groups
What process_mode do resource groups use? job_with_resource_group_created_in_pipeline ? monthly Pipeline Resource Groups

Expand to view examples and guidelines for filling the table

Events:
  • Description: Include what the event is supposed to track, where and when.
  • Name: Primary identifier of the event, format: <action>_<target_of_action>_<where/when>
    • Example event name: click_save_button_in_issue_description_within_15s_of_page_load (action = click ; target = save button; where = in issue description ; when = within 15s
  • **Additional properties: Besides user/project/namespace, what other details should be tracked, if any? ex) status, type, object id, etc.
  • Feature: What feature is being instrumented? Please use the feature title that is used in features.yml if thats already available.

Metrics:

  • Description: What quantitative measurements derived from either event data or database columns would you like to track? eg: Weekly count of unique users who update an issue
  • Event/DB column: What event or database column should the metric count or be based on.
  • Total or unique count: Should the metric count all occurrences or only unique counts, e.g. of user_id to get a count of unique users triggering an event.
  • Time Frame: What time frames should be tracked. Default and recommended is 7d and 28d.

Next steps

Important links

Quick start guide to internal events

Analytics Instrumentation slack channel for questions

Try our internal events generator. Creating event and metric definition files has never been easier.

Edited by Viktor Nagy (GitLab)