From 72feafb359abf4ab83db91fb4964312d81f99aea Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Fri, 25 Sep 2026 15:59:37 -0400 Subject: [PATCH] Give each Ceph HEALTH_WARN its own dedup ticket (#112) Every HEALTH_WARN other than four known types hashed with an empty subtype, so unrelated cluster warnings (noout, nearfull, mon space, insecure keys, MDS standby, ...) all collapsed onto one ticket. Each run the reported warnings overwrote its title in turn, writing ~47k title-flip audit rows on ticket 221040637. Unknown warnings now key on Ceph's health-check code when the reporter sends one (optional `check_code` payload field, e.g. OSDMAP_FLAGS), else on the warning text before its first colon with counts stripped, so "3 pool(s) nearfull" and "4 pool(s) nearfull" stay one ticket. Known subtypes hash exactly as before. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01MGDKHiU5RJdo3dqQUDow3X --- create_ticket_api.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/create_ticket_api.php b/create_ticket_api.php index 0809d1e..290f972 100644 --- a/create_ticket_api.php +++ b/create_ticket_api.php @@ -159,6 +159,23 @@ function generateTicketHash($data) } } elseif (stripos($title, 'HEALTH_ERR') !== false) { $issueSubtype = 'health_err'; + } else { + // Any other warning gets its own ticket. Previously every other + // HEALTH_WARN shared one empty subtype, so unrelated warnings + // (noout, nearfull, insecure keys, ...) collapsed onto a single + // ticket and overwrote its title in turn every run (#112). + // Prefer Ceph's own health-check code when the reporter sends + // it; otherwise key on the warning text with counts stripped. + $checkCode = isset($data['check_code']) && is_string($data['check_code']) ? $data['check_code'] : ''; + if ($checkCode !== '' && preg_match('/^[A-Z0-9_]{1,64}$/', $checkCode)) { + $issueSubtype = 'check_' . strtolower($checkCode); + } elseif (preg_match('/HEALTH_WARN:\s*([^\[]+)/i', $title, $warnMatch)) { + $warnText = strtolower(explode(':', $warnMatch[1])[0]); + $warnText = trim(preg_replace('/[^a-z]+/', '_', $warnText), '_'); + if ($warnText !== '') { + $issueSubtype = 'warn_' . $warnText; + } + } } }