Skip to content
Snippets Groups Projects

Resolve "SaaS Service Ping Metrics Failures causing null UMAU value"

All threads resolved!

What does this MR do and why?

Follow up to !73273 (merged) which scheduled async index creation

Every metric that is calculated based on data coming from database, service collection ServicePing data run actually 3 types of queries under the hood:

  1. Query to locate starting point, where is should begin counting metric from
  2. Query to locate finish point, where counting of metric should be stopped
  3. Query to calculate metric within boundaries of discovered at 1 and 2

Metric usage_activity_by_stage_monthly.manage.events started to time out 1st query since planner used pkey index to look for starting point (see old query) After experimenting on postres.ai it was found out that index on created_at and id combined with dedicated start query should be able to vastly improve metric performance

Database

  1. Old timeouting min query: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7064/commands/24990
  2. Index candidate: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7145/commands/25312
  3. New min query: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7145/commands/25315
  4. New max query https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/7145/commands/25316

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

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Related to #343679 (closed)

Edited by Mikołaj Wawrzyniak

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ethan Urie approved this merge request

    approved this merge request

  • :wave: @eurie, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.

    For more info, please refer to the following links:

  • Ethan Urie requested review from @mwoolf and removed review request for @eurie

    requested review from @mwoolf and removed review request for @eurie

  • Database migrations

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20211103162025 - AddIndexOnEventsUsingBtreeCreatedAtId Post deploy 2.0 s :white_check_mark: +0.00 B

    Migration: 20211103162025 - AddIndexOnEventsUsingBtreeCreatedAtId

    • Type: Post deploy
    • Duration: 2.0 s
    • Database size change: +0.00 B

    Other migrations pending on GitLab.com
    Migration Type Total runtime Result DB size change

    Clone Details

    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-881843 2021-11-09 09:06:30 UTC 2021-11-09 07:59:55 UTC 2021-11-09 21:07:34 +0000

    Artifacts


    Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic

  • Diogo Frazão
  • Max Woolf approved this merge request

    approved this merge request

  • Max Woolf removed review request for @mwoolf

    removed review request for @mwoolf

  • Diogo Frazão removed review request for @dfrazao-gitlab

    removed review request for @dfrazao-gitlab

  • Diogo Frazão requested review from @tigerwnz

    requested review from @tigerwnz

  • Diogo Frazão approved this merge request

    approved this merge request

  • no schema changes; no impact to warehouse

  • Tiger Watson resolved all threads

    resolved all threads

  • Tiger Watson approved this merge request

    approved this merge request

  • added databaseapproved label and removed databasereviewed label

  • Mikołaj Wawrzyniak added 507 commits

    added 507 commits

    Compare with previous version

  • Mikołaj Wawrzyniak resolved all threads

    resolved all threads

  • Mikołaj Wawrzyniak enabled an automatic merge when the pipeline for 5842d468 succeeds

    enabled an automatic merge when the pipeline for 5842d468 succeeds

  • mentioned in commit 43996cb8

  • added workflowcanary label and removed workflowstaging label

  • Jason Plum mentioned in issue #345416

    mentioned in issue #345416

  • added workflowproduction label and removed workflowcanary label

  • Mikołaj Wawrzyniak mentioned in merge request !75722 (merged)

    mentioned in merge request !75722 (merged)

  • Please register or sign in to reply
    Loading