> For the complete documentation index, see [llms.txt](https://tarscloud.gitbook.io/tarsdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tarscloud.gitbook.io/tarsdocs/tars.js/tars-notify.md).

# @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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
