Skip to content

Whether the user needs to determine the status of span to reduce the consumption caused by tracking! #2994

Answered by dmathieu
AtlanCI asked this question in Q&A
Discussion options

You must be logged in to vote

span.SpanContext.IsValid checks that the current trace and span IDs are valid:

func (sc SpanContext) IsValid() bool {

span.SpanContext.IsSampled checks whethere the span state has the sample flag (coming from the propagator):

func (sc SpanContext) IsSampled() bool {

span.IsRecording returns true if the span is recording (and if it's not finished).
A recording span: https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/trace/span.go#L172
A non-recording span: https://github.com/open-telemetry/opentelemetry-go/blob/main/trace/noop.go#L65

With…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
4 replies
@AtlanCI
Comment options

@AtlanCI
Comment options

@dmathieu
Comment options

@AtlanCI
Comment options

Comment options

You must be logged in to vote
5 replies
@AtlanCI
Comment options

@dmathieu
Comment options

@AtlanCI
Comment options

@dmathieu
Comment options

@AtlanCI
Comment options

Answer selected by AtlanCI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants