Skip to content

fix: replace self-dividing HighMemoryUsage Prometheus alert expression - #37

Open
Thecesar85 wants to merge 1 commit into
weilixiong:mainfrom
Thecesar85:main
Open

fix: replace self-dividing HighMemoryUsage Prometheus alert expression#37
Thecesar85 wants to merge 1 commit into
weilixiong:mainfrom
Thecesar85:main

Conversation

@Thecesar85

Copy link
Copy Markdown

Summary

Fix the HighMemoryUsage Prometheus alert expression: the previous rule used process_resident_memory_bytes / process_resident_memory_bytes > 0.9 which is self-dividing and always evaluates to 1 for any nonzero value — making the alert useless.

Change: Replace denominator with machine_memory_bytes so the expression compares process resident memory against total machine memory.

Validation

  • python3 -c "import ast; ast.parse(open('tools/monitoring_setup.py').read()); print('Syntax OK')" passes
  • The expression process_resident_memory_bytes / machine_memory_bytes > 0.9 is valid PromQL and fires when memory usage exceeds 90%

Fixes #1

The HighMemoryUsage alert used process_resident_memory_bytes divided by
itself, always evaluating to 1 for any nonzero value. This made the alert
rule useless and prevented it from reflecting real memory pressure.

Fix: change denominator to machine_memory_bytes so the expression compares
process resident memory against total machine memory.

Fixes weilixiong#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$30 BOUNTY] [Python] Fix HighMemoryUsage alert ratio expression

1 participant