@ms-cloudpack/telemetry 0.10.11 → 0.10.13
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/{AppInsightsTelemetryClient-WPYWCXFS.js → AppInsightsTelemetryClient-EVVRLV5G.js} +1 -1
- package/dist/{NoOpTelemetryClient-CXHBGYTQ.js → NoOpTelemetryClient-YFBGGJLV.js} +2 -2
- package/dist/{chunk-K6SP5OSF.js → chunk-26T3UJ3W.js} +3 -50
- package/dist/{chunk-RQHEXBMA.js → chunk-DZ26G5TC.js} +1 -1
- package/dist/index.js +4 -4
- package/lib/proxies/createImprovedStartActiveSpan.d.ts +2 -0
- package/package.json +3 -5
package/dist/{AppInsightsTelemetryClient-WPYWCXFS.js → AppInsightsTelemetryClient-EVVRLV5G.js}
RENAMED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
require_src2,
|
|
22
22
|
require_src3,
|
|
23
23
|
require_src4
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-26T3UJ3W.js";
|
|
25
25
|
|
|
26
26
|
// ../../node_modules/.store/@azure-core-rest-pipeline-npm-1.17.0-aa1ea9ace7/package/dist/commonjs/pipeline.js
|
|
27
27
|
var require_pipeline = __commonJS({
|
|
@@ -6,8 +6,8 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
NoOpTelemetryClient
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-DZ26G5TC.js";
|
|
10
|
+
import "./chunk-26T3UJ3W.js";
|
|
11
11
|
export {
|
|
12
12
|
NoOpTelemetryClient
|
|
13
13
|
};
|
|
@@ -12184,55 +12184,8 @@ var _SpanEnrichingProcessor = class _SpanEnrichingProcessor {
|
|
|
12184
12184
|
__name(_SpanEnrichingProcessor, "SpanEnrichingProcessor");
|
|
12185
12185
|
var SpanEnrichingProcessor = _SpanEnrichingProcessor;
|
|
12186
12186
|
|
|
12187
|
-
//
|
|
12188
|
-
|
|
12189
|
-
for (let i = 0; i < 256; ++i) {
|
|
12190
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
12191
|
-
}
|
|
12192
|
-
function unsafeStringify(arr, offset = 0) {
|
|
12193
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
12194
|
-
}
|
|
12195
|
-
__name(unsafeStringify, "unsafeStringify");
|
|
12196
|
-
|
|
12197
|
-
// ../../node_modules/.store/uuid-npm-10.0.0-4872b46ff8/package/dist/esm-node/rng.js
|
|
12198
|
-
import crypto from "node:crypto";
|
|
12199
|
-
var rnds8Pool = new Uint8Array(256);
|
|
12200
|
-
var poolPtr = rnds8Pool.length;
|
|
12201
|
-
function rng() {
|
|
12202
|
-
if (poolPtr > rnds8Pool.length - 16) {
|
|
12203
|
-
crypto.randomFillSync(rnds8Pool);
|
|
12204
|
-
poolPtr = 0;
|
|
12205
|
-
}
|
|
12206
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
12207
|
-
}
|
|
12208
|
-
__name(rng, "rng");
|
|
12209
|
-
|
|
12210
|
-
// ../../node_modules/.store/uuid-npm-10.0.0-4872b46ff8/package/dist/esm-node/native.js
|
|
12211
|
-
import crypto2 from "node:crypto";
|
|
12212
|
-
var native_default = {
|
|
12213
|
-
randomUUID: crypto2.randomUUID
|
|
12214
|
-
};
|
|
12215
|
-
|
|
12216
|
-
// ../../node_modules/.store/uuid-npm-10.0.0-4872b46ff8/package/dist/esm-node/v4.js
|
|
12217
|
-
function v4(options, buf, offset) {
|
|
12218
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
12219
|
-
return native_default.randomUUID();
|
|
12220
|
-
}
|
|
12221
|
-
options = options || {};
|
|
12222
|
-
const rnds = options.random || (options.rng || rng)();
|
|
12223
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
12224
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
12225
|
-
if (buf) {
|
|
12226
|
-
offset = offset || 0;
|
|
12227
|
-
for (let i = 0; i < 16; ++i) {
|
|
12228
|
-
buf[offset + i] = rnds[i];
|
|
12229
|
-
}
|
|
12230
|
-
return buf;
|
|
12231
|
-
}
|
|
12232
|
-
return unsafeStringify(rnds);
|
|
12233
|
-
}
|
|
12234
|
-
__name(v4, "v4");
|
|
12235
|
-
var v4_default = v4;
|
|
12187
|
+
// src/BaseTelemetryClient.ts
|
|
12188
|
+
import { randomUUID } from "crypto";
|
|
12236
12189
|
|
|
12237
12190
|
// ../json-utilities/lib/readJson.js
|
|
12238
12191
|
import fs from "fs";
|
|
@@ -12546,7 +12499,7 @@ var _BaseTelemetryClient = class _BaseTelemetryClient {
|
|
|
12546
12499
|
this._tracerProvider = new import_sdk_trace_node.NodeTracerProvider({
|
|
12547
12500
|
resource
|
|
12548
12501
|
});
|
|
12549
|
-
const telemetryId =
|
|
12502
|
+
const telemetryId = randomUUID();
|
|
12550
12503
|
this._tracerProvider.addSpanProcessor(
|
|
12551
12504
|
new SpanEnrichingProcessor({
|
|
12552
12505
|
"cloudpack.telemetry.id": telemetryId,
|
|
@@ -7,7 +7,7 @@ const __dirname = topLevelPath.dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
BaseTelemetryClient,
|
|
9
9
|
__name
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-26T3UJ3W.js";
|
|
11
11
|
|
|
12
12
|
// src/NoOpTelemetryClient.ts
|
|
13
13
|
var _NoOpTelemetryClient = class _NoOpTelemetryClient extends BaseTelemetryClient {
|
package/dist/index.js
CHANGED
|
@@ -6,28 +6,28 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
NoOpTelemetryClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DZ26G5TC.js";
|
|
10
10
|
import {
|
|
11
11
|
DiagConsoleLogger,
|
|
12
12
|
DiagLogLevel,
|
|
13
13
|
__name,
|
|
14
14
|
diag,
|
|
15
15
|
init_esm
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-26T3UJ3W.js";
|
|
17
17
|
|
|
18
18
|
// src/createTelemetryClient.ts
|
|
19
19
|
init_esm();
|
|
20
20
|
async function createTelemetryClient(options) {
|
|
21
21
|
if (!options.connectionString) {
|
|
22
22
|
console.debug("No connection string found. Telemetry will not be sent.");
|
|
23
|
-
const { NoOpTelemetryClient: NoOpTelemetryClient2 } = await import("./NoOpTelemetryClient-
|
|
23
|
+
const { NoOpTelemetryClient: NoOpTelemetryClient2 } = await import("./NoOpTelemetryClient-YFBGGJLV.js");
|
|
24
24
|
return new NoOpTelemetryClient2();
|
|
25
25
|
}
|
|
26
26
|
diag.setLogger(new DiagConsoleLogger(), {
|
|
27
27
|
logLevel: (options.logLevel && DiagLogLevel[options.logLevel]) ?? DiagLogLevel.WARN,
|
|
28
28
|
suppressOverrideMessage: true
|
|
29
29
|
});
|
|
30
|
-
const { AppInsightsTelemetryClient } = await import("./AppInsightsTelemetryClient-
|
|
30
|
+
const { AppInsightsTelemetryClient } = await import("./AppInsightsTelemetryClient-EVVRLV5G.js");
|
|
31
31
|
return new AppInsightsTelemetryClient(options);
|
|
32
32
|
}
|
|
33
33
|
__name(createTelemetryClient, "createTelemetryClient");
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Tracer, Span, SpanOptions, Context } from '@opentelemetry/api';
|
|
2
2
|
export type SpanFunction<T> = (span: Span) => T | Promise<T>;
|
|
3
|
+
type StartActiveSpanFn = <T>(name: string, optionsOrFn?: SpanOptions | SpanFunction<T>, contextOrFn?: Context | SpanFunction<T>, maybeFn?: SpanFunction<T>) => T;
|
|
3
4
|
export declare function createImprovedStartActiveSpan(target: Tracer): <T>(name: string, optionsOrFn?: SpanOptions | SpanFunction<unknown> | undefined, contextOrFn?: Context | SpanFunction<unknown> | undefined, maybeFn?: SpanFunction<unknown> | undefined) => Promise<T>;
|
|
5
|
+
export {};
|
|
4
6
|
//# sourceMappingURL=createImprovedStartActiveSpan.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/telemetry",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.13",
|
|
4
4
|
"description": "Helpers for reporting telemetry in Cloudpack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@azure/monitor-opentelemetry-exporter": "1.0.0-beta.26",
|
|
18
18
|
"@ms-cloudpack/environment": "^0.1.1",
|
|
19
19
|
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|
|
20
|
-
"@ms-cloudpack/package-utilities": "^11.3.
|
|
20
|
+
"@ms-cloudpack/package-utilities": "^11.3.3",
|
|
21
21
|
"@ms-cloudpack/scripts": "^0.0.1",
|
|
22
22
|
"@opentelemetry/api": "~1.9.0",
|
|
23
23
|
"@opentelemetry/context-async-hooks": "~1.26.0",
|
|
@@ -25,9 +25,7 @@
|
|
|
25
25
|
"@opentelemetry/resources": "~1.26.0",
|
|
26
26
|
"@opentelemetry/sdk-trace-base": "~1.26.0",
|
|
27
27
|
"@opentelemetry/sdk-trace-node": "~1.26.0",
|
|
28
|
-
"@opentelemetry/semantic-conventions": "~1.27.0"
|
|
29
|
-
"@types/uuid": "^10.0.0",
|
|
30
|
-
"uuid": "^10.0.0"
|
|
28
|
+
"@opentelemetry/semantic-conventions": "~1.27.0"
|
|
31
29
|
},
|
|
32
30
|
"scripts": {
|
|
33
31
|
"api": "cloudpack-scripts api",
|