@ms-cloudpack/cli 0.35.4 → 0.35.6
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/lib/initTelemetry.js +1 -1
- package/lib/initTelemetry.js.map +1 -1
- package/package.json +5 -5
package/lib/initTelemetry.js
CHANGED
|
@@ -12,7 +12,7 @@ export let rootSpan;
|
|
|
12
12
|
*/
|
|
13
13
|
export async function initTelemetry(options) {
|
|
14
14
|
const instrumentationKey = (await readConfig()).telemetry?.instrumentationKey || process.env.CLOUDPACK_TELEMETRY_INSTRUMENTATION_KEY;
|
|
15
|
-
const logLevel = options.useVerboseLogging ? '
|
|
15
|
+
const logLevel = options.useVerboseLogging ? 'VERBOSE' : options.useDebugLogging ? 'DEBUG' : undefined;
|
|
16
16
|
telemetryClient = await createTelemetryClient({
|
|
17
17
|
productVersion: getVersion(import.meta.url),
|
|
18
18
|
instrumentationKey,
|
package/lib/initTelemetry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initTelemetry.js","sourceRoot":"","sources":["../src/initTelemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAmC,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAO7F,IAAI,eAA4C,CAAC;AACjD,MAAM,CAAC,IAAI,QAA0B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA6B;IAC/D,MAAM,kBAAkB,GACtB,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC,SAAS,EAAE,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC;IAE5G,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvG,eAAe,GAAG,MAAM,qBAAqB,CAAC;QAC5C,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,kBAAkB;QAClB,QAAQ;QACR,gBAAgB,EAAE,WAAW;QAC7B,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,iGAAiG;IACjG,QAAQ,GAAG,eAAe,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAEzD,IAAI,QAAQ,EAAE;QACZ,qFAAqF;QACrF,4BAA4B,CAAC,QAAQ,CAAC,CAAC;KACxC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAAkC;IAC7E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACrD,eAAe,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACrD;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAW,EAAE,KAAa;IACpE,eAAe,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,OAAO,eAAe,EAAE,QAAQ,EAAE,CAAC;AACrC,CAAC","sourcesContent":["import { readConfig } from '@ms-cloudpack/config';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { type Span, type TelemetryClient, createTelemetryClient } from '@ms-cloudpack/telemetry';\nimport { registerPerformanceObservers } from './performance/registerPerformanceObservers.js';\n\nexport interface TelemetryInitOptions {\n useDebugLogging: boolean;\n useVerboseLogging: boolean;\n}\n\nlet telemetryClient: TelemetryClient | undefined;\nexport let rootSpan: Span | undefined;\n\n/**\n * Initialize the telemetry client, create the root span, register performance observers.\n * Telemetry will not be sent if no instrumentation key is found.\n * @param options - options to initialize telemetry\n * @returns\n */\nexport async function initTelemetry(options: TelemetryInitOptions) {\n const instrumentationKey =\n (await readConfig()).telemetry?.instrumentationKey || process.env.CLOUDPACK_TELEMETRY_INSTRUMENTATION_KEY;\n\n const logLevel = options.useVerboseLogging ? '
|
|
1
|
+
{"version":3,"file":"initTelemetry.js","sourceRoot":"","sources":["../src/initTelemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAmC,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAO7F,IAAI,eAA4C,CAAC;AACjD,MAAM,CAAC,IAAI,QAA0B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA6B;IAC/D,MAAM,kBAAkB,GACtB,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC,SAAS,EAAE,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC;IAE5G,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvG,eAAe,GAAG,MAAM,qBAAqB,CAAC;QAC5C,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,kBAAkB;QAClB,QAAQ;QACR,gBAAgB,EAAE,WAAW;QAC7B,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,iGAAiG;IACjG,QAAQ,GAAG,eAAe,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAEzD,IAAI,QAAQ,EAAE;QACZ,qFAAqF;QACrF,4BAA4B,CAAC,QAAQ,CAAC,CAAC;KACxC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAAkC;IAC7E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACrD,eAAe,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACrD;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAW,EAAE,KAAa;IACpE,eAAe,EAAE,sBAAsB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,OAAO,eAAe,EAAE,QAAQ,EAAE,CAAC;AACrC,CAAC","sourcesContent":["import { readConfig } from '@ms-cloudpack/config';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { type Span, type TelemetryClient, createTelemetryClient } from '@ms-cloudpack/telemetry';\nimport { registerPerformanceObservers } from './performance/registerPerformanceObservers.js';\n\nexport interface TelemetryInitOptions {\n useDebugLogging: boolean;\n useVerboseLogging: boolean;\n}\n\nlet telemetryClient: TelemetryClient | undefined;\nexport let rootSpan: Span | undefined;\n\n/**\n * Initialize the telemetry client, create the root span, register performance observers.\n * Telemetry will not be sent if no instrumentation key is found.\n * @param options - options to initialize telemetry\n * @returns\n */\nexport async function initTelemetry(options: TelemetryInitOptions) {\n const instrumentationKey =\n (await readConfig()).telemetry?.instrumentationKey || process.env.CLOUDPACK_TELEMETRY_INSTRUMENTATION_KEY;\n\n const logLevel = options.useVerboseLogging ? 'VERBOSE' : options.useDebugLogging ? 'DEBUG' : undefined;\n\n telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n instrumentationKey,\n logLevel,\n serviceNamespace: 'cloudpack',\n serviceName: 'cli',\n });\n\n // This is the root span for the CLI. It will be used to track the duration of the CLI execution.\n rootSpan = telemetryClient.getTracer()?.startSpan('CLI');\n\n if (rootSpan) {\n // Register performance observers to track performance metrics as events of CLI span.\n registerPerformanceObservers(rootSpan);\n }\n}\n\n/**\n * Adds shared attributes to all spans.\n * No-op if telemetry is not initialized.\n * @param attributes - key-value pair\n */\nexport function setSharedTelemetryAttributes(attributes: Record<string, string>) {\n for (const [key, value] of Object.entries(attributes)) {\n telemetryClient?.setSharedSpanAttribute(key, value);\n }\n}\n\n/**\n * Adds a shared attribute to all spans.\n * No-op if telemetry is not initialized.\n * @param key - key of the attribute\n * @param value - value of the attribute\n */\nexport function setSharedTelemetryAttribute(key: string, value: string) {\n telemetryClient?.setSharedSpanAttribute(key, value);\n}\n\n/**\n * Ends rootSpan and flushes all telemetry.\n * No-op if telemetry is not initialized.\n * @returns a promise that resolves when telemetry is flushed and shutdown.\n */\nexport function stopTelemetry() {\n rootSpan?.end();\n return telemetryClient?.shutdown();\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.6",
|
|
4
4
|
"description": "The Cloudpack command line interface - a tool for managing fast inner and outer looping in web apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
"cloudpack": "./bin/cloudpack.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ms-cloudpack/api-server": "^0.5.
|
|
20
|
-
"@ms-cloudpack/bundler": "^0.11.
|
|
19
|
+
"@ms-cloudpack/api-server": "^0.5.5",
|
|
20
|
+
"@ms-cloudpack/bundler": "^0.11.29",
|
|
21
21
|
"@ms-cloudpack/config": "^0.5.2",
|
|
22
22
|
"@ms-cloudpack/create-express-app": "^1.3.3",
|
|
23
23
|
"@ms-cloudpack/data-bus": "^0.1.1",
|
|
24
24
|
"@ms-cloudpack/json-utilities": "^0.0.6",
|
|
25
25
|
"@ms-cloudpack/overlay": "^0.13.2",
|
|
26
|
-
"@ms-cloudpack/package-utilities": "^2.4.
|
|
26
|
+
"@ms-cloudpack/package-utilities": "^2.4.3",
|
|
27
27
|
"@ms-cloudpack/path-utilities": "^2.2.1",
|
|
28
28
|
"@ms-cloudpack/path-string-parsing": "^1.0.1",
|
|
29
29
|
"@ms-cloudpack/task-reporter": "^0.3.0",
|
|
30
|
-
"@ms-cloudpack/telemetry": "^0.
|
|
30
|
+
"@ms-cloudpack/telemetry": "^0.3.0",
|
|
31
31
|
"chokidar": "^3.5.3",
|
|
32
32
|
"commander": "^10.0.0",
|
|
33
33
|
"es-module-lexer": "^1.0.3",
|