@interopio/otel 0.0.151 → 0.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,8 +11,12 @@ export declare class TracingState implements IOInsights.TracingState {
|
|
|
11
11
|
private maxAttributeDepth?;
|
|
12
12
|
context?: Context | undefined;
|
|
13
13
|
private currentSpanStatus;
|
|
14
|
+
private _startTime;
|
|
15
|
+
private _endTime?;
|
|
14
16
|
constructor(source: string, level: keyof typeof IOInsights.SpanVerbosity, span: Span, logger: IOInsights.Logger, version: string, disablePropagation: boolean, forceChildTracing?: boolean | undefined, maxAttributeDepth?: number | undefined, context?: Context | undefined);
|
|
15
|
-
|
|
17
|
+
get startTime(): Date;
|
|
18
|
+
get endTime(): Date | undefined;
|
|
19
|
+
endSpan(endTime?: Date): Promise<void>;
|
|
16
20
|
get enabled(): boolean;
|
|
17
21
|
private hasEnded;
|
|
18
22
|
private spanContextField;
|
|
@@ -15,17 +15,25 @@ class TracingState {
|
|
|
15
15
|
this.maxAttributeDepth = maxAttributeDepth;
|
|
16
16
|
this.context = context;
|
|
17
17
|
this.currentSpanStatus = { code: api_1.SpanStatusCode.UNSET };
|
|
18
|
+
this._startTime = new Date();
|
|
18
19
|
this.hasEnded = false;
|
|
19
20
|
this.spanContextField = span.spanContext();
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
get startTime() {
|
|
23
|
+
return this._startTime;
|
|
24
|
+
}
|
|
25
|
+
get endTime() {
|
|
26
|
+
return this._endTime;
|
|
27
|
+
}
|
|
28
|
+
endSpan(endTime) {
|
|
22
29
|
var _a;
|
|
23
30
|
if (this.hasEnded) {
|
|
24
31
|
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.debug(`Span ended more than once: ${this.source}`);
|
|
25
32
|
}
|
|
26
33
|
else {
|
|
27
34
|
this.hasEnded = true;
|
|
28
|
-
this.
|
|
35
|
+
this._endTime = endTime !== null && endTime !== void 0 ? endTime : new Date();
|
|
36
|
+
this.span.end(endTime);
|
|
29
37
|
}
|
|
30
38
|
return Promise.resolve();
|
|
31
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracingState.js","sourceRoot":"","sources":["../../src/traces/tracingState.ts"],"names":[],"mappings":";;;AAGA,4CAS4B;AAC5B,mCAA8C;AAE9C,MAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"tracingState.js","sourceRoot":"","sources":["../../src/traces/tracingState.ts"],"names":[],"mappings":";;;AAGA,4CAS4B;AAC5B,mCAA8C;AAE9C,MAAa,YAAY;IAKvB,YACS,MAAc,EACd,KAA4C,EAC5C,IAAU,EACT,MAAyB,EACzB,OAAe,EACf,kBAA2B,EAC3B,iBAA2B,EAC3B,iBAA0B,EAC3B,OAAiB;QARjB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAuC;QAC5C,SAAI,GAAJ,IAAI,CAAM;QACT,WAAM,GAAN,MAAM,CAAmB;QACzB,YAAO,GAAP,OAAO,CAAQ;QACf,uBAAkB,GAAlB,kBAAkB,CAAS;QAC3B,sBAAiB,GAAjB,iBAAiB,CAAU;QAC3B,sBAAiB,GAAjB,iBAAiB,CAAS;QAC3B,YAAO,GAAP,OAAO,CAAU;QAblB,sBAAiB,GAAe,EAAE,IAAI,EAAE,oBAAc,CAAC,KAAK,EAAE,CAAC;QAC/D,eAAU,GAAS,IAAI,IAAI,EAAE,CAAC;QAuC9B,aAAQ,GAAG,KAAK,CAAC;QA1BvB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,OAAO,CAAC,OAAc;;QAC3B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAA,IAAI,CAAC,MAAM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QAED,iDAAiD;QACjD,yDAAyD;QACzD,OAAO,eAAe,CAAC;IACzB,CAAC;IAEM,qBAAqB,CAAC,OAA0C;QACrE,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,OAAO;SACR;QACD,MAAM,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACrC,IAAI,EAAE,EAAE;YACN,OAAO,CAAC,+BAA+B,GAAG,EAAE,CAAC;SAC9C;IACH,CAAC;CACF;AA7HD,oCA6HC;AAED,IAAK,aAQJ;AARD,WAAK,aAAa;IAChB,+CAAG,CAAA;IACH,qDAAM,CAAA;IACN,6DAAU,CAAA;IACV,mDAAK,CAAA;IACL,iDAAI,CAAA;IACJ,iDAAI,CAAA;IACJ,uDAAO,CAAA;AACT,CAAC,EARI,aAAa,KAAb,aAAa,QAQjB"}
|
package/insights.d.ts
CHANGED
|
@@ -623,6 +623,8 @@ export namespace IOInsights {
|
|
|
623
623
|
* and injectPropagationInfo()
|
|
624
624
|
*/
|
|
625
625
|
enabled: boolean;
|
|
626
|
+
startTime?: Date;
|
|
627
|
+
endTime?: Date;
|
|
626
628
|
status?: SpanStatus;
|
|
627
629
|
level: keyof typeof SpanVerbosity;
|
|
628
630
|
addData(level: SpanVerbosity | keyof typeof SpanVerbosity, data: object): void;
|
|
@@ -1164,31 +1166,89 @@ export namespace IOInsights {
|
|
|
1164
1166
|
}
|
|
1165
1167
|
|
|
1166
1168
|
/**
|
|
1167
|
-
* Configuration for
|
|
1169
|
+
* Configuration for Clickstream trace behavior.
|
|
1168
1170
|
* Controls how user interaction events are tracked and organized in traces.
|
|
1169
1171
|
*/
|
|
1170
1172
|
export interface ClickstreamTraceConfig {
|
|
1173
|
+
/**
|
|
1174
|
+
* Whether the Clickstream trace is enabled.
|
|
1175
|
+
*/
|
|
1171
1176
|
enabled: boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* If `sibling`, all spans in the Clickstream trace will be nested under the same
|
|
1179
|
+
* root span. This is useful when working with visualization interfaces that do not handle
|
|
1180
|
+
* arbitrarily nested spans.
|
|
1181
|
+
*
|
|
1182
|
+
* If `nested`, every span in the Clickstream trace will be nested under the previous span.
|
|
1183
|
+
* This is useful for some kinds of querying.
|
|
1184
|
+
*
|
|
1185
|
+
* @default "sibling"
|
|
1186
|
+
*/
|
|
1172
1187
|
structure?: "sibling" | "nested";
|
|
1188
|
+
/**
|
|
1189
|
+
* If `true`, the Clickstream trace spans will be named interopio.api.clickstream.<applicationName>.<event>
|
|
1190
|
+
* If `false`, the Clickstream trace spans will be named interopio.api.clickstream.<event>
|
|
1191
|
+
*
|
|
1192
|
+
* @default true
|
|
1193
|
+
*/
|
|
1173
1194
|
descriptiveName?: boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* List of DOM event names to capture as Clickstream trace spans.
|
|
1197
|
+
*
|
|
1198
|
+
* @default ["click"]
|
|
1199
|
+
*/
|
|
1174
1200
|
events?: string[];
|
|
1201
|
+
/**
|
|
1202
|
+
* If `true`, io.Insights will try to nest spans from other event listeners for the same event under
|
|
1203
|
+
* the Clickstream span. This is not guaranteed to always work due to specifics of how browsers execute
|
|
1204
|
+
* event listeners.
|
|
1205
|
+
*
|
|
1206
|
+
* @default true
|
|
1207
|
+
*/
|
|
1208
|
+
nestEventListeners?: boolean;
|
|
1175
1209
|
}
|
|
1176
1210
|
|
|
1177
1211
|
/**
|
|
1178
|
-
* Configuration for
|
|
1179
|
-
* Controls how significant
|
|
1212
|
+
* Configuration for User Journey trace behavior.
|
|
1213
|
+
* Controls how significant User Journey milestones are tracked throughout the platform session.
|
|
1180
1214
|
*/
|
|
1181
1215
|
export interface UserJourneyTraceConfig {
|
|
1216
|
+
/**
|
|
1217
|
+
* Whether the User Journey trace is enabled.
|
|
1218
|
+
*/
|
|
1182
1219
|
enabled: boolean;
|
|
1220
|
+
/**
|
|
1221
|
+
* If `sibling`, all spans in the User Journey trace will be nested under the same
|
|
1222
|
+
* root span. This is useful when working with visualization interfaces that do not handle
|
|
1223
|
+
* arbitrarily nested spans.
|
|
1224
|
+
*
|
|
1225
|
+
* If `nested`, every span in the User Journey trace will be nested under the previous span.
|
|
1226
|
+
* This is useful for some kinds of querying.
|
|
1227
|
+
*
|
|
1228
|
+
* @default "sibling"
|
|
1229
|
+
*/
|
|
1183
1230
|
structure?: "sibling" | "nested";
|
|
1231
|
+
/**
|
|
1232
|
+
* If `true`, the User Journey trace spans will be named interopio.desktop.userJourney.<event>.<applicationName>.
|
|
1233
|
+
* If `false`, the User Journey trace spans will be named interopio.api.userJourney.<event>
|
|
1234
|
+
*
|
|
1235
|
+
* @default true
|
|
1236
|
+
*/
|
|
1184
1237
|
descriptiveName?: boolean;
|
|
1238
|
+
/**
|
|
1239
|
+
* If specified, this number of previously focused applications and their focus times will be added as attributes to
|
|
1240
|
+
* the User Journey span. This is useful for some kinds of querying.
|
|
1241
|
+
*
|
|
1242
|
+
* @default 0
|
|
1243
|
+
*/
|
|
1185
1244
|
chainLength?: number;
|
|
1186
1245
|
}
|
|
1187
1246
|
|
|
1188
1247
|
/**
|
|
1189
|
-
* Callback function type for creating marker spans in
|
|
1248
|
+
* Callback function type for creating marker spans in User Journey or Clickstream traces.
|
|
1190
1249
|
*
|
|
1191
|
-
* @param source - Descriptive name for the marker span (e.g., "checkout-completed", "navigation-event")
|
|
1250
|
+
* @param source - Descriptive name for the marker span (e.g., "checkout-completed", "navigation-event"). If not provided,
|
|
1251
|
+
* no new span will be created, and the data will simply be added to the current user journey or clickstream span.
|
|
1192
1252
|
* @param data - Optional span data organized by verbosity level, allowing different detail levels for different environments
|
|
1193
1253
|
* @returns Either PropagationInfo to link the marker span to other traces, or void
|
|
1194
1254
|
*/
|