@ms-cloudpack/external-telemetry 0.5.110 → 0.5.112

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.
@@ -1,6 +1,6 @@
1
1
  import { readConfig } from '@ms-cloudpack/config';
2
2
  import { environmentInfo } from '@ms-cloudpack/environment';
3
- import { createTelemetryClient } from '@ms-cloudpack/telemetry';
3
+ import { startTelemetry } from '@ms-cloudpack/telemetry';
4
4
  import { getVersion } from '@ms-cloudpack/package-utilities';
5
5
  import { getAppName } from './getAppName.js';
6
6
  const external = 'EXTERNAL';
@@ -11,13 +11,12 @@ const external = 'EXTERNAL';
11
11
  export async function reportExternalTelemetryEvent(options) {
12
12
  const { telemetry } = await readConfig(options.appPath);
13
13
  const connectionString = telemetry?.connectionString || environmentInfo.cloudpack.telemetryConnectionString;
14
- const telemetryClient = await createTelemetryClient({
14
+ const telemetryApi = startTelemetry({
15
15
  productVersion: getVersion(import.meta.url),
16
16
  serviceName: 'external-telemetry',
17
- serviceNamespace: 'cloudpack',
18
- connectionString: connectionString,
19
17
  logLevel: options.logLevel,
20
18
  });
19
+ const telemetryClient = await telemetryApi.createClient(connectionString);
21
20
  const externalTelemetrySpan = telemetryClient.tracer.startSpan(external, {
22
21
  attributes: {
23
22
  appName: options.appName || (await getAppName(options.appPath)) || '<unknown>',
@@ -25,6 +24,6 @@ export async function reportExternalTelemetryEvent(options) {
25
24
  });
26
25
  externalTelemetrySpan.addEvent(`${external}-${options.eventName}`, options.attributes);
27
26
  externalTelemetrySpan.end();
28
- await telemetryClient.shutdown();
27
+ await telemetryApi.shutdown();
29
28
  }
30
29
  //# sourceMappingURL=reportExternalTelemetryEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reportExternalTelemetryEvent.js","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,E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ient } from '@ms-cloudpack/telemetry';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { getAppName } from './getAppName.js';\nimport type { ReportTelemetryOptions } from './types/ReportTelemetryOptions.js';\n\nconst external = 'EXTERNAL';\n\n/**\n * Report an external telemetry event to the CloudPack telemetry service.\n * @param options - The options for reporting the event.\n */\nexport async function reportExternalTelemetryEvent(options: ReportTelemetryOptions): Promise<void> {\n const { telemetry } = await readConfig(options.appPath);\n const connectionString = telemetry?.connectionString || environmentInfo.cloudpack.telemetryConnectionString;\n\n const telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n serviceName: 'external-telemetry',\n serviceNamespace: 'cloudpack',\n connectionString: connectionString,\n logLevel: options.logLevel,\n });\n\n const externalTelemetrySpan = telemetryClient.tracer.startSpan(external, {\n attributes: {\n appName: options.appName || (await getAppName(options.appPath)) || '<unknown>',\n },\n });\n\n externalTelemetrySpan.addEvent(`${external}-${options.eventName}`, options.attributes);\n\n externalTelemetrySpan.end();\n\n await telemetryClient.shutdown();\n}\n"]}
1
+ {"version":3,"file":"reportExternalTelemetryEvent.js","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAE5B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAA+B;IAChF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,SAAS,EAAE,gBAAgB,IAAI,eAAe,CAAC,SAAS,CAAC,yBAAyB,CAAC;IAE5G,MAAM,YAAY,GAAG,cAAc,CAAC;QAClC,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,WAAW,EAAE,oBAAoB;QACjC,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAE1E,MAAM,qBAAqB,GAAG,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE;QACvE,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,WAAW;SAC/E;KACF,CAAC,CAAC;IAEH,qBAAqB,CAAC,QAAQ,CAAC,GAAG,QAAQ,IAAI,OAAO,CAAC,SAAS,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvF,qBAAqB,CAAC,GAAG,EAAE,CAAC;IAE5B,MAAM,YAAY,CAAC,QAAQ,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import { readConfig } from '@ms-cloudpack/config';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { startTelemetry } from '@ms-cloudpack/telemetry';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { getAppName } from './getAppName.js';\nimport type { ReportTelemetryOptions } from './types/ReportTelemetryOptions.js';\n\nconst external = 'EXTERNAL';\n\n/**\n * Report an external telemetry event to the CloudPack telemetry service.\n * @param options - The options for reporting the event.\n */\nexport async function reportExternalTelemetryEvent(options: ReportTelemetryOptions): Promise<void> {\n const { telemetry } = await readConfig(options.appPath);\n const connectionString = telemetry?.connectionString || environmentInfo.cloudpack.telemetryConnectionString;\n\n const telemetryApi = startTelemetry({\n productVersion: getVersion(import.meta.url),\n serviceName: 'external-telemetry',\n logLevel: options.logLevel,\n });\n\n const telemetryClient = await telemetryApi.createClient(connectionString);\n\n const externalTelemetrySpan = telemetryClient.tracer.startSpan(external, {\n attributes: {\n appName: options.appName || (await getAppName(options.appPath)) || '<unknown>',\n },\n });\n\n externalTelemetrySpan.addEvent(`${external}-${options.eventName}`, options.attributes);\n\n externalTelemetrySpan.end();\n\n await telemetryApi.shutdown();\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/external-telemetry",
3
- "version": "0.5.110",
3
+ "version": "0.5.112",
4
4
  "description": "Reporting external telemetry which is not about of cloudpack internals.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -15,11 +15,11 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@ms-cloudpack/common-types": "^0.24.10",
18
- "@ms-cloudpack/config": "^0.33.19",
18
+ "@ms-cloudpack/config": "^0.33.21",
19
19
  "@ms-cloudpack/environment": "^0.1.1",
20
20
  "@ms-cloudpack/json-utilities": "^0.1.10",
21
- "@ms-cloudpack/package-utilities": "^12.0.0",
22
- "@ms-cloudpack/telemetry": "^0.10.18"
21
+ "@ms-cloudpack/package-utilities": "^12.0.1",
22
+ "@ms-cloudpack/telemetry": "^0.11.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",