@ms-cloudpack/external-telemetry 0.5.193 → 0.5.194

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 +1 @@
1
- {"version":3,"file":"reportExternalTelemetryEvent.d.ts","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAIhF;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBjG"}
1
+ {"version":3,"file":"reportExternalTelemetryEvent.d.ts","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAIhF;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BjG"}
@@ -9,17 +9,21 @@ const external = 'EXTERNAL';
9
9
  * @param options - The options for reporting the event.
10
10
  */
11
11
  export async function reportExternalTelemetryEvent(options) {
12
- const { telemetry } = await readConfig(options.appPath);
12
+ const { appPath } = options;
13
+ const { telemetry } = await readConfig(appPath);
13
14
  const connectionString = telemetry?.connectionString || environmentInfo.cloudpack.telemetryConnectionString;
14
- const telemetryApi = startTelemetry({
15
+ const telemetryApi = await startTelemetry({
15
16
  productVersion: getVersion(import.meta.url),
16
17
  serviceName: 'external-telemetry',
17
18
  logLevel: options.logLevel,
19
+ connectionStrings: {
20
+ [appPath]: connectionString,
21
+ },
18
22
  });
19
- const telemetryClient = await telemetryApi.createClient(connectionString);
20
- const externalTelemetrySpan = telemetryClient.tracer.startSpan(external, {
23
+ const client = telemetryApi.clients[appPath];
24
+ const externalTelemetrySpan = client.tracer.startSpan(external, {
21
25
  attributes: {
22
- appName: options.appName || (await getAppName(options.appPath)) || '<unknown>',
26
+ appName: options.appName || (await getAppName(appPath)) || '<unknown>',
23
27
  },
24
28
  });
25
29
  externalTelemetrySpan.addEvent(`${external}-${options.eventName}`, options.attributes);
@@ -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,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"]}
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,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,SAAS,EAAE,gBAAgB,IAAI,eAAe,CAAC,SAAS,CAAC,yBAAyB,CAAC;IAE5G,MAAM,YAAY,GAAG,MAAM,cAAc,CAAC;QACxC,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,WAAW,EAAE,oBAAoB;QACjC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,iBAAiB,EAAE;YACjB,CAAC,OAAO,CAAC,EAAE,gBAAgB;SAC5B;KACF,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7C,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE;QAC9D,UAAU,EAAE;YACV,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,WAAW;SACvE;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 { appPath } = options;\n const { telemetry } = await readConfig(appPath);\n const connectionString = telemetry?.connectionString || environmentInfo.cloudpack.telemetryConnectionString;\n\n const telemetryApi = await startTelemetry({\n productVersion: getVersion(import.meta.url),\n serviceName: 'external-telemetry',\n logLevel: options.logLevel,\n connectionStrings: {\n [appPath]: connectionString,\n },\n });\n const client = telemetryApi.clients[appPath];\n\n const externalTelemetrySpan = client.tracer.startSpan(external, {\n attributes: {\n appName: options.appName || (await getAppName(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.193",
3
+ "version": "0.5.194",
4
4
  "description": "Reporting external telemetry which is not about of cloudpack internals.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,12 +21,12 @@
21
21
  "lint": "cloudpack-scripts lint"
22
22
  },
23
23
  "dependencies": {
24
- "@ms-cloudpack/common-types": "^0.34.0",
25
- "@ms-cloudpack/config": "^0.38.40",
26
- "@ms-cloudpack/environment": "^0.1.1",
27
- "@ms-cloudpack/json-utilities": "^0.1.11",
28
- "@ms-cloudpack/package-utilities": "^13.8.2",
29
- "@ms-cloudpack/telemetry": "^0.11.75"
24
+ "@ms-cloudpack/common-types": "^0.34.1",
25
+ "@ms-cloudpack/config": "^0.38.41",
26
+ "@ms-cloudpack/environment": "^0.1.3",
27
+ "@ms-cloudpack/json-utilities": "^0.1.12",
28
+ "@ms-cloudpack/package-utilities": "^13.8.3",
29
+ "@ms-cloudpack/telemetry": "^0.12.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",