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
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

…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
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 1, 2026

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

declarative config: detect and log missing dependencies

1 participant