Instrument metric: count of projects with active SLA countdown timer
What does this MR do?
#255986 (closed)
This adds a new ~"product analytics(telemetry)" metric for devopsmonitor, projects_incident_sla_enabled
.
This provides a count of the number of Projects who have enabled the Incident SLA setting in their Operations Settings.
To do this, a new scope was created which needs database review:
Project.with_enabled_incident_sla
SQL generated by query:
Loading development environment (Rails 6.0.3.3)
[1] pry(main)> Gitlab::UsageData.count(::Project.with_enabled_incident_sla)
(15.0ms) SELECT MIN("projects"."id") FROM "projects" INNER JOIN "project_incident_management_settings" ON "project_incident_management_settings"."project_id" = "projects"."id" WHERE "project_incident_management_settings"."sla_timer" = $1 [["sla_timer", true]]
(0.6ms) SELECT MAX("projects"."id") FROM "projects" INNER JOIN "project_incident_management_settings" ON "project_incident_management_settings"."project_id" = "projects"."id" WHERE "project_incident_management_settings"."sla_timer" = $1 [["sla_timer", true]]
(0.6ms) SELECT COUNT("projects"."id") FROM "projects" INNER JOIN "project_incident_management_settings" ON "project_incident_management_settings"."project_id" = "projects"."id" WHERE "project_incident_management_settings"."sla_timer" = $1 AND "projects"."id" BETWEEN $2 AND $3 [["sla_timer", true], ["id", 21], ["id", 100020]]****
local: 4000+ projects and settings with sla_enabled = true
- Explain (min): database-lab | local
- Explain (max): database-lab | local
- Explain (count): database-lab | local
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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
Related to #255986 (closed)
Edited by Peter Leitzen