Skip to content

Fix HighMemoryUsage alert ratio expression - #36

Open
louiss72 wants to merge 2 commits into
weilixiong:mainfrom
louiss72:agent/fix-high-memory-alert-1
Open

Fix HighMemoryUsage alert ratio expression#36
louiss72 wants to merge 2 commits into
weilixiong:mainfrom
louiss72:agent/fix-high-memory-alert-1

Conversation

@louiss72

Copy link
Copy Markdown

Summary

Fixes #1.

The recommended HighMemoryUsage alert no longer divides process_resident_memory_bytes by itself. It now compares process resident memory against machine_memory_bytes, matching the existing memory usage recording rule denominator and making the alert reflect actual memory pressure.

Changes

  • Updated HighMemoryUsage from process_resident_memory_bytes / process_resident_memory_bytes > 0.9 to process_resident_memory_bytes / machine_memory_bytes > 0.9.
  • Added find_self_dividing_metrics() / validate_alert_rule_expressions() to catch self-dividing alert expressions before upload/dry-run output.
  • Added --validate-rules so the built-in alert rules can be checked without a live Prometheus or Alertmanager instance.
  • Committed the required diagnostic artifacts:
    • diagnostic/build-bbea7080.json
    • diagnostic/build-bbea7080-part001.logd
    • diagnostic/build-bbea7080-part002.logd
    • diagnostic/build-bbea7080-part003.logd
    • diagnostic/build-bbea7080-part004.logd
    • diagnostic/build-bbea7080-part005.logd

Testing

  • python3 -m py_compile tools/monitoring_setup.py passed.
  • python3 tools/monitoring_setup.py --validate-rules passed.
  • python3 tools/monitoring_setup.py --alerts --dry-run confirmed HighMemoryUsage renders as process_resident_memory_bytes / machine_memory_bytes > 0.9.
  • git diff --check passed before committing.
  • python3 build.py was run as required and generated the committed diagnostic artifacts.

python3 build.py result: exited 1 in this local macOS runner because required cross-language build tools are unavailable or incompatible here. The diagnostic metadata records the details: missing cargo, go, cmake, luac, ghc, missing Java runtime, and the C build hitting Linux-specific MAP_HUGETLB on macOS. Frontend and v2-market-stream passed.

Diagnostic decrypt note from build.py:

cat diagnostic/build-bbea7080-part001.logd diagnostic/build-bbea7080-part002.logd diagnostic/build-bbea7080-part003.logd diagnostic/build-bbea7080-part004.logd diagnostic/build-bbea7080-part005.logd > diagnostic/build-bbea7080.logd
encryptly unpack diagnostic/build-bbea7080.logd <outdir> --password 9c0bdbdc6cee9c65620a

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

Payout: I can receive XMR or common EVM-chain stablecoins. Preferred XMR address:
4DSQMNzzq46N1z2pZWAVdeA6JvUL9TCB2bnBiA3ZzoqEdYJnMydt5akCa3vtmapeDsbVKGPFdNkzqTcJS8M8oyK7WGjNk99k1B6CoKjvH5

EVM/BSC/ERC-20 address if the bounty is paid that way:
0x2f8081562ac67467d1cbd40ab3120849c1f587da

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