Package io.sentry
Class SpanContext
- java.lang.Object
-
- io.sentry.SpanContext
-
- All Implemented Interfaces:
JsonSerializable
,JsonUnknown
- Direct Known Subclasses:
TransactionContext
public class SpanContext extends java.lang.Object implements JsonUnknown, JsonSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpanContext.Deserializer
static class
SpanContext.JsonKeys
-
Field Summary
Fields Modifier and Type Field Description protected @Nullable java.lang.String
description
Longer description of the span's operation, which uniquely identifies the span but is consistent across instances of the span.protected @NotNull java.lang.String
op
Short code identifying the type of operation the span is measuring.protected @Nullable SpanStatus
status
Describes the status of the Transaction.protected @NotNull java.util.Map<java.lang.String,@NotNull java.lang.String>
tags
A map or list of tags for this event.static java.lang.String
TYPE
-
Constructor Summary
Constructors Constructor Description SpanContext(@NotNull SentryId traceId, @NotNull SpanId spanId, @NotNull java.lang.String operation, @Nullable SpanId parentSpanId, @Nullable java.lang.Boolean sampled)
SpanContext(@NotNull SentryId traceId, @NotNull SpanId spanId, @Nullable SpanId parentSpanId, @NotNull java.lang.String operation, @Nullable java.lang.String description, @Nullable java.lang.Boolean sampled, @Nullable SpanStatus status)
SpanContext(@NotNull SpanContext spanContext)
Copy constructor.SpanContext(@NotNull java.lang.String operation)
Creates trace context with deferred sampling decision.SpanContext(@NotNull java.lang.String operation, @Nullable java.lang.Boolean sampled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.lang.String
getDescription()
@NotNull java.lang.String
getOperation()
@Nullable SpanId
getParentSpanId()
@Nullable java.lang.Boolean
getSampled()
@NotNull SpanId
getSpanId()
@Nullable SpanStatus
getStatus()
@NotNull java.util.Map<java.lang.String,java.lang.String>
getTags()
@NotNull SentryId
getTraceId()
@Nullable java.util.Map<java.lang.String,java.lang.Object>
getUnknown()
void
serialize(@NotNull JsonObjectWriter writer, @NotNull ILogger logger)
void
setDescription(@Nullable java.lang.String description)
void
setOperation(@NotNull java.lang.String operation)
void
setSampled(@Nullable java.lang.Boolean sampled)
void
setStatus(@Nullable SpanStatus status)
void
setTag(@NotNull java.lang.String name, @NotNull java.lang.String value)
void
setUnknown(@Nullable java.util.Map<java.lang.String,java.lang.Object> unknown)
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
op
@NotNull protected @NotNull java.lang.String op
Short code identifying the type of operation the span is measuring.
-
description
@Nullable protected @Nullable java.lang.String description
Longer description of the span's operation, which uniquely identifies the span but is consistent across instances of the span.
-
status
@Nullable protected @Nullable SpanStatus status
Describes the status of the Transaction.
-
tags
@NotNull protected @NotNull java.util.Map<java.lang.String,@NotNull java.lang.String> tags
A map or list of tags for this event. Each tag must be less than 200 characters.
-
-
Constructor Detail
-
SpanContext
public SpanContext(@NotNull @NotNull java.lang.String operation, @Nullable @Nullable java.lang.Boolean sampled)
-
SpanContext
public SpanContext(@NotNull @NotNull java.lang.String operation)
Creates trace context with deferred sampling decision.- Parameters:
operation
- the operation
-
SpanContext
public SpanContext(@NotNull @NotNull SentryId traceId, @NotNull @NotNull SpanId spanId, @NotNull @NotNull java.lang.String operation, @Nullable @Nullable SpanId parentSpanId, @Nullable @Nullable java.lang.Boolean sampled)
-
SpanContext
@Internal public SpanContext(@NotNull @NotNull SentryId traceId, @NotNull @NotNull SpanId spanId, @Nullable @Nullable SpanId parentSpanId, @NotNull @NotNull java.lang.String operation, @Nullable @Nullable java.lang.String description, @Nullable @Nullable java.lang.Boolean sampled, @Nullable @Nullable SpanStatus status)
-
SpanContext
public SpanContext(@NotNull @NotNull SpanContext spanContext)
Copy constructor.- Parameters:
spanContext
- the spanContext to copy
-
-
Method Detail
-
setOperation
public void setOperation(@NotNull @NotNull java.lang.String operation)
-
setTag
public void setTag(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String value)
-
setDescription
public void setDescription(@Nullable @Nullable java.lang.String description)
-
setStatus
public void setStatus(@Nullable @Nullable SpanStatus status)
-
getTraceId
@NotNull public @NotNull SentryId getTraceId()
-
getSpanId
@NotNull public @NotNull SpanId getSpanId()
-
getParentSpanId
@Nullable @TestOnly public @Nullable SpanId getParentSpanId()
-
getOperation
@NotNull public @NotNull java.lang.String getOperation()
-
getDescription
@Nullable public @Nullable java.lang.String getDescription()
-
getStatus
@Nullable public @Nullable SpanStatus getStatus()
-
getTags
@NotNull public @NotNull java.util.Map<java.lang.String,java.lang.String> getTags()
-
getSampled
@Nullable public @Nullable java.lang.Boolean getSampled()
-
setSampled
@Internal public void setSampled(@Nullable @Nullable java.lang.Boolean sampled)
-
serialize
public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws java.io.IOException
- Specified by:
serialize
in interfaceJsonSerializable
- Throws:
java.io.IOException
-
getUnknown
@Nullable public @Nullable java.util.Map<java.lang.String,java.lang.Object> getUnknown()
- Specified by:
getUnknown
in interfaceJsonUnknown
-
setUnknown
public void setUnknown(@Nullable @Nullable java.util.Map<java.lang.String,java.lang.Object> unknown)
- Specified by:
setUnknown
in interfaceJsonUnknown
-
-