@uipath/traces-tool 1.199.0-preview.97 → 1.199.0
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.
- package/dist/tool.js +50 -19
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -21230,7 +21230,7 @@ var init_server = __esm(() => {
|
|
|
21230
21230
|
var package_default = {
|
|
21231
21231
|
name: "@uipath/traces-tool",
|
|
21232
21232
|
license: "MIT",
|
|
21233
|
-
version: "1.199.0
|
|
21233
|
+
version: "1.199.0",
|
|
21234
21234
|
description: "Query execution traces for UiPath jobs",
|
|
21235
21235
|
private: false,
|
|
21236
21236
|
keywords: [
|
|
@@ -24555,7 +24555,7 @@ function requireOmap() {
|
|
|
24555
24555
|
function resolveYamlOmap(data) {
|
|
24556
24556
|
if (data === null)
|
|
24557
24557
|
return true;
|
|
24558
|
-
const objectKeys =
|
|
24558
|
+
const objectKeys = {};
|
|
24559
24559
|
const object = data;
|
|
24560
24560
|
for (let index = 0, length = object.length;index < length; index += 1) {
|
|
24561
24561
|
const pair = object[index];
|
|
@@ -24573,10 +24573,9 @@ function requireOmap() {
|
|
|
24573
24573
|
}
|
|
24574
24574
|
if (!pairHasKey)
|
|
24575
24575
|
return false;
|
|
24576
|
-
if (
|
|
24577
|
-
objectKeys.push(pairKey);
|
|
24578
|
-
else
|
|
24576
|
+
if (_hasOwnProperty.call(objectKeys, pairKey))
|
|
24579
24577
|
return false;
|
|
24578
|
+
Object.defineProperty(objectKeys, pairKey, { value: true });
|
|
24580
24579
|
}
|
|
24581
24580
|
return true;
|
|
24582
24581
|
}
|
|
@@ -27437,8 +27436,18 @@ function getInboundTraceContext() {
|
|
|
27437
27436
|
|
|
27438
27437
|
// ../common/src/telemetry/session-id.ts
|
|
27439
27438
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
27440
|
-
var
|
|
27441
|
-
var
|
|
27439
|
+
var SESSION_ID_MAX_LENGTH = 64;
|
|
27440
|
+
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
27441
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
|
|
27442
|
+
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
27443
|
+
var INHERITED_SESSION_SOURCES = [
|
|
27444
|
+
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
27445
|
+
{ envVar: "CODEX_THREAD_ID", source: "codex" },
|
|
27446
|
+
{ envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
|
|
27447
|
+
{ envVar: "TERM_SESSION_ID", source: "terminal" },
|
|
27448
|
+
{ envVar: "WT_SESSION", source: "terminal" }
|
|
27449
|
+
];
|
|
27450
|
+
var telemetrySessionSlot = singleton("TelemetrySession");
|
|
27442
27451
|
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
27443
27452
|
function getProcessEnv2() {
|
|
27444
27453
|
return globalThis.process?.env;
|
|
@@ -27447,14 +27456,42 @@ function normalizeSessionId(value) {
|
|
|
27447
27456
|
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
27448
27457
|
return;
|
|
27449
27458
|
}
|
|
27450
|
-
const
|
|
27451
|
-
return
|
|
27459
|
+
const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
|
|
27460
|
+
return cleaned || undefined;
|
|
27452
27461
|
}
|
|
27453
27462
|
function getConfiguredTelemetrySessionId() {
|
|
27454
27463
|
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
27455
27464
|
}
|
|
27456
|
-
function
|
|
27457
|
-
|
|
27465
|
+
function getInheritedSession(env) {
|
|
27466
|
+
for (const candidate of INHERITED_SESSION_SOURCES) {
|
|
27467
|
+
const handle = normalizeSessionId(env[candidate.envVar]);
|
|
27468
|
+
if (handle) {
|
|
27469
|
+
return { id: handle, source: candidate.source };
|
|
27470
|
+
}
|
|
27471
|
+
}
|
|
27472
|
+
return;
|
|
27473
|
+
}
|
|
27474
|
+
function generateRandomSession() {
|
|
27475
|
+
const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
|
|
27476
|
+
crypto.getRandomValues(bytes);
|
|
27477
|
+
let hex = "";
|
|
27478
|
+
for (const byte of bytes) {
|
|
27479
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
27480
|
+
}
|
|
27481
|
+
return { id: hex, source: "random" };
|
|
27482
|
+
}
|
|
27483
|
+
function resolveTelemetrySession() {
|
|
27484
|
+
const existing = telemetrySessionSlot.get();
|
|
27485
|
+
if (existing) {
|
|
27486
|
+
return existing;
|
|
27487
|
+
}
|
|
27488
|
+
const declaredHandle = getConfiguredTelemetrySessionId();
|
|
27489
|
+
const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
|
|
27490
|
+
telemetrySessionSlot.set(resolved);
|
|
27491
|
+
return resolved;
|
|
27492
|
+
}
|
|
27493
|
+
function getTelemetrySessionSource() {
|
|
27494
|
+
return resolveTelemetrySession().source;
|
|
27458
27495
|
}
|
|
27459
27496
|
function getTelemetryOperationId() {
|
|
27460
27497
|
const existing = telemetryOperationIdSlot.get();
|
|
@@ -27731,24 +27768,18 @@ class TelemetryService {
|
|
|
27731
27768
|
}
|
|
27732
27769
|
enrichPropertiesWithContext(properties, context) {
|
|
27733
27770
|
const globalProperties = getGlobalTelemetryProperties();
|
|
27734
|
-
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
27735
|
-
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
27736
27771
|
const enriched = {
|
|
27737
27772
|
...getExecutionContextTelemetryProperties(),
|
|
27738
27773
|
...globalProperties,
|
|
27739
27774
|
...this.defaultProperties,
|
|
27740
27775
|
...redactProperties(properties ?? {}),
|
|
27776
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
27741
27777
|
...context ? {
|
|
27742
27778
|
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
27743
27779
|
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
27744
27780
|
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
27745
27781
|
} : {}
|
|
27746
27782
|
};
|
|
27747
|
-
if (sessionId === undefined) {
|
|
27748
|
-
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
27749
|
-
} else {
|
|
27750
|
-
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
27751
|
-
}
|
|
27752
27783
|
return enriched;
|
|
27753
27784
|
}
|
|
27754
27785
|
generateId() {
|
|
@@ -34958,4 +34989,4 @@ export {
|
|
|
34958
34989
|
metadata
|
|
34959
34990
|
};
|
|
34960
34991
|
|
|
34961
|
-
//# debugId=
|
|
34992
|
+
//# debugId=E9D66BFAA8FC2FE664756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/traces-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0
|
|
4
|
+
"version": "1.199.0",
|
|
5
5
|
"description": "Query execution traces for UiPath jobs",
|
|
6
6
|
"private": false,
|
|
7
7
|
"keywords": [
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"registry": "https://registry.npmjs.org/"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
|
|
25
25
|
}
|