Skip to content

Add documentation on how to remove the span and disable implicit child spans for a particular code path #1717

Open
@anuraaga

Description

@anuraaga

Currently, the best way to how to remove the span and disable implicit child spans for a particular code path is probably this

try (Scope ignored = TracingContextUtils.currentContextWith(DefaultSpan.getInvalid())) {
  // Since scoped span is invalid, no tracing happens.
}

This should be documented, possibly with a helper somewhere, something like Scope withTracingDisabled().

/cc @marcingrzejszczak

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestSuggest an idea for this projectblocked:specblocked on open or unresolved spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions