open-telemetry / open-telemetry/opentelemetry-ruby

Restrict `Logger` construction to `LoggerProvider` only

Open
#2,350 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement logs spec-compliance spec:stable
Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

Description

Spec requirement

It SHOULD only be possible to create Logger instances through a LoggerProvider (sdk.md:71-72 (permalink)).

Current behavior

logs_sdk/lib/opentelemetry/sdk/logs/logger.rb:24 (permalink
Logger.new(name, version, logger_provider) is a fully public constructor, restricted only by a docs comment rather than any language-level visibility control.

Suggested fix

Consider making Logger.new private and exposing an internal factory only LoggerProvider can call. This is a SHOULD, not a MUST, so weigh the ergonomics tradeoff before changing the public method's visibility. If it's determined we should not update this method, clearly document it in this issue.

Related rows in SPEC_COMPLIANCE_LOGS.md

SDK-3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with logs_sdk/lib/opentelemetry/sdk/logs/logger.rb at the public constructor, then inspect LoggerProvider and the referenced sdk.md lines 71-72. Review SPEC_COMPLIANCE_LOGS.md for SDK-3 and run the logs SDK tests. Done means the provider-only construction decision is implemented or clearly documented, with the compliance entry reflecting that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.