open-telemetry / open-telemetry/opentelemetry-ruby

Update `Internal.valid_attributes` for reuse with log records

Open
#1,739 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

keep logs
Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

Description

There's a lot of duplication among the tracing SDK and the logs SDK. One of the areas of duplication is with LogRecord#validate_attributes. This is very similar to the code in Internal.valid_attributes.

Once the logs SDK is stable and we're ready to bring it into the main SDK gem, refactor Internal.valid_attributes for use with both signals. Depending on the timing, this may also be helpful for metric attribute validation as well.

This issue originated from this comment: https://github.com/open-telemetry/opentelemetry-ruby/pull/1696/files#r1759599051

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 by reading Internal.valid_attributes and LogRecord#validate_attributes, then compare the tracing and logs SDK validation paths. Determine the shared behavior needed for both signals, with metric attribute validation as a possible extension. Done means the duplicated validation is reusable without changing the required behavior for logs or tracing.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.