# Giám sát hoạt động của AI Gateway

Để theo dõi và phân tích hoạt động của một AI Gateway đang hoạt động, bạn có thể giám sát thông qua:

## Metric

Tại giao diện chi tiết của một Gateway, chọn tab **Monitor** để theo dõi các chỉ số thời gian thực được thể hiện qua biểu đồ bao gồm:

* **Requests**: Tổng số lượng request đã được gửi tới AI Gateway.
* **Errors**: Số request đã được gửi tới AI Gateway và được nhận kết quả lỗi.
* **Tokens**: Số lượng token đã sử dụng, bao gồm:
  * `input`: token đầu vào (câu hỏi của bạn).
  * `output`: token đầu ra (kết quả từ LLM Model).

Bạn có thể tùy chỉnh khoảng thời gian quan sát (15m, 30m, 1h, 2h, v.v.) và lọc theo Provider hoặc Model cụ thể.

<figure><img src="/files/DbUg91kyalqwNOOTy3Bs" alt=""><figcaption></figcaption></figure>

## Logs

Tại giao diện chi tiết của một Gateway, chọn tab **Log** để xem danh sách tất cả các request đã gửi qua Gateway.

Tại đây, bạn có thể danh sách request được gửi tới AI Gateway bao gồm:

* **Time:** thời gian gửi request.
* **Status:** trạng thái của request, bao gồm **Success**, **Error** hoặc **Timeout**.
* **Model:** tên model được sử dụng.
* **Tokens:** số lượng token input/ output.
* **Duration:** tổng thời gian xử lý request.

Bạn có thể tùy chỉnh khoảng thời gian quan sát (24h, 1d, 2d,...) và lọc theo Status cụ thể.

<figure><img src="/files/yG8961EKXhqy7YEohOGj" alt=""><figcaption></figcaption></figure>

Ngoài ra, bạn có thể xem chi tiết một request bằng cách:

* Nhấn vào biểu tượng **Detail** cột **Action** để mở **Detail Log**.
* Tại đây bạn sẽ thấy:
  * **Input**: Nội dung câu hỏi hoặc prompt gốc bạn gửi vào.
  * **Output**: Kết quả trả về từ LLM Model.
  * **Thông tin bổ sung**: host, model, thời gian phản hồi,...

<figure><img src="/files/PjQBG5MfEBblcl2dNjMU" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Eob3OVxNsIOyzglVkyUx" alt=""><figcaption></figcaption></figure>


---

# 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://docs.vngcloud.vn/vng-cloud-document/vn/ai-stack/ai-gateway/bat-dau-voi-ai-gateway/giam-sat-hoat-dong-cua-ai-gateway.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.
