Skip to content

Conversation

@zeitlinger
Copy link
Member

@trask the tests were lacking - so it seemed fine to remove SpringConfigProvider - but it turned out that it's needed.

@zeitlinger zeitlinger self-assigned this Jan 6, 2026
@zeitlinger zeitlinger requested a review from a team as a code owner January 6, 2026 14:36
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Jan 6, 2026
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

I'd prefer if we can find a way to map to typed data based on the yaml content only instead of dynamically coercing based on whether getInt or getString happens to be called by the user

string_key_with_env_quoted: "${STRING_ENV:default_quoted_value}"
int_key: 42
int_key_with_env: ${INT_ENV:100}
int_key_with_env_quoted: "${INT_ENV:200}"
Copy link
Member

Choose a reason for hiding this comment

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

should "${INT_ENV:200}" resolve to a string instead of an int?

e.g. see the examples at https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/data-model.md#environment-variable-substitution

or if we're aligning with Spring rules for mapping yaml data to types, can you link to those rules?

Copy link
Member Author

Choose a reason for hiding this comment

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

Spring has this workflow:

  1. flatten YAML to flat properties
  2. resolve expressions
  3. inject and bind into application (e.g. ConfigurationProperties)

The problem is that the type info is lost when expressions are resolved - unlike the SDK YAML parser (as shown below).
I tried parsing the YAML file directly at first, but this breaks down when you use multiple YAML files (e.g. for a production profile), or when you use env var overrides, e.g. OTEL_INSTRUMENTATION_DEVELOPMENT_JAVA_FOO_INT_KEY = 43.

@laurit please double check if I missed something, as you helped with this part.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Thinking a bit more about this I've found a solution that is only coerces environment variables: #15784

Let me know what you think.

Copy link
Member Author

Choose a reason for hiding this comment

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

@trask please review this again after you said that #15784 is not better.

@trask trask added this to the v2.24.0 milestone Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants