Extension API: OpenTelemetry Exporter

未关闭
#1,821 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
json, rust

调研方向

Start by reading the prerequisites linked in the issue: #1782 and #1792 for JSON-RPC extensions, and #1080 for extension options; the full specification depends on those implementations. The issue proposes an OpenTelemetry extension capability that exports tracing spans, but leaves its full specification open. Done means defining the extension API and supporting the listed trace export requirements; the payload names no files or tests.

由索引模型根据 Issue 内容生成。

描述

Area-OpenTelemetry Issue-Enhancement
Summary of the new feature / enhancement

As an infrastructure engineer,
I want to export the OpenTelemetry data from DSC invocations,
So that I can review and explore performance and behavior.

As an integrating developer,
I want to consume OpenTelemetry from DSC,
So that I can integrate that data into my own OpenTelemetry.

With the merging of #1795, the DSC engine can support gathering OpenTelemetry tracing data from an invocation. However, the initial implementation uses a noop span exporter, so the data is discarded. There's no way to emit the telemetry to an OpenTelemetry collector or a backend that accepts OpenTelemetry data.

DSC should provide two supported exporters that are available in the DSC release package:

  1. Exporting to the OpenTelemetry Collector, which is the recommendation for production environments.
  2. Exporting spans to a file as JSON Lines, per OpenTelemetry Protocol File Exporter, which is convenient for testing purposes and when debugging without a visualization backend.

Instead of implementing this functionality directly in the engine, and to ensure we can support emitting OpenTelemetry to any collector or backend, we should define an extension API that defines where to emit telemetry.

Proposed technical implementation details (optional)

We should add a new capability to DSC extensions for OpenTelemetry. An extension with the otel capability indicates that the extension handles exporting OpenTelemetry data from DSC.

Initially, we need to support exporting tracing spans. We can defer exporting metrics and logs, as we don't currently collect either.

Implementing this capability has a few prerequisites that need to be in place before we can fully implement the built-in extensions:

  1. We need to enable extensions to run as JSON-RPC processes, as with the proposal for resources (see #1782 and #1792). Without this functionality, DSC would need to spin up the extension every time we need to batch emit tracing data. It will be much more coherent to start the extension as a JSON-RPC server and send the tracing data to it as part of the batch exporting in the engine.

  2. We need to add support for extension options (see #1080). Without users being able to define options the extensions will either need to be locked to a hardcoded export endpoint or document controlling environment variables separately from DSC.

    Since this functionality is specific to forwarding telemetry for DSC and it's very reasonable for users to configure their exporters to work with different targets, we must support ergonomic option definitions for these extensions.

The following list clarifies some design proposals assuming those prerequisites are implemented. Full spec depends on those implementations.

  • DSC uses batch exporting for tracing spans, sending the data to the extension over JSON-RPC as OTLP JSON. For more information on OTLP JSON, see:

  • DSC handles collecting and propagating tracing spans and events from all sources in an invocation except from the OpenTelemetry extension. I think we should avoid having the extension emit tracing events to DSC for DSC to send back to the extension.

  • If the DSC settings indicate that the engine should collect and export tracing data, the engine must start the appropriate extension as early as possible and ensure that all spans are emitted before shutdown, even in the case of interruption or failure.

  • Initially, collecting and exporting OpenTelemetry data should be disabled by default.

  • OpenTelemetry extensions should only support JSON-RPC invocation.

  • OpenTelemetry extensions should not implement any filtering on tracing level. They should rely on DSC to handle that functionality (since it's built into the propagation/export logic). The extensions may support other forms of filtering but aren't required to.

  • OpenTelemetry extensions should indicate the telemetry kinds they support from the following list: traces, metrics, and logs. Initially, DSC only supports traces, but we should ensure that we can support forwarding those types of telemetry in the future.

主要语言
Rust
星标
546
派生
84
平均合并
2 天 9 小时
30 天内合并 PR
25

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/DSC 的其他 Issue

查看 PowerShell/DSC 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。