Skip to main content

Properties (50)

Property Type Default Required Description
additionalAttributes⚓︎ { [x: string]: unknown } | (() => { [x: string]: unknown }) x x

Additional span attributes to publish as part of each span, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., %MyEnvVar%), and can contain a fallback value (e.g., %MyEnvVar?literalDefaultValue%).

additionalResourceAttributes⚓︎ { [x: string]: unknown } | (() => { [x: string]: unknown }) x x

Additional attributes to publish as part of the OTEL resource definition, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., %MyEnvVar%), and can contain a fallback value (e.g., %MyEnvVar?literalDefaultValue%).

addResourceAttributesToAttributes⚓︎ boolean false x

Whether to add resource attributes to span attributes.

clickstream⚓︎ boolean | "nested" | "sibling" | ClickstreamTraceConfig true x

Whether the clickstream trace will be enabled. false - clickstream trace is disabled. true - same as sibling nested - clickstream trace is enabled and each subsequent span is a child span of the previous one. sibling - clickstream trace is enabled and each subsequent span is a child of the same initial span.

closeTrace⚓︎ boolean false x

If true, the application will create a span with the name interopio.api.application.close when it's being closed. This functionality requires close handlers to be enabled in the application configuration.

compression⚓︎ CompressionAlgorithm x x

Compression algorithm to use when exporting trace.

concurrencyLimit⚓︎ number x x

Maximum number of concurrent trace export requests.

console⚓︎ boolean x x

If an OTEL TraceProvider isn't provided to the library, it will initialize its own.

If 'console' is 'true', TracerProvider will have a ConsoleTraceExporter.

contextManager⚓︎ (tracesSettings: TracesSettings, settings: Settings) => ContextManager x x

Allows specifying a constructor callback for creating the ContextManager instance.

countMetric⚓︎ boolean | string | null true x

If true or a string, span hits are published as a counter metric. If a string value is specified, this will be the name of the metric. Otherwise, the default "insights_trace_count" is used. Set to false or null to disable the metric. Spans opt in through the countMetric span creation option (see 'filters' and 'defaults').

defaultFilters⚓︎ SpanFilter[] x x

This property is for internal use only.

defaults⚓︎ SpanCreationOptions x x

Default settings if appropriate entries aren't found in 'filters' and 'sampling' collections.

durationMetric⚓︎ boolean | string | null true x

If true or a string, span durations are published as a histogram metric. If a string value is specified, this will be the name of the metric. Otherwise, the default "insights_trace_duration" is used. Set to false or null to disable the metric. Spans opt in through the durationMetric span creation option (see 'filters' and 'defaults').

enabled⚓︎ boolean false

Whether tracing functionality is enabled. If disabled, API is still usable, but methods are no-ops.

exporterSettings⚓︎ OTLPExporterNodeConfigBase x x

If an OTEL TraceProvider isn't provided to the library, it will initialize its own.

If 'url' is specified, TracerProvider will have an OTLPTraceExporter with 'url' as detination URL and 'exporterSettings' as additional config.

filters⚓︎ SpanFilter[] x x

Array of filter entries used to determine whether a particular operation will create a tracing span, and what verbosity level will apply to attributes added to that span.

If no matching filter entry is found, the settings from 'default' are used.

headers⚓︎ { [x: string]: string } | (() => { [x: string]: string }) x x

Additional headers to send in HTTP requests, e.g. when using HTTP exporters.

hybridContextMode⚓︎ boolean false x

If true, the library will use both the ContextManager provided by the OTEL SDK and the Traces.currentTracingState property to resolve the current context. See the documentation of the useOTELContextManager property for more details.

instrumentAppLoad⚓︎ boolean false x

If true, io.Insights will instrument and trace the application initialization process automatically.

instrumentAppStartup⚓︎ boolean true x

If true, io.Insights will instrument and trace the application startup process automatically: a root "interopio.api.appStartup" span starting at the runtime's time origin, under which spans created during the startup window are nested (via the propagation defaults). In browsers the root carries child spans and KPIs reconstructed from the performance timeline (navigation phases, paints, long tasks, startup-window web vitals, lifecycle transitions).

Also works in NodeJS: the root span opens at process start and the startup window nesting applies, but the browser performance-timeline children are not produced. The window closes on startupParentSpanTimeoutMs or an explicit startupTraceFinished() call ("loader" mode behaves as "any" in Node - there is no loader signal). When the platform provides a root propagation info, the startup span is parented under it.

instrumentDocumentLoad⚓︎ boolean false x

If true, io.Insights will instrument and trace the steps of the document load process automatically

