-
Notifications
You must be signed in to change notification settings - Fork 3
Prometheus
marstone edited this page May 9, 2025
·
30 revisions
- 本文旨在定义符合科探云监控的技术规范
- 指标命名规范:
实体_动作_度量,比如http_requests_total。具体参考官方文档 - 对于所有指标,如果可以区分租户,使用
tenant标签,内容为租户编码 - 对于所有指标,各
pod独立统计,无需考虑跨节点统计 - 对于
counter类指标,重启不需要考虑持久化记录,可清零重新统计 - 端口:
9090,端点:/actuator/prometheus - 数据库连接池、JVM等指标,无需额外统计,由 springboot actuator 默认提供
- 名称:
version - 类型:
gauge,值无意义,可使用常量零 - 标签:
id - 举例:
# HELP 版本号
# TYPE version gauge
version{id="20230323"} 0.0- 类型:
counter,记录事件次数,重启后清零 - 举例:提醒服务 报错
# HELP 提醒服务报错次数
# TYPE notification_api_invoked_total counter
notification_api_invoked_total{channel="sms", result="success", tenant="t1", } 1.0
notification_api_invoked_total{channel="sms", result="exception", tenant="t1", } 2.0- 类型
gauge,记录访问时度量 - 举例:身份平台三元组记数
# HELP 身份平台三元组记数,kind为user/dept/post/occupy之一;upstream为权威源标识
# TYPE triple_count gauge
triple_count{kind="user", tenant="t1", } 1000.0
triple_count{kind="dept", tenant="t1", } 50.0| 模块 | 指标 标签 |
类型 | 解释 | 最低版本 |
|---|---|---|---|---|
| sso | user_login_totalip result
|
counter | 用户登录尝试次数 | - |
| infoplus | messenger_invoked_totalendpoint event result
|
counter | msgr调用次数 | - |
| infoplus | background_tasks_totalkind result
|
counter | 后台任务运行次数 | 20230901 |
| infoplus | license_remaining_daystenant
|
gauge | 授权剩余天数 | - |
| infoplus | triple_countkind
|
gauge | 三元组同步数量 | - |
| iga | triple_tasks_totalresult
|
counter | 身份治理任务运行次数 | 20230629 |
| iga | triple_countkind status
|
gauge | 底座三元组数量 | - |
| iga | triple_added_totalkind upstream
|
counter | 底座三元组增加数累加 | - |
| iga | triple_updated_totalkind upstream
|
counter | 底座三元组更新数累加 | - |
| iga | triple_deleted_totalkind upstream
|
counter | 底座三元组删除数累加 | - |
| notification | notification_api_invoked_totalchannel type result
|
counter | 提醒API被调用次数 | - |
| etl | etl_tasks_totalresult
|
counter | 数据交换任务执行次数 | - |
| taskapi | system_invoke_totalsystem mode type status
|
counter | 接口调用次数(含推拉) | 20230519 |
| taskapi | system_invoke_max_time_mssystem type status
|
gauge | 接口请求的最大毫秒数 | 20230519 |
| taskapi | user_invoke_failed_countuser type
|
counter | 按用户接口调用失败次数 | 20230519 |
| bus | api_invoked_secondsservice type operation client result
|
histogram | 按时间分桶的调用次数 | 20230629 |
| bus | privilege_access_totalservice type operation client result
|
histogram | 特权接口访问次数 | 20240613 |
| bus | license_remaining_daysservice
|
gauge | 授权剩余天数 | 20240613 |
- 用户登录尝试次数
-
result:-
success:登录成功 -
fail:登录失败。包括各种可预期的问题,比如密码错、验证码错、账号冻结等 -
exception:登录异常,比如和上游网络不通等不可预期的问题,需及时触发监控告警
-
- 流程平台后台任务运行次数
-
kind:-
notification: 通知提醒发送 -
triple_remote:身份数据同步(上游到数据库) -
triple_memory:身份数据同步(数据库到缓存) -
databinding:数据绑定 -
event_expire: 超时事件、超时办理、超时终止 -
form_tagger:重新计算表单名称、标签的后台任务 -
openid_updater: 用户id批量替换的后台任务
-
-
result:successskipexception
- 身份治理任务运行次数
-
result:successskiperror
- 接口调用次数(含推拉)
-
system:接入系统名 -
mode:pushpull -
type:tododoingdone -
status: 0表示成功,非0为错误码
- 按时间分桶的服务调用次数
- 标签定义:
| 标签 | Explained |
|---|---|
service |
服务名 |
type |
GraphQL类型名 |
operation |
GraphQL操作名 |
client |
client_id |
result |
成功返回 success,失败使用 错误扩展中的错误码,未给出使用 fail
|
- 桶定义(单位:秒):
-
110+INF
- 特权接口访问次数
- 标签定义:
| 标签 | Explained |
|---|---|
service |
服务名 |
type |
GraphQL类型名 |
operation |
GraphQL操作名 |
client |
client_id |
result |
granted(正常)blocked(阻断)warning(告警)suspected(可疑) |
- 对于 result 的额外解释:
-
granted:特权接口调用时,access_token拥有privilegescope,且未触发 suspected -
blocked:未正常授权被阻断的请求 -
warning:未正常授权理应被阻断的请求(过渡阶段) -
suspected:- 无论是否授权,大岗位(超过100人岗位)用户token的特权接口请求,且,
无论是否授权,使用 隐式授权(implicit)模式 获取的token调用特权接口
-
- 授权剩余天数,可以为负数(表示已过期)