前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Opentelemetry-Language APIs & SDKs-C++-Getting Started

Opentelemetry-Language APIs & SDKs-C++-Getting Started

作者头像
方亮
发布于 2024-05-24 11:22:38
发布于 2024-05-24 11:22:38
15600
代码可运行
举报
文章被收录于专栏:方亮方亮
运行总次数:0
代码可运行
大纲

  • *Getting Started*
    • *Prerequisites*
    • *Example Application*
    • *Setup*
    • *Dependencies*
    • *Create and launch an HTTP Server*
    • *Instrumentation*
    • *Next Steps*

Getting Started

入门

Get telemetry for your app in less than 5 minutes! 不到 5 分钟即可获取您的应用程序的遥测数据!

This page will show you how to get started with OpenTelemetry in C++. 本页将向您展示如何开始使用 C++ 中的 OpenTelemetry。

You will learn how to instrument a simple C++ application, such that traces are emitted to the terminal. 您将学习如何检测简单的 C++ 应用程序,以便将Trace发送到终端。

Prerequisites

先决条件

Ensure that you have the following installed locally: 确保您已在本地安装以下软件:

  • Git
  • C++ compiler supporting C++ version >= 14
  • Make
  • CMake version >= 3.20

Example Application

应用示例

The following example uses a basic Oat++ application. If you are not using Oat++, that’s OK - you can use OpenTelemetry C++ with any other web framework as well. 以下示例使用基本的Oat++应用程序。如果您不使用 Oat++,那也没关系 - 您也可以将 OpenTelemetry C++ 与任何其他 Web 框架一起使用。

Setup

  • Create a folder named otel-cpp-starter. 创建一个名为 的文件夹otel-cpp-starter。
  • move into the newly created folder. This will serve as your working directory. 移动到新创建的文件夹中。这将作为您的工作目录。
  • After setting up dependencies, your directory structure should resemble this: 设置依赖项后,您的目录结构应类似于以下内容:

otel-cpp-starter │ ├── oatpp ├── opentelemetry-cpp └── roll-dice

Dependencies

依赖关系

To begin, install Oat++ locally using the source code and make, following these steps: 首先,按照以下步骤在本地下载和使用 Oat++源代码:

  1. Obtain the Oat++ source code by cloning from the oatpp/oatpp  GitHub repository. 通过从GitHub的oatpp/oatpp 存储库克隆来获取 Oat++ 源代码 。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
git clone https://github.com/oatpp/oatpp.git
  1. Navigate to the oatpp directory. 进入oatpp目录。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cd oatpp
  1. Create a build subdirectory and navigate into it. 创建一个build子目录并进入其中。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
mkdir build
cd build
  1. Build oatpp using the cmake and make commands. This command will trigger the build process specified in the CMakeLists.txt included in the oatpp source code. 使用cmake和make命令构建 oatpp。该命令将触发toatpp源代码中CMakeLists.tx指定的构建过程。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cmake ..
make
  1. Install oatpp. 安装oatpp。

This command will install the built oatpp library and headers on your system, making it accessible for development in your project. 此命令将在您的系统上安装构建的oatpp库和头文件,使其可以在您的项目中进行开发。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
sudo make install

To uninstall the built oatpp library and headers from your system. 从系统中卸载内置的oatpp库和头文件。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
sudo make uninstall

Next, install and build OpenTelemetry C++ locally using CMake, following these steps: 接下来,使用CMake在本地安装并构建OpenTelemetry C++,步骤如下:

  1. In your terminal, navigate back to the otel-cpp-starter directory. Then, clone the OpenTelemetry C++ GitHub repository to your local machine. 在您的终端中,切换到otel-cpp-starter目录。然后,将GitHub中的OpenTelemetry C++存储库克隆到本地计算机。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
git clone https://github.com/open-telemetry/opentelemetry-cpp.git
  1. Change your working directory to the OpenTelemetry C++ SDK directory. 将工作目录更改为 OpenTelemetry C++ SDK 目录。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cd opentelemetry-cpp
  1. Create a build directory and navigate into it. 创建build目录并切换到其中。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
