Opentelemetry——Signals-Baggage

2024-04-14 11:04

本文主要是介绍Opentelemetry——Signals-Baggage,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Baggage

Contextual information that is passed between signals
信号之间传递的上下文信息

In OpenTelemetry, Baggage is contextual information that’s passed between spans. It’s a key-value store that resides alongside span context in a trace, making values available to any span created within that trace.
在 OpenTelemetry 中,Baggage 是在Span之间传递的上下文信息。它是一个键值对存储结构,与Trace中的Span Context并存,可供该Trace中创建的任何Span使用。

For example, imagine you want to have a CustomerId attribute on every span in your trace, which involves multiple services; however, CustomerId is only available in one specific service. To accomplish your goal, you can use OpenTelemetry Baggage to propagate this value across your system.
例如,假设您希望涉及多个服务的Trace中的每个Span都有一个CustomerId属性,而CustomerId仅在一项特定服务中可用。为了实现您的目标,您可以使用OpenTelemetry Baggage在整个系统中传播此值。

OpenTelemetry uses Context Propagation to pass Baggage around, and each of the different library implementations has propagators that parse and make that Baggage available without you needing to explicitly implement it.
OpenTelemetry使用Context Propagation来传递 Baggage,每个不同的库实现都有传播器(propagators)来解析并使 Baggage 可用,而无需您显式实现它。

在这里插入图片描述

Why does OTel Baggage exist?

Baggage provides a uniform way to store and propagate information across a trace and other signals. For example, you may want to attach information from your application to a span and retrieve that information much later and use it later on with another span. However, spans in OpenTelemetry are immutable once created, and can be exported before you need information on them later on. Baggage allows you to work around this problem by providing a place to store and retrieve information.
Baggage提供了一种统一的存储和传播的信息的方案。这些信号可以跨越Trace以及其他信号。例如,您可能希望将应用程序中的信息附加到一个Span,并在稍后检索该信息,然后在另一个Span中使用它。但是,OpenTelemetry中的Span一旦创建就不可变,并且可以在您稍后需要有关它们的信息之前导出。 Baggage提供存储和检索信息的位置来帮助您解决此问题。

What should OTel Baggage be used for?

Common use cases include information that’s only accessible further up a stack. This can include things like Account Identification, User IDs, Product IDs, and origin IPs, for example. Passing these down your stack allows you to then add them to your Spans in downstream services to make it easier to filter when you’re searching in your Observability backend.
常见用例包括:只能在堆栈的更上层访问的信息。例如,这可以包括帐户标识、用户 ID、产品 ID 和源 IP 等内容。将这些传递到堆栈中后,您可以将它们添加到下游服务中的 Spans 中,以便在可观测性后端搜索时更轻松地进行过滤。
在这里插入图片描述

Baggage security considerations

Sensitive Baggage items could be shared with unintended resources, like third-party APIs. This is because automatic instrumentation includes Baggage in most of your service’s network requests. Specifically, Baggage and other parts of trace context are sent in HTTP headers, making it visible to anyone inspecting your network traffic. If traffic is restricted within your network, then this risk may not apply, but keep in mind that downstream services could propagate Baggage outside your network.
便捷的Baggage可能会与第三方API等非预期资源共享信息。这是因为在大多数服务的网络请求的自动测量装置中都包含 Baggage。具体来说,Baggage 和Trace Context的其他部分在 HTTP 标头中发送,使其对检查您的网络流量的任何人都可见。如果您的网络内的流量受到限制,则此风险可能不适用,但请记住,下游服务可能会将Baggage传播到您的网络之外。

Also, there are no built-in integrity checks to ensure that Baggage items are yours, so exercise caution when retrieving them.
此外,没有内置的完整性检查来确保Baggage中项目属于您,因此从中取值时请务必小心。

Baggage is not the same as Span attributes

One important thing to note about Baggage is that it is not a subset of the Span Attributes. When you add something as Baggage, it does not automatically end up on the Attributes of the child system’s spans. You must explicitly take something out of Baggage and append it as Attributes.
关于 Baggage 需要注意的一件重要事情是它不是 Span Attributes的子集。当您将某些内容添加到Baggage中时,它不会自动出现在子系统Span的属性上。您必须明确地从 Baggage 中取出某些内容并将其附加为 Span Attributes。

For example, in .NET you might do this:
例如,在 .NET 中您可以这样做:

var accountId = Baggage.GetBaggage("AccountId");
Activity.Current?.SetTag("AccountId", accountId);

