Transaction "Class", inherits Span only has setName

Hierarchy

Properties

data: {
    [key: string]: any;
}

Data of the Span.

Type declaration

  • [key: string]: any
description?: string

Description of the Span.

endTimestamp?: number

Timestamp in seconds (epoch time) indicating when the span ended.

instrumenter: Instrumenter

The instrumenter that created this transaction.

metadata: TransactionMetadata

Metadata about the transaction

name: string

Human-readable identifier for the transaction

op?: string

Operation of the Span.

parentSampled?: boolean

If this transaction has a parent, the parent's sampling decision

parentSpanId?: string

Parent Span ID

sampled?: boolean

Was this span chosen to be sent as part of the sample?

spanId: string

Span ID

startTimestamp: number

Timestamp in seconds (epoch time) indicating when the span started.

status?: string

Completion status of the Span. See: {@sentry/tracing SpanStatus} for possible values

tags: {
    [key: string]: Primitive;
}

Tags of the Span.

Type declaration

  • [key: string]: Primitive
traceId: string

Trace ID

transaction?: Transaction

The transaction containing this span

trimEnd?: boolean

If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming the duration of the transaction. This is useful to discard extra time in the transaction that is not accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.

Methods

  • Sets the finish timestamp on the current span.

    Parameters

    • Optional endTimestamp: number

      Takes an endTimestamp if the end should not be the time when you call this function.

    Returns void

  • Return the current Dynamic Sampling Context of this transaction

    Returns Partial<DynamicSamplingContext>

  • Convert the object to JSON for w. spans array info only

    Returns {
        data?: {
            [key: string]: any;
        };
        description?: string;
        op?: string;
        parent_span_id?: string;
        span_id: string;
        status?: string;
        tags?: {
            [key: string]: Primitive;
        };
        trace_id: string;
    }

    • Optional data?: {
          [key: string]: any;
      }
      • [key: string]: any
    • Optional description?: string
    • Optional op?: string
    • Optional parent_span_id?: string
    • span_id: string
    • Optional status?: string
    • Optional tags?: {
          [key: string]: Primitive;
      }
      • [key: string]: Primitive
    • trace_id: string
  • Determines whether span was successful (HTTP200)

    Returns boolean

  • Set the context of a transaction event

    Parameters

    • key: string
    • context: Context

    Returns void

  • Sets the data attribute on the current span

    Parameters

    • key: string

      Data key

    • value: any

      Data value

    Returns Transaction

  • Sets the status attribute on the current span based on the http code

    Parameters

    • httpStatus: number

      http code used to set the status

    Returns Transaction

  • Set observed measurement for this transaction.

    Parameters

    • name: string

      Name of the measurement

    • value: number

      Value of the measurement

    • unit: MeasurementUnit

      Unit of the measurement. (Defaults to an empty string)

    Returns void

  • Set the name of the transaction

    Parameters

    Returns void

  • Sets the status attribute on the current span See: {@sentry/tracing SpanStatus} for possible values

    Parameters

    • status: string

      http code used to set the status

    Returns Transaction

  • Sets the tag attribute on the current span.

    Can also be used to unset a tag, by passing undefined.

    Parameters

    • key: string

      Tag key

    • value: Primitive

      Tag value

    Returns Transaction

  • Creates a new Span while setting the current Span.id as parentSpanId. Also the sampled decision will be inherited.

    Parameters

    • Optional spanContext: Pick<SpanContext, "instrumenter" | "data" | "tags" | "description" | "op" | "status" | "spanId" | "startTimestamp" | "endTimestamp">

    Returns Span

  • Convert the object to JSON

    Returns {
        data?: {
            [key: string]: any;
        };
        description?: string;
        op?: string;
        parent_span_id?: string;
        span_id: string;
        start_timestamp: number;
        status?: string;
        tags?: {
            [key: string]: Primitive;
        };
        timestamp?: number;
        trace_id: string;
    }

    • Optional data?: {
          [key: string]: any;
      }
      • [key: string]: any
    • Optional description?: string
    • Optional op?: string
    • Optional parent_span_id?: string
    • span_id: string
    • start_timestamp: number
    • Optional status?: string
    • Optional tags?: {
          [key: string]: Primitive;
      }
      • [key: string]: Primitive
    • Optional timestamp?: number
    • trace_id: string
  • Return a traceparent compatible header string

    Returns string

Generated using TypeDoc