Strip volatile SMART counters from ticket title to stop comment spam
Power_On_Hours and other SMART counters embedded in the issue string were included verbatim in the ticket title. Since the count increments every hour, the title was "new" on every run, triggering a title-update comment every single cycle (307 spam comments on two tickets). Strip ': Warning <attr>: <N>' / ': Critical <attr>: <N>' suffixes from the title before building the ticket payload. Counter values are still fully captured in the ticket description. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1919,6 +1919,10 @@ class SystemHealthMonitor:
|
|||||||
clean_issue = clean_issue.replace('[cluster-wide] ', '').replace('[cluster-wide]', '')
|
clean_issue = clean_issue.replace('[cluster-wide] ', '').replace('[cluster-wide]', '')
|
||||||
# Remove [ceph] marker since _categorize_issue adds it as issue_tag
|
# Remove [ceph] marker since _categorize_issue adds it as issue_tag
|
||||||
clean_issue = clean_issue.replace('[ceph] ', '').replace('[ceph]', '')
|
clean_issue = clean_issue.replace('[ceph] ', '').replace('[ceph]', '')
|
||||||
|
# Strip ever-changing SMART counters from the title so the title stays
|
||||||
|
# stable across runs and doesn't trigger hourly "Title updated" comment spam.
|
||||||
|
# The counter values are already captured in the ticket description.
|
||||||
|
clean_issue = re.sub(r':\s*(?:Warning|Critical)\s+\w+:\s*\d+', '', clean_issue).strip(': ').strip()
|
||||||
|
|
||||||
# Extract drive capacity if this is a drive-related issue.
|
# Extract drive capacity if this is a drive-related issue.
|
||||||
# Issue strings now use serial numbers; find the matching drive by serial.
|
# Issue strings now use serial numbers; find the matching drive by serial.
|
||||||
|
|||||||
Reference in New Issue
Block a user