@ms-cloudpack/telemetry 0.3.6 → 0.3.8

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.
Files changed (36) hide show
  1. package/lib/AppInsights/AppInsightsTelemetryClient.d.ts +6 -1
  2. package/lib/AppInsights/AppInsightsTelemetryClient.d.ts.map +1 -1
  3. package/lib/AppInsights/AppInsightsTelemetryClient.js +14 -0
  4. package/lib/AppInsights/AppInsightsTelemetryClient.js.map +1 -1
  5. package/lib/NoOp/NoOpTelemetryClient.d.ts +4 -0
  6. package/lib/NoOp/NoOpTelemetryClient.d.ts.map +1 -1
  7. package/lib/NoOp/NoOpTelemetryClient.js +4 -0
  8. package/lib/NoOp/NoOpTelemetryClient.js.map +1 -1
  9. package/lib/PerformanceRecorder.d.ts +28 -0
  10. package/lib/PerformanceRecorder.d.ts.map +1 -0
  11. package/lib/PerformanceRecorder.js +42 -0
  12. package/lib/PerformanceRecorder.js.map +1 -0
  13. package/lib/createNoOpTelemetryClient.d.ts +3 -0
  14. package/lib/createNoOpTelemetryClient.d.ts.map +1 -0
  15. package/lib/createNoOpTelemetryClient.js +5 -0
  16. package/lib/createNoOpTelemetryClient.js.map +1 -0
  17. package/lib/index.d.ts +4 -0
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +1 -0
  20. package/lib/index.js.map +1 -1
  21. package/lib/tsdoc-metadata.json +1 -1
  22. package/lib/types/PerformanceTracker.d.ts +7 -0
  23. package/lib/types/PerformanceTracker.d.ts.map +1 -0
  24. package/lib/types/PerformanceTracker.js +2 -0
  25. package/lib/types/PerformanceTracker.js.map +1 -0
  26. package/lib/types/SpanAttributes.d.ts +2 -0
  27. package/lib/types/SpanAttributes.d.ts.map +1 -0
  28. package/lib/types/SpanAttributes.js +2 -0
  29. package/lib/types/SpanAttributes.js.map +1 -0
  30. package/lib/types/TelemetryClient.d.ts +10 -1
  31. package/lib/types/TelemetryClient.d.ts.map +1 -1
  32. package/lib/types/TelemetryClient.js.map +1 -1
  33. package/lib/types/TelemetryOptions.d.ts +4 -0
  34. package/lib/types/TelemetryOptions.d.ts.map +1 -1
  35. package/lib/types/TelemetryOptions.js.map +1 -1
  36. package/package.json +1 -1
@@ -1,10 +1,15 @@
1
- import type { Tracer } from '@opentelemetry/api';
1
+ import type { Span, Tracer } from '@opentelemetry/api';
2
2
  import type { TelemetryOptions } from '../types/TelemetryOptions.js';
3
3
  import type { TelemetryClient } from '../types/TelemetryClient.js';
