/** * @module runtime/metrics-client * @description Metrics and observability client for Gati runtime */ import * as api from '@opentelemetry/api'; /** * Metrics client interface for runtime components */ export interface MetricsClient { /** Increment a counter metric */ incrementCounter(name: string, labels?: Record, value?: number): void; /** Set a gauge metric value */ setGauge(name: string, value: number, labels?: Record): void; /** Record a histogram observation */ recordHistogram(name: string, value: number, labels?: Record): void; /** Create a new span for tracing */ createSpan(name: string, attributes?: api.Attributes): api.Span; /** Execute function within a span context */ withSpan(name: string, fn: (span: api.Span) => Promise, attributes?: api.Attributes): Promise; /** Log structured message with request context */ logWithContext(level: 'info' | 'warn' | 'error', message: string, context: Record): void; /** Record audit event */ recordAudit(event: string, context: AuditContext): void; } /** * Audit context for security logging */ export interface AuditContext { requestId: string; handlerId?: string; version?: string; userId?: string; action: string; resource?: string; result: 'success' | 'failure' | 'denied'; metadata?: Record; } /** * Runtime metrics client implementation */ export declare class RuntimeMetricsClient implements MetricsClient { private serviceName; private serviceVersion; private tracer; private metrics?; private counters; private gauges; private histograms; constructor(serviceName?: string, serviceVersion?: string); incrementCounter(name: string, labels?: Record, value?: number): void; setGauge(name: string, value: number, labels?: Record): void; recordHistogram(name: string, value: number, labels?: Record): void; createSpan(name: string, attributes?: api.Attributes): api.Span; withSpan(name: string, fn: (span: api.Span) => Promise, attributes?: api.Attributes): Promise; logWithContext(level: 'info' | 'warn' | 'error', message: string, context: Record): void; recordAudit(event: string, context: AuditContext): void; } /** * Default metrics client instance */ export declare const metricsClient: RuntimeMetricsClient; //# sourceMappingURL=metrics-client.d.ts.map