mkdir build
cd build
  1. In the build directory run CMake, to configure and generate the build system. 在build目录中运行CMake,配置并生成构建系统
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cmake ..

Or, if the cmake --build fails, you can also try: 或者,如果cmake --build失败,您也可以尝试:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cmake -DWITH_ABSEIL=ON ..
  1. Execute the build process. 执行构建过程。
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cmake --build .

With Oat++ and OpenTelemetry C++ ready, you can continue with creating the HTTP Server, that we want to instrument eventually. 准备好Oat++和OpenTelemetry C++后,您可以继续创建我们最终想要测量的HTTP服务器

Create and launch an HTTP Server

创建并启动HTTP服务器

In your otel-cpp-starter folder, create a subfolder roll-dice, where the Oat++ library will be used by referencing the oatpp headers and linking them when compiling your project. 在您的otel-cpp-starter文件夹中,创建一个子文件夹roll-dice,其中将通过引用oatpp头文件,并在编译项目时链接它们来使用Oat++库。

Create a file called CMakeLists.txt to define the Oat++ library directories, include paths, and link against Oat++ during the compilation process. 创建一个名为CMakeLists.txt的文件,用于定义Oat++库目录、包含路径,并在编译过程中链接到Oat++。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
project(RollDiceServer)
cmake_minimum_required(VERSION 3.1)
# Set C++ standard (e.g., C++17)
set(CMAKE_CXX_STANDARD 17)
set(project_name roll-dice-server)

# Define your project's source files
set(SOURCES
    main.cpp  # Add your source files here
)

# Create an executable target
add_executable(dice-server ${SOURCES})

set(OATPP_ROOT ../oatpp)
find_library(OATPP_LIB NAMES liboatpp.a HINTS "${OATPP_ROOT}/build/src/" NO_DEFAULT_PATH)

if (NOT OATPP_LIB)
  message(SEND_ERROR "Did not find oatpp library ${OATPP_ROOT}/build/src")
endif()
#set the path to the directory containing "oatpp" package configuration files
include_directories(${OATPP_ROOT}/src)
target_link_libraries(dice-server PRIVATE ${OATPP_LIB})

Next, the sample HTTP server source code is needed. It will do the following: 接下来,需要编写示例HTTP服务器源代码。它将执行以下操作:

  • Initialize an HTTP router and set up a request handler to generate a random number as the response when a GET request is made to the /rolldice endpoint. 初始化HTTP路由器并设置请求处理程序,以在向端点发出GET请求时生成随机数作为响应/rolldice。
  • Next, create a connection handler, a connection provider, and start the server on localhost:8080. 接下来,创建一个连接处理程序、一个连接提供程序,并在localhost:8080上启动服务器。
  • Lastly, initialize and run the application within the main function. 最后,在主函数中初始化并运行应用程序。

In that roll-dice folder, create a file called main.cpp and add the following code to the file. 在该roll-dice文件夹中,创建一个名为main.cpp的文件,并将以下代码添加到该文件中。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
#include "oatpp/web/server/HttpConnectionHandler.hpp"
#include "oatpp/network/Server.hpp"
#include "oatpp/network/tcp/server/ConnectionProvider.hpp"
#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;

class Handler : public oatpp::web::server::HttpRequestHandler {
public:
  shared_ptr<OutgoingResponse> handle(const shared_ptr<IncomingRequest>& request) override {
    int low = 1;
    int high = 7;
    int random = rand() % (high - low) + low;
    // Convert a std::string to oatpp::String
    const string response = to_string(random);
    return ResponseFactory::createResponse(Status::CODE_200, response.c_str());
  }
};

void run() {
  auto router = oatpp::web::server::HttpRouter::createShared();
  router->route("GET", "/rolldice", std::make_shared<Handler>());
  auto connectionHandler = oatpp::web::server::HttpConnectionHandler::createShared(router);
  auto connectionProvider = oatpp::network::tcp::server::ConnectionProvider::createShared({"localhost", 8080, oatpp::network::Address::IP_4});
  oatpp::network::Server server(connectionProvider, connectionHandler);
  OATPP_LOGI("Dice Server", "Server running on port %s", connectionProvider->getProperty("port").getData());
  server.run();
}

