Fix HighMemoryUsage alert ratio validation#23
Open
shihuajin111 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the recommended
HighMemoryUsagePrometheus alert so it no longer dividesprocess_resident_memory_bytesby itself. The alert now compares resident process memory tomachine_memory_bytes, matching the existing memory usage recording rule in this monitoring setup.Fixes #1.
Changes
HighMemoryUsageexpression withprocess_resident_memory_bytes / machine_memory_bytes > 0.9.--alerts/--initand callingsys.exit(main()).Testing
python3 -m py_compile tools/monitoring_setup.py- passed.python3 tools/monitoring_setup.py --alerts --dry-run- passed; dry-run output now includesexpr: process_resident_memory_bytes / machine_memory_bytes > 0.9.validate_alert_rules(RECOMMENDED_ALERT_RULES)returns[].validate_alert_rules([{"name": "BadMemory", "expr": "process_resident_memory_bytes / process_resident_memory_bytes > 0.9"}])reports the self-dividing expression.python3 tools/monitoring_setup.py --validate --prometheus-url http://127.0.0.1:1 --alertmanager-url http://127.0.0.1:1printsrecommended alert rules: OKand exits1only because no local Prometheus/Alertmanager is listening on that test port.python3 build.pywas attempted on Windows. It did not reach the diagnostic finalization step becausebuild.pylaunches frontendnpm installassubprocess.run(["npm", ...]); on this Windows environment Node providesnpm.cmd, whichshutil.which("npm")finds butsubprocess.run(["npm", ...])cannot execute directly.python3 build.py -m backendwas run to generate diagnostic artifacts. It exits1because Rust/Cargo is not installed in this environment, and it generated:diagnostic/build-2b54872c.logddiagnostic/build-2b54872c.jsonChecklist