@ms-cloudpack/external-telemetry 0.1.10 → 0.1.12

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { reportExternalTelemetryEvent } from './reportExternalTelemetryEvent.js';
2
- export type { ReportTelemetryOptions } from './types.js';
2
+ export type { ReportTelemetryOptions } from './types/ReportTelemetryOptions.js';
3
3
  export type { LogLevel } from '@ms-cloudpack/telemetry';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,YAAY,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,YAAY,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC","sourcesContent":["export { reportExternalTelemetryEvent } from './reportExternalTelemetryEvent.js';\nexport type { ReportTelemetryOptions } from './types.js';\nexport type { LogLevel } from '@ms-cloudpack/telemetry';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC","sourcesContent":["export { reportExternalTelemetryEvent } from './reportExternalTelemetryEvent.js';\nexport type { ReportTelemetryOptions } from './types/ReportTelemetryOptions.js';\nexport type { LogLevel } from '@ms-cloudpack/telemetry';\n"]}
@@ -1,4 +1,4 @@
1
- import type { ReportTelemetryOptions } from './types.js';
1
+ import type { ReportTelemetryOptions } from './types/ReportTelemetryOptions.js';
2
2
  /**
3
3
  * Report an external telemetry event to the CloudPack telemetry service.
4
4
  * @param options - The options for reporting the event.
@@ -1 +1 @@
1
- {"version":3,"file":"reportExternalTelemetryEvent.d.ts","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIzD;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,iBAqBjF"}
1
+ {"version":3,"file":"reportExternalTelemetryEvent.d.ts","sourceRoot":"","sources":["../src/reportExternalTelemetryEvent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAIhF;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,sBAAsB,iBAqBjF"}
@@ -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,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,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,EAAE,CAAC;IACzC,MAAM,kBAAkB,GAAG,SAAS,EAAE,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC;IAEhH,MAAM,eAAe,GAAG,MAAM,qBAAqB,CAAC;QAClD,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,WAAW,EAAE,oBAAoB;QACjC,gBAAgB,EAAE,WAAW;QAC7B,kBAAkB,EAAE,kBAAkB;QACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IAEH,eAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,UAAU,EAAE,CAAC,IAAI,WAAW,CAAC,CAAC;IAE1G,MAAM,qBAAqB,GAAG,eAAe,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAE9E,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,eAAe,CAAC,QAAQ,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { readConfig } from '@ms-cloudpack/config';\nimport { createTelemetryClient } from '@ms-cloudpack/telemetry';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { getAppName } from './getAppName.js';\nimport type { ReportTelemetryOptions } from './types.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) {\n const { telemetry } = await readConfig();\n const instrumentationKey = telemetry?.instrumentationKey || process.env.CLOUDPACK_TELEMETRY_INSTRUMENTATION_KEY;\n\n const telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n serviceName: 'external-telemetry',\n serviceNamespace: 'cloudpack',\n instrumentationKey: instrumentationKey,\n logLevel: options.logLevel,\n });\n\n telemetryClient.setSharedSpanAttribute('appName', options.appName || (await getAppName()) || '<unknown>');\n\n const externalTelemetrySpan = telemetryClient.getTracer().startSpan(external);\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,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,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,EAAE,CAAC;IACzC,MAAM,kBAAkB,GAAG,SAAS,EAAE,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC;IAEhH,MAAM,eAAe,GAAG,MAAM,qBAAqB,CAAC;QAClD,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,WAAW,EAAE,oBAAoB;QACjC,gBAAgB,EAAE,WAAW;QAC7B,kBAAkB,EAAE,kBAAkB;QACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IAEH,eAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,UAAU,EAAE,CAAC,IAAI,WAAW,CAAC,CAAC;IAE1G,MAAM,qBAAqB,GAAG,eAAe,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAE9E,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,eAAe,CAAC,QAAQ,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { readConfig } from '@ms-cloudpack/config';\nimport { createTelemetryClient } 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) {\n const { telemetry } = await readConfig();\n const instrumentationKey = telemetry?.instrumentationKey || process.env.CLOUDPACK_TELEMETRY_INSTRUMENTATION_KEY;\n\n const telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n serviceName: 'external-telemetry',\n serviceNamespace: 'cloudpack',\n instrumentationKey: instrumentationKey,\n logLevel: options.logLevel,\n });\n\n telemetryClient.setSharedSpanAttribute('appName', options.appName || (await getAppName()) || '<unknown>');\n\n const externalTelemetrySpan = telemetryClient.getTracer().startSpan(external);\n\n externalTelemetrySpan.addEvent(`${external}-${options.eventName}`, options.attributes);\n\n externalTelemetrySpan.end();\n\n await telemetryClient.shutdown();\n}\n"]}
@@ -1,11 +1,11 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.4"
9
- }
10
- ]
11
- }
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.34.8"
9
+ }
10
+ ]
11
+ }
@@ -21,4 +21,4 @@ export interface ReportTelemetryOptions {
21
21
  */
