Skip to content

Enable ServicePing timings reporting

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR is a follow up to !82607 (merged) It turn feature flag measure_service_ping_metric_collection to default enabled after confirming it works on GitLab.com

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  1. Spin up local VersionApp server. If you do not have VersionApp set up locally follow this instruction

  2. Change ServicePing:SubmitService to point to your local development VersionApp instance

diff --git a/app/services/service_ping/submit_service.rb b/app/services/service_ping/submit_service.rb
index 64793f5072c..e8236f9142d 100644
--- a/app/services/service_ping/submit_service.rb
+++ b/app/services/service_ping/submit_service.rb
@@ -102,6 +102,7 @@ def save_raw_usage_data(usage_data)
     # See https://gitlab.com/gitlab-org/gitlab/-/issues/233615 for details
     def base_url
       Rails.env.production? ? PRODUCTION_BASE_URL : STAGING_BASE_URL
+      'http://localhost:3000'
     end
   end
 end
  1. In rails console $ bin/rails c trigger ServicePing report
[1] pry(main)> ServicePing::SubmitService.new.execute
  1. Look for incoming request to /usage_ping_metadata output in VersionApp
Started POST "/usage_ping_metadata" for ::1 at 2022-04-07 13:30:44 +0200
Processing by UsagePingMetadataController#create as HTML
  Parameters: {"metadata"=>{"metrics"=>[{"name"=>"version", "time_elapsed"=>3.00002284348011e-06}, {"name"=>"installation_type", "time_elapsed"=>8.999952115118504e-06}, {"name"=>"settings.ldap_encrypted_secrets_enabled", "time_elapsed"=>0.0013879999751225114}, {"name"=>"settings.smtp_encrypted_secrets_enabled", "time_elapsed"=>0.0005740000633522868}, {"name"=>"settings.operating_system", "time_elapsed"=>0.6089230000507087}, {"name"=>"settings.gitaly_apdex", "time_elapsed"=>0.012181999976746738}, {"name"=>"counts.assignee_lists", "time_elapsed"=>0.027057999977841973}, {"name"=>"counts.ci_builds", "time_elapsed"=>0.03883099998347461}, {"name"=>"counts.ci_internal_pipelines", "time_elapsed"=>0.029631000012159348},
....
{"name"=>"counts.assignee_lists", "time_elapsed"=>0.027057999977841973}, {"name"=>"counts.ci_builds", "time_elapsed"=>0.03883099998347461}, {"name"=>"counts.ci_internal_pipelines", "time_elapsed"=>0.029631000012159348}, {"name"=>"counts.ci_external_pipelines", "time_elapsed"=>0.014370999997481704}]
Completed 201 Created in 21ms (ActiveRecord: 0.0ms | Allocations: 37391)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Mikołaj Wawrzyniak

Merge request reports