open-telemetry / open-telemetry/opentelemetry-cpp

Scope docstring is confusing/wrong?

Open
#2,508 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Stale triage/accepted
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

Is your feature request related to a problem?

Scope is documented as "On destruction, the given span is ended":

https://github.com/open-telemetry/opentelemetry-cpp/blob/8da71b78ed01bd1e40861b0ab50c1362e03abf15/api/include/opentelemetry/trace/scope.h#L18-L24

However, from looking through the implementation, it appears only to reset the active span and doesn't actually end the span? Examples in documentation align with this (e.g. creating a scope, then explicitly ending the span). Also, if it did end the span, that would mean there is no (obvious) way to activate a span without ending it.

Describe the solution you'd like
Update the docstring.

Describe alternatives you've considered
N/A

Additional context
N/A

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

Read api/include/opentelemetry/trace/scope.h at lines 18-24, then compare its description with the implementation and the documentation examples referenced in the issue. Update the docstring so it accurately describes Scope behavior, and verify that the wording matches how spans are explicitly ended in those examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation, observability
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.