Opentelemetry——Observability Primer

Observability Primer

可观测性入门

Core observability concepts.
可观测性核心概念。

What is Observability?

什么是可观测性?

Observability lets us understand a system from the outside, by letting us ask questions about that system without knowing its inner workings. Furthermore, it allows us to easily troubleshoot and handle novel problems (i.e. “unknown unknowns”), and helps us answer the question, “Why is this happening?”
可观测性是指我们可以从外部,在不了解其内部工作原理的情况下,可以向系统提出(诊断)问题(的特性)。(可以理解为医生没有进入我们血管,但是可以问我们“血压多少”)此外,它还使我们能够轻松排查和处理新问题,并帮助我们回答”为什么会发生这种情况?之类的问题。

In order to be able to ask those questions of a system, the application must be properly instrumented. That is, the application code must emit signals such as traces, metrics, and logs. An application is properly instrumented when developers don’t need to add more instrumentation to troubleshoot an issue, because they have all of the information they need.
为了能够对系统提出这些问题,应用程序必须被正确测量。也就是说,应用程序代码必须发出Traces、Metrics和Logs等信号。应用程序已被正确测量的标志是:开发人员不需要添加更多测量装置(诸如代码等)来解决问题。 因为他们拥有所有所需的信息。

OpenTelemetry is the mechanism by which application code is instrumented, to help make a system observable.
OpenTelemetry是一种对应用程序代码进行测量,以帮助使其具有可观测性的机制。

Reliability & Metrics

可靠性和指标

Telemetry refers to data emitted from a system, about its behavior. The data can come in the form of traces, metrics, and logs.
遥测(数据)是指从系统发出来的行为数据。数据的形式可以是Traces、Metrics和Logs。

Reliability answers the question: “Is the service doing what users expect it to be doing?” A system could be up 100% of the time, but if, when a user clicks “Add to Cart” to add a black pair of shoes to their shopping cart, and instead, the system doesn’t always add black shoes, then the system would be said to be unreliable.
可靠性回答了这个问题:“服务是否按照用户的期望运行?”。如果一个系统一直可以运行,但是如果当用户点击 “添加到购物车”以将一双黑色鞋子添加到他们的购物车中,然而系统并不总是添加黑鞋,那么就可以认为系统不可靠的。(是想表达服务可用,但是功能错误)

Metrics are aggregations over a period of time of numeric data about your infrastructure or application. Examples include: system error rate, CPU utilization, request rate for a given service. For more on metrics and how they pertain to OpenTelemetry, see Metrics.
指标是在一段时间内基础设施或应用程序的量化数据的聚合信息。示例包括:系统错误率、CPU 利用率,给定服务的请求速率。有关指标及其与 OpenTelemetry关联的更多信息,请参阅Metrics。

SLI, or Service Level Indicator, represents a measurement of a service’s behavior. A good SLI measures your service from the perspective of your users. An example SLI can be the speed at which a web page loads.
SLI服务级别指标表示对服务行为的测量。一个好的 SLI 是从用户的角度来衡量您的服务。 一个SLI示例是网页加载的速度。

SLO, or Service Level Objective, is the means by which reliability is communicated to an organization/other teams. This is accomplished by attaching one or more SLIs to business value.
SLO,即服务水平目标,是向组织/其他团队传达可靠性的方式。这是通过将一个或多个 SLI 附加到业务价值上来实现的。

Understanding Distributed Tracing

了解分布式跟踪

To understand Distributed Tracing, let’s start with some basics.
要了解分布式跟踪,让我们从一些基础知识开始。

Logs

A log is a timestamped message emitted by services or other components. Unlike traces, however, they are not necessarily associated with any particular user request or transaction. They are found almost everywhere in software, and have been heavily relied on in the past by both developers and operators alike to help them understand system behavior.

Log 是由服务或其他组件发出的带时间戳的消息。 然而,与Trace不同的是,Log不一定是与任何特定的用户请求或事务相关联。它们在软件中几乎无处不在,并且在过去被开发人员和操作员严重依赖,以帮助他们了解系统行为。

Sample log:

