open-telemetry / open-telemetry/opentelemetry-java
getMap error message shows null value for hyphenated or mixed-case property names
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 58
Description
Describe the bug
DefaultConfigProperties.getMap(String) builds the "Invalid map property" error message with the raw property name, so the value shown is null whenever the caller passes a name that needs normalization (hyphens or upper case).
Steps to reproduce
Call getMap with a hyphenated name whose value is a malformed map entry:
DefaultConfigProperties.createFromMap(Collections.singletonMap("test-map", "a=1,b"))
.getMap("test-map");
What did you expect to see?
A message reporting the actual configured value, e.g. Invalid map property: test-map=a=1,b, matching the value lookup that getList already does with ConfigUtil.normalizePropertyKey.
What did you see instead?
Invalid map property: test-map=null. The stored config keys are normalized (test-map -> test.map), but DefaultConfigProperties.getMap() looks the value up with the un-normalized name via config.get(name), so the lookup misses and prints null.
What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-extension-autoconfigure-spi
Version: main @ 09d6c17f3
How did you reference these artifacts? Gradle, io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi
Environment
Compiler: Temurin 21
OS: N/A
Additional context
Only the error message string is affected; getMap's normal return path already uses the normalized key, so hyphenated or mixed-case names work otherwise.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at DefaultConfigProperties.getMap(String) and compare its error-message lookup with the normalized-key lookup used by getList. Reproduce the malformed "test-map" case through createFromMap, then verify that the error reports the configured value rather than null while normal getMap behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100