2.0.0 • Published 6 years ago

@tars/notify v2.0.0

Weekly downloads
49
License
BSD-3-Clause
Repository
github
Last release
6 years ago

@tars/notify

上报业务(框架)消息(告警)至 TARS 平台。

report(message, id)

将消息上报到平台上,并可以在WEB管理页面上查看到。

  • message: 消息内容( 必填
  • id: 服务线程(进程)ID, 默认值为 process.pid

notify(message, level, id)

上报通知信息到平台。

  • message: 通知内容( 必填
  • level: 通知内容的级别,为 LEVEL 枚举, 默认值为 LEVEL.NOTIFYNORMAL
  • id: 服务线程(进程)ID, 默认值为 process.pid

LEVEL 枚举中有3项可选:

  • LEVEL.NOTIFYNORMAL: 正常(默认)
  • LEVEL.NOTIFYWARN: 警告
  • LEVEL.NOTIFYERROR: 错误

如果 level 的级别为 LEVEL.NOTIFYERROR,则会进行短信告警,平台每10分钟对上报的异常进行收敛告警。