io.insights.tracesTracesManagerinterface
Traces API.
Properties (9)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| clickstreamMarker⚓︎ | MarkerSpanCallback | x | x | Optional callback function to programmatically create marker spans in the Clickstream trace. Allows applications to mark specific user interaction events beyond automatic click tracking (e.g., custom UI interactions, gesture events, programmatic actions). The callback receives:
Returns either PropagationInfo to link the marker span to other traces, or void. Works in conjunction with the clickstream setting to track detailed user interaction patterns. |
| currentTracingState⚓︎ | TracingState | null | x | The tracing state representing the currently active trace and span, if any. |
|
| endOpenSpans⚓︎ | (reason?: string) => number | x | x | Ends every span that is still open, so that it gets exported: a span is only exported once
it has ended, and whatever is still open when the process goes away is lost. The spans are
ended as they stand and marked with an |
| flush⚓︎ | (timeoutMs?: number) => Promise<void> | x | x | Exports the spans that have ended so far, waiting for up to |
| instrumentElectronNet⚓︎ | (netModule: unknown) => void | x | x | Instruments Electron's main-process |
| settings⚓︎ | TracesSettings | x | Traces settings. |
|
| started⚓︎ | boolean | x | Whether or not this instance is started. |
|
| startupTraceFinished⚓︎ | (reason?: string) => void | x | x | Called by the application to signify that its startup has completed and no further spans should be nested under the startup trace. It also tells io.Connect Desktop, by invoking the platform's "T42.ACS.AppStartupFinished"
interop method: what the platform's appStartMeasurement "explicit" counts as the
application having started. The method is invoked with the interop API the library was
built with - |
| userJourneyMarker⚓︎ | MarkerSpanCallback | x | x | Optional callback function to programmatically create marker spans in the User Journey trace. Allows applications to mark significant points in a user's journey through the application (e.g., navigation events, key user actions, milestone completions). The callback receives:
Returns either PropagationInfo to link the marker span to other traces, or void. Works in conjunction with the userJourney setting to track the user's entire session flow. |
14 Methods
setFilterConfig()⚓︎
(filters: SpanFilter[]) => void
Allows updating the configured filters.
On the startup span buffer (BufferingTracesManager), which has no settings of its own:
gives it the filters the real manager is going to match the spans against. A span that a
filter disables for certain (enabled: false - going by the span's source and the
context it was created with) is then not buffered: its callback runs as that of a
disabled span does, and the spans created inside it nest under the nearest buffered
ancestor. Not when something is asked of the span although it is disabled -
countMetricOnDisabledSpans, resultMetricOnDisabledSpans,
durationMetricOnDisabledSpans, log.onDisabledSpans or
stopPropagationIfSpanIsDisabled, set by a filter that may match the span, by a default
filter of its options or by the options themselves: such a span is buffered, and handled
by the real manager at the replay, like every other span (what the defaults of the
traces settings ask is not seen: the buffer does not have them). Only a plain
enabled: false is acted on while buffering - every other span is buffered, and every
other filter property applied, by the real manager at the replay.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| filters⚓︎ | SpanFilter[] | x |
waitForFinalExport()⚓︎
(timeoutMs?: number) => Promise<void>
Waits for any pending data to be published, with the option to specify a timeout.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| timeoutMs⚓︎ | number | x | maximum time to wait for export |
withSequenceSpan()⚓︎
<T>(source: string, callback: | WithSpanCallback<T>) => Promise<T>
Allows creating a span for a named trace.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. The name of the trace will be |
|
| callback⚓︎ | | WithSpanCallback<T> | Logic to execute in the span. |
withSequenceSpan()⚓︎
<T>(source: string, filteringContext: | FilteringContext | null, callback: | WithSpanCallback<T>) => Promise<T>
Allows creating a span for a named trace.
Parameters (3)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. The name of the trace will be |
|
| filteringContext⚓︎ | | FilteringContext | null | Filtering context used to match against the tracing filtering configuration. |
|
| callback⚓︎ | | WithSpanCallback<T> | Logic to execute in the span. |
withSequenceSpan()⚓︎
<T>(source: string, filteringContext: | FilteringContext | null, options: | WithSpanOptions | null, callback: | WithSpanCallback<T>) => Promise<T>
Allows creating a span for a named trace.
Parameters (4)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. The name of the trace will be |
|
| filteringContext⚓︎ | | FilteringContext | null | Filtering context used to match against the tracing filtering configuration. |
|
| options⚓︎ | | WithSpanOptions | null | Options to use when creating the span. |
|
| callback⚓︎ | | WithSpanCallback<T> | Logic to execute in the span. |
withSequenceSpanEx()⚓︎
<T>(source: string, traceName: | string | null, callback: | WithSpanCallback<T>) => Promise<T>
Allows creating a span for a named trace.
Parameters (3)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. |
|
| traceName⚓︎ | | string | null | The name of the trace to nest the span in. If one doesn't exist, it will be created. |
|
| callback⚓︎ | | WithSpanCallback<T> | Logic to execute in the span. |
withSequenceSpanEx()⚓︎
<T>(source: string, traceName: | string | null, filteringContext: | FilteringContext | null, callback: | WithSpanCallback<T>) => Promise<T>
Allows creating a span for a named trace.
Parameters (4)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. |
|
| traceName⚓︎ | | string | null | The name of the trace to nest the span in. If one doesn't exist, it will be created. |
|
| filteringContext⚓︎ | | FilteringContext | null | Filtering context used to match against the tracing filtering configuration. |
|
| callback⚓︎ | | WithSpanCallback<T> | Logic to execute in the span. |
withSequenceSpanEx()⚓︎
<T>(source: string, traceName: | string | null, filteringContext: | FilteringContext | null, options: | WithSpanOptions | null, callback: | WithSpanCallback<T>) => Promise<T>
Allows creating a span for a named trace.
Parameters (5)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. |
|
| traceName⚓︎ | | string | null | The name of the trace to nest the span in. If one doesn't exist, it will be created. |
|
| filteringContext⚓︎ | | FilteringContext | null | Filtering context used to match against the tracing filtering configuration. |
|
| options⚓︎ | | WithSpanOptions | null | Options to use when creating the span. |
|
| callback⚓︎ | | WithSpanCallback<T> | Logic to execute in the span. |
withSpan()⚓︎
<T>(source: string, callback: WithSpanCallback<T>) => T
Allows creating a span for the currently active trace. If one doesn't exist, it will be created.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. |
|
| callback⚓︎ | WithSpanCallback<T> | Logic to execute in the span. |
withSpan()⚓︎
<T>(source: string, filteringContext: FilteringContext, callback: WithSpanCallback<T>) => T
Allows creating a span for the currently active trace. If one doesn't exist, it will be created.
Parameters (3)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. |
|
| filteringContext⚓︎ | FilteringContext | Filtering context used to match against the tracing filtering configuration. |
|
| callback⚓︎ | WithSpanCallback<T> | Logic to execute in the span. |
withSpan()⚓︎
<T>(source: string, filteringContext: FilteringContext, propagationInfo: PropagationInfo | PropagationInfoCarrier | null, callback: WithSpanCallback<T>) => T
Allows creating a span for the currently active trace or a specified trace. If one doesn't exist, it will be created.
Parameters (4)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. |
|
| filteringContext⚓︎ | FilteringContext | Filtering context used to match against the tracing filtering configuration. |
|
| propagationInfo⚓︎ | PropagationInfo | PropagationInfoCarrier | null | Span and trace id to use for manually nesting the new trace. |
|
| callback⚓︎ | WithSpanCallback<T> | Logic to execute in the span. |
withSpan()⚓︎
<T>(source: string, filteringContext: FilteringContext, propagationInfo: PropagationInfo | PropagationInfoCarrier | null, options: WithSpanOptions | null, callback: WithSpanCallback<T>) => T
Allows creating a span for the currently active trace or a specified trace. If one doesn't exist, it will be created.
Parameters (5)
| Name | Type | Required | Description |
|---|---|---|---|
| source⚓︎ | string | The name of the span to create. |
|
| filteringContext⚓︎ | FilteringContext | Filtering context used to match against the tracing filtering configuration. |
|
| propagationInfo⚓︎ | PropagationInfo | PropagationInfoCarrier | null | Span and trace id to use for manually nesting the new trace. |
|
| options⚓︎ | WithSpanOptions | null | Options to use when creating the span. |
|
| callback⚓︎ | WithSpanCallback<T> | Logic to execute in the span. |