Skip to content
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_total
ip result
counter 用户登录尝试次数 -
infoplus messenger_invoked_total
endpoint event result
counter msgr调用次数 -
infoplus background_tasks_total
kind result
counter 后台任务运行次数 20230901
infoplus license_remaining_days
tenant
gauge 授权剩余天数 -
infoplus triple_count
kind
gauge 三元组同步数量 -
iga triple_tasks_total
result
counter 身份治理任务运行次数 20230629
iga triple_count
kind status
gauge 底座三元组数量 -
iga triple_added_total
kind upstream
counter 底座三元组增加数累加 -
iga triple_updated_total
kind upstream
counter 底座三元组更新数累加 -
iga triple_deleted_total
kind upstream
counter 底座三元组删除数累加 -
notification notification_api_invoked_total
channel type result
counter 提醒API被调用次数 -
etl etl_tasks_total
result
counter 数据交换任务执行次数 -
taskapi system_invoke_total
system mode type status
counter 接口调用次数(含推拉) 20230519
taskapi system_invoke_max_time_ms
system type status
gauge 接口请求的最大毫秒数 20230519
taskapi user_invoke_failed_count
user type
counter 按用户接口调用失败次数 20230519
bus api_invoked_seconds
service type operation client result
histogram 按时间分桶的调用次数 20230629
bus privilege_access_total
service type operation client result
histogram 特权接口访问次数 20240613
bus license_remaining_days
service
gauge 授权剩余天数 20240613

user_login_total

  • 用户登录尝试次数
  • result:
    • success:登录成功
    • fail:登录失败。包括各种可预期的问题,比如密码错、验证码错、账号冻结等
    • exception:登录异常,比如和上游网络不通等不可预期的问题,需及时触发监控告警

infoplus:background_tasks_total

  • 流程平台后台任务运行次数
  • kind:
    • notification: 通知提醒发送
    • triple_remote:身份数据同步(上游到数据库)
    • triple_memory:身份数据同步(数据库到缓存)
    • databinding:数据绑定
    • event_expire: 超时事件、超时办理、超时终止
    • form_tagger:重新计算表单名称、标签的后台任务
    • openid_updater: 用户id批量替换的后台任务
  • result: success skip exception

iga:triple_tasks_total

  • 身份治理任务运行次数
  • result: success skip error

taskapi:system_invoke_total

  • 接口调用次数(含推拉)
  • system:接入系统名
  • mode: push pull
  • type: todo doing done
  • status: 0表示成功,非0为错误码

bus:api_invoked_seconds

  • 按时间分桶的服务调用次数
  • 标签定义:
标签 Explained
service 服务名
type GraphQL类型名
operation GraphQL操作名
client client_id
result 成功返回 success,失败使用 错误扩展中的错误码,未给出使用 fail
  • 桶定义(单位:秒):
  • 1 10 +INF

bus:privilege_access_total

  • 特权接口访问次数
  • 标签定义:
标签 Explained
service 服务名
type GraphQL类型名
operation GraphQL操作名
client client_id
result granted(正常)blocked(阻断)warning(告警)suspected(可疑)
  • 对于 result 的额外解释:
    • granted:特权接口调用时,access_token拥有 privilege scope,且未触发 suspected
    • blocked:未正常授权被阻断的请求
    • warning:未正常授权理应被阻断的请求(过渡阶段)
    • suspected
      • 无论是否授权,大岗位(超过100人岗位)用户token的特权接口请求,且,
      • 无论是否授权,使用 隐式授权(implicit)模式 获取的token调用特权接口

bus:license_remaining_days

  • 授权剩余天数,可以为负数(表示已过期)
Clone this wiki locally