Skip to content

opentelemetry-sdk: add support for file exporter with declarative config#5311

Open
herin049 wants to merge 4 commits into
open-telemetry:mainfrom
herin049:feat/file-exporter-decl-config
Open

opentelemetry-sdk: add support for file exporter with declarative config#5311
herin049 wants to merge 4 commits into
open-telemetry:mainfrom
herin049:feat/file-exporter-decl-config

Conversation

@herin049

@herin049 herin049 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

Add support for the newly added OTLP JSON File exporter to declarative config.

Refs #3631

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@herin049 herin049 requested a review from a team as a code owner June 16, 2026 18:46
@herin049 herin049 added the config Issues and PRs related to implementing Declarative Config label Jun 16, 2026
@herin049 herin049 requested a review from Copilot June 16, 2026 18:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the opentelemetry-sdk declarative configuration pipeline to support the experimental OTLP JSON Lines file exporter for traces, metrics, and logs by wiring new factory functions into the existing exporter registries and adding output_stream parsing/validation.

Changes:

  • Add otlp_file_development exporter factories for spans, metrics, and logs (with helpful “missing package” ConfigurationErrors).
  • Introduce _parse_otlp_file_output_stream() and corresponding unit tests for stdout, file://... URIs, and invalid schemes/inputs.
  • Add changelog entry for the new declarative-config capability.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_common.py Adds output_stream parsing helper used by file exporters.
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_tracer_provider.py Registers and constructs OTLP JSON file span exporter via declarative config.
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_meter_provider.py Registers and constructs OTLP JSON file metric exporter via declarative config.
opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_logger_provider.py Registers and constructs OTLP JSON file log exporter via declarative config.
opentelemetry-sdk/tests/_configuration/test_common.py Adds tests for _parse_otlp_file_output_stream().
opentelemetry-sdk/tests/_configuration/test_tracer_provider.py Adds trace pipeline tests for otlp_file_development exporter behavior.
opentelemetry-sdk/tests/_configuration/test_meter_provider.py Adds metric pipeline tests for otlp_file_development exporter behavior.
opentelemetry-sdk/tests/_configuration/test_logger_provider.py Adds log pipeline tests for otlp_file_development exporter behavior.
.changelog/5311.added Changelog entry for the new feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_common.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Issues and PRs related to implementing Declarative Config

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants