Skip to content

Bounty #6: Add Prometheus stale-metric guard to health check#23

Closed
lizhiming454 wants to merge 2 commits into
Soengkit:mainfrom
lizhiming454:bounty-6-prometheus-stale-metric-guard
Closed

Bounty #6: Add Prometheus stale-metric guard to health check#23
lizhiming454 wants to merge 2 commits into
Soengkit:mainfrom
lizhiming454:bounty-6-prometheus-stale-metric-guard

Conversation

@lizhiming454

Copy link
Copy Markdown

Summary

Added a Prometheus staleness guard to the health check tool. The health check now detects and reports Prometheus metrics older than the 5-minute staleness threshold.

Changes

  • Added check_prometheus_staleness() function that fetches /metrics and flags stale entries
  • New -p/--prom-url flag to specify the Prometheus metrics URL
  • Stale metrics appear in results['system']['prometheus_stale_metrics'] in JSON output with: metric name, labels (redacted), value, timestamp, age_seconds, age_readable
  • Backward compatible: all existing flags (--json, --service, etc.) work unchanged
  • Secret redaction applied to metric labels to avoid credential leaks

Testing

python3 -m py_compile tools/health_check.py  # OK
python3 tools/health_check.py --json
python3 build.py

Diagnostic Artifact

Commit: 3774a0c
Password: f1880266ec27193ad5e5

Reassemble: cat diagnostic/build-3774a0c8-part001.logd diagnostic/build-3774a0c8-part002.logd > diagnostic/build-3774a0c8.logd
Decrypt: encryptly unpack diagnostic/build-3774a0c8.logd <outdir> --password f1880266ec27193ad5e5

Diagnostic chunks: diagnostic/build-3774a0c8-part001.logd, diagnostic/build-3774a0c8-part002.logd

- Added check_prometheus_staleness() that fetches /metrics and flags
  metrics with timestamps older than 5 minutes (Prometheus staleness threshold)
- New --prom-url flag to specify Prometheus metrics endpoint
- Added stale_metrics to system section of JSON output with:
  metric name, labels (redacted), value, timestamp, age_seconds, age_readable
- Backward compatible: existing --json and --service flags unchanged
- Secret redaction applied to metric labels to avoid leaking credentials
- Text output shows stale metrics with age in human-readable format
@lizhiming454

Copy link
Copy Markdown
Author

/claim

@Soengkit

Copy link
Copy Markdown
Owner

Thanks for the PR. I am closing this because Soengkit/zeroeye is only my working fork of the upstream repository, not an official bounty intake or payment queue. The fork parent/source is NemoMi/zeroeye: https://github.com/NemoMi/zeroeye. Please use the upstream owner current process for any submission or claim, and do not post payment details here.

@Soengkit Soengkit closed this Jun 23, 2026
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.

2 participants