SegmentSpec

Baseline spec implementation. Can be utilized anywhere a generic spec will satisfy the requirements. Some shims require more specialized specs that this one does not satisfy.

Constructor

new SegmentSpec(params)

Parameters:
NameTypeDescription
paramsSegmentSpecParams

Spec properties to set.

Members

inContext :InContextCallback

internal :boolean

Marks the segment as the boundary point into an instrumented library. If set to true, and the parent segment is also marked as internal: true by the same shim, then we will not record this inner activity.

This is useful when instrumenting a library which implements high-order methods which simply call other public method, and you only want to record the method directly called by the user while still instrumenting all endpoints.

Type:
  • boolean

name :string

A name for the segment that can be recognized by users.

Type:
  • string

opaque :boolean

Indicates if child segments should be recorded or not. When true, child segments will not be created and traces will omit the details descended from an opaque segment.

Type:
  • boolean

parameters :Object.<string, *>

A key-value hash of attributes that a shim can utilize.

Type:
  • Object.<string, *>

parent :TraceSegment

The parent segment, if any. Should be set to the currently active segment by default.

Type:
  • TraceSegment

recorder :MetricFunction

A metric recorder for the segment. This field is intended to be used by shim implementations. It is not intended that an instrumentation will ever need to specify its own metric recorder.

Type:
  • MetricFunction