Skip to content

Add instrumentation classes for projects_with_alerts_created metric

What does this MR do and why?

This MR add missing instrumentation class for projects_with_alerts_created metrics and removes the according code from usage_data

Db review

CountProjectsWithAlertsCreatedMetric#8 will generate the below queries.

Query without time range (all):
SELECT COUNT(DISTINCT(project_id)) FROM alert_management_alerts;

Query analyses: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/19341/commands/63885 (internal link)

Time: 30.473 s
  - planning: 0.185 ms
  - execution: 30.473 s
    - I/O read: 23.287 s
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 349595 (~2.70 GiB) from the buffer pool
  - reads: 55899 (~436.70 MiB) from the OS file cache, including disk I/O
  - dirtied: 93 (~744.00 KiB)
  - writes: 0

Temp buffers:
  - reads: 21346 (~166.80 MiB)
  - writes: 21349 (~166.80 MiB)
Query with time range (28d):
SELECT COUNT(DISTINCT "alert_management_alerts"."id") FROM "alert_management_alerts" WHERE "alert_management_alerts"."created_at" BETWEEN '2023-05-10 09:02:08.103116' AND '2023-06-07 09:02:08.103183'

Query Analyses: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/19341/commands/63889

Time: 4.754 s
  - planning: 0.243 ms
  - execution: 4.753 s
    - I/O read: 0.000 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 2246393 (~17.10 GiB) from the buffer pool
  - reads: 0 from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

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

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 #409632 (closed)

Edited by Prabakaran Murugesan

Merge request reports