TritonUtils
Overview
The tritonUtils module provides utility functions for stack-trace analysis, transaction ID generation, and runtime information capture. Import the named exports you need:
import { isNotTriton, generateTransactionId, captureRuntimeInfo, getFunctionName } from 'c/tritonUtils';Stack Trace Analysis
isNotTriton(stackTraceLine)
Description: Checks whether a stack-trace line is not from an internal Triton file or method — used to filter Triton frames out of captured stacks.
Parameters:
stackTraceLine:{string}Line from a stack trace
Returns:
{boolean}trueif the line is not from Triton internalsExample:
const isUserCode = isNotTriton('at MyComponent.handleClick (/modules/c/myComponent.js:15:10)');getFunctionName(stackTraceLine)
Description: Extracts the function name from a stack-trace line.
Parameters:
stackTraceLine:{string}Line from a stack trace
Returns:
{string}The function name, or an empty string if none is foundExample:
Transaction Management
generateTransactionId()
Description: Generates a UUID v4 (random UUID). Used for transaction and span IDs.
Returns:
{string}A UUID in the formatxxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxxExample:
Runtime Information
captureRuntimeInfo()
Description: Captures comprehensive runtime information about the current environment. Each capture group is wrapped in try/catch so a failure in one area never blocks the others.
Returns:
{Object}Object containing environment, viewport, theme, performance, memory, network, and device detailsExample:
The returned object includes:
Last updated