Bounty #6: Add Prometheus stale-metric guard to health check#23
Closed
lizhiming454 wants to merge 2 commits into
Closed
Bounty #6: Add Prometheus stale-metric guard to health check#23lizhiming454 wants to merge 2 commits into
lizhiming454 wants to merge 2 commits into
Conversation
- 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
Author
|
/claim |
Owner
|
Thanks for the PR. I am closing this because |
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
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
check_prometheus_staleness()function that fetches /metrics and flags stale entries-p/--prom-urlflag to specify the Prometheus metrics URLresults['system']['prometheus_stale_metrics']in JSON output with: metric name, labels (redacted), value, timestamp, age_seconds, age_readable--json,--service, etc.) work unchangedTesting
Diagnostic Artifact
Commit: 3774a0c
Password:
f1880266ec27193ad5e5Reassemble:
cat diagnostic/build-3774a0c8-part001.logd diagnostic/build-3774a0c8-part002.logd > diagnostic/build-3774a0c8.logdDecrypt:
encryptly unpack diagnostic/build-3774a0c8.logd <outdir> --password f1880266ec27193ad5e5Diagnostic chunks: diagnostic/build-3774a0c8-part001.logd, diagnostic/build-3774a0c8-part002.logd