For more information, see the baggage specification.

如需了解更多信息,请参阅baggage specification.。

这篇关于Opentelemetry——Signals-Baggage的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/902845

相关文章

HDU 1950 Bridging signals (DP)

题目地址:HDU 1950 这题是求最长上升序列,但是普通的最长上升序列求法时间复杂度是O(n*n),显然会超时。于是便学了一种O(n*logn)的方法。也很好理解。感觉还用到了一点贪心的思想。 具体的见这篇博客吧,写的很通俗易懂。传送门 代码如下: #include <iostream>#include <cstdio>#include <string>#include <cs

学习使用Opentelemetry python SDK

前言 📢博客主页:程序源⠀-CSDN博客 📢欢迎点赞👍收藏⭐留言📝如有错误敬请指正! 一、什么是 OpenTelemetry OpenTelemetry 由 OpenTracing 和 OpenCensus 项目合并而成,是一组规范、工具、API 和 SDK 的集合。使用它来检测、生成、收集和导出遥测数据(Metrics、Logs 和 Traces),以帮助运维开发人员分析软件

Signals and systems Chapter 1 学习笔记

<<Signals and systems>> Chapter 1                          下决心要啃完这本信号与系统! 这个人的名字我在键盘上敲了N次... Alan V. alppenhiem 两大信号类别: 离散信号以及连续信号 左右两边分别时是典型的连续周期信号和离散周期信号的表现形式. 注意信号函数的奇偶

【Qt知识】Qt框架中的信号(Signals)与槽(Slots)机制

Qt框架中的信号(Signals)与槽(Slots)机制是一种强大的通信方式,允许对象之间相互通信而无需对象之间直接引用或了解对方。这一机制简化了应用程序的事件处理和组件之间的交互,是Qt的一大特色和核心概念。 基本概念 信号(Signals):信号是类的一部分,当特定事件发生时自动发出。你可以把它想象成一个对象说:“某事发生了!”信号不需要指定接收者,也不关心谁会接收到这

【APM】在Kubernetes中,使用Helm安装OpenTelemetry 0.97.0(手动埋点)

1、OpenTelemetry 简介 OpenTelemetry 是一个开源的、全面的可观测性框架,旨在为云原生及传统应用提供标准化的方式来生成、收集、处理和导出遥测数据,包括跟踪(Traces)、度量(Metrics)和日志(Logs)。这个项目由 Cloud Native Computing Foundation (CNCF) 孵化,目标是简化和统一观测性数据的收集与分析,从而提高开发人员在

QT编译找不到signals函数

通过QT编译可以不必将.h文件全部导入到pro文件中,但是对于该Signal函数,如果不导入,则找不到。

OpenTelemetry-2.Go接入Jaeger(grpc,gin-http)

目录 1.什么是OpenTelemetry 2.搭建jaeger 3.链路追踪 本地调用 远程调用 GRPC proto server端 client端 Gin-HTTP 调用流程 api1 api2 grpc 4.完整代码 1.什么是OpenTelemetry 参考:OpenTelemetry-1.介绍-CSDN博客 2.搭建jaeger 参考:

从 Elastic 的 Go APM 代理迁移到 OpenTelemetry Go SDK

作者:来自 Elastic Damien Mathieu 正如我们之前所分享的,Elastic 致力于帮助 OpenTelemetry(OTel)取得成功,这意味着在某些情况下构建语言 SDK 的分发版本。 Elastic 在观察性和安全数据收集方面战略性地选择了 OTel 标准。此外,Elastic 承诺与 OTel 社区合作,成为观察性生态系统中最佳的数据收集基础设施。Elastic

Signals and Systems with MATLAB Computing and Simulink Modeling, Fourth Edition

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。 http://blog.csdn.net/topmvp - topmvp This new (fourth) edition contains a 36-page discussion on window functions and additional examples using

技术周刊 118:Signals 提案进入 Stage 1 阶段、3 月 Web 平台更新、Nuxt 展望未来、Q1 全球 AGI 融资盘点

大家好,我是童欧巴,欢迎来到第 118 期技术周刊。 前端资讯 Signals 提案进入 Stage 1 阶段 框架作者们已经与 TC39 合作,争取打合出一份 Signals 提案,目标是将其变成 JavaScript 语言的一部分。如果能落地,前端框架的响应式实现将变得非常简单。 3 月 Web 平台更新 2024 年 3 月,Firefox 124、Safari 17.4 和 Ch