22
22
  logLevel?: LogLevel;
23
23
  }
24
- //# sourceMappingURL=types.d.ts.map
24
+ //# sourceMappingURL=ReportTelemetryOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportTelemetryOptions.d.ts","sourceRoot":"","sources":["../../src/types/ReportTelemetryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ReportTelemetryOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportTelemetryOptions.js","sourceRoot":"","sources":["../../src/types/ReportTelemetryOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogLevel } from '@ms-cloudpack/telemetry';\n\n/**\n * Options for external telemetry.\n */\n\nexport interface ReportTelemetryOptions {\n /**\n * Event name to be reported into application insights.\n * \"EXTERNAL-\" prefix will be added by cloudpack.\n */\n eventName: string;\n\n /**\n * Application name to be reported into application insights.\n */\n appName?: string;\n\n /**\n * Additional attributes to be reported into application insights.\n */\n attributes?: Record<string, string>;\n\n /**\n * Log level to be used by application insights.\n */\n logLevel?: LogLevel;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/external-telemetry",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Reporting external telemetry which is not about of cloudpack internals.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,19 +13,18 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@ms-cloudpack/telemetry": "^0.3.0",
17
- "@ms-cloudpack/config": "^0.5.6",
16
+ "@ms-cloudpack/telemetry": "^0.3.1",
17
+ "@ms-cloudpack/config": "^0.6.0",
18
18
  "@ms-cloudpack/package-utilities": "^3.1.0",
19
19
  "@ms-cloudpack/path-utilities": "^2.2.2",
20
20
  "@ms-cloudpack/json-utilities": "^0.0.6",
21
21
  "@ms-cloudpack/bundler-types": "^0.13.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@ms-cloudpack/eslint-config-base": "*",
24
+ "@ms-cloudpack/eslint-plugin-internal": "*",
25
25
  "@ms-cloudpack/scripts": "*"
26
26
  },
27
27
  "scripts": {
28
- "api:update": "cloudpack-scripts api-update",
29
28
  "api": "cloudpack-scripts api",
30
29
  "build:watch": "cloudpack-scripts build-watch",
31
30
  "build": "cloudpack-scripts build",
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB"}
package/lib/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogLevel } from '@ms-cloudpack/telemetry';\n\n/**\n * Options for external telemetry.\n */\nexport interface ReportTelemetryOptions {\n /**\n * Event name to be reported into application insights.\n * \"EXTERNAL-\" prefix will be added by cloudpack.\n */\n eventName: string;\n\n /**\n * Application name to be reported into application insights.\n */\n appName?: string;\n\n /**\n * Additional attributes to be reported into application insights.\n */\n attributes?: Record<string, string>;\n\n /**\n * Log level to be used by application insights.\n */\n logLevel?: LogLevel;\n}\n"]}