open-telemetry / open-telemetry/opentelemetry-ruby
Make instrument name conflict detection case-insensitive
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 606
- Forks
- 301
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 42
Description
Spec requirement
Instrument names are case-insensitive; a second registration differing only by case MUST reuse the first-seen name and log a message (sdk.md:1017-1031).
Current behavior
@instrument_registry is a plain Ruby Hash keyed by the literal (case-sensitive) name string (meter.rb:32,258-260 (permalink)), so create_counter("requestCount") followed by create_counter("RequestCount") registers two independent instruments instead of being detected as the same name under case-insensitive comparison.
Suggested fix
Normalize the registry key (e.g. downcase) when checking for an existing instrument, while preserving and reusing the first-seen name's original casing, and log a message on the case-differing collision.
Related rows in SPEC_COMPLIANCE_METRICS.md
SDK-37
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 in metrics_api/lib/opentelemetry/metrics/meter.rb, especially the @instrument_registry declaration and the lookup around lines 258-260. Compare the behavior with SDK-37 in SPEC_COMPLIANCE_METRICS.md and the linked metrics SDK requirement. Done means case-only duplicate names reuse the first-seen casing and emit the required collision message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100