Skip to content

Add the Query Apdex Prometheus metric to usage ping

What does this MR do?

Related issue: #227305 (closed)

Depends on: !39206 (merged) and omnibus-gitlab!4489 (merged)

This MR adds a new field query_apdex_weekly_average to the topology Usage Ping sent from customer's Omnibus deployments.

We pull this value from the gitlab_usage_ping:sql_duration_apdex:ratio_rate5m pre-recorded Prometheus ratio (defined in omnibus-gitlab!4489 (merged)) and calculate the rolling 7 day average (avg_over_time for 1w).

It will be used to compute the Database Product Performance Indicator: Query apdex with 100ms target, 250ms tolerable.

Feature Showcase

Initialization: run a local GitLab instance (with the updates from omnibus-gitlab!4489 (merged)) and the connected Prometheus for ~30 minutes, while generating queries, clicking on pages, etc

The local prometheus records correctly the rule:

image

Generating manually the usage ping also reports correctly the new metric:

image

  • (not that I was not running the node exporter hence the missing metrics for the rest of the topology usage data)*

The same while manually checking the updated methods in rails console:

[2] pry(main)> top = Gitlab::UsageData::Topology.new
[3] pry(main)> top.topology_usage_data
=> {:topology=>
  {:query_apdex_weekly_average=>0.9764369406622733,
   :nodes=>[],
   :duration_s=>0.12191600000005565,
   :failures=>
    [{"app_requests"=>"empty_result"},
     {"node_memory"=>"empty_result"},
     {"node_memory_utilization"=>"empty_result"},
     {"node_cpus"=>"empty_result"},
     {"node_cpu_utilization"=>"empty_result"},
     {"node_uname_info"=>"empty_result"},
     {"service_rss"=>"empty_result"},
     {"service_uss"=>"empty_result"},
     {"service_pss"=>"empty_result"},
     {"service_process_count"=>"empty_result"},
     {"service_workers"=>"empty_result"}]}}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Yannis Roussos

Merge request reports

Loading