@ms-cloudpack/telemetry 0.10.19 → 0.11.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/index.js +27275 -25
- package/lib/FilteredBatchSpanProcessor.d.ts +12 -0
- package/lib/SpanEnrichingProcessor.d.ts +2 -1
- package/lib/index.d.ts +4 -3
- package/lib/proxies/createImprovedStartActiveSpan.d.ts +2 -2
- package/lib/proxies/createProxiedTracer.d.ts +1 -1
- package/lib/startTelemetry.d.ts +8 -0
- package/lib/types/TelemetryApi.d.ts +13 -0
- package/lib/types/TelemetryClient.d.ts +0 -14
- package/lib/types/TelemetryOptions.d.ts +0 -9
- package/package.json +1 -1
- package/dist/AppInsightsTelemetryClient-D64DKZED.js +0 -14791
- package/dist/NoOpTelemetryClient-DSXX3QKA.js +0 -13
- package/dist/chunk-AWW6HGS7.js +0 -28
- package/dist/chunk-X6DBTXTN.js +0 -12593
- package/lib/AppInsightsTelemetryClient.d.ts +0 -6
- package/lib/BaseTelemetryClient.d.ts +0 -30
- package/lib/CustomContextManager.d.ts +0 -41
- package/lib/NoOpTelemetryClient.d.ts +0 -9
- package/lib/createTelemetryClient.d.ts +0 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BatchSpanProcessor, type SpanExporter, type ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
/**
|
|
3
|
+
* FilteredBatchSpanProcessor is a custom span processor that filters spans
|
|
4
|
+
* based on a provided filter function before passing them to the exporter.
|
|
5
|
+
* This allows for more granular control over which spans are exported.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FilteredBatchSpanProcessor extends BatchSpanProcessor {
|
|
8
|
+
private readonly filterFn;
|
|
9
|
+
constructor(exporter: SpanExporter, filterFn: (span: ReadableSpan) => boolean);
|
|
10
|
+
onEnd(span: ReadableSpan): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=FilteredBatchSpanProcessor.d.ts.map
|
|
@@ -5,7 +5,8 @@ import type { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base'
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class SpanEnrichingProcessor implements SpanProcessor {
|
|
7
7
|
private sharedSpanAttributes;
|
|
8
|
-
|
|
8
|
+
private readonly filter?;
|
|
9
|
+
constructor(sharedSpanAttributes: Attributes, filter?: ((span: ReadableSpan) => boolean) | undefined);
|
|
9
10
|
forceFlush(): Promise<void>;
|
|
10
11
|
shutdown(): Promise<void>;
|
|
11
12
|
onStart(): void;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export type { Span } from '@opentelemetry/api';
|
|
2
|
-
export {
|
|
3
|
-
export { createTelemetryClient } from './createTelemetryClient.js';
|
|
2
|
+
export type { TelemetryApi } from './types/TelemetryApi.js';
|
|
4
3
|
export type { LogLevel } from './types/LogLevel.js';
|
|
5
4
|
export type { TelemetryClient } from './types/TelemetryClient.js';
|
|
6
5
|
export type { TelemetryOptions } from './types/TelemetryOptions.js';
|
|
7
|
-
export { createNoOpTelemetryClient } from './createNoOpTelemetryClient.js';
|
|
8
6
|
export type { AsyncTracer } from './proxies/createProxiedTracer.js';
|
|
7
|
+
export { SpanStatusCode } from '@opentelemetry/api';
|
|
8
|
+
export { startTelemetry } from './startTelemetry.js';
|
|
9
|
+
export { createNoOpTelemetryClient } from './createNoOpTelemetryClient.js';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Tracer, type Span, type SpanOptions, type Context } from '@opentelemetry/api';
|
|
2
2
|
export type SpanFunction<T> = (span: Span) => T | Promise<T>;
|
|
3
3
|
type StartActiveSpanFn = <T>(name: string, optionsOrFn?: SpanOptions | SpanFunction<T>, contextOrFn?: Context | SpanFunction<T>, maybeFn?: SpanFunction<T>) => T;
|
|
4
|
-
export declare function createImprovedStartActiveSpan(target: Tracer): <T>(name: string, optionsOrFn?: SpanOptions | SpanFunction<unknown> | undefined, contextOrFn?: Context | SpanFunction<unknown> | undefined, maybeFn?: SpanFunction<unknown> | undefined) => Promise<T>;
|
|
4
|
+
export declare function createImprovedStartActiveSpan(target: Tracer, getRootContext?: () => Context): <T>(name: string, optionsOrFn?: SpanOptions | SpanFunction<unknown> | undefined, contextOrFn?: Context | SpanFunction<unknown> | undefined, maybeFn?: SpanFunction<unknown> | undefined) => Promise<T>;
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=createImprovedStartActiveSpan.d.ts.map
|
|
@@ -11,5 +11,5 @@ export type AsyncTracer = Omit<Tracer, 'startActiveSpan'> & {
|
|
|
11
11
|
* @param tracer - The tracer to proxy
|
|
12
12
|
* @returns - Proxied tracer
|
|
13
13
|
*/
|
|
14
|
-
export declare function createProxiedTracer(tracer: Tracer): AsyncTracer;
|
|
14
|
+
export declare function createProxiedTracer(tracer: Tracer, getRootContext?: () => Context): AsyncTracer;
|
|
15
15
|
//# sourceMappingURL=createProxiedTracer.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TelemetryOptions } from './types/TelemetryOptions.js';
|
|
2
|
+
import type { TelemetryApi } from './types/TelemetryApi.js';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize the telemetry infrastructure.
|
|
5
|
+
* This function sets up the OpenTelemetry, configures the tracer provider.
|
|
6
|
+
*/
|
|
7
|
+
export declare function startTelemetry(options: TelemetryOptions): TelemetryApi;
|
|
8
|
+
//# sourceMappingURL=startTelemetry.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TelemetryClient } from './TelemetryClient.js';
|
|
2
|
+
export interface TelemetryApi {
|
|
3
|
+
/**
|
|
4
|
+
* Flushes all telemetry and shuts down the telemetry client.
|
|
5
|
+
*/
|
|
6
|
+
shutdown(): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a telemetry client with the given connection string.
|
|
9
|
+
* @param connectionString - The connection string for the telemetry client.
|
|
10
|
+
*/
|
|
11
|
+
createClient(connectionString?: string): Promise<TelemetryClient>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=TelemetryApi.d.ts.map
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import type { Context, ContextAPI } from '@opentelemetry/api';
|
|
2
1
|
import type { AsyncTracer } from '../proxies/createProxiedTracer.js';
|
|
3
2
|
export interface TelemetryClient {
|
|
4
|
-
/**
|
|
5
|
-
* Flushes all telemetry and shuts down the telemetry client.
|
|
6
|
-
*/
|
|
7
|
-
shutdown(): Promise<void>;
|
|
8
3
|
/**
|
|
9
4
|
* Gets the OpenTelemetry tracer.
|
|
10
5
|
* @returns the OpenTelemetry tracer
|
|
11
6
|
*/
|
|
12
7
|
get tracer(): AsyncTracer;
|
|
13
|
-
/**
|
|
14
|
-
* Gets the OpenTelemetry context.
|
|
15
|
-
*/
|
|
16
|
-
get context(): ContextAPI;
|
|
17
|
-
/**
|
|
18
|
-
* Sets the root context.
|
|
19
|
-
* @param context - the root context for the telemetry client
|
|
20
|
-
*/
|
|
21
|
-
setRootContext(context: Context | undefined): void;
|
|
22
8
|
}
|
|
23
9
|
//# sourceMappingURL=TelemetryClient.d.ts.map
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { LogLevel } from './LogLevel.js';
|
|
2
2
|
export interface TelemetryOptions {
|
|
3
|
-
/**
|
|
4
|
-
* The connection string for the Application Insights.
|
|
5
|
-
*/
|
|
6
|
-
connectionString?: string;
|
|
7
3
|
/**
|
|
8
4
|
* The log level for the telemetry client.
|
|
9
5
|
*/
|
|
@@ -12,11 +8,6 @@ export interface TelemetryOptions {
|
|
|
12
8
|
* The version of the product. This will be added as a shared attribute to all spans.
|
|
13
9
|
*/
|
|
14
10
|
productVersion: string;
|
|
15
|
-
/**
|
|
16
|
-
* 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.
|
|
17
|
-
* Possible values: cloudpack, cloudpack.services, etc.
|
|
18
|
-
*/
|
|
19
|
-
serviceNamespace: string;
|
|
20
11
|
/**
|
|
21
12
|
* Logic name of the service
|
|
22
13
|
* Possible values: cli, bundler-service, etc.
|