int main() {
  oatpp::base::Environment::init();
  srand((int)time(0));
  run();
  oatpp::base::Environment::destroy();
  return 0;
}

Build and run the application with the following CMake commands. 使用以下CMake命令构建并运行应用程序。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
mkdir build
cd build
cmake ..
cmake --build .

After successfully building your project, you can run the generated executable. 成功构建项目后,您可以运行生成的可执行文件。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
./dice-server

Then, open http://localhost:8080/rolldice in your browser to ensure it is working. 然后,在浏览器中打开http://localhost:8080/rolldice以确保其正常工作。

Instrumentation

测量装置

To add OpenTelemetry to your application, update the CMakeLists.txt file with the following additional dependencies. 要将OpenTelemetry添加到您的应用程序,请让CMakeLists.txt使用以下附加依赖项,并更新文件。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
project(RollDiceServer)
cmake_minimum_required(VERSION 3.1)
# Set C++ standard (e.g., C++17)
set(CMAKE_CXX_STANDARD 17)
set(project_name roll-dice-server)

# Define your project's source files
set(SOURCES
    main.cpp  # Add your source files here
)
# Create an executable target
add_executable(dice-server ${SOURCES})

set(OATPP_ROOT ../oatpp)
set(OPENTELEMETRY_ROOT ../opentelemetry-cpp)
find_library(OATPP_LIB NAMES liboatpp.a HINTS "${OATPP_ROOT}/build/src/" NO_DEFAULT_PATH)
if (NOT OATPP_LIB)
  message(SEND_ERROR "Did not find oatpp library ${OATPP_ROOT}/build/src")
endif()
# set the path to the directory containing "oatpp" package configuration files
include_directories(${OATPP_ROOT}/src)

include_directories(${OPENTELEMETRY_ROOT}/api/include)
include_directories(${OPENTELEMETRY_ROOT}/sdk/include)
include_directories(${OPENTELEMETRY_ROOT}/sdk/src)
include_directories(${OPENTELEMETRY_ROOT}/exporters/ostream/include)

find_library(OPENTELEMETRY_COMMON_LIB NAMES libopentelemetry_common.a HINTS "${OPENTELEMETRY_ROOT}/build/sdk/src/common" NO_DEFAULT_PATH)
find_library(OPENTELEMETRY_TRACE_LIB NAMES libopentelemetry_trace.a HINTS "${OPENTELEMETRY_ROOT}/build/sdk/src/trace" NO_DEFAULT_PATH)
find_library(OPENTELEMETRY_EXPORTER_LIB NAMES libopentelemetry_exporter_ostream_span.a HINTS "${OPENTELEMETRY_ROOT}/build/exporters/ostream" NO_DEFAULT_PATH)
find_library(OPENTELEMETRY_RESOURCE_LIB NAMES libopentelemetry_resources.a HINTS "${OPENTELEMETRY_ROOT}/build/sdk/src/resource" NO_DEFAULT_PATH)

if(OPENTELEMETRY_COMMON_LIB AND OPENTELEMETRY_TRACE_LIB AND OPENTELEMETRY_EXPORTER_LIB AND OPENTELEMETRY_RESOURCE_LIB)
  message(STATUS "Found opentelemetry libraries")
else()
  message(SEND_ERROR "Did not find opentelemetry libraries")
endif()

target_link_libraries(dice-server PRIVATE ${OATPP_LIB} ${OPENTELEMETRY_COMMON_LIB} ${OPENTELEMETRY_TRACE_LIB} ${OPENTELEMETRY_EXPORTER_LIB} ${OPENTELEMETRY_RESOURCE_LIB})

