Give each Ceph HEALTH_WARN its own dedup ticket (#112)
Lint / PHP (phpcs PSR-12) (push) Successful in 51s
Lint / JS (eslint) (push) Successful in 13s
Lint / PHP requirements (version + extensions) (push) Successful in 39s
Lint / Notify on failure (push) Skipped
Security / PHP Security (semgrep) (push) Successful in 1m36s
Lint / Deploy (push) Successful in 3s
Lint / PHP (phpcs PSR-12) (push) Successful in 51s
Lint / JS (eslint) (push) Successful in 13s
Lint / PHP requirements (version + extensions) (push) Successful in 39s
Lint / Notify on failure (push) Skipped
Security / PHP Security (semgrep) (push) Successful in 1m36s
Lint / Deploy (push) Successful in 3s
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MGDKHiU5RJdo3dqQUDow3X
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user