@ms-cloudpack/telemetry 0.4.1 → 0.4.2

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.
@@ -2,6 +2,7 @@ import { type Span, type Tracer } from '@opentelemetry/api';
2
2
  import { PerformanceRecorder } from '../PerformanceRecorder.js';
3
3
  import type { TelemetryClient } from '../types/TelemetryClient.js';
4
4
  import type { TelemetryOptions } from '../types/TelemetryOptions.js';
5
+ import type { SpanAttributeValue } from '../types/SpanAttributes.js';
5
6
  export declare class AppInsightsTelemetryClient implements TelemetryClient {
6
7
  private readonly _performance;
7
8
  private readonly _rootSpan;
@@ -15,7 +16,7 @@ export declare class AppInsightsTelemetryClient implements TelemetryClient {
15
16
  * @param key - key of the attribute
16
17
  * @param value - value of the attribute
17
18
  */
18
- setSharedSpanAttribute(key: string, value: string): void;
19
+ setSharedSpanAttribute(key: string, value: SpanAttributeValue): void;
19
20
  /**
20
21
  * Flushes all telemetry and shuts down the telemetry client.
21
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AppInsightsTelemetryClient.d.ts","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIrE,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAO;IACjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA8B;IACnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;gBAExC,OAAO,EAAE,gBAAgB;IAoBrC,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;IAOrB;;;OAGG;IACI,SAAS,IAAI,MAAM;CAG3B"}
1
+ {"version":3,"file":"AppInsightsTelemetryClient.d.ts","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,MAAM,4BAA4B,CAAC;AAErF,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAO;IACjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAsB;IAC3D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;gBAExC,OAAO,EAAE,gBAAgB;IAoBrC,IAAW,WAAW,IAAI,mBAAmB,CAE5C;IAED,IAAW,QAAQ,IAAI,IAAI,CAE1B;IAED;;;;OAIG;IACI,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;IAIpE;;OAEG;IACU,QAAQ;IAOrB;;;OAGG;IACI,SAAS,IAAI,MAAM;CAG3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"AppInsightsTelemetryClient.js","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,KAAK,EAAoD,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,OAAO,0BAA0B;IAMrC,YAAY,OAAyB;QAHpB,yBAAoB,GAA2B,EAAE,CAAC;QAIjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE7C,kDAAkD;QAClD,eAAe,CAAC,MAAM,CAAC,CAAC;QAExB,IAAI,CAAC,cAAc,GAAI,KAAK,CAAC,iBAAiB,EAA0B,CAAC,WAAW,EAAwB,CAAC;QAE7G,wBAAwB;QACxB,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QAE/D,mEAAmE;QACnE,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAElG,mBAAmB;QACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC;QAE5E,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,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACpB,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QACvC,oBAAoB,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { shutdownAzureMonitor, useAzureMonitor } from '@azure/monitor-opentelemetry';\nimport { trace, type ProxyTracerProvider, type Span, type Tracer } from '@opentelemetry/api';\nimport type { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport { PerformanceRecorder } from '../PerformanceRecorder.js';\nimport type { TelemetryClient } from '../types/TelemetryClient.js';\nimport type { TelemetryOptions } from '../types/TelemetryOptions.js';\nimport { SpanEnrichingProcessor } from './SpanEnrichingProcessor.js';\nimport { getAppInsightsConfig } from './getAppInsightsConfig.js';\n\nexport class AppInsightsTelemetryClient implements TelemetryClient {\n private readonly _performance: PerformanceRecorder;\n private readonly _rootSpan: Span;\n private readonly sharedSpanAttributes: Record<string, string> = {};\n private readonly _traceProvider: NodeTracerProvider;\n\n constructor(options: TelemetryOptions) {\n const config = getAppInsightsConfig(options);\n\n // Set up azure monitor (aka application insights)\n useAzureMonitor(config);\n\n this._traceProvider = (trace.getTracerProvider() as ProxyTracerProvider).getDelegate() as NodeTracerProvider;\n\n // Set shared attributes\n this.setSharedSpanAttribute('version', options.productVersion);\n\n // Set SpanEnrichingProcessor to add shared attributes to all spans\n this._traceProvider.addSpanProcessor(new SpanEnrichingProcessor(() => this.sharedSpanAttributes));\n\n // Create root span\n this._rootSpan = this.getTracer().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._performance.shutdown();\n this.rootSpan.end();\n await this._traceProvider.forceFlush();\n shutdownAzureMonitor();\n }\n\n /**\n * Gets the OpenTelemetry tracer.\n * @returns the OpenTelemetry tracer\n */\n public getTracer(): Tracer {\n return trace.getTracer('cloudpack-tracer');\n }\n}\n"]}
1
+ {"version":3,"file":"AppInsightsTelemetryClient.js","sourceRoot":"","sources":["../../src/AppInsights/AppInsightsTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,KAAK,EAAoD,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,MAAM,OAAO,0BAA0B;IAMrC,YAAY,OAAyB;QAHpB,yBAAoB,GAAmB,EAAE,CAAC;QAIzD,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE7C,kDAAkD;QAClD,eAAe,CAAC,MAAM,CAAC,CAAC;QAExB,IAAI,CAAC,cAAc,GAAI,KAAK,CAAC,iBAAiB,EAA0B,CAAC,WAAW,EAAwB,CAAC;QAE7G,wBAAwB;QACxB,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QAE/D,mEAAmE;QACnE,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,sBAAsB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAElG,mBAAmB;QACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC;QAE5E,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,KAAyB;QAClE,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACpB,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QACvC,oBAAoB,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { shutdownAzureMonitor, useAzureMonitor } from '@azure/monitor-opentelemetry';\nimport { trace, type ProxyTracerProvider, type Span, type Tracer } from '@opentelemetry/api';\nimport type { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport { PerformanceRecorder } from '../PerformanceRecorder.js';\nimport type { TelemetryClient } from '../types/TelemetryClient.js';\nimport type { TelemetryOptions } from '../types/TelemetryOptions.js';\nimport { SpanEnrichingProcessor } from './SpanEnrichingProcessor.js';\nimport { getAppInsightsConfig } from './getAppInsightsConfig.js';\nimport type { SpanAttributeValue, SpanAttributes } from '../types/SpanAttributes.js';\n\nexport class AppInsightsTelemetryClient implements TelemetryClient {\n private readonly _performance: PerformanceRecorder;\n private readonly _rootSpan: Span;\n private readonly sharedSpanAttributes: SpanAttributes = {};\n private readonly _traceProvider: NodeTracerProvider;\n\n constructor(options: TelemetryOptions) {\n const config = getAppInsightsConfig(options);\n\n // Set up azure monitor (aka application insights)\n useAzureMonitor(config);\n\n this._traceProvider = (trace.getTracerProvider() as ProxyTracerProvider).getDelegate() as NodeTracerProvider;\n\n // Set shared attributes\n this.setSharedSpanAttribute('version', options.productVersion);\n\n // Set SpanEnrichingProcessor to add shared attributes to all spans\n this._traceProvider.addSpanProcessor(new SpanEnrichingProcessor(() => this.sharedSpanAttributes));\n\n // Create root span\n this._rootSpan = this.getTracer().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: SpanAttributeValue) {\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._performance.shutdown();\n this.rootSpan.end();\n await this._traceProvider.forceFlush();\n shutdownAzureMonitor();\n }\n\n /**\n * Gets the OpenTelemetry tracer.\n * @returns the OpenTelemetry tracer\n */\n public getTracer(): Tracer {\n return trace.getTracer('cloudpack-tracer');\n }\n}\n"]}
@@ -1,10 +1,11 @@
1
1
  import type { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';
2
+ import type { SpanAttributes } from '../types/SpanAttributes.js';
2
3
  /**
3
4
  * Span processor that adds shared attributes to all spans.
4
5
  */
5
6
  export declare class SpanEnrichingProcessor implements SpanProcessor {
6
7
  private getSharedSpanAttributes;
7
- constructor(getSharedSpanAttributes: () => Record<string, string>);
8
+ constructor(getSharedSpanAttributes: () => SpanAttributes);
8
9
  forceFlush(): Promise<void>;
9
10
  shutdown(): Promise<void>;
10
11
  onStart(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"SpanEnrichingProcessor.d.ts","sourceRoot":"","sources":["../../src/AppInsights/SpanEnrichingProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEjF;;GAEG;AACH,qBAAa,sBAAuB,YAAW,aAAa;IAC9C,OAAO,CAAC,uBAAuB;gBAAvB,uBAAuB,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzE,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,OAAO,IAAI,IAAI;IAIf,KAAK,CAAC,IAAI,EAAE,YAAY;CAKzB"}
1
+ {"version":3,"file":"SpanEnrichingProcessor.d.ts","sourceRoot":"","sources":["../../src/AppInsights/SpanEnrichingProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;GAEG;AACH,qBAAa,sBAAuB,YAAW,aAAa;IAC9C,OAAO,CAAC,uBAAuB;gBAAvB,uBAAuB,EAAE,MAAM,cAAc;IAEjE,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,OAAO,IAAI,IAAI;IAIf,KAAK,CAAC,IAAI,EAAE,YAAY;CAKzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpanEnrichingProcessor.js","sourceRoot":"","sources":["../../src/AppInsights/SpanEnrichingProcessor.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACjC,YAAoB,uBAAqD;QAArD,4BAAuB,GAAvB,uBAAuB,CAA8B;IAAG,CAAC;IAE7E,UAAU;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,OAAO;IACT,CAAC;IAED,KAAK,CAAC,IAAkB;QACtB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,EAAE;YACzE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAC9B;IACH,CAAC;CACF","sourcesContent":["import type { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\n/**\n * Span processor that adds shared attributes to all spans.\n */\nexport class SpanEnrichingProcessor implements SpanProcessor {\n constructor(private getSharedSpanAttributes: () => Record<string, string>) {}\n\n forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve();\n }\n\n onStart(): void {\n // noop\n }\n\n onEnd(span: ReadableSpan) {\n for (const [key, value] of Object.entries(this.getSharedSpanAttributes())) {\n span.attributes[key] = value;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"SpanEnrichingProcessor.js","sourceRoot":"","sources":["../../src/AppInsights/SpanEnrichingProcessor.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACjC,YAAoB,uBAA6C;QAA7C,4BAAuB,GAAvB,uBAAuB,CAAsB;IAAG,CAAC;IAErE,UAAU;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,OAAO;IACT,CAAC;IAED,KAAK,CAAC,IAAkB;QACtB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,EAAE;YACzE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAC9B;IACH,CAAC;CACF","sourcesContent":["import type { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport type { SpanAttributes } from '../types/SpanAttributes.js';\n\n/**\n * Span processor that adds shared attributes to all spans.\n */\nexport class SpanEnrichingProcessor implements SpanProcessor {\n constructor(private getSharedSpanAttributes: () => SpanAttributes) {}\n\n forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve();\n }\n\n onStart(): void {\n // noop\n }\n\n onEnd(span: ReadableSpan) {\n for (const [key, value] of Object.entries(this.getSharedSpanAttributes())) {\n span.attributes[key] = value;\n }\n }\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export type { TelemetryClient } from './types/TelemetryClient.js';
5
5
  export type { TelemetryOptions } from './types/TelemetryOptions.js';
6
6
  export { createNoOpTelemetryClient } from './createNoOpTelemetryClient.js';
7
7
  export type { PerformanceTracker } from './types/PerformanceTracker.js';
8
- export type { SpanAttributes } from './types/SpanAttributes.js';
8
+ export type { SpanAttributes, SpanAttributeValue } from './types/SpanAttributes.js';
9
9
  export type { PerformanceRecorder } from './PerformanceRecorder.js';
10
10
  export type { MetricEvent } from './types/MetricEvent.js';
11
11
  export type { MetricEventAggregator } from './types/MetricEventAggregator.js';
@@ -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;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;AACpE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,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,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC"}
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;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';\nexport type { MetricEvent } from './types/MetricEvent.js';\nexport type { MetricEventAggregator } from './types/MetricEventAggregator.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, SpanAttributeValue } from './types/SpanAttributes.js';\nexport type { PerformanceRecorder } from './PerformanceRecorder.js';\nexport type { MetricEvent } from './types/MetricEvent.js';\nexport type { MetricEventAggregator } from './types/MetricEventAggregator.js';\n"]}
@@ -1,2 +1,3 @@
1
- export type SpanAttributes = Record<string, string | number>;
1
+ export type SpanAttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
2
+ export type SpanAttributes = Record<string, SpanAttributeValue>;
2
3
  //# sourceMappingURL=SpanAttributes.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"SpanAttributes.d.ts","sourceRoot":"","sources":["../../src/types/SpanAttributes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,GAChC,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,GAChC,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;AAEtC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC"}
@@ -1 +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
+ {"version":3,"file":"SpanAttributes.js","sourceRoot":"","sources":["../../src/types/SpanAttributes.ts"],"names":[],"mappings":"","sourcesContent":["export type SpanAttributeValue =\n | string\n | number\n | boolean\n | Array<null | undefined | string>\n | Array<null | undefined | number>\n | Array<null | undefined | boolean>;\n\nexport type SpanAttributes = Record<string, SpanAttributeValue>;\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { Span, Tracer } from '@opentelemetry/api';
2
2
  import type { PerformanceRecorder } from '../PerformanceRecorder.js';
3
+ import type { SpanAttributeValue } from './SpanAttributes.js';
3
4
  export interface TelemetryClient {
4
5
  /**
5
6
  * Root span which measures the duration of the highest level application (ie: CLI)
@@ -10,7 +11,7 @@ export interface TelemetryClient {
10
11
  * @param key - key of the attribute
11
12
  * @param value - value of the attribute
12
13
  */
13
- setSharedSpanAttribute(key: string, value: string): void;
14
+ setSharedSpanAttribute(key: string, value: SpanAttributeValue): void;
14
15
  /**
15
16
  * Flushes all telemetry and shuts down the telemetry client.
16
17
  */
@@ -1 +1 @@
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
+ {"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;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,IAAI,CAAC;IAEf;;;;OAIG;IACH,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAErE;;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 { 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"]}
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';\nimport type { SpanAttributeValue } from './SpanAttributes.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: SpanAttributeValue): 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/telemetry",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Helpers for logging tasks to the console.",
5
5
  "license": "MIT",
6
6
  "type": "module",