测量装置
How OpenTelemetry facilitates instrumentation OpenTelemety如何简化测量
In order to make a system observable, it must be instrumented: That is, code from the system’s components must emit traces, metrics, and logs. 为了使系统可观察,必须对其进行测量,也就是说,来自系统组件的代码必须发出Traces, Metrics和Logs。
Using OpenTelemetry, you can instrument your code in two primary ways: 使用 OpenTelemetry,您可以通过两种主要方式测量代码:
Code-based solutions allow you to get deeper insight and rich telemetry from your application itself. They let you use the OpenTelemetry API to generate telemetry from your application, which acts as an essential complement to the telemetry generated by zero-code solutions. 基于代码的解决方案使您可以从应用程序本身获得更深入的洞察和丰富的遥测数据。它们允许您使用 OpenTelemetry API 从应用程序生成遥测数据,这是对零代码解决方案生成的遥测数据的重要补充。
Zero-code solutions are great for getting started, or when you can’t modify the application you need to get telemetry out of. They provide rich telemetry from libraries you use and/or the environment your application runs in. Another way to think of it is that they provide information about what’s happening at the edges of your application. 零代码解决方案非常适合入门,以及当您无法修改应用程序以从中获取遥测数据时。它们从您使用的库和/或应用程序运行的环境中提供丰富的遥测数据。从另外一个角度说,它们提供有关应用程序边缘发生的信息。
You can use both solutions simultaneously. 您可以同时使用两种解决方案。
其他 OpenTelemetry 优势
OpenTelemetry provides more than just zero-code and code-based telemetry solutions. The following things are also a part of OpenTelemetry: OpenTelemetry 提供的不仅仅是零代码和基于代码的遥测解决方案。以下内容也是 OpenTelemetry 的一部分:
Learn how to add observability to an application without the need to write code 了解如何在无需编写代码的情况下向应用程序添加可观察性
基于代码
Learn the essential steps in setting up code-based instrumentation 了解设置基于代码的Instrumentation的基本步骤
库 Learn how to add native instrumentation to your library. 了解如何将本地Instrumentation添加到您的库中。