# @tars/notify

## @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*: 错误

平台每10分钟对上报的异常进行收敛告警。

如果结合: <http://alarm.k.tarsyun.com/alarms/index.html#/document>, 能快速将异常通知到您!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tarscloud.gitbook.io/tarsdocs/tars.js/tars-notify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
