@ms-cloudpack/telemetry 0.5.0 → 0.5.1

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.
@@ -4,7 +4,7 @@ import {
4
4
  init_esbuildCjsShims,
5
5
  init_esm,
6
6
  trace
7
- } from "./chunk-BVWZW3N3.js";
7
+ } from "./chunk-S6YCWIS3.js";
8
8
 
9
9
  // src/NoOp/NoOpTelemetryClient.ts
10
10
  init_esbuildCjsShims();
package/dist/index.js CHANGED
@@ -1,25 +1,32 @@
1
1
  import {
2
2
  NoOpTelemetryClient
3
- } from "./chunk-U2PXIPI6.js";
3
+ } from "./chunk-YATXYOI4.js";
4
4
  import {
5
+ DiagConsoleLogger,
6
+ DiagLogLevel,
5
7
  __name,
6
- init_esbuildCjsShims
7
- } from "./chunk-BVWZW3N3.js";
8
+ diag,
9
+ init_esbuildCjsShims,
10
+ init_esm
11
+ } from "./chunk-S6YCWIS3.js";
8
12
 
9
13
  // src/index.ts
10
14
  init_esbuildCjsShims();
11
15
 
12
16
  // src/createTelemetryClient.ts
13
17
  init_esbuildCjsShims();
18
+ init_esm();
14
19
  async function createTelemetryClient(options) {
15
20
  if (!options.connectionString) {
16
21
  console.debug("No connection string found. Telemetry will not be sent.");
17
- const { NoOpTelemetryClient: NoOpTelemetryClient2 } = await import("./NoOpTelemetryClient-GBCRTSF4.js");
22
+ const { NoOpTelemetryClient: NoOpTelemetryClient2 } = await import("./NoOpTelemetryClient-XLCEWCVA.js");
18
23
  return new NoOpTelemetryClient2();
19
24
  }
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");
25
+ diag.setLogger(new DiagConsoleLogger(), {
26
+ logLevel: options.logLevel || DiagLogLevel.WARN,
27
+ suppressOverrideMessage: true
28
+ });
29
+ const { AppInsightsTelemetryClient } = await import("./AppInsightsTelemetryClient-UR2GSWWS.js");
23
30
  return new AppInsightsTelemetryClient(options);
24
31
  }
25
32
  __name(createTelemetryClient, "createTelemetryClient");
@@ -1,8 +1,8 @@
1
1
  import { type Span, type Tracer } from '@opentelemetry/api';
2
2
  import { PerformanceRecorder } from '../PerformanceRecorder.js';
3
+ import type { SpanAttributeValue } from '../types/SpanAttributes.js';
3
4
  import type { TelemetryClient } from '../types/TelemetryClient.js';
4
5
  import type { TelemetryOptions } from '../types/TelemetryOptions.js';
5
- import type { SpanAttributeValue } from '../types/SpanAttributes.js';
6
6
  export declare class AppInsightsTelemetryClient implements TelemetryClient {
7
7
  private readonly _performance;
8
8
  private readonly _rootSpan;
@@ -0,0 +1,4 @@
1
+ import { Resource } from '@opentelemetry/resources';
2
+ import type { TelemetryOptions } from '../types/TelemetryOptions.js';
3
+ export declare function createResourceFromOptions(options: TelemetryOptions): Resource;
4
+ //# sourceMappingURL=createResourceFromOptions.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { type AzureMonitorExporterOptions } from '@azure/monitor-opentelemetry-exporter';
2
+ import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
3
+ import type { Resource } from '@opentelemetry/resources';
4
+ export declare function createTraceProvider(config: {
5
+ azureMonitorExporterOptions: AzureMonitorExporterOptions;
6
+ resource: Resource;
7
+ }): NodeTracerProvider;
8
+ //# sourceMappingURL=createTraceProvider.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/telemetry",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Helpers for logging tasks to the console.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  }
15
15
  },
16
16
  "devDependencies": {
17
- "@azure/monitor-opentelemetry": "~1.3.0",
17
+ "@azure/monitor-opentelemetry-exporter": "1.0.0-beta.21",
18
18
  "@ms-cloudpack/eslint-plugin-internal": "*",
19
19
  "@ms-cloudpack/scripts": "*",
20
20
  "@opentelemetry/api": "^1.8.0",