Skip to content

Update ProcessLicenseUsageDataService to Save Add-on Metrics to Seat Links

Background

We currently track add-on metrics as part of seat link records for online cloud licenses to provide visibility into Duo seat adoption for Self-Managed customers.

Now that offline cloud license customers can purchase Duo Enterprise, we will need to capture this same adoption data from these users and ensure these metrics are part of the offline license data sharing process.

In order to allow the offline cloud license usage export file to contain these add-on metrics, we will need to start tracking this as part of GitLab's historical license data.

Problem

After gitlab#551173 is complete, add-on metrics will be saved to the GitLab historical license data in the same format as the add-on metrics saved during online cloud license seat link syncs. The HistoricalUserData::CsvService in GitLab will then be updated in gitlab#551177 to add a new Add-on Metrics column to the license usage CSV export for the historical data rows.

Today, when the customer sends their export CSV via email, the ProcessLicenseUsageDataService in CustomersDot will parse the CSV and iterate through each of the generated arrays to convert into a hash.

The problem is this processing is not flexible enough to handle additional columns for the historical data rows. For example, without the new Add-on Metrics column, an array parsed from the CSV for one of the historical data rows could look like the following:

# Date, Billable User Count
[ "2025-06-18 12:00:26", "46"]

convert_to_hash will then generate:

{ "2025-06-18 12:00:26" => "46" }

With the addition of the Add-on Metrics column, we would have an array that would look like:

# Date, Billable User Count, Add-on Metrics
[ "2025-06-18 12:00:26", "46", "[{\"add_on_type\":\"duo_core\",\"assigned_seats\":0,\"purchased_seats\":200}]" ]

convert_to_hash only assigns the first entry as the key to the second entry as the value, and will end up ignoring the third entry which contains the add-on metrics

Proposal

The ProcessLicenseUsageDataService in CustomersDot will need to be updated to allow saving these add-on metrics to the seat link records that are generated from the CSV data.

We will also need to ensure that it remains backwards compatible for older GitLab versions that would not be sending these add-on metrics as part of their offline license usage exports.

Edited by Valerie Burton