Extension API: OpenTelemetry Exporter

Open
#1,821 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
json, rust

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Rust
Stars
546
Forks
84
Avg merge
2d 9h
Merged PRs (30d)
25

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/DSC

All issues in PowerShell/DSC

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.