4
+ import { PerformanceRecorder } from '../PerformanceRecorder.js';
4
5
  export declare class AppInsightsTelemetryClient implements TelemetryClient {
6
+ private readonly _performance;
7
+ private readonly _rootSpan;
5
8
  private readonly appInsightsClient;
6
9
  private readonly sharedSpanAttributes;
7
10
  constructor(options: TelemetryOptions);
11
+ get performance(): PerformanceRecorder;
12
+ get rootSpan(): Span;
8
13
  /**
9
14
  * Sets a shared attribute that will be added to all spans.
10
15
  * @param key - key of the attribute
@@ -1 +1 @@
1
- {"version":3,"file":"AppInsightsTelemetryClient.d.ts","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAMjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA4B;IAC9D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA8B;gBAEvD,OAAO,EAAE,gBAAgB;IAerC;;;;OAIG;IACI,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAIxD;;OAEG;IACU,QAAQ;IAKrB;;;OAGG;IACI,SAAS,IAAI,MAAM;CAG3B"}
1
+ {"version":3,"file":"AppInsightsTelemetryClient.d.ts","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAMvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAO;IACjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA4B;IAC9D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA8B;gBAEvD,OAAO,EAAE,gBAAgB;IAuBrC,IAAW,WAAW,IAAI,mBAAmB,CAE5C;IAED,IAAW,QAAQ,IAAI,IAAI,CAE1B;IAED;;;;OAIG;IACI,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAIxD;;OAEG;IACU,QAAQ;IAMrB;;;OAGG;IACI,SAAS,IAAI,MAAM;CAG3B"}
@@ -2,6 +2,7 @@ import { ApplicationInsightsClient } from 'applicationinsights';
2
2
  import { convertLogLevel } from './convertLogLevel.js';
3
3
  import { getAppInsightsConfig } from './getAppInsightsConfig.js';
4
4
  import { SpanEnrichingProcessor } from './SpanEnrichingProcessor.js';
5
+ import { PerformanceRecorder } from '../PerformanceRecorder.js';
5
6
  export class AppInsightsTelemetryClient {
6
7
  constructor(options) {
7
8
  this.sharedSpanAttributes = {};
@@ -13,6 +14,18 @@ export class AppInsightsTelemetryClient {
13
14
  // Set SpanEnrichingProcessor to add shared attributes to all spans
14
15
  const nodeTraceProvider = this.appInsightsClient.getTraceHandler().getTracerProvider();
15
16
  nodeTraceProvider.addSpanProcessor(new SpanEnrichingProcessor(() => this.sharedSpanAttributes));
17
+ // Create root span
18
+ this._rootSpan = this.appInsightsClient
19
+ .getTraceHandler()
20
+ .getTracer()
21
+ .startSpan(options.rootSpanName || 'root');
22
+ this._performance = new PerformanceRecorder(this._rootSpan);
23
+ }
24
+ get performance() {
25
+ return this._performance;
26
+ }
27
+ get rootSpan() {
28
+ return this._rootSpan;
16
29
  }
17
30
  /**
18
31
  * Sets a shared attribute that will be added to all spans.
@@ -26,6 +39,7 @@ export class AppInsightsTelemetryClient {
26
39
  * Flushes all telemetry and shuts down the telemetry client.
27
40
  */
28
41
  async shutdown() {
42
+ this._rootSpan.end();
29
43
  await this.appInsightsClient?.flush();
30
44
  await this.appInsightsClient?.shutdown();
31
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppInsightsTelemetryClient.js","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAIrE,MAAM,OAAO,0BAA0B;IAIrC,YAAY,OAAyB;QAFpB,yBAAoB,GAA2B,EAAE,CAAC;QAGjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,iBAAiB,GAAG,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAE/D,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAErF,wBAAwB;QACxB,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QAE/D,mEAAmE;QACnE,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC,iBAAiB,EAAwB,CAAC;QAC7G,iBAAiB,CAAC,gBAAgB,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAClG,CAAC;IAED;;;;OAIG;IACI,sBAAsB,CAAC,GAAW,EAAE,KAAa;QACtD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,MAAM,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,CAAC;QACtC,MAAM,IAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,iBAAiB,EAAE,eAAe,EAAE,CAAC,SAAS,EAAE,CAAC;IAC/D,CAAC;CACF","sourcesContent":["import type { Tracer } from '@opentelemetry/api';\nimport type { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport { ApplicationInsightsClient } from 'applicationinsights';\nimport { convertLogLevel } from './convertLogLevel.js';\nimport { getAppInsightsConfig } from './getAppInsightsConfig.js';\nimport { SpanEnrichingProcessor } from './SpanEnrichingProcessor.js';\nimport type { TelemetryOptions } from '../types/TelemetryOptions.js';\nimport type { TelemetryClient } from '../types/TelemetryClient.js';\n\nexport class AppInsightsTelemetryClient implements TelemetryClient {\n private readonly appInsightsClient: ApplicationInsightsClient;\n private readonly sharedSpanAttributes: Record<string, string> = {};\n\n constructor(options: TelemetryOptions) {\n const config = getAppInsightsConfig(options);\n\n this.appInsightsClient = new ApplicationInsightsClient(config);\n\n this.appInsightsClient.getLogger().updateLogLevel(convertLogLevel(options.logLevel));\n\n // Set shared attributes\n this.setSharedSpanAttribute('version', options.productVersion);\n\n // Set SpanEnrichingProcessor to add shared attributes to all spans\n const nodeTraceProvider = this.appInsightsClient.getTraceHandler().getTracerProvider() as NodeTracerProvider;\n nodeTraceProvider.addSpanProcessor(new SpanEnrichingProcessor(() => this.sharedSpanAttributes));\n }\n\n /**\n * Sets a shared attribute that will be added to all spans.\n * @param key - key of the attribute\n * @param value - value of the attribute\n */\n public setSharedSpanAttribute(key: string, value: string) {\n this.sharedSpanAttributes[key] = value;\n }\n\n /**\n * Flushes all telemetry and shuts down the telemetry client.\n */\n public async shutdown() {\n await this.appInsightsClient?.flush();\n await this.appInsightsClient?.shutdown();\n }\n\n /**\n * Gets the OpenTelemetry tracer.\n * @returns the OpenTelemetry tracer\n */\n public getTracer(): Tracer {\n return this.appInsightsClient?.getTraceHandler().getTracer();\n }\n}\n"]}
1
+ {"version":3,"file":"AppInsightsTelemetryClient.js","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,OAAO,0BAA0B;IAMrC,YAAY,OAAyB;QAFpB,yBAAoB,GAA2B,EAAE,CAAC;QAGjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,iBAAiB,GAAG,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAE/D,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAErF,wBAAwB;QACxB,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QAE/D,mEAAmE;QACnE,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC,iBAAiB,EAAwB,CAAC;QAC7G,iBAAiB,CAAC,gBAAgB,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAEhG,mBAAmB;QACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB;aACpC,eAAe,EAAE;aACjB,SAAS,EAAE;aACX,SAAS,CAAC,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC;QAE7C,IAAI,CAAC,YAAY,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,sBAAsB,CAAC,GAAW,EAAE,KAAa;QACtD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QACrB,MAAM,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,CAAC;QACtC,MAAM,IAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,iBAAiB,EAAE,eAAe,EAAE,CAAC,SAAS,EAAE,CAAC;IAC/D,CAAC;CACF","sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport type { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport { ApplicationInsightsClient } from 'applicationinsights';\nimport { convertLogLevel } from './convertLogLevel.js';\nimport { getAppInsightsConfig } from './getAppInsightsConfig.js';\nimport { SpanEnrichingProcessor } from './SpanEnrichingProcessor.js';\nimport type { TelemetryOptions } from '../types/TelemetryOptions.js';\nimport type { TelemetryClient } from '../types/TelemetryClient.js';\nimport { PerformanceRecorder } from '../PerformanceRecorder.js';\n\nexport class AppInsightsTelemetryClient implements TelemetryClient {\n private readonly _performance: PerformanceRecorder;\n private readonly _rootSpan: Span;\n private readonly appInsightsClient: ApplicationInsightsClient;\n private readonly sharedSpanAttributes: Record<string, string> = {};\n\n constructor(options: TelemetryOptions) {\n const config = getAppInsightsConfig(options);\n\n this.appInsightsClient = new ApplicationInsightsClient(config);\n\n this.appInsightsClient.getLogger().updateLogLevel(convertLogLevel(options.logLevel));\n\n // Set shared attributes\n this.setSharedSpanAttribute('version', options.productVersion);\n\n // Set SpanEnrichingProcessor to add shared attributes to all spans\n const nodeTraceProvider = this.appInsightsClient.getTraceHandler().getTracerProvider() as NodeTracerProvider;\n nodeTraceProvider.addSpanProcessor(new SpanEnrichingProcessor(() => this.sharedSpanAttributes));\n\n // Create root span\n this._rootSpan = this.appInsightsClient\n .getTraceHandler()\n .getTracer()\n .startSpan(options.rootSpanName || 'root');\n\n this._performance = new PerformanceRecorder(this._rootSpan);\n }\n\n public get performance(): PerformanceRecorder {\n return this._performance;\n }\n\n public get rootSpan(): Span {\n return this._rootSpan;\n }\n\n /**\n * Sets a shared attribute that will be added to all spans.\n * @param key - key of the attribute\n * @param value - value of the attribute\n */\n public setSharedSpanAttribute(key: string, value: string) {\n this.sharedSpanAttributes[key] = value;\n }\n\n /**\n * Flushes all telemetry and shuts down the telemetry client.\n */\n public async shutdown() {\n this._rootSpan.end();\n await this.appInsightsClient?.flush();\n await this.appInsightsClient?.shutdown();\n }\n\n /**\n * Gets the OpenTelemetry tracer.\n * @returns the OpenTelemetry tracer\n */\n public getTracer(): Tracer {\n return this.appInsightsClient?.getTraceHandler().getTracer();\n }\n}\n"]}
@@ -1,10 +1,14 @@
1
+ import type { Span } from '@opentelemetry/api';
1
2
  import type { TelemetryClient } from '../types/TelemetryClient.js';
2
3
  import { NoOpTracer } from './NoOpTracer.js';
4
+ import { PerformanceRecorder } from '../PerformanceRecorder.js';
3
5
  /**
4
6
  * No-op implementation of {@link TelemetryClient}.
5
7
  * This class will be used when Telemetry is disabled.
6
8
  */
7
9
  export declare class NoOpTelemetryClient implements TelemetryClient {
10
+ readonly rootSpan: Span;
11
+ readonly performance: PerformanceRecorder;
8
12
  private tracer;
9
13
  setSharedSpanAttribute(): TelemetryClient;
10
14
  shutdown(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"NoOpTelemetryClient.d.ts","sourceRoot":"","sources":["../../src/NoOp/NoOpTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,OAAO,CAAC,MAAM,CAAoB;IAElC,sBAAsB,IAAI,eAAe;IAKzC,QAAQ;IAKR,SAAS;CAGV"}
1
+ {"version":3,"file":"NoOpTelemetryClient.d.ts","sourceRoot":"","sources":["../../src/NoOp/NoOpTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAkB;IACzC,QAAQ,CAAC,WAAW,sBAA0C;IAC9D,OAAO,CAAC,MAAM,CAAoB;IAElC,sBAAsB,IAAI,eAAe;IAKzC,QAAQ;IAKR,SAAS;CAGV"}
@@ -1,10 +1,14 @@
1
1
  import { NoOpTracer } from './NoOpTracer.js';
2
+ import { NoOpSpan } from './NoOpSpan.js';
3
+ import { PerformanceRecorder } from '../PerformanceRecorder.js';
2
4
  /**
3
5
  * No-op implementation of {@link TelemetryClient}.
4
6
  * This class will be used when Telemetry is disabled.
5
7
  */
6
8
  export class NoOpTelemetryClient {
7
9
  constructor() {
10
+ this.rootSpan = new NoOpSpan();
11
+ this.performance = new PerformanceRecorder(this.rootSpan);
8
12
  this.tracer = new NoOpTracer();
9
13
  }
10
14
  setSharedSpanAttribute() {
@@ -1 +1 @@
1
- {"version":3,"file":"NoOpTelemetryClient.js","sourceRoot":"","sources":["../../src/NoOp/NoOpTelemetryClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACU,WAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAepC,CAAC;IAbC,sBAAsB;QACpB,QAAQ;QACR,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ;QACN,QAAQ;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["import type { TelemetryClient } from '../types/TelemetryClient.js';\nimport { NoOpTracer } from './NoOpTracer.js';\n\n/**\n * No-op implementation of {@link TelemetryClient}.\n * This class will be used when Telemetry is disabled.\n */\nexport class NoOpTelemetryClient implements TelemetryClient {\n private tracer = new NoOpTracer();\n\n setSharedSpanAttribute(): TelemetryClient {\n // No-op\n return this;\n }\n\n shutdown() {\n // No-op\n return Promise.resolve();\n }\n\n getTracer() {\n return this.tracer;\n }\n}\n"]}
1
+ {"version":3,"file":"NoOpTelemetryClient.js","sourceRoot":"","sources":["../../src/NoOp/NoOpTelemetryClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACW,aAAQ,GAAS,IAAI,QAAQ,EAAE,CAAC;QAChC,gBAAW,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtD,WAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAepC,CAAC;IAbC,sBAAsB;QACpB,QAAQ;QACR,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ;QACN,QAAQ;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { TelemetryClient } from '../types/TelemetryClient.js';\nimport { NoOpTracer } from './NoOpTracer.js';\nimport { NoOpSpan } from './NoOpSpan.js';\nimport { PerformanceRecorder } from '../PerformanceRecorder.js';\n\n/**\n * No-op implementation of {@link TelemetryClient}.\n * This class will be used when Telemetry is disabled.\n */\nexport class NoOpTelemetryClient implements TelemetryClient {\n readonly rootSpan: Span = new NoOpSpan();\n readonly performance = new PerformanceRecorder(this.rootSpan);\n private tracer = new NoOpTracer();\n\n setSharedSpanAttribute(): TelemetryClient {\n // No-op\n return this;\n }\n\n shutdown() {\n // No-op\n return Promise.resolve();\n }\n\n getTracer() {\n return this.tracer;\n }\n}\n"]}
@@ -0,0 +1,28 @@
1
+ import type { Span } from '@opentelemetry/api';
2
+ import type { SpanAttributes } from './types/SpanAttributes.js';
3
+ import type { PerformanceTracker } from './types/PerformanceTracker.js';
4
+ /**
5
+ * PerformanceRecorder is a utility class for recording performance metrics into telemetry.
6
+ */
7
+ export declare class PerformanceRecorder {
8
+ private readonly span;
9
+ constructor(span: Span);
10
+ /**
11
+ * Records a performance metric into telemetry. The metric will be recorded as an event on the span and logged to the console.
12
+ * It can be used for any situation where a performance metric (ie: how long does it take run something, or any other purpose) is needed.
13
+ * @param attributes
14
+ */
15
+ record(attributes: {
16
+ name: string;
17
+ value: number;
18
+ additionalProperties?: SpanAttributes;
19
+ }): void;
20
+ /**
21
+ * Tracks the execution time of a given `execute` function and report it to telemetry.
22
+ * @param name - The name of the performance metric.
23
+ * @param execute - The function to execute and track.
24
+ * @returns - The result of the `execute` function.
25
+ */
26
+ track<T>(name: string, execute: (tracker: PerformanceTracker) => Promise<T>): Promise<T>;
27
+ }
28
+ //# sourceMappingURL=PerformanceRecorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceRecorder.d.ts","sourceRoot":"","sources":["../src/PerformanceRecorder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE;;GAEG;AACH,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,IAAI;IAEvC;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,cAAc,CAAA;KAAE,GAAG,IAAI;IAMhG;;;;;OAKG;IACG,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAqB/F"}
@@ -0,0 +1,42 @@
1
+ import { performance } from 'perf_hooks';
2
+ /**
3
+ * PerformanceRecorder is a utility class for recording performance metrics into telemetry.
4
+ */
5
+ export class PerformanceRecorder {
6
+ constructor(span) {
7
+ this.span = span;
8
+ }
9
+ /**
10
+ * Records a performance metric into telemetry. The metric will be recorded as an event on the span and logged to the console.
11
+ * It can be used for any situation where a performance metric (ie: how long does it take run something, or any other purpose) is needed.
12
+ * @param attributes
13
+ */
14
+ record(attributes) {
15
+ const { name, value, additionalProperties = {} } = attributes;
16
+ this.span.addEvent('Performance-Metric', { ...additionalProperties, name, value });
17
+ console.debug(`Performance-Metric: ${name} ${value} ms`);
18
+ }
19
+ /**
20
+ * Tracks the execution time of a given `execute` function and report it to telemetry.
21
+ * @param name - The name of the performance metric.
22
+ * @param execute - The function to execute and track.
23
+ * @returns - The result of the `execute` function.
24
+ */
25
+ async track(name, execute) {
26
+ const additionalProperties = {};
27
+ const startTime = performance.now();
28
+ const tracker = {
29
+ name,
30
+ startTime,
31
+ setProperties: (properties) => {
32
+ for (const [key, value] of Object.entries(properties)) {
33
+ additionalProperties[key] = value;
34
+ }
35
+ },
36
+ };
37
+ const result = await execute(tracker);
38
+ this.record({ name, value: performance.now() - startTime, additionalProperties });
39
+ return result;
40
+ }
41
+ }
42
+ //# sourceMappingURL=PerformanceRecorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceRecorder.js","sourceRoot":"","sources":["../src/PerformanceRecorder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC9B,YAA6B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAE3C;;;;OAIG;IACH,MAAM,CAAC,UAAkF;QACvF,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,oBAAoB,GAAG,EAAE,EAAE,GAAG,UAAU,CAAC;QAC9D,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,EAAE,GAAG,oBAAoB,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACnF,OAAO,CAAC,KAAK,CAAC,uBAAuB,IAAI,IAAI,KAAK,KAAK,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,KAAK,CAAI,IAAY,EAAE,OAAoD;QAC/E,MAAM,oBAAoB,GAAmB,EAAE,CAAC;QAEhD,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAEpC,MAAM,OAAO,GAAuB;YAClC,IAAI;YACJ,SAAS;YACT,aAAa,EAAE,CAAC,UAA0B,EAAE,EAAE;gBAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;oBACrD,oBAAoB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;iBACnC;YACH,CAAC;SACF,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;QAElF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { performance } from 'perf_hooks';\nimport type { SpanAttributes } from './types/SpanAttributes.js';\nimport type { PerformanceTracker } from './types/PerformanceTracker.js';\n\n/**\n * PerformanceRecorder is a utility class for recording performance metrics into telemetry.\n */\nexport class PerformanceRecorder {\n constructor(private readonly span: Span) {}\n\n /**\n * Records a performance metric into telemetry. The metric will be recorded as an event on the span and logged to the console.\n * It can be used for any situation where a performance metric (ie: how long does it take run something, or any other purpose) is needed.\n * @param attributes\n */\n record(attributes: { name: string; value: number; additionalProperties?: SpanAttributes }): void {\n const { name, value, additionalProperties = {} } = attributes;\n this.span.addEvent('Performance-Metric', { ...additionalProperties, name, value });\n console.debug(`Performance-Metric: ${name} ${value} ms`);\n }\n\n /**\n * Tracks the execution time of a given `execute` function and report it to telemetry.\n * @param name - The name of the performance metric.\n * @param execute - The function to execute and track.\n * @returns - The result of the `execute` function.\n */\n async track<T>(name: string, execute: (tracker: PerformanceTracker) => Promise<T>): Promise<T> {\n const additionalProperties: SpanAttributes = {};\n\n const startTime = performance.now();\n\n const tracker: PerformanceTracker = {\n name,\n startTime,\n setProperties: (properties: SpanAttributes) => {\n for (const [key, value] of Object.entries(properties)) {\n additionalProperties[key] = value;\n }\n },\n };\n\n const result = await execute(tracker);\n\n this.record({ name, value: performance.now() - startTime, additionalProperties });\n\n return result;\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { TelemetryClient } from './types/TelemetryClient.js';
2
+ export declare function createNoOpTelemetryClient(): TelemetryClient;
3
+ //# sourceMappingURL=createNoOpTelemetryClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createNoOpTelemetryClient.d.ts","sourceRoot":"","sources":["../src/createNoOpTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,wBAAgB,yBAAyB,IAAI,eAAe,CAE3D"}
@@ -0,0 +1,5 @@
1
+ import { NoOpTelemetryClient } from './NoOp/NoOpTelemetryClient.js';
2
+ export function createNoOpTelemetryClient() {
3
+ return new NoOpTelemetryClient();
4
+ }
5
+ //# sourceMappingURL=createNoOpTelemetryClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createNoOpTelemetryClient.js","sourceRoot":"","sources":["../src/createNoOpTelemetryClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,UAAU,yBAAyB;IACvC,OAAO,IAAI,mBAAmB,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import type { TelemetryClient } from './types/TelemetryClient.js';\nimport { NoOpTelemetryClient } from './NoOp/NoOpTelemetryClient.js';\n\nexport function createNoOpTelemetryClient(): TelemetryClient {\n return new NoOpTelemetryClient();\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -3,4 +3,8 @@ export { createTelemetryClient } from './createTelemetryClient.js';
3
3
  export type { LogLevel } from './types/LogLevel.js';
4
4
  export type { TelemetryClient } from './types/TelemetryClient.js';
5
5
  export type { TelemetryOptions } from './types/TelemetryOptions.js';
6
+ export { createNoOpTelemetryClient } from './createNoOpTelemetryClient.js';
7
+ export type { PerformanceTracker } from './types/PerformanceTracker.js';
8
+ export type { SpanAttributes } from './types/SpanAttributes.js';
9
+ export type { PerformanceRecorder } from './PerformanceRecorder.js';
6
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
package/lib/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { createTelemetryClient } from './createTelemetryClient.js';
2
+ export { createNoOpTelemetryClient } from './createNoOpTelemetryClient.js';
2
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export type { Span, Tracer } from '@opentelemetry/api';\nexport { createTelemetryClient } from './createTelemetryClient.js';\nexport type { LogLevel } from './types/LogLevel.js';\nexport type { TelemetryClient } from './types/TelemetryClient.js';\nexport type { TelemetryOptions } from './types/TelemetryOptions.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAInE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["export type { Span, Tracer } from '@opentelemetry/api';\nexport { createTelemetryClient } from './createTelemetryClient.js';\nexport type { LogLevel } from './types/LogLevel.js';\nexport type { TelemetryClient } from './types/TelemetryClient.js';\nexport type { TelemetryOptions } from './types/TelemetryOptions.js';\nexport { createNoOpTelemetryClient } from './createNoOpTelemetryClient.js';\nexport type { PerformanceTracker } from './types/PerformanceTracker.js';\nexport type { SpanAttributes } from './types/SpanAttributes.js';\nexport type { PerformanceRecorder } from './PerformanceRecorder.js';\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.36.1"
8
+ "packageVersion": "7.36.4"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,7 @@
1
+ import type { SpanAttributes } from './SpanAttributes.js';
2
+ export interface PerformanceTracker {
3
+ name: string;
4
+ startTime: number;
5
+ setProperties(properties: SpanAttributes): void;
6
+ }
7
+ //# sourceMappingURL=PerformanceTracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceTracker.d.ts","sourceRoot":"","sources":["../../src/types/PerformanceTracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;CACjD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PerformanceTracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceTracker.js","sourceRoot":"","sources":["../../src/types/PerformanceTracker.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanAttributes } from './SpanAttributes.js';\n\nexport interface PerformanceTracker {\n name: string;\n startTime: number;\n setProperties(properties: SpanAttributes): void;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export type SpanAttributes = Record<string, string | number>;
2
+ //# sourceMappingURL=SpanAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpanAttributes.d.ts","sourceRoot":"","sources":["../../src/types/SpanAttributes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SpanAttributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpanAttributes.js","sourceRoot":"","sources":["../../src/types/SpanAttributes.ts"],"names":[],"mappings":"","sourcesContent":["export type SpanAttributes = Record<string, string | number>;\n"]}
@@ -1,5 +1,10 @@
1
- import type { Tracer } from '@opentelemetry/api';
1
+ import type { Span, Tracer } from '@opentelemetry/api';
2
+ import type { PerformanceRecorder } from '../PerformanceRecorder.js';
2
3
  export interface TelemetryClient {
4
+ /**
5
+ * Root span which measures the duration of the highest level application (ie: CLI)
6
+ */
7
+ rootSpan: Span;
3
8
  /**
4
9
  * Sets a shared attribute that will be added to all spans.
5
10
  * @param key - key of the attribute
@@ -15,5 +20,9 @@ export interface TelemetryClient {
15
20
  * @returns the OpenTelemetry tracer
16
21
  */
17
22
  getTracer(): Tracer;
23
+ /**
24
+ * Gets the performance recorder.
25
+ */
26
+ performance: PerformanceRecorder;
18
27
  }
19
28
  //# sourceMappingURL=TelemetryClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TelemetryClient.d.ts","sourceRoot":"","sources":["../../src/types/TelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,SAAS,IAAI,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"TelemetryClient.d.ts","sourceRoot":"","sources":["../../src/types/TelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,IAAI,CAAC;IAEf;;;;OAIG;IACH,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,SAAS,IAAI,MAAM,CAAC;IAEpB;;OAEG;IACH,WAAW,EAAE,mBAAmB,CAAC;CAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TelemetryClient.js","sourceRoot":"","sources":["../../src/types/TelemetryClient.ts"],"names":[],"mappings":"","sourcesContent":["import type { Tracer } from '@opentelemetry/api';\n\nexport interface TelemetryClient {\n /**\n * Sets a shared attribute that will be added to all spans.\n * @param key - key of the attribute\n * @param value - value of the attribute\n */\n setSharedSpanAttribute(key: string, value: string): void;\n\n /**\n * Flushes all telemetry and shuts down the telemetry client.\n */\n shutdown(): Promise<void>;\n\n /**\n * Gets the OpenTelemetry tracer.\n * @returns the OpenTelemetry tracer\n */\n getTracer(): Tracer;\n}\n"]}
1
+ {"version":3,"file":"TelemetryClient.js","sourceRoot":"","sources":["../../src/types/TelemetryClient.ts"],"names":[],"mappings":"","sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport type { PerformanceRecorder } from '../PerformanceRecorder.js';\n\nexport interface TelemetryClient {\n /**\n * Root span which measures the duration of the highest level application (ie: CLI)\n */\n rootSpan: Span;\n\n /**\n * Sets a shared attribute that will be added to all spans.\n * @param key - key of the attribute\n * @param value - value of the attribute\n */\n setSharedSpanAttribute(key: string, value: string): void;\n\n /**\n * Flushes all telemetry and shuts down the telemetry client.\n */\n shutdown(): Promise<void>;\n\n /**\n * Gets the OpenTelemetry tracer.\n * @returns the OpenTelemetry tracer\n */\n getTracer(): Tracer;\n\n /**\n * Gets the performance recorder.\n */\n performance: PerformanceRecorder;\n}\n"]}
@@ -22,5 +22,9 @@ export interface TelemetryOptions {
22
22
  * Possible values: cli, bundler-service, etc.
23
23
  */
24
24
  serviceName: string;
25
+ /**
26
+ * Name of the root span, 'root' will be used as a span name if this property is not set.
27
+ */
28
+ rootSpanName?: string;
25
29
  }
26
30
  //# sourceMappingURL=TelemetryOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TelemetryOptions.d.ts","sourceRoot":"","sources":["../../src/types/TelemetryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"TelemetryOptions.d.ts","sourceRoot":"","sources":["../../src/types/TelemetryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"TelemetryOptions.js","sourceRoot":"","sources":["../../src/types/TelemetryOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogLevel } from './LogLevel.js';\n\nexport interface TelemetryOptions {\n /**\n * The instrumentation key for the Application Insights.\n */\n instrumentationKey?: string;\n\n /**\n * The log level for the telemetry client.\n */\n logLevel?: LogLevel;\n\n /**\n * The version of the product. This will be added as a shared attribute to all spans.\n */\n productVersion: string;\n\n /**\n * A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services.\n * Possible values: cloudpack, cloudpack.services, etc.\n */\n serviceNamespace: string;\n\n /**\n * Logic name of the service\n * Possible values: cli, bundler-service, etc.\n */\n serviceName: string;\n}\n"]}
1
+ {"version":3,"file":"TelemetryOptions.js","sourceRoot":"","sources":["../../src/types/TelemetryOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { LogLevel } from './LogLevel.js';\n\nexport interface TelemetryOptions {\n /**\n * The instrumentation key for the Application Insights.\n */\n instrumentationKey?: string;\n\n /**\n * The log level for the telemetry client.\n */\n logLevel?: LogLevel;\n\n /**\n * The version of the product. This will be added as a shared attribute to all spans.\n */\n productVersion: string;\n\n /**\n * A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services.\n * Possible values: cloudpack, cloudpack.services, etc.\n */\n serviceNamespace: string;\n\n /**\n * Logic name of the service\n * Possible values: cli, bundler-service, etc.\n */\n serviceName: string;\n\n /**\n * Name of the root span, 'root' will be used as a span name if this property is not set.\n */\n rootSpanName?: string;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/telemetry",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Helpers for logging tasks to the console.",
5
5
  "license": "MIT",
6
6
  "type": "module",