I, [2021-02-23T13:26:23.505892 #22473] INFO – : [6459ffe1-ea53-4044-aaa3-bf902868f730] Started GET “/” for ::1 at 2021-02-23 13:26:23 -0800

Unfortunately, logs aren’t extremely useful for tracking code execution, as they typically lack contextual information, such as where they were called from.
不幸的是,Log对于跟踪代码执行并不是非常有用,因为它们通常缺少上下文信息,例如从哪里调用它们(即调用链路不清晰)。

They become far more useful when they are included as part of a span, or when they are correlated with a trace and a span.
当它们作为Span的一部分被包含在内时, 或者当它们与Trace和Span相关联时,它们会变得更加有用。

For more on logs and how they pertain to OTel, see Logs.
有关Logs及其与 OTel 关系的更多信息,请参阅Logs。

Spans

A span represents a unit of work or operation. It tracks specific operations that a request makes, painting a picture of what happened during the time in which that operation was executed.
Span表示一个工作或操作的单元。它跟踪请求所产生的具体操作,描绘了当时在执行该操作时发生的情况。

A span contains name, time-related data, structured log messages, and other metadata (that is, Attributes) to provide information about the operation it tracks.
一个Span包含名称、与时间相关的数据、结构化日志消息和其他元数据(即属性),以提供有关其跟踪的操作的信息。

Span attributes

Span属性

The following table contains examples of span attributes:
下表包含Span属性的示例:

KeyValue
http.request.method“GET”
network.protocol.version“1.1”
url.path“/webshop/articles/4”
url.query“?s=1”
server.address“example.com”
server.port8080
url.scheme“https”
http.route“/webshop/articles/:article_id”
http.response.status_code200
client.address“192.0.2.4”
client.socket.address“192.0.2.5” (the client goes through a proxy)
user_agent.original“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0”

For more on spans and how they pertain to OpenTelemetry, see Spans.
有关Spans及其与OpenTelemetry的关系的详细信息,请参阅Spans。

Distributed Traces

分布式跟踪

A distributed trace, more commonly known as a trace, records the paths taken by requests (made by an application or end-user) as they propagate through multi-service architectures, like microservice and serverless applications.
分布式跟踪(通常称为Trace)记录了在多服务器架构上,如微服务和无服务器应用程序,(由应用程序或最终用户发出的)请求传播的路径。

Without tracing, it is challenging to pinpoint the cause of performance problems in a distributed system.
在分布式系统中,如果没有Trace,就很难查明性能问题的原因。

It improves the visibility of our application or system’s health and lets us debug behavior that is difficult to reproduce locally. Tracing is essential for distributed systems, which commonly have nondeterministic problems or are too complicated to reproduce locally.
它提高了应用程序或系统运行状况的可见性,并让我们调试难以在本地重现的行为。Trace对于分布式系统至关重要,因为很多不确定性问题很难在本地复现。

Tracing makes debugging and understanding distributed systems less daunting by breaking down what happens within a request as it flows through a distributed system.
Trace使调试和理解分布式系统变得不那么令人生畏,它会分解请求流经分布式系统时发生的情况。

A trace is made of one or more spans. The first span represents the root span. Each root span represents a request from start to finish. The spans underneath the parent provide a more in-depth context of what occurs during a request (or what steps make up a request).
Trace由一个或多个Span组成。第一个Span是Root Span。 每个Root Span表示从头到尾的请求。下面的Span父级提供更详细的上下文以了解请求期间发生的情况(或请求的构成步骤)。

Many Observability backends visualize traces as waterfall diagrams that may look something like this:
许多可观测性后端将Trace可视化为瀑布图,这些瀑布图可能看起来像下图:

在这里插入图片描述

Waterfall diagrams show the parent-child relationship between a root span and its child spans. When a span encapsulates another span, this also represents a nested relationship.
瀑布图展示了Root Span和 它的Child Span。当一个Span封装另一个Span时,这也展示嵌套关系。

For more on traces and how they pertain to OpenTelemetry, see Traces.
有关Trace及其与 OpenTelemetry 的关系的详细信息,请参阅Traces。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/808309.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java——数组练习

目录 一.数组转字符串 二.数组拷贝 三.求数组中元素的平均值 四.查找数组中指定元素(顺序查找) 五.查找数组中指定元素(二分查找) 六.数组排序(冒泡排序) 七.数组逆序 一.数组转字符串 代码示例: import java.util.Arrays int[] arr {1,2,3,4,5,6}; String…

数据分析——数据规范化

数据规范化是数据分析中的一个重要步骤,其目的在于确保数据的一致性和可比性,提高数据质量和分析结果的准确性。以下是一些数据规范化的常见方法和技术: 数据清洗:此步骤主要清除数据中的重复项、空格、格式错误等,确…

批归一化(BN)在神经网络中的作用与原理

文章目录 1. 批归一化(BN)在神经网络中的作用与原理1.1 作用与优势1.2 原理与推导 2. 将BN应用于神经网络的方法2.1 训练时的BN 2. 将BN应用于神经网络的方法2.1 训练时的BN2.2 测试时的BN代码示例(Python): 3. BN的优…

编程规范(保姆级教程)

文章目录 为什么需要编程规范?💡代码检测工具 ESLint💡代码格式化 Prettier💡ESLint 与 Prettier 配合解决代码格式问题eslint支持ts约定式提交规范Commitizen助你规范化提交代码什么是 Git Hooks使用 husky commitlint 检查提交…

探索设计模式的魅力:MVVM模式在AI大模型领域的创新应用-打破传统,迎接智能未来

​🌈 个人主页:danci_ 🔥 系列专栏:《设计模式》 💪🏻 制定明确可量化的目标,坚持默默的做事。 MVVM模式在AI大模型领域的创新应用-打破传统迎接智能未来 🚀 “在人工智能的领域里&a…

【Entity Framework】如何使用EF中的生成值

【Entity Framework】如何使用EF中的生成值 文章目录 【Entity Framework】如何使用EF中的生成值一、概述二、默认值三、计算列四、设置主键五、显示配置值生成六、设置日期/时间值生成6.1 创建时间戳6.2 更新时间戳 七、替代值生成八、无值生成九、总结 一、概述 数据库列的值…

DHCP抓包分析

DHCP动态路由配置协议,是C/S架构,由DHCP服务器为客户端动态分配IP信息。 DHCP客户端首次接入网络数据交互过程: 如何解决IP地址的冲突: ▫ DHCP服务器端:收到DHCP DISCOVER报文时,给客户端分配IP地址前会发…

【C++第三阶段】stackqueue容器

以下内容仅为当前认识,可能有不足之处,欢迎讨论! 文章目录 stack容器queue容器 stack容器 是什么?功能是什么?常用接口是什么?局限性有哪些?优势又有哪些? 栈容器,先进…

error-ckeditor-duplicated-modules 在vue中引入ckeditor插件报错

报错原因: 由于集成了webpack,统一引入了ckeditor ,但是页面里面我们又通过import引入了一遍,所以导致引入重复了 解决: ckeditor本身除了基本的一些功能,其他基本全靠插件引入,所以想加功能必…

谷歌推出Vids:AI驱动的PowerPoint,重新定义演示文稿的未来|TodayAI

不管你喜不喜欢,找到集成了AI技术以简化常见任务的工具和服务变得越来越容易。谷歌的应用套件迅速成为了一个集成了Gemini AI的产品中心,这些产品可以在工作场所到你的家中的任何地方使用。例如,如果在工作中做演示一直是你的痛点&#xff0c…

git操作码云(gitee)创建仓库到上传到远程仓库

想必有的小伙伴在为上传到码云远程仓库而感到烦恼吧!本篇为大家详细讲解实现过程,跟着我的步伐一步一步来。 我就当大家已经注册好了码云 一、在码云上需要的操作 接下来我们需要使用到 git 了 二、git 上的操作 到了咋们的git了,开整 首…

外包干了3天,技术退步明显.......

先说一下自己的情况,大专生,19年通过校招进入杭州某软件公司,干了接近4年的功能测试,今年年初,感觉自己不能够在这样下去了,长时间呆在一个舒适的环境会让一个人堕落! 而我已经在一个企业干了四年的功能测…

Terraform 状态不同步处理

背景 在使用 Terraform 创建 TencentCloud TKE 的时候,手贱把 node pool 删掉了。导致执行 destroy, plan 都会报错。 │ Error: [TencentCloudSDKError] CodeInternalError.UnexpectedInternal, Messagerelated node pool query err(get node pool failed: [E501…

Python如何安装第三方模块

cmd窗口中使用pip install命令安装 1、键盘按下win R,然后在输入框中输入cmd,回车,就打开了cmd窗口。 下图的运行框会出现到屏幕左下角。 2、输入下面的命令,回车即可。 pip install xxx # xxx为要安装的模块名 如图所示&…

【13137】基于TQM的人力资源管理

目录 1.单选题 2.多选题 3.名词解释题 4.简答题 1.单选题

中通科技数仓数据治理实践

目录 一、背景 1.1 中通数仓架构介绍 1.2 中通数仓层级划分 1.3 中通数据现状 1.4 中通数仓现面临的压力 二、数据仓库具体实践 2.1 时效治理 2.1.1 数据入仓治理 2.1.2 核心模型治理 2.2 存储治理 2.3 内存治理 2.3.1 内存浪费治理 2.3.2 数据倾斜治理 2.3.3 内…

算法设计与分析实验报告c++java实现(ACM面试题、字符串匹配算法、循环赛日程安排问题、分治法求解最大连续子序列和、动态规划法求解最大连续子序列和)

一、 实验目的 1.加深学生对算法设计方法的基本思想、基本步骤、基本方法的理解与掌握; 2.提高学生利用课堂所学知识解决实际问题的能力; 3.提高学生综合应用所学知识解决实际问题的能力。 二、实验任务 1、【ACM、…

linux重定向符号

将ls命令执行结果重定向到a文件中 将错误ls命令执行结果重定向到a文件中(这里用到前面的标准错误输出重定向)

科研学习|可视化——相关性结果的可视化

一、相关性分析介绍 相关性分析是指研究两种或者两种以上的变量之间相关关系的统计分析方法,一般分析步骤为: 1)判断变量间是否存在关联;2)分析关联关系(线性/非线性)、关联方向(正相…

上海人工智能实验室的书生·浦语大模型学习笔记(第二期第三课——上篇)

书生浦语是上海人工智能实验室和商汤科技联合研发的一款大模型,这次有机会参与试用,特记录每次学习情况。 一、课程笔记 本次学习的是RAG(Retrieval Augmented Generation)技术,它是通过检索与用户输入相关的信息片段…