@ms-cloudpack/telemetry 0.4.7 → 0.4.9-beta.0
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/dist/AppInsightsTelemetryClient-7X6RLLF5.js +71948 -0
- package/dist/NoOpTelemetryClient-GBCRTSF4.js +7 -0
- package/dist/chunk-BVWZW3N3.js +1906 -0
- package/dist/chunk-U2PXIPI6.js +32 -0
- package/dist/index.js +36 -0
- package/package.json +12 -13
- package/lib/AppInsights/AppInsightsTelemetryClient.d.ts.map +0 -1
- package/lib/AppInsights/AppInsightsTelemetryClient.js +0 -52
- package/lib/AppInsights/AppInsightsTelemetryClient.js.map +0 -1
- package/lib/AppInsights/SpanEnrichingProcessor.d.ts.map +0 -1
- package/lib/AppInsights/SpanEnrichingProcessor.js +0 -23
- package/lib/AppInsights/SpanEnrichingProcessor.js.map +0 -1
- package/lib/AppInsights/convertLogLevel.d.ts.map +0 -1
- package/lib/AppInsights/convertLogLevel.js +0 -21
- package/lib/AppInsights/convertLogLevel.js.map +0 -1
- package/lib/AppInsights/getAppInsightsConfig.d.ts.map +0 -1
- package/lib/AppInsights/getAppInsightsConfig.js +0 -32
- package/lib/AppInsights/getAppInsightsConfig.js.map +0 -1
- package/lib/AppInsights/getComputerName.d.ts.map +0 -1
- package/lib/AppInsights/getComputerName.js +0 -21
- package/lib/AppInsights/getComputerName.js.map +0 -1
- package/lib/MetricEventAggregatorRegistry.d.ts.map +0 -1
- package/lib/MetricEventAggregatorRegistry.js +0 -29
- package/lib/MetricEventAggregatorRegistry.js.map +0 -1
- package/lib/NoOp/NoOpTelemetryClient.d.ts.map +0 -1
- package/lib/NoOp/NoOpTelemetryClient.js +0 -24
- package/lib/NoOp/NoOpTelemetryClient.js.map +0 -1
- package/lib/PerformanceRecorder.d.ts.map +0 -1
- package/lib/PerformanceRecorder.js +0 -53
- package/lib/PerformanceRecorder.js.map +0 -1
- package/lib/createNoOpTelemetryClient.d.ts.map +0 -1
- package/lib/createNoOpTelemetryClient.js +0 -5
- package/lib/createNoOpTelemetryClient.js.map +0 -1
- package/lib/createTelemetryClient.d.ts.map +0 -1
- package/lib/createTelemetryClient.js +0 -16
- package/lib/createTelemetryClient.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/lib/tsdoc-metadata.json +0 -11
- package/lib/types/LogLevel.d.ts.map +0 -1
- package/lib/types/LogLevel.js +0 -2
- package/lib/types/LogLevel.js.map +0 -1
- package/lib/types/MetricEvent.d.ts.map +0 -1
- package/lib/types/MetricEvent.js +0 -2
- package/lib/types/MetricEvent.js.map +0 -1
- package/lib/types/MetricEventAggregator.d.ts.map +0 -1
- package/lib/types/MetricEventAggregator.js +0 -2
- package/lib/types/MetricEventAggregator.js.map +0 -1
- package/lib/types/PerformanceTracker.d.ts.map +0 -1
- package/lib/types/PerformanceTracker.js +0 -2
- package/lib/types/PerformanceTracker.js.map +0 -1
- package/lib/types/SpanAttributes.d.ts.map +0 -1
- package/lib/types/SpanAttributes.js +0 -2
- package/lib/types/SpanAttributes.js.map +0 -1
- package/lib/types/TelemetryClient.d.ts.map +0 -1
- package/lib/types/TelemetryClient.js +0 -2
- package/lib/types/TelemetryClient.js.map +0 -1
- package/lib/types/TelemetryOptions.d.ts.map +0 -1
- package/lib/types/TelemetryOptions.js +0 -2
- package/lib/types/TelemetryOptions.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PerformanceRecorder,
|
|
3
|
+
__name,
|
|
4
|
+
init_esbuildCjsShims,
|
|
5
|
+
init_esm,
|
|
6
|
+
trace
|
|
7
|
+
} from "./chunk-BVWZW3N3.js";
|
|
8
|
+
|
|
9
|
+
// src/NoOp/NoOpTelemetryClient.ts
|
|
10
|
+
init_esbuildCjsShims();
|
|
11
|
+
init_esm();
|
|
12
|
+
var _NoOpTelemetryClient = class _NoOpTelemetryClient {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.rootSpan = this.getTracer().startSpan("no-op");
|
|
15
|
+
this.performance = new PerformanceRecorder(this.rootSpan);
|
|
16
|
+
}
|
|
17
|
+
setSharedSpanAttribute() {
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
shutdown() {
|
|
21
|
+
return Promise.resolve();
|
|
22
|
+
}
|
|
23
|
+
getTracer() {
|
|
24
|
+
return trace.getTracer("no-op");
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
__name(_NoOpTelemetryClient, "NoOpTelemetryClient");
|
|
28
|
+
var NoOpTelemetryClient = _NoOpTelemetryClient;
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
NoOpTelemetryClient
|
|
32
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NoOpTelemetryClient
|
|
3
|
+
} from "./chunk-U2PXIPI6.js";
|
|
4
|
+
import {
|
|
5
|
+
__name,
|
|
6
|
+
init_esbuildCjsShims
|
|
7
|
+
} from "./chunk-BVWZW3N3.js";
|
|
8
|
+
|
|
9
|
+
// src/index.ts
|
|
10
|
+
init_esbuildCjsShims();
|
|
11
|
+
|
|
12
|
+
// src/createTelemetryClient.ts
|
|
13
|
+
init_esbuildCjsShims();
|
|
14
|
+
async function createTelemetryClient(options) {
|
|
15
|
+
if (!options.connectionString) {
|
|
16
|
+
console.debug("No connection string found. Telemetry will not be sent.");
|
|
17
|
+
const { NoOpTelemetryClient: NoOpTelemetryClient2 } = await import("./NoOpTelemetryClient-GBCRTSF4.js");
|
|
18
|
+
return new NoOpTelemetryClient2();
|
|
19
|
+
}
|
|
20
|
+
process.env.APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL = options.logLevel || "WARN";
|
|
21
|
+
process.env.AZURE_TRACING_DISABLED = "true";
|
|
22
|
+
const { AppInsightsTelemetryClient } = await import("./AppInsightsTelemetryClient-7X6RLLF5.js");
|
|
23
|
+
return new AppInsightsTelemetryClient(options);
|
|
24
|
+
}
|
|
25
|
+
__name(createTelemetryClient, "createTelemetryClient");
|
|
26
|
+
|
|
27
|
+
// src/createNoOpTelemetryClient.ts
|
|
28
|
+
init_esbuildCjsShims();
|
|
29
|
+
function createNoOpTelemetryClient() {
|
|
30
|
+
return new NoOpTelemetryClient();
|
|
31
|
+
}
|
|
32
|
+
__name(createNoOpTelemetryClient, "createNoOpTelemetryClient");
|
|
33
|
+
export {
|
|
34
|
+
createNoOpTelemetryClient,
|
|
35
|
+
createTelemetryClient
|
|
36
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/telemetry",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9-beta.0",
|
|
4
4
|
"description": "Helpers for logging tasks to the console.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,29 +10,28 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"source": "./src/index.ts",
|
|
12
12
|
"types": "./lib/index.d.ts",
|
|
13
|
-
"import": "./
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@azure/monitor-opentelemetry": "~1.2.0",
|
|
18
|
-
"@opentelemetry/api": "^1.7.0",
|
|
19
|
-
"@opentelemetry/resources": "~1.21.0",
|
|
20
|
-
"@opentelemetry/sdk-trace-base": "~1.21.0",
|
|
21
|
-
"@opentelemetry/sdk-trace-node": "~1.21.0",
|
|
22
|
-
"@opentelemetry/semantic-conventions": "~1.21.0"
|
|
23
|
-
},
|
|
24
16
|
"devDependencies": {
|
|
17
|
+
"@azure/monitor-opentelemetry": "~1.3.0",
|
|
25
18
|
"@ms-cloudpack/eslint-plugin-internal": "*",
|
|
26
|
-
"@ms-cloudpack/scripts": "*"
|
|
19
|
+
"@ms-cloudpack/scripts": "*",
|
|
20
|
+
"@opentelemetry/api": "^1.8.0",
|
|
21
|
+
"@opentelemetry/resources": "~1.22.0",
|
|
22
|
+
"@opentelemetry/sdk-trace-base": "~1.22.0",
|
|
23
|
+
"@opentelemetry/sdk-trace-node": "~1.22.0",
|
|
24
|
+
"@opentelemetry/semantic-conventions": "~1.22.0"
|
|
27
25
|
},
|
|
28
26
|
"scripts": {
|
|
29
27
|
"api": "cloudpack-scripts api",
|
|
30
28
|
"build:watch": "cloudpack-scripts build-watch",
|
|
31
|
-
"build": "cloudpack-scripts build",
|
|
29
|
+
"build": "cloudpack-scripts build && cloudpack-scripts bundle-node",
|
|
32
30
|
"lint:update": "cloudpack-scripts lint-update",
|
|
33
31
|
"lint": "cloudpack-scripts lint"
|
|
34
32
|
},
|
|
35
33
|
"files": [
|
|
36
|
-
"
|
|
34
|
+
"dist",
|
|
35
|
+
"lib/**/*.d.ts"
|
|
37
36
|
]
|
|
38
37
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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,52 +0,0 @@
|
|
|
1
|
-
import { shutdownAzureMonitor, useAzureMonitor } from '@azure/monitor-opentelemetry';
|
|
2
|
-
import { trace } from '@opentelemetry/api';
|
|
3
|
-
import { PerformanceRecorder } from '../PerformanceRecorder.js';
|
|
4
|
-
import { SpanEnrichingProcessor } from './SpanEnrichingProcessor.js';
|
|
5
|
-
import { getAppInsightsConfig } from './getAppInsightsConfig.js';
|
|
6
|
-
export class AppInsightsTelemetryClient {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
this.sharedSpanAttributes = {};
|
|
9
|
-
const config = getAppInsightsConfig(options);
|
|
10
|
-
// Set up azure monitor (aka application insights)
|
|
11
|
-
useAzureMonitor(config);
|
|
12
|
-
this._traceProvider = trace.getTracerProvider().getDelegate();
|
|
13
|
-
// Set shared attributes
|
|
14
|
-
this.setSharedSpanAttribute('version', options.productVersion);
|
|
15
|
-
// Set SpanEnrichingProcessor to add shared attributes to all spans
|
|
16
|
-
this._traceProvider.addSpanProcessor(new SpanEnrichingProcessor(() => this.sharedSpanAttributes));
|
|
17
|
-
// Create root span
|
|
18
|
-
this._rootSpan = this.getTracer().startSpan(options.rootSpanName || 'root');
|
|
19
|
-
this._performance = new PerformanceRecorder(this._rootSpan);
|
|
20
|
-
}
|
|
21
|
-
get performance() {
|
|
22
|
-
return this._performance;
|
|
23
|
-
}
|
|
24
|
-
get rootSpan() {
|
|
25
|
-
return this._rootSpan;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Sets a shared attribute that will be added to all spans.
|
|
29
|
-
* @param key - key of the attribute
|
|
30
|
-
* @param value - value of the attribute
|
|
31
|
-
*/
|
|
32
|
-
setSharedSpanAttribute(key, value) {
|
|
33
|
-
this.sharedSpanAttributes[key] = value;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Flushes all telemetry and shuts down the telemetry client.
|
|
37
|
-
*/
|
|
38
|
-
async shutdown() {
|
|
39
|
-
this._performance.shutdown();
|
|
40
|
-
this.rootSpan.end();
|
|
41
|
-
await this._traceProvider.forceFlush();
|
|
42
|
-
shutdownAzureMonitor();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Gets the OpenTelemetry tracer.
|
|
46
|
-
* @returns the OpenTelemetry tracer
|
|
47
|
-
*/
|
|
48
|
-
getTracer() {
|
|
49
|
-
return trace.getTracer('cloudpack-tracer');
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=AppInsightsTelemetryClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Span processor that adds shared attributes to all spans.
|
|
3
|
-
*/
|
|
4
|
-
export class SpanEnrichingProcessor {
|
|
5
|
-
constructor(getSharedSpanAttributes) {
|
|
6
|
-
this.getSharedSpanAttributes = getSharedSpanAttributes;
|
|
7
|
-
}
|
|
8
|
-
forceFlush() {
|
|
9
|
-
return Promise.resolve();
|
|
10
|
-
}
|
|
11
|
-
shutdown() {
|
|
12
|
-
return Promise.resolve();
|
|
13
|
-
}
|
|
14
|
-
onStart() {
|
|
15
|
-
// noop
|
|
16
|
-
}
|
|
17
|
-
onEnd(span) {
|
|
18
|
-
for (const [key, value] of Object.entries(this.getSharedSpanAttributes())) {
|
|
19
|
-
span.attributes[key] = value;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=SpanEnrichingProcessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAAC;YAC1E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC/B,CAAC;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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertLogLevel.d.ts","sourceRoot":"","sources":["../../src/AppInsights/convertLogLevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,YAAY,CAkBjE"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DiagLogLevel } from '@opentelemetry/api';
|
|
2
|
-
export function convertLogLevel(logLevel) {
|
|
3
|
-
switch (logLevel) {
|
|
4
|
-
case 'DEBUG':
|
|
5
|
-
return DiagLogLevel.DEBUG;
|
|
6
|
-
case 'VERBOSE':
|
|
7
|
-
return DiagLogLevel.VERBOSE;
|
|
8
|
-
case 'NONE':
|
|
9
|
-
return DiagLogLevel.NONE;
|
|
10
|
-
case 'ERROR':
|
|
11
|
-
return DiagLogLevel.ERROR;
|
|
12
|
-
case 'ALL':
|
|
13
|
-
return DiagLogLevel.ALL;
|
|
14
|
-
case 'INFO':
|
|
15
|
-
return DiagLogLevel.INFO;
|
|
16
|
-
case 'WARN':
|
|
17
|
-
default:
|
|
18
|
-
return DiagLogLevel.WARN;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=convertLogLevel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertLogLevel.js","sourceRoot":"","sources":["../../src/AppInsights/convertLogLevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,UAAU,eAAe,CAAC,QAAmB;IACjD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,YAAY,CAAC,KAAK,CAAC;QAC5B,KAAK,SAAS;YACZ,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B,KAAK,MAAM;YACT,OAAO,YAAY,CAAC,IAAI,CAAC;QAC3B,KAAK,OAAO;YACV,OAAO,YAAY,CAAC,KAAK,CAAC;QAC5B,KAAK,KAAK;YACR,OAAO,YAAY,CAAC,GAAG,CAAC;QAC1B,KAAK,MAAM;YACT,OAAO,YAAY,CAAC,IAAI,CAAC;QAC3B,KAAK,MAAM,CAAC;QACZ;YACE,OAAO,YAAY,CAAC,IAAI,CAAC;IAC7B,CAAC;AACH,CAAC","sourcesContent":["import { DiagLogLevel } from '@opentelemetry/api';\nimport type { LogLevel } from '../types/LogLevel.js';\n\nexport function convertLogLevel(logLevel?: LogLevel): DiagLogLevel {\n switch (logLevel) {\n case 'DEBUG':\n return DiagLogLevel.DEBUG;\n case 'VERBOSE':\n return DiagLogLevel.VERBOSE;\n case 'NONE':\n return DiagLogLevel.NONE;\n case 'ERROR':\n return DiagLogLevel.ERROR;\n case 'ALL':\n return DiagLogLevel.ALL;\n case 'INFO':\n return DiagLogLevel.INFO;\n case 'WARN':\n default:\n return DiagLogLevel.WARN;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAppInsightsConfig.d.ts","sourceRoot":"","sources":["../../src/AppInsights/getAppInsightsConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AAGrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AASrE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,oCAsB7D"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import Resources from '@opentelemetry/resources';
|
|
2
|
-
import SemanticConventions from '@opentelemetry/semantic-conventions';
|
|
3
|
-
import { createHash } from 'crypto';
|
|
4
|
-
import { getComputerName } from './getComputerName.js';
|
|
5
|
-
const { Resource } = Resources;
|
|
6
|
-
const { SemanticResourceAttributes } = SemanticConventions;
|
|
7
|
-
function sha256(input) {
|
|
8
|
-
return createHash('sha256').update(input).digest('hex');
|
|
9
|
-
}
|
|
10
|
-
export function getAppInsightsConfig(options) {
|
|
11
|
-
const config = {
|
|
12
|
-
azureMonitorExporterOptions: {
|
|
13
|
-
connectionString: options.connectionString,
|
|
14
|
-
},
|
|
15
|
-
instrumentationOptions: {
|
|
16
|
-
http: {
|
|
17
|
-
enabled: false,
|
|
18
|
-
},
|
|
19
|
-
azureSdk: {
|
|
20
|
-
enabled: false,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
resource: new Resource({
|
|
24
|
-
// Use a hash of the computer name to avoid PII
|
|
25
|
-
[SemanticResourceAttributes.SERVICE_INSTANCE_ID]: sha256(getComputerName()),
|
|
26
|
-
[SemanticResourceAttributes.SERVICE_NAME]: options.serviceName,
|
|
27
|
-
[SemanticResourceAttributes.SERVICE_NAMESPACE]: options.serviceNamespace,
|
|
28
|
-
}),
|
|
29
|
-
};
|
|
30
|
-
return config;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=getAppInsightsConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAppInsightsConfig.js","sourceRoot":"","sources":["../../src/AppInsights/getAppInsightsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;AAC/B,MAAM,EAAE,0BAA0B,EAAE,GAAG,mBAAmB,CAAC;AAE3D,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,OAAyB;IAC5D,MAAM,MAAM,GAAqC;QAC/C,2BAA2B,EAAE;YAC3B,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;SAC3C;QACD,sBAAsB,EAAE;YACtB,IAAI,EAAE;gBACJ,OAAO,EAAE,KAAK;aACf;YACD,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK;aACf;SACF;QACD,QAAQ,EAAE,IAAI,QAAQ,CAAC;YACrB,+CAA+C;YAC/C,CAAC,0BAA0B,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC;YAC3E,CAAC,0BAA0B,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,WAAW;YAC9D,CAAC,0BAA0B,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,gBAAgB;SACzE,CAAC;KACH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import Resources from '@opentelemetry/resources';\nimport SemanticConventions from '@opentelemetry/semantic-conventions';\nimport type { AzureMonitorOpenTelemetryOptions } from '@azure/monitor-opentelemetry';\nimport { createHash } from 'crypto';\nimport { getComputerName } from './getComputerName.js';\nimport type { TelemetryOptions } from '../types/TelemetryOptions.js';\n\nconst { Resource } = Resources;\nconst { SemanticResourceAttributes } = SemanticConventions;\n\nfunction sha256(input: string) {\n return createHash('sha256').update(input).digest('hex');\n}\n\nexport function getAppInsightsConfig(options: TelemetryOptions) {\n const config: AzureMonitorOpenTelemetryOptions = {\n azureMonitorExporterOptions: {\n connectionString: options.connectionString,\n },\n instrumentationOptions: {\n http: {\n enabled: false,\n },\n azureSdk: {\n enabled: false,\n },\n },\n resource: new Resource({\n // Use a hash of the computer name to avoid PII\n [SemanticResourceAttributes.SERVICE_INSTANCE_ID]: sha256(getComputerName()),\n [SemanticResourceAttributes.SERVICE_NAME]: options.serviceName,\n [SemanticResourceAttributes.SERVICE_NAMESPACE]: options.serviceNamespace,\n }),\n };\n\n return config;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getComputerName.d.ts","sourceRoot":"","sources":["../../src/AppInsights/getComputerName.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,eAAe,WAe9B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import { hostname } from 'os';
|
|
3
|
-
/**
|
|
4
|
-
* Each OS has a different way of getting the computer name.
|
|
5
|
-
* @returns computer name for the current OS, or the hostname if it cannot be determined
|
|
6
|
-
*/
|
|
7
|
-
export function getComputerName() {
|
|
8
|
-
try {
|
|
9
|
-
const computerNameGetters = {
|
|
10
|
-
win32: () => process.env.COMPUTERNAME,
|
|
11
|
-
darwin: () => execSync('scutil --get ComputerName').toString(),
|
|
12
|
-
};
|
|
13
|
-
const computerName = computerNameGetters[process.platform]?.() || hostname();
|
|
14
|
-
return computerName.trim();
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
console.warn('Unable to get OS specific computer name for telemetry, falling back to hostname', e);
|
|
18
|
-
return hostname();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=getComputerName.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getComputerName.js","sourceRoot":"","sources":["../../src/AppInsights/getComputerName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC;QACH,MAAM,mBAAmB,GAA+D;YACtF,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY;YACrC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE;SAC/D,CAAC;QAEF,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,QAAQ,EAAE,CAAC;QAE7E,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,iFAAiF,EAAE,CAAC,CAAC,CAAC;QAEnG,OAAO,QAAQ,EAAE,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["import { execSync } from 'child_process';\nimport { hostname } from 'os';\n\n/**\n * Each OS has a different way of getting the computer name.\n * @returns computer name for the current OS, or the hostname if it cannot be determined\n */\nexport function getComputerName() {\n try {\n const computerNameGetters: Partial<Record<NodeJS.Platform, () => string | undefined>> = {\n win32: () => process.env.COMPUTERNAME,\n darwin: () => execSync('scutil --get ComputerName').toString(),\n };\n\n const computerName = computerNameGetters[process.platform]?.() || hostname();\n\n return computerName.trim();\n } catch (e) {\n console.warn('Unable to get OS specific computer name for telemetry, falling back to hostname', e);\n\n return hostname();\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricEventAggregatorRegistry.d.ts","sourceRoot":"","sources":["../src/MetricEventAggregatorRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE9E,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6C;IAE1E;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAQhD;;;OAGG;IACH,mBAAmB,IAAI,WAAW,EAAE;CAQrC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export class MetricEventAggregatorRegistry {
|
|
2
|
-
constructor() {
|
|
3
|
-
this._aggregators = new Set();
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Registers a new aggregator. If an aggregator already exists, it will be return the aggregator.
|
|
7
|
-
* @param name - The name of the metric.
|
|
8
|
-
* @param aggregate - The aggregator function.
|
|
9
|
-
* @returns The aggregator that is passed in.
|
|
10
|
-
*/
|
|
11
|
-
register(aggregator) {
|
|
12
|
-
if (!this._aggregators.has(aggregator)) {
|
|
13
|
-
this._aggregators.add(aggregator);
|
|
14
|
-
}
|
|
15
|
-
return aggregator;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Gets all the aggregated events from all the registered aggregators.
|
|
19
|
-
* @returns The aggregated events.
|
|
20
|
-
*/
|
|
21
|
-
getAggregatedEvents() {
|
|
22
|
-
const events = [];
|
|
23
|
-
for (const aggregator of this._aggregators) {
|
|
24
|
-
events.push(...aggregator.getAggregatedEvents());
|
|
25
|
-
}
|
|
26
|
-
return events;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=MetricEventAggregatorRegistry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricEventAggregatorRegistry.js","sourceRoot":"","sources":["../src/MetricEventAggregatorRegistry.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,6BAA6B;IAA1C;QACmB,iBAAY,GAAG,IAAI,GAAG,EAAkC,CAAC;IA4B5E,CAAC;IA1BC;;;;;OAKG;IACH,QAAQ,CAAI,UAAoC;QAC9C,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,MAAM,MAAM,GAAkB,EAAE,CAAC;QACjC,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAC3C,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import type { MetricEvent } from './types/MetricEvent.js';\nimport type { MetricEventAggregator } from './types/MetricEventAggregator.js';\n\nexport class MetricEventAggregatorRegistry {\n private readonly _aggregators = new Set<MetricEventAggregator<unknown>>();\n\n /**\n * Registers a new aggregator. If an aggregator already exists, it will be return the aggregator.\n * @param name - The name of the metric.\n * @param aggregate - The aggregator function.\n * @returns The aggregator that is passed in.\n */\n register<T>(aggregator: MetricEventAggregator<T>) {\n if (!this._aggregators.has(aggregator)) {\n this._aggregators.add(aggregator);\n }\n\n return aggregator;\n }\n\n /**\n * Gets all the aggregated events from all the registered aggregators.\n * @returns The aggregated events.\n */\n getAggregatedEvents(): MetricEvent[] {\n const events: MetricEvent[] = [];\n for (const aggregator of this._aggregators) {\n events.push(...aggregator.getAggregatedEvents());\n }\n\n return events;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NoOpTelemetryClient.d.ts","sourceRoot":"","sources":["../../src/NoOp/NoOpTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAS,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;;IAO1C,sBAAsB,IAAI,eAAe;IAKzC,QAAQ;IAKR,SAAS;CAGV"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { trace } from '@opentelemetry/api';
|
|
2
|
-
import { PerformanceRecorder } from '../PerformanceRecorder.js';
|
|
3
|
-
/**
|
|
4
|
-
* No-op implementation of {@link TelemetryClient}.
|
|
5
|
-
* This class will be used when Telemetry is disabled.
|
|
6
|
-
*/
|
|
7
|
-
export class NoOpTelemetryClient {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.rootSpan = this.getTracer().startSpan('no-op');
|
|
10
|
-
this.performance = new PerformanceRecorder(this.rootSpan);
|
|
11
|
-
}
|
|
12
|
-
setSharedSpanAttribute() {
|
|
13
|
-
// No-op
|
|
14
|
-
return this;
|
|
15
|
-
}
|
|
16
|
-
shutdown() {
|
|
17
|
-
// No-op
|
|
18
|
-
return Promise.resolve();
|
|
19
|
-
}
|
|
20
|
-
getTracer() {
|
|
21
|
-
return trace.getTracer('no-op');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=NoOpTelemetryClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NoOpTelemetryClient.js","sourceRoot":"","sources":["../../src/NoOp/NoOpTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAI9B;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED,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,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;CACF","sourcesContent":["import { type Span, trace } from '@opentelemetry/api';\nimport type { TelemetryClient } from '../types/TelemetryClient.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;\n readonly performance: PerformanceRecorder;\n\n constructor() {\n this.rootSpan = this.getTracer().startSpan('no-op');\n this.performance = new PerformanceRecorder(this.rootSpan);\n }\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 trace.getTracer('no-op');\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PerformanceRecorder.d.ts","sourceRoot":"","sources":["../src/PerformanceRecorder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE9E;;GAEG;AACH,qBAAa,mBAAmB;IAGlB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAuC;gBAEzD,IAAI,EAAE,IAAI;IAEvC;;;;;OAKG;IACH,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAI1D;;;;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;IACH,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,CAAC,GAAG,CAAC;IACtE,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAsBxF;;OAEG;IACH,QAAQ,IAAI,IAAI;CAKjB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { performance } from 'perf_hooks';
|
|
2
|
-
import { MetricEventAggregatorRegistry } from './MetricEventAggregatorRegistry.js';
|
|
3
|
-
/**
|
|
4
|
-
* PerformanceRecorder is a utility class for recording performance metrics into telemetry.
|
|
5
|
-
*/
|
|
6
|
-
export class PerformanceRecorder {
|
|
7
|
-
constructor(span) {
|
|
8
|
-
this.span = span;
|
|
9
|
-
this._metricEventAggregatorRegistry = new MetricEventAggregatorRegistry();
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Registers a new aggregator for a given metric.
|
|
13
|
-
* If an aggregator already exists, it will be skipped.
|
|
14
|
-
* @param name - The name of the metric.
|
|
15
|
-
* @param aggregator - The aggregator function.
|
|
16
|
-
*/
|
|
17
|
-
registerAggregator(aggregator) {
|
|
18
|
-
return this._metricEventAggregatorRegistry.register(aggregator);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Records a performance metric into telemetry. The metric will be recorded as an event on the span and logged to the console.
|
|
22
|
-
* 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.
|
|
23
|
-
* @param attributes
|
|
24
|
-
*/
|
|
25
|
-
record(attributes) {
|
|
26
|
-
const { name, value, additionalProperties = {} } = attributes;
|
|
27
|
-
this.span.addEvent('Performance-Metric', { ...additionalProperties, name, value });
|
|
28
|
-
console.debug(`Performance-Metric: ${name} ${value}`);
|
|
29
|
-
}
|
|
30
|
-
async track(name, execute) {
|
|
31
|
-
const additionalProperties = {};
|
|
32
|
-
const startTime = performance.now();
|
|
33
|
-
const tracker = {
|
|
34
|
-
name,
|
|
35
|
-
startTime,
|
|
36
|
-
setProperties: (properties) => {
|
|
37
|
-
Object.assign(additionalProperties, properties);
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const result = execute.constructor.name == 'AsyncFunction' ? await execute(tracker) : execute(tracker);
|
|
41
|
-
this.record({ name, value: performance.now() - startTime, additionalProperties });
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Shuts down the performance recorder and records any aggregated events.
|
|
46
|
-
*/
|
|
47
|
-
shutdown() {
|
|
48
|
-
for (const { name, value, attributes } of this._metricEventAggregatorRegistry.getAggregatedEvents()) {
|
|
49
|
-
this.record({ name, value, additionalProperties: attributes });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=PerformanceRecorder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PerformanceRecorder.js","sourceRoot":"","sources":["../src/PerformanceRecorder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAKnF;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAA6B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAFtB,mCAA8B,GAAG,IAAI,6BAA6B,EAAE,CAAC;IAE5C,CAAC;IAE3C;;;;;OAKG;IACH,kBAAkB,CAAI,UAAoC;QACxD,OAAO,IAAI,CAAC,8BAA8B,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAClE,CAAC;IAED;;;;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,EAAE,CAAC,CAAC;IACxD,CAAC;IAUD,KAAK,CAAC,KAAK,CACT,IAAY,EACZ,OAA6F;QAE7F,MAAM,oBAAoB,GAAmB,EAAE,CAAC;QAChD,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,OAAO,GAAuB;YAClC,IAAI;YACJ,SAAS;YACT,aAAa,EAAE,CAAC,UAA0B,EAAE,EAAE;gBAC5C,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;YAClD,CAAC;SACF,CAAC;QAEF,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEvG,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;IAED;;OAEG;IACH,QAAQ;QACN,KAAK,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,IAAI,CAAC,8BAA8B,CAAC,mBAAmB,EAAE,EAAE,CAAC;YACpG,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF","sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { performance } from 'perf_hooks';\nimport { MetricEventAggregatorRegistry } from './MetricEventAggregatorRegistry.js';\nimport type { PerformanceTracker } from './types/PerformanceTracker.js';\nimport type { SpanAttributes } from './types/SpanAttributes.js';\nimport type { MetricEventAggregator } from './types/MetricEventAggregator.js';\n\n/**\n * PerformanceRecorder is a utility class for recording performance metrics into telemetry.\n */\nexport class PerformanceRecorder {\n private readonly _metricEventAggregatorRegistry = new MetricEventAggregatorRegistry();\n\n constructor(private readonly span: Span) {}\n\n /**\n * Registers a new aggregator for a given metric.\n * If an aggregator already exists, it will be skipped.\n * @param name - The name of the metric.\n * @param aggregator - The aggregator function.\n */\n registerAggregator<T>(aggregator: MetricEventAggregator<T>) {\n return this._metricEventAggregatorRegistry.register(aggregator);\n }\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}`);\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 track<T>(name: string, execute: (tracker: PerformanceTracker) => T): T;\n track<T>(name: string, execute: (tracker: PerformanceTracker) => Promise<T>): Promise<T>;\n async track<T>(\n name: string,\n execute: ((tracker: PerformanceTracker) => Promise<T>) | ((tracker: PerformanceTracker) => T),\n ): Promise<T> {\n const additionalProperties: SpanAttributes = {};\n const startTime = performance.now();\n const tracker: PerformanceTracker = {\n name,\n startTime,\n setProperties: (properties: SpanAttributes) => {\n Object.assign(additionalProperties, properties);\n },\n };\n\n const result = execute.constructor.name == 'AsyncFunction' ? await execute(tracker) : execute(tracker);\n\n this.record({ name, value: performance.now() - startTime, additionalProperties });\n\n return result;\n }\n\n /**\n * Shuts down the performance recorder and records any aggregated events.\n */\n shutdown(): void {\n for (const { name, value, attributes } of this._metricEventAggregatorRegistry.getAggregatedEvents()) {\n this.record({ name, value, additionalProperties: attributes });\n }\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTelemetryClient.d.ts","sourceRoot":"","sources":["../src/createTelemetryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAkB/F"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export async function createTelemetryClient(options) {
|
|
2
|
-
if (!options.connectionString) {
|
|
3
|
-
console.debug('No connection string found. Telemetry will not be sent.');
|
|
4
|
-
// Create a no-op telemetry client if no instrumentation key is provided
|
|
5
|
-
const { NoOpTelemetryClient } = await import('./NoOp/NoOpTelemetryClient.js');
|
|
6
|
-
return new NoOpTelemetryClient();
|
|
7
|
-
}
|
|
8
|
-
// Set initial log level to WARN to avoid logging telemetry initialization
|
|
9
|
-
process.env.APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL = options.logLevel || 'WARN';
|
|
10
|
-
// Disable Azure SDK tracing to avoid polluting logs with trace messages
|
|
11
|
-
process.env.AZURE_TRACING_DISABLED = 'true';
|
|
12
|
-
// Import TelemetryClient after setting initial log level
|
|
13
|
-
const { AppInsightsTelemetryClient } = await import('./AppInsights/AppInsightsTelemetryClient.js');
|
|
14
|
-
return new AppInsightsTelemetryClient(options);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=createTelemetryClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTelemetryClient.js","sourceRoot":"","sources":["../src/createTelemetryClient.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAAyB;IACnE,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAEzE,wEAAwE;QACxE,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;QAC9E,OAAO,IAAI,mBAAmB,EAAE,CAAC;IACnC,CAAC;IAED,0EAA0E;IAC1E,OAAO,CAAC,GAAG,CAAC,iDAAiD,GAAG,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC;IAE3F,wEAAwE;IACxE,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,MAAM,CAAC;IAE5C,yDAAyD;IACzD,MAAM,EAAE,0BAA0B,EAAE,GAAG,MAAM,MAAM,CAAC,6CAA6C,CAAC,CAAC;IACnG,OAAO,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import type { TelemetryOptions } from './types/TelemetryOptions.js';\nimport type { TelemetryClient } from './types/TelemetryClient.js';\n\nexport async function createTelemetryClient(options: TelemetryOptions): Promise<TelemetryClient> {\n if (!options.connectionString) {\n console.debug('No connection string found. Telemetry will not be sent.');\n\n // Create a no-op telemetry client if no instrumentation key is provided\n const { NoOpTelemetryClient } = await import('./NoOp/NoOpTelemetryClient.js');\n return new NoOpTelemetryClient();\n }\n\n // Set initial log level to WARN to avoid logging telemetry initialization\n process.env.APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL = options.logLevel || 'WARN';\n\n // Disable Azure SDK tracing to avoid polluting logs with trace messages\n process.env.AZURE_TRACING_DISABLED = 'true';\n\n // Import TelemetryClient after setting initial log level\n const { AppInsightsTelemetryClient } = await import('./AppInsights/AppInsightsTelemetryClient.js');\n return new AppInsightsTelemetryClient(options);\n}\n"]}
|
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
package/lib/tsdoc-metadata.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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.39.4"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LogLevel.d.ts","sourceRoot":"","sources":["../../src/types/LogLevel.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC"}
|
package/lib/types/LogLevel.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LogLevel.js","sourceRoot":"","sources":["../../src/types/LogLevel.ts"],"names":[],"mappings":"","sourcesContent":["export type LogLevel = 'NONE' | 'ERROR' | 'WARN' | 'INFO' | 'DEBUG' | 'VERBOSE' | 'ALL';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricEvent.d.ts","sourceRoot":"","sources":["../../src/types/MetricEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/lib/types/MetricEvent.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricEvent.js","sourceRoot":"","sources":["../../src/types/MetricEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpanAttributes } from './SpanAttributes.js';\n\nexport interface MetricEvent {\n attributes?: SpanAttributes;\n value: number;\n name: string;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricEventAggregator.d.ts","sourceRoot":"","sources":["../../src/types/MetricEventAggregator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACvB,mBAAmB,IAAI,WAAW,EAAE,CAAC;CACtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MetricEventAggregator.js","sourceRoot":"","sources":["../../src/types/MetricEventAggregator.ts"],"names":[],"mappings":"","sourcesContent":["import type { MetricEvent } from '../index.js';\n\nexport interface MetricEventAggregator<T> {\n record(event: T): void;\n getAggregatedEvents(): MetricEvent[];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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"}
|