# 可观察性

可观察性使用指标、日志和追踪这些外部输出来理解系统的能力。这些指标、日志和追踪是基于系统内部的事件产生的。

## 指标（Metrics）

指标是数据的总体汇总，它能让你了解正在发生的事情和需要深入挖掘的地方。服务不断产生消费指标，这些指标是服务健康状况的持续衡量标准。

指标包括两种类型：应用/业务指标和运维指标。

### 应用指标

应用性能指标（Application Performance Metrics，简称 APM）数据与应用性能有关，如加载时间和响应时间，确保应用向客户提供预期性能。像 [Apache SkyWalking](https://skywalking.apache.org) 这样的开源技术可以集成到 Istio 服务网格中，既可以作为 APM，也可以作为额外的服务性能管理（Service Performance Management，简称 SPM）系统——一举两得。

### 运维指标

运维指标关注的是服务的运行情况。你的环境表现如何，通常被描述为 "RED "指标——衡量请求（Request）率 、错误（Error）率和持续（Duration）时间。

服务网格（比如Istio）唯一关心的就是收集这些运维指标，帮助你确定服务表现如何，并对服务健康状况有一个大致的了解。

## 日志（Logs）

日志是冗长的。包含一个 "事件"从头到尾的信息。一则日志可以收集（匿名）用户数据。例如，哪个用户发出了请求，这条请求从哪里开始，到达哪些服务等等。

## 追踪（Tracing）

追踪让你能够看到一个请求从开始到结束的过程。它是对事件行为的实时捕捉。它可以帮助确定故障发生的位置，或确定引起当前示例性能问题的原因。 在基于微服务的环境中会产生大量的事件。事件被定义为从请求到达网络外围的那一刻起发生的一切，即产生可观察数据的动作。


---

# 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://doc.cncf.vip/kubernetes-handbook/ling-yu-ying-yong/observability.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.
