@conduit-client/service-instrumentation

中文文档
3.34.0发布于 2026/11/05SEE LICENSE IN LICENSE.txtTypeScriptESM + CJS近 30 天下载 4.2万

Luvio仪器服务定义

中文使用文档
文档目录5 节
  1. 软件包结构
  2. 安装
  3. 使用量
  4. 无操作执行
  5. 添加到接口

该软件目前没有得到任何支持.

卢维奥仪器服务公司

本套件再出口仪器服务接口类型和实施.

软件包结构

仪表服务分为:

此主软件包( E)-client/service-instrumentation)再出口出所有类型和执行,以保持后向相容性.

安装

npm install -client/service-instrumentation

使用量

// Using the noop implementation
import { buildNoopInstrumentationServiceDescriptor } from '@conduit-client/service-instrumentation/v1';

const noopService = buildNoopInstrumentationServiceDescriptor();

// Using the o11y implementation
import { buildO11yInstrumentationServiceDescriptor } from '@conduit-client/service-instrumentation/v1';
import { logger } from '@conduit-client/logger';

const o11yService = buildO11yInstrumentationServiceDescriptor(logger);

仪器服务

我们是关于标准在这里。 OpenTeleometry是标准. 我们还在揭露他们的API对于图书馆的道理。 我们要追踪和记录衡量标准。 我们也想登录,但这个部分是 开发中 (截至2024年3月),因此,为了稳定起见,我们将不这样做.

无操作执行

我们提供了一个不执行的OOTB,因此,如果不提供实际执行,事情就会顺利进行.

使用 buildNoopInstrumentationService 当建立你的服务.

import { buildNoopInstrumentationService } from '@conduit-client/service-instrumentation/v1';

边:我们最初尝试了使用OTel API提供的"不开放"执行,但成本为7kb,这对我们的口味来说有点丰富,尤其是当这项服务暴露出API中相对较小的子集时. 我敢肯定,有办法 缩小范围, 但是现在,我们应付 我们自己的

添加到接口

所以你意识到我们 有过 拥有 DiagAPI 作为API的一部分? (我们也许应该加到某个时候)

这个过程相当简单,虽然很乏味(因为手卷了一个"不操作"执行和单位测试). 重要的是,我们只是拉 API那部分有道理。 例如,与 跟踪API, (中文(简体) ), setGlobalTracerProvider 是运行时间应用的责任, 我们不应该有权力自己设置它, 所以我们不提这一点。 考虑到这一点,只有几个步骤可以采取.

  1. 从 OTel API 创建您想要包含、 使用的类型 Pick<> 选择什么才有意义
  2. 添加到服务界面
  3. 创建“禁用操作”执行程序,同时进行单位测试,使我们的代码覆盖面保持幸福
  4. 更新 buildNoopInstrumentationService 函数

离职 此公关 将 MetricsAPI 添加到服务接口中以用于指导.

版本与发布记录

@conduit-client/service-instrumentation 共发布 74 个版本,首次发布于 2025/11/01;过去 12 个月发布了 71 个版本。

版本发布日期距今
3.34.0latest2026/11/055 天前
3.33.02026/10/2912 天前
3.32.12026/10/2219 天前
3.32.02026/10/1526 天前
3.31.02026/10/091 个月前
3.30.12026/10/091 个月前

其他发布通道:patch → 3.26.1-dev3。

关于 @conduit-client/service-instrumentation 的常见问题

@conduit-client/service-instrumentation 是什么?

Luvio仪器服务定义

如何安装 @conduit-client/service-instrumentation?

在项目目录运行 npm install @conduit-client/service-instrumentation,或使用 pnpm add / yarn add / bun add。

@conduit-client/service-instrumentation 支持 TypeScript 吗?

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

@conduit-client/service-instrumentation 支持 ESM 还是 CommonJS?

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

@conduit-client/service-instrumentation 可以商用吗?

@conduit-client/service-instrumentation 使用 SEE LICENSE IN LICENSE.txt 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@conduit-client/service-instrumentation 的下载量有多少?

根据 npm 官方下载统计,@conduit-client/service-instrumentation 在 2026/10/11 – 2026/11/09 这 30 天内被下载 41,761 次,日均约 1,392 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@conduit-client/service-instrumentation 还在维护吗?

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