Skip to content

Instrument metric: count of projects with active SLA countdown timer

Sean Arnold requested to merge 255986-metric-incident-sla-enabled into master

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

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

Related to #255986 (closed)

Edited by Peter Leitzen

Merge request reports