open-telemetry / open-telemetry/opentelemetry-ruby

SpanKind immutable to SpanProcessors

Open
#1,934 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The SpanKind (span.kind) is inherently considered immutable and only to be set on Span creation.
However a SpanProcessor should be able to essentially perform any kind of change to Spans (especially on the on_start and on_finishing methods).

Currently there is no way to adjust the kind within a Span processor without resulting to unsafe Ruby core functionality (e.g. span.instance_variable_set(:@kind, ::OpenTelemetry::Trace::SpanKind::CONSUMER)). It would be better if there were a dedicated way for a SpanProcessor to adjust the kind.

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 the SpanKind definition and immutability behavior in sdk/lib/opentelemetry/sdk/trace/span.rb, then inspect the SpanProcessor on_start and on_finishing entry points. Define and implement a supported way for processors to adjust kind without unsafe instance-variable access; done means the behavior is covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.