Skip to content

fix(configuration): parse declarative config YAML as YAML 1.2 - #5935

Open
eisen0419 wants to merge 1 commit into
open-telemetry:mainfrom
eisen0419:fix/declarative-config-yaml-1-2
Open

eisen0419 wants to merge 1 commit into
open-telemetry:mainfrom
eisen0419:fix/declarative-config-yaml-1-2

Conversation

@eisen0419

Copy link
Copy Markdown

Description

Declarative configuration YAML files were parsed with PyYAML's SafeLoader, which implements YAML 1.1 rather than the YAML 1.2 Core schema specified by the OpenTelemetry file configuration specification. Plain scalars such as on / yes / off / no resolved to booleans, 1:20 resolved to sexagesimal 80, 010 resolved to octal 8, timestamps became datetime.date, and standalone ${VAR} environment substitutions re-resolved through the same YAML 1.1 rules.

This adds a private pure-Python yaml.loader.SafeLoader subclass (_YAML12CoreLoader) with isolated Core schema implicit resolvers and explicit !!bool / !!int / !!float constructors, without adding any third-party dependency or mutating global yaml.safe_load behavior.

Configs that relied on YAML 1.1 boolean words (disabled: on), sexagesimal scalars, legacy 010 octals, implicit timestamps, or << merge keys will now parse according to YAML 1.2 Core rules.

Fixes #5909

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I am a human and not a bot
  • I have run tox -e precommit
  • I have run tox -e typecheck
  • I have run the relevant tests and linting tox environments

PyYAML's SafeLoader implements YAML 1.1, so plain scalars such as on, yes,
and 1:20 were loaded as booleans and integers. Configuration files now use
a SafeLoader subclass that applies the YAML 1.2 Core schema, including when
a plain ${VAR} is re-resolved after env substitution.

Fixes open-telemetry#5909
@eisen0419
eisen0419 requested a review from a team as a code owner November 14, 2026 07:01
@eisen0419
eisen0419 force-pushed the fix/declarative-config-yaml-1-2 branch from a20da58 to c8350b7 Compare November 14, 2026 07:01
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

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

  • ✅ login: eisen0419 / name: eisen0419 (c8350b7)

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-14 07:23 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@eisen0419

Copy link
Copy Markdown
Author

/easycla

This branch has not been deployed

No deployments
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.

opentelemetry-configuration: YAML config files are parsed as YAML 1.1 instead of 1.2

1 participant