instrumentErrors⚓︎ boolean | ErrorInstrumentationConfig false x

If true (or a configuration object with enabled), uncaught errors and unhandled promise rejections are published as error spans ("interopio.api.instrumentation.error" / ".unhandledRejection"), including errors buffered before initialization by the pre-init recorder. Capped per session to guard against error storms. When enabled, the app startup trace defers its own error capture to this instrumentation, and the pre-init recorder (when installed) captures errors from page start - opt out of that with the configuration object's preInit: false.

Also works in NodeJS, via process.uncaughtExceptionMonitor - a behavior-preserving hook: the process still crashes exactly as it would have. The span processors are force-flushed immediately, so the crash span is exported whenever anything keeps the process alive past the crash (an application 'uncaughtException' handler, a graceful shutdown); on a hard crash the export cannot complete and the span is lost with the process. Under Node's default unhandled-rejections=throw mode, crash-grade unhandled rejections are reported too; non-crashing rejection observation is deliberately not done in Node, because subscribing to process.unhandledRejection would suppress Node's default crash semantics.

instrumentEventLoop⚓︎ boolean | EventLoopInstrumentationConfig false x

If true (or a configuration object), event loop responsiveness is instrumented: slow input events (Event Timing API) and main-thread-blocking long frames (Long Animation Frames API, falling back to Long Tasks) are published as spans ("interopio.api.instrumentation.inputDelay" / ".eventLoopBlocking"), with the input-delay spans carrying the same element-describing attributes as the clickstream spans. Optional histogram metrics can be enabled via the configuration object. Entries recorded before initialization are replayed from the performance buffers.

instrumentNavigation⚓︎ boolean false x

If true, in-page (SPA) navigations - history pushState/replaceState, popstate and hashchange - are published as spans ("interopio.api.instrumentation.navigation") with the sanitized from/to URLs. Same-URL state updates are not reported.

instrumentRequests⚓︎ boolean | RequestTraceConfig false x

If true (or a configuration object with enabled: true), io.Insights will instrument and trace XMLHttpRequest and fetch() requests automatically. When enabled, the pre-init recorder (when installed) also captures requests from page start - opt out of that with the configuration object's preInit: false.

instrumentResources⚓︎ boolean | ResourceInstrumentationConfig false x

If true (or a configuration object), resource loads (scripts, stylesheets, images, fonts, ...) are published as spans ("interopio.api.instrumentation.resource") with their real timings from the resource timing buffer, including resources loaded before initialization, a cacheState attribute ("hit", "revalidated", "network", or "unknown" - cross-origin resources without a Timing-Allow-Origin header withhold cache provenance), and the nonzero connection-phase timings (dns/connect/tls/ttfb). By default fetch/XHR resources are excluded (the request instrumentation covers them in more detail; see skipRequests), as are telemetry uploads. Optional histogram/counter metrics can be enabled via the configuration object. When enabled, the app startup trace defers its slowest-resource child spans to this instrumentation.

instrumentWebSockets⚓︎ boolean | WebSocketInstrumentationConfig false x

If true (or a configuration object), WebSocket connections are instrumented: each connection is published as a span ("interopio.api.instrumentation.webSocket") covering its whole lifetime - construction until close - with the connect duration, negotiated protocol, close code/reason/wasClean, and message/byte totals in both directions. Abnormal closures (code 1006) and connection failures mark the span as ERROR. Optional message/byte counters and a connect-duration histogram can be enabled via the configuration object. Telemetry endpoints are never instrumented; the io.Connect gateway connection is tracked by default (its lifecycle is platform-health telemetry - exclude it with ignoreGateway), and ignorePattern can exclude other infrastructure sockets.

When the pre-init module (early.js) is loaded, sockets are tracked from page start: connections that closed before initialization become retroactive spans, and connections still open are adopted with spans starting at their true construction time and counters carried across - a socket opened at bootstrap is fully observed. Without the pre-init module, sockets constructed before initialization are not observed at all.

instrumentWebVitals⚓︎ boolean | WebVitalsInstrumentationConfig false x

If true (or a configuration object), session-level Web Vitals are tracked: CLS (cumulative layout shift, session-window algorithm), INP (interaction to next paint, the web-vitals estimation over Event Timing entries) and the final LCP. A "interopio.api.instrumentation.webVitals" span with the current values is published each time the page becomes hidden (when the values changed), and optional histogram metrics record one terminal sample per page at pagehide. Complements the startup trace's perf.vitals, which cover only the startup window - CLS accumulates and INP is defined over the whole session.

keepAlive⚓︎ boolean true x