Update the main.cpp file with the following code to initialize a tracer and to emit spans when the /rolldice request handler is called. main.cpp使用以下代码更新文件,以初始化Tracer,并在程序处理/rolldice调用请求时发出Span。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
#include "oatpp/web/server/HttpConnectionHandler.hpp"
#include "oatpp/network/Server.hpp"
#include "oatpp/network/tcp/server/ConnectionProvider.hpp"

#include "opentelemetry/exporters/ostream/span_exporter_factory.h"
#include "opentelemetry/sdk/trace/exporter.h"
#include "opentelemetry/sdk/trace/processor.h"
#include "opentelemetry/sdk/trace/simple_processor_factory.h"
#include "opentelemetry/sdk/trace/tracer_provider_factory.h"
#include "opentelemetry/trace/provider.h"

#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;
namespace trace_api = opentelemetry::trace;
namespace trace_sdk = opentelemetry::sdk::trace;
namespace trace_exporter = opentelemetry::exporter::trace;

namespace {
  void InitTracer() {
    auto exporter  = trace_exporter::OStreamSpanExporterFactory::Create();
    auto processor = trace_sdk::SimpleSpanProcessorFactory::Create(std::move(exporter));
    std::shared_ptr<opentelemetry::trace::TracerProvider> provider =
      trace_sdk::TracerProviderFactory::Create(std::move(processor));
    //set the global trace provider
    trace_api::Provider::SetTracerProvider(provider);
  }
  void CleanupTracer() {
    std::shared_ptr<opentelemetry::trace::TracerProvider> none;
    trace_api::Provider::SetTracerProvider(none);
  }

}

class Handler : public oatpp::web::server::HttpRequestHandler {
public:
  shared_ptr<OutgoingResponse> handle(const shared_ptr<IncomingRequest>& request) override {
    auto tracer = opentelemetry::trace::Provider::GetTracerProvider()->GetTracer("my-app-tracer");
    auto span = tracer->StartSpan("RollDiceServer");
    int low = 1;
    int high = 7;
    int random = rand() % (high - low) + low;
    // Convert a std::string to oatpp::String
    const string response = to_string(random);
    span->End();
    return ResponseFactory::createResponse(Status::CODE_200, response.c_str());
  }
};

void run() {
  auto router = oatpp::web::server::HttpRouter::createShared();
  router->route("GET", "/rolldice", std::make_shared<Handler>());
  auto connectionHandler = oatpp::web::server::HttpConnectionHandler::createShared(router);
  auto connectionProvider = oatpp::network::tcp::server::ConnectionProvider::createShared({"localhost", 8080, oatpp::network::Address::IP_4});
  oatpp::network::Server server(connectionProvider, connectionHandler);
  OATPP_LOGI("Dice Server", "Server running on port %s", connectionProvider->getProperty("port").getData());
  server.run();
}

int main() {
  oatpp::base::Environment::init();
  InitTracer();
  srand((int)time(0));
  run();
  oatpp::base::Environment::destroy();
  CleanupTracer();
  return 0;
}

Build your project again. 再次构建您的项目。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
cd build
cmake ..
cmake --build .

After successfully building your project, you can run the generated executable. 成功构建项目后,您可以运行生成的可执行文件。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
./dice-server

When you send a request to the server at http://localhost:8080/rolldice , you will see a span being emitted to the terminal. 当您向http://localhost:8080/rolldice的服务器发送请求时,您将看到一个Span被发送到终端

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
{
  "name" : "RollDiceServer",
  "trace_id": "f47bea385dc55e4d17470d51f9d3130b",
  "span_id": "deed994b51f970fa",
  "tracestate" : ,
  "parent_span_id": "0000000000000000",
  "start": 1698991818716461000,
  "duration": 64697,
  "span kind": "Internal",
  "status": "Unset",
  "service.name": "unknown_service",
  "telemetry.sdk.language": "cpp",
  "telemetry.sdk.name": "opentelemetry",
  "telemetry.sdk.version": "1.11.0",
  "instr-lib": "my-app-tracer"
}

Next Steps

For more information about instrumenting your code, refer the instrumentation documentation. 有关测量代码的更多信息,请参阅测量装置文档。

