Migrate expiration policy metrics
What does this MR do and why?
This MR migrate counts.projects_with_expiration_policy_enabled(_with_cadence*)
metrics family to instrumentation class.
It resolves part of the metrics included in #339315 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Setup (optional)
::ContainerExpirationPolicy.limit(30).update_all(enabled: true)
::ContainerExpirationPolicy.cadence_options.keys.each_with_index do |value, idx|
::ContainerExpirationPolicy.active.offset(idx * 5).limit(5).update_all(cadence: value)
end
Verfication
payload = ServicePing::BuildPayload.new.execute
puts "enabled: #{payload["counts"]["projects_with_expiration_policy_enabled"]}"
puts "enabled with cadence_set_to_3month: #{payload["counts"]["projects_with_expiration_policy_enabled_with_cadence_set_to_3month"]}"
puts "enabled with cadence_set_to_1month: #{payload["counts"]["projects_with_expiration_policy_enabled_with_cadence_set_to_1month"]}"
puts "enabled with cadence_set_to_1d: #{payload["counts"]["projects_with_expiration_policy_enabled_with_cadence_set_to_1d"]}"
puts "enabled with cadence_set_to_7d: #{payload["counts"]["projects_with_expiration_policy_enabled_with_cadence_set_to_7d"]}"
puts "enabled with cadence_set_to_14d: #{payload["counts"]["projects_with_expiration_policy_enabled_with_cadence_set_to_14d"]}"
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Mikołaj Wawrzyniak