Describe the bug
When using the declarative config in opentelemetry-java, the code for environment variable substitution (as per the OpenTelemetry spec and implemented via an extension of SnakeYAML) causes parsing errors for YAML values containing both single and double quotes. This occurs even if the value is not intended for environment variable substitution (i.e., it is just a regular string, not referencing an environment variable).
Steps to reproduce
- Use a configuration like:
resource:
attributes:
- name: single_quote
value: '"single"'
- name: double_quote
value: "\"double\""
- Load this YAML file with the opentelemetry-java SDK (poc branch or main), with the environment variable substitution code present (no need to actually use environment variables in the values).
What did you expect to see?
The quoted values should be parsed as literal strings including both single and double quotes, as written.
What did you see instead?
The parser produces incorrect values (quotes missing or misinterpreted) or throws errors, even though the values are not referencing environment variables.