Skip to content

Instrument Service Ping metric for number of Duo seats assigned

What does this MR do and why?

The code changes introduce a new metric to track the number of Duo seats purchased and assigned to users.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Make sure you have Team Member License or any other active subscription active.
  2. Make sure you have active Duo pro add on
GitlabSubscriptions::AddOnPurchase.for_gitlab_duo_pro.active.any?
# Or
GitlabSubscriptions::AddOnPurchase.for_duo_enterprise.active.any?
  1. Run rails c and generate service ping locally
> q = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values)
> q["duo_seats"]
=> {"pro"=>{"seats"=>10, "assigned"=>0}, "enterprise"=>{"seats"=>nil, "assigned"=>nil}}

Related to #477583 (closed)

Edited by Niko Belokolodov

Merge request reports

Loading