Skip to content

feat(sdk): add MissingDependencyError for declarative configuration#5265

Open
dharaneeshexe-web wants to merge 1 commit into
open-telemetry:mainfrom
dharaneeshexe-web:dharaneeshexe-web/feat/missing-dependency-error
Open

feat(sdk): add MissingDependencyError for declarative configuration#5265
dharaneeshexe-web wants to merge 1 commit into
open-telemetry:mainfrom
dharaneeshexe-web:dharaneeshexe-web/feat/missing-dependency-error

Conversation

@dharaneeshexe-web

@dharaneeshexe-web dharaneeshexe-web commented Jun 1, 2026

Copy link
Copy Markdown

Changes

Adds a structured \MissingDependencyError\ (subclass of \ConfigurationError) that generates a descriptive pip install message when an optional dependency is missing. Replaces ad-hoc \ConfigurationError\ / \ImportError\ raises across all declarative config providers.

Key changes:

  • **_exceptions.py**: Added \MissingDependencyError\ with \package, \ eature, \install_name, \extras\ parameters and auto-generated pip install message
  • **_tracer_provider.py*, **_logger_provider.py*, **_meter_provider.py**: OTLP HTTP/gRPC exporter and Prometheus reader dependency checks now raise \MissingDependencyError\
  • **\ ile/_loader.py**: yaml/jsonschema import guards now raise \MissingDependencyError\
  • **\ ile/init.py**: Added \MissingDependencyError\ to re-exports
  • **\ est_exceptions.py**: 7 unit tests covering subclass check, minimal constructor, feature message, custom install_name, extras, and catch-as-ConfigurationError
  • **.changelog/5229.added**: Towncrier fragment

Closes #5229
Refs #3631

…ependency checking

Implements a structured MissingDependencyError (subclass of ConfigurationError)
that generates a descriptive pip install message. Replaces ad-hoc
ConfigurationError / ImportError raises across all declarative config
providers (tracer, logger, meter, file loader) for missing optional
dependencies like OTLP exporters, Prometheus reader, pyyaml, and
jsonschema.

Adds unit tests covering the new exception class.

Closes open-telemetry#5229
@dharaneeshexe-web dharaneeshexe-web requested a review from a team as a code owner June 1, 2026 09:32
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 1, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: dharaneeshexe-web / name: dharaneesh (3abac05)

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

@github-actions github-actions Bot added the Stale label Jun 16, 2026
@xrmx xrmx moved this to Easy to review / merge / close in Python PR digest Jun 18, 2026
@github-actions github-actions Bot removed the Stale label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Easy to review / merge / close

Development

Successfully merging this pull request may close these issues.

declarative config: detect and log missing dependencies

2 participants