feat: add Prometheus metrics for service and token health#129
Open
zy6p wants to merge 2 commits intoTheSmallHanCat:mainfrom
Open
feat: add Prometheus metrics for service and token health#129zy6p wants to merge 2 commits intoTheSmallHanCat:mainfrom
zy6p wants to merge 2 commits intoTheSmallHanCat:mainfrom
Conversation
Contributor
Author
|
补充说明一下这个 PR 的情况,方便 review: 目前 CI 已通过,分支也已经和 这个 PR 的主要内容是给 Flow2API 增加标准 Prometheus
另外,在接入 Prometheus 指标时发现现有的“今日图片 / 今日视频 / 今日错误”统计存在跨天污染问题。原逻辑里这几个今日计数字段共用一个 如果你觉得这个 PR 改动面偏大,我可以按你的偏好拆成两个 PR:
看你这边更倾向哪种方式。 |
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
/metricsendpoint backed byprometheus-client/healthand/api/tokensso operators can also inspect token expiry and ban state without opening the UIDetails
src/core/monitoring.pyto render metrics and build a public health snapshotDatabase.update_token()to allow clearing fields likeban_reason/banned_atback toNULLValidation
python3 -m compileall src main.pygit diff --check