Package io.sentry
Class SpanContext
java.lang.Object
io.sentry.SpanContext
- All Implemented Interfaces:
JsonSerializable
,JsonUnknown
- Direct Known Subclasses:
TransactionContext
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
-
Field Summary
Modifier and TypeFieldDescriptionprotected @Nullable String
Longer description of the span's operation, which uniquely identifies the span but is consistent across instances of the span.protected @NotNull String
Short code identifying the type of operation the span is measuring.protected @Nullable String
Describes the status of the Transaction.protected @Nullable SpanStatus
Describes the status of the Transaction.A map or list of tags for this event.static final String
-
Constructor Summary
ConstructorDescriptionSpanContext
(@NotNull SentryId traceId, @NotNull SpanId spanId, @NotNull String operation, @Nullable SpanId parentSpanId, @Nullable TracesSamplingDecision samplingDecision) SpanContext
(@NotNull SentryId traceId, @NotNull SpanId spanId, @Nullable SpanId parentSpanId, @NotNull String operation, @Nullable String description, @Nullable TracesSamplingDecision samplingDecision, @Nullable SpanStatus status, @Nullable String origin) SpanContext
(@NotNull SpanContext spanContext) Copy constructor.SpanContext
(@NotNull String operation) Creates trace context with deferred sampling decision.SpanContext
(@NotNull String operation, @Nullable TracesSamplingDecision samplingDecision) -
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable String
@NotNull String
@Nullable String
@Nullable SpanId
@Nullable Boolean
@Nullable Boolean
@Nullable TracesSamplingDecision
@NotNull SpanId
@Nullable SpanStatus
getTags()
@NotNull SentryId
int
hashCode()
void
serialize
(@NotNull ObjectWriter writer, @NotNull ILogger logger) void
setDescription
(@Nullable String description) void
setOperation
(@NotNull String operation) void
void
setSampled
(@Nullable Boolean sampled) void
setSampled
(@Nullable Boolean sampled, @Nullable Boolean profileSampled) void
setSamplingDecision
(@Nullable TracesSamplingDecision samplingDecision) void
setStatus
(@Nullable SpanStatus status) void
void
setUnknown
(@Nullable Map<String, Object> unknown)
-
Field Details
-
TYPE
- See Also:
-
op
Short code identifying the type of operation the span is measuring. -
description
Longer description of the span's operation, which uniquely identifies the span but is consistent across instances of the span. -
status
Describes the status of the Transaction. -
tags
A map or list of tags for this event. Each tag must be less than 200 characters. -
origin
Describes the status of the Transaction.
-
-
Constructor Details
-
SpanContext
public SpanContext(@NotNull @NotNull String operation, @Nullable @Nullable TracesSamplingDecision samplingDecision) -
SpanContext
Creates trace context with deferred sampling decision.- Parameters:
operation
- the operation
-
SpanContext
public SpanContext(@NotNull @NotNull SentryId traceId, @NotNull @NotNull SpanId spanId, @NotNull @NotNull String operation, @Nullable @Nullable SpanId parentSpanId, @Nullable @Nullable TracesSamplingDecision samplingDecision) -
SpanContext
@Internal public SpanContext(@NotNull @NotNull SentryId traceId, @NotNull @NotNull SpanId spanId, @Nullable @Nullable SpanId parentSpanId, @NotNull @NotNull String operation, @Nullable @Nullable String description, @Nullable @Nullable TracesSamplingDecision samplingDecision, @Nullable @Nullable SpanStatus status, @Nullable @Nullable String origin) -
SpanContext
Copy constructor.- Parameters:
spanContext
- the spanContext to copy
-
-
Method Details
-
setOperation
-
setTag
-
setDescription
-
setStatus
-
getTraceId
-
getSpanId
-
getParentSpanId
-
getOperation
-
getDescription
-
getStatus
-
getTags
-
getSamplingDecision
-
getSampled
-
getProfileSampled
-
setSampled
-
setSampled
-
setSamplingDecision
@Internal public void setSamplingDecision(@Nullable @Nullable TracesSamplingDecision samplingDecision) -
getOrigin
-
setOrigin
-
equals
-
hashCode
public int hashCode() -
serialize
public void serialize(@NotNull @NotNull ObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serialize
in interfaceJsonSerializable
- Throws:
IOException
-
getUnknown
- Specified by:
getUnknown
in interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknown
in interfaceJsonUnknown
-