You’ll also want to configure an appropriate exporter to export your telemetry data to one or more telemetry backends. 您还需要配置适当的导出器以将遥测数据导出到一个或多个遥测后端。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2024-05-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
Opentelemetry——分析C++项目链接时循环依赖导致的错误
在《Opentelemetry-Language APIs & SDKs-C+±Getting Started》一文中,介绍了如果编译一个可以发出Trace遥测数据的C++项目。虽然过程很详细,但是在我的环境下,编译出现了问题。本文将介绍分析并解决该问题的过程。
方亮
2024/05/24
3350
Opentelemetry——分析C++项目链接时循环依赖导致的错误
Language APIs & SDKs-C++-Exporters
Send telemetry to the OpenTelemetry Collector to make sure it’s exported correctly. Using the Collector in production environments is a best practice. To visualize your telemetry, export it to a backend such as Jaeger , Zipkin , Prometheus , or a vendor-specific backend. 将遥测数据发送到OpenTelemetry Collector以确保其导出正确。在生产环境中使用收集器是最佳实践。要可视化您的遥测数据,请将其导出到后端,例如 Jaeger、Zipkin、 Prometheus或特定于供应商的后端。
方亮
2024/05/24
1020
Language APIs & SDKs-C++-Instrumentation
Instrumentation for OpenTelemetry C++ OpenTelemetry C++测量装置
方亮
2024/05/24
1050
OpenTelemetry:Go可观测性指南
现代应用程序通常是复杂的分布式系统。调试它们可不是一件有趣的事情:你必须跟踪跨服务的请求,日志会丢失,而且指标通常难以关联。这就像大海捞针——只不过这个草堆正在燃烧,而且针还在移动。这就是 OpenTelemetry (OTel) 可以提供帮助的地方。
云云众生s
2025/02/09
1830
OpenTelemetry:Go可观测性指南
Opentelemetry 实践分享 - Golang篇
Opentelemetry 是一个CNCF社区下一个开源的可观测性框架,或者也可以说是一组工具、API 和 SDK 的集合,来检测、生成、收集和导出可观测性数据(指标、日志和链路),以帮助我们分析软件的性能和行为。
云原生小白
2023/08/28
4.5K0
Opentelemetry 实践分享 - Golang篇
游戏服务的可观测性能力建设(C++生态)
近年来可观测性领域越来越成熟,游戏服务的可观测性能力建设日益成为提升产品质量与运维效率的关键环节。随着游戏系统架构的不断复杂化,传统的监控和故障排查方式已难以满足业务高可用和用户体验优化的需求。通过健全的可观测性体系,可以实现对游戏服务全链路的实时监控、异常检测与分析,助力技术团队及时发现和定位问题,推动产品持续优化与稳定迭代,从而为玩家提供更加流畅和可靠的游戏体验。
owent
2025/05/27
1150
Opentelemetry SDK的简单用法
Opentelemetry trace的简单架构图如下,客户端和服务端都需要启动一个traceProvider,主要用于将trace数据传输到registry(如jaeger、opencensus等)。client和server通过context将整个链路串起来。
charlieroro
2022/08/31
1.9K0
Opentelemetry SDK的简单用法
OpenTelemetry 实战:从零实现分布式链路追踪
之前写过一篇 从 Dapper 到 OpenTelemetry:分布式追踪的演进之旅的文章,主要是从概念上讲解了 Trace 在 OpenTelemetry 的中的场景和使用。
crossoverJie
2024/09/29
3600
PHP 中使用 opentelemetry-auto-laravel 进行链路追踪时间片段不连续的问题
seth-shi
2024/03/29
4300
PHP 中使用 opentelemetry-auto-laravel 进行链路追踪时间片段不连续的问题
使用 OpenTelemetry Tracing 了解您的微服务
微服务架构具有诸多优势,包括增强团队自主性、提高扩展与部署灵活性。但缺点是,系统中的服务越多(一个微服务应用可能包含几十个甚至几百个服务),清晰地了解系统总体运行情况的难度就越大。作为复杂软件系统的编写者和维护者,我们深知掌握系统运行情况的重要性。可观测性工具可帮助我们清晰地了解众多服务和支持基础设施。
我是阳明
2023/08/21
8810
使用 OpenTelemetry Tracing 了解您的微服务
Jaeger引入了对OpenTelemetry的原生支持
最新的Jaeger v1.35 版本[1]引入了通过OpenTelemetry 协议(OTLP)[2]接收 OpenTelemetry 追踪数据的能力,所有 OpenTelemetry SDK 都需要支持该协议。这是之前宣布淘汰 Jaeger“经典”客户端库[3]的后续。
CNCF
2022/06/10
2.1K0
Jaeger引入了对OpenTelemetry的原生支持
Java 应用通过 OpenTelemetry API 实现手动埋点
我们知道对于 Java 应用可以通过 OpenTelemetry 提供的 Java agent 来实现自动埋点功能,在大多数场景下也完全足够了,但是有时候我们需要更加精细的控制,这时候我们就需要使用手动埋点的方式来实现了。
我是阳明
2023/09/11
1.4K0
Java 应用通过 OpenTelemetry API 实现手动埋点
OpenTelemetry 在 Go 项目中的集成与使用
在我们上一篇文章中,我们讨论了OpenTelemetry的核心概念和它为何重要。今天,我们将探讨如何在Go项目中集成OpenTelemetry。
运维开发王义杰
2023/08/10
1.4K0
OpenTelemetry 在 Go 项目中的集成与使用
一探究竟新一代可观测标准OpenTelemetry
相信大家日常经常使用kibana、grafana、jaeger等平台观察系统状态和定位问题,这些就是可观测体系的一部分。可观测主要包括:
用户1093396
2023/09/01
1.4K0
一探究竟新一代可观测标准OpenTelemetry
Opentelemetry——Instrumentation-Libraries
Learn how to add native instrumentation to your library. 了解如何将本地测量装置添加到您的库中。
方亮
2024/05/24
1390
Opentelemetry——Instrumentation-Libraries
技术阅读摘要-2.OpenTelemetry技术概览
本系列的第二讲,我原先计划聊一下OpenTracing这个技术,但计划赶不上变化,我发现OpenTracing的官网上已经声明:这部分的技术将迁移到OpenTelemetry。
junedayday
2021/10/27
1.3K0
使用OpenTelemetry对React应用程序进行插桩
了解如何在 React 应用程序中使用 OpenTelemetry,包括基本和自动插桩,以及添加自定义跨度和指标。
云云众生s
2024/09/21
3420
使用OpenTelemetry对React应用程序进行插桩
跨服务链路追踪:一次完整的 OpenTelemetry 使用实践
在现代的微服务架构中,一个用户请求可能需要跨多个服务才能完全处理。这样的复杂性可能会给诊断问题和性能优化带来挑战。因此,跨服务链路追踪技术的应用越来越受到关注。
运维开发王义杰
2023/08/10
2.6K0
跨服务链路追踪:一次完整的 OpenTelemetry 使用实践
基于OpenTelemetry实现Java微服务调用链跟踪
随着业务的发展,所有的系统都会走向微服务化体系,微服务进行拆分后,服务的依赖关系变得复杂,如果出现了错误和异常,定位的过程将会变得复杂,一个请求可能需要调用很多个服务,所以微服务架构中,分布式链路跟踪的实现至关重要,去跟进一个请求到底有哪些服务参与,参与的顺序又是怎样的,从而达到每个请求的步骤清晰可见。如何快速查询整个请求链路上的信息并呈现出来是解决排查问题复杂度的根本方法。
用户1107783
2024/04/11
2670
基于OpenTelemetry实现Java微服务调用链跟踪
Opentelemetry——Components
The main components that make up OpenTelemetry 构成 OpenTelemetry 的主要组件
方亮
2024/05/24
1050
相关推荐
Opentelemetry——分析C++项目链接时循环依赖导致的错误
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验