Whether to keep the connection alive when sending traces.

otlpExporterConfig⚓︎ OTLPExporterNodeConfigBase x x x
parentNameLimit⚓︎ number x x

Maximum length for parent operation names in span hierarchies.

processorSettings⚓︎ BatchSpanProcessorBrowserConfig x x

Configuration for the batch span processor buffer settings.

propagator⚓︎ (tracesSettings: TracesSettings, settings: Settings) => TextMapPropagator x x

Allows specifying a constructor callback for creating the TextMapPropagator instance.

publishInterval⚓︎ number x x

Interval in milliseconds between trace export batches.

resultMetric⚓︎ boolean | string | null true x

If true or a string, span results (status codes) are published as a counter metric. If a string value is specified, this will be the name of the metric. Otherwise, the default "insights_trace_result" is used. Set to false or null to disable the metric. Spans opt in through the resultMetric span creation option (see 'filters' and 'defaults').

rootPropagationInfo⚓︎ PropagationInfo x x

Property for internal use.

sampler⚓︎ (defaultSampler: Sampler, tracesSettings: TracesSettings, settings: Settings) => Sampler x x

Allows specifying a constructor callback for creating the Sampler instance.

sampling⚓︎ SamplingSettings[] x x

Array of sampling setting entries used to determine whether a span will be sampled.

If no matching sampling setting entry is found, the settings from 'defaults' are used.

spanExporters⚓︎ (exporterSettings: OTLPExporterNodeConfigBase, tracesSettings: TracesSettings, settings: Settings) => SpanExporter[] x x

Allows specifying a constructor callback for creating the SpanExporter instances.

spanProcessors⚓︎ (processorSettings: BatchSpanProcessorBrowserConfig | undefined, exporterSettings: OTLPExporterNodeConfigBase, tracesSettings: TracesSettings, settings: Settings) => SpanProcessor[] x x

Allows specifying a constructor callback for creating the SpanProcessor instances.

ssoAuth⚓︎ SSOAuthSettings x x

Overrides the properties of the top-level ssoAuth for the traces export requests; the ones that aren't specified here are taken from it.

startupParentSpanEnd⚓︎ "explicit" | "timeout" | "loader" | "any" "any" x

When will the application startup span be considered completed, so that further spans are added under it.

  • explicit - when Traces.instance.startupTraceFinished() is called by the application code
  • timeout - same as "explicit" OR when startupParentSpanTimeoutMs have elapsed and the DOMContentLoaded event has fired
  • loader - same as "explicit" OR when the loading animation of the window has completed
  • any - when any of the above conditions are met

In NodeJS there is no loader signal (or DOM readiness): "loader" behaves as "any", and the timeout counts alone.

startupParentSpanTimeoutMs⚓︎ number 3000 x

If non-zero, how long after application startup will any traced operations automatically be nested under the application startup trace. The timeout is counted from the moment the io.Connect API begins initializing. Without a timeout the startup window only closes on an explicit startupTraceFinished() call (or the loader signal in io.Connect Desktop windows) - the root span stays open, and unexported, until then.

timeoutMillis⚓︎ number 10000ms. x

Maximum time the OTLP exporter will wait for each batch export.

tracerProvider⚓︎ (tracerProviderSettings: TracerConfig, tracesSettings: TracesSettings, settings: Settings) => TracerProvider x x

Allows specifying a constructor callback for creating the tracerProvider instance.

tracerProviderSettings⚓︎ TracerConfig x x

OTEL TracerConfig - provides an interface for configuring a Basic Tracer.

url⚓︎ string x x

If an OTEL TraceProvider isn't provided to the library, it will initialize its own.

If 'url' is specified, TracerProvider will have an OTLPTraceExporter using this destination URL.

useDefaultFilters⚓︎ boolean true. x

If true, use a predefined list of filters for well-known platform traces.

useOTELContextManager⚓︎ boolean false x

If true, the library will use the ContextManager provided by the active OTEL SDK to manage and derive propagation information to ensure spans created across asynchronous operations are properly nested.

Otherwise, use Traces.currentTracingState to set and retrieve propagation info across asynchronous operations manually.

See https://opentelemetry.io/docs/languages/js/propagation/ and https://opentelemetry.io/docs/languages/js/context/#context-manager for more information.

userJourney⚓︎ boolean | "nested" | "sibling" | UserJourneyTraceConfig true x

Whether the user journey trace will be enabled. false - User Journey trace is disabled. nested - User Journey trace is enabled and each subsequent span is a child span of the previous one. sibling - User Journey trace is enabled and each subsequent span is a child of the same initial span.