UNPKG

@dexwox-labs/a2a-core

Version:

Core types, validation and telemetry for Google's Agent-to-Agent (A2A) protocol - shared foundation for client and server implementations

53 lines 1.42 kB
import { type Span, type Attributes, type Context } from '@opentelemetry/api'; import { TelemetryConfig } from './config'; /** * Telemetry service for collecting and exporting metrics and traces */ export declare class TelemetryService { private static instance; private config; private meter; private resource; private isInitialized; private constructor(); /** * Initialize the telemetry service */ static initialize(config?: Partial<TelemetryConfig>): TelemetryService; /** * Get the singleton instance of the telemetry service */ static getInstance(): TelemetryService; /** * Check if telemetry is enabled */ isEnabled(): boolean; /** * Create a new span */ startSpan(name: string, parentContext?: Context): { span: Span; ctx: Context; }; /** * End a span */ endSpan(span: Span, error?: Error): void; /** * Record a metric */ recordMetric(name: string, value: number, attributes?: Attributes): void; /** * Record a duration metric */ recordDuration(name: string, startTime: number, attributes?: Attributes): void; /** * Update the configuration */ updateConfig(config: Partial<TelemetryConfig>): void; /** * Shutdown the telemetry service */ shutdown(): Promise<void>; } //# sourceMappingURL=service.d.ts.map