@zendesk/retrace
Version:
define and capture Product Operation Traces along with computed metrics with an optional friendly React beacon API
56 lines • 1.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ticketOperationTracer = void 0;
const traceManager_1 = require("./traceManager");
exports.ticketOperationTracer = traceManager_1.traceManager.createTracer({
name: `ticket-activation`,
type: 'operation',
requiredSpans: [
{
name: 'TicketView',
matchingRelations: true,
type: 'component-render',
isIdle: true,
},
],
relationSchemaName: 'ticket',
variants: {
click: { timeout: 15_000 },
},
debounceOnSpans: [
{
name: 'TicketView',
matchingRelations: true,
},
],
interruptOnSpans: [
{
name: 'TicketView',
matchingRelations: true,
type: 'component-unmount',
},
],
computedSpanDefinitions: {
time_to_start_loading: {
startSpan: 'operation-start',
endSpan: {
name: 'TicketView',
matchingRelations: true,
fn: (s) => s.span.type === 'component-render' &&
s.span.renderedOutput === 'loading',
},
},
},
computedValueDefinitions: {
had_error: {
matches: [{ name: 'TicketView', type: 'component-render', isIdle: true }],
computeValueFromMatches: (matches) => {
const error = matches.find((m) => m.span.type === 'component-render' &&
m.span.renderedOutput === 'error');
return !!error;
},
},
},
captureInteractive: true,
});
//# sourceMappingURL=ticketOperationTracer.js.map