Package io.sentry

Class SpanContext

  • Direct Known Subclasses:
    TransactionContext

    public class SpanContext
    extends java.lang.Object
    • 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)  
    • Field Detail

      • 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)