@azure/core-tracing

中文文档
1.4.0发布于 2026/07/14MITTypeScriptESM + CJS近 30 天下载 9902.6万

Provides low-level interfaces and helper methods for tracing in Azure SDK

原始使用文档
文档目录7 节
  1. Getting started
  2. Installation
  3. Key Concepts
  4. Examples
  5. Next steps
  6. Troubleshooting
  7. Contributing

Azure Core tracing library for JavaScript

This is the core tracing library that provides low-level interfaces and helper methods for tracing in Azure SDK JavaScript libraries which work in the browser and Node.js.

Getting started

Installation

This package is primarily used in Azure client libraries and not meant to be used directly by consumers of Azure SDKs.

Key Concepts

  • TracingClient is the primary interface providing tracing functionality to client libraries. Client libraries should only be aware of and interact with a TracingClient instance.
    • A TracingClient implementation can be created using the createTracingClient factory function.
  • Instrumenter provides an abstraction over an instrumentation and acts as the interop point for using third party libraries like OpenTelemetry. By default, a no-op Instrumenter is used. Customers who wish to enable OpenTelemetry based tracing will do so by installing and registering the @azure/opentelemetry-instrumentation-azure-sdk package.
  • TracingContext is an immutable data container, used to pass operation-specific information around (such as span parenting information).
  • TracingSpan is an abstraction of a Span which can be used to record events, attributes, and exceptions.

Examples

Examples can be found in the samples folder.

Next steps

You can build and run the tests locally by executing npm run test. Explore the test folder to see advanced usage and behavior of the public classes.

Troubleshooting

If you run into issues while using this library, please feel free to file an issue.

Contributing

If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.

版本与发布记录

@azure/core-tracing 共发布 535 个版本,首次发布于 2019/08/07;过去 12 个月发布了 74 个版本。

版本发布日期距今
1.4.0latest2026/07/143 个月前
1.3.2-alpha.20260311.2dev2026/03/127 个月前
1.3.2-alpha.20260310.22026/03/117 个月前
1.3.2-alpha.20260309.32026/03/107 个月前
1.3.2-alpha.20260306.42026/03/078 个月前
1.3.2-alpha.20260305.62026/03/068 个月前

关于 @azure/core-tracing 的常见问题

@azure/core-tracing 是什么?

Provides low-level interfaces and helper methods for tracing in Azure SDK

如何安装 @azure/core-tracing?

在项目目录运行 npm install @azure/core-tracing,或使用 pnpm add / yarn add / bun add。

@azure/core-tracing 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@azure/core-tracing 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@azure/core-tracing 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@azure/core-tracing 可以商用吗?

@azure/core-tracing 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@azure/core-tracing 的下载量有多少?

根据 npm 官方下载统计,@azure/core-tracing 在 2026/10/08 – 2026/11/06 这 30 天内被下载 99,025,641 次,日均约 3,300,855 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@azure/core-tracing 还在维护吗?

最新版本 1.4.0 发布于 2026/07/14(3 个月前);至今共发布 535 个版本,其中过去 12 个月发布了 74 个;首次发布于 2019/08/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。