Skip to content

comment on Scope class is not accurate regarding span ended #3109

@brucedlg

Description

@brucedlg

api/include/opentelemetry/trace/scope.h has following comment on the Scope class:

/**
 * Controls how long a span is active.
 *
 * On creation of the Scope object, the given span is set to the currently
 * active span. On destruction, the given span is ended and the previously
 * active span will be the currently active span again.
 */
class Scope final

It specifies that "the given span is ended". This is not accurate. The span is not ended simply because scope object is destroyed.

Users may not explicitly call span.End() based on the comment. This could delay the end of span.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions