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 摘要。