import type { IRequest } from '../http/Request';
import type { IResponse } from '../http/Response';
export type NextFunction = (error?: Error) => void | Promise<void>;
export interface MNextFunction {
    middleware(serviceName: string, enabled?: boolean, samplingRate?: number): (req: IRequest, res: IResponse, next: NextFunction) => void | Promise<void>;
    injectHeaders(serviceName: string, _targetServiceName: string): (headers: Record<string, string>, traceId?: string) => Record<string, string>;
}
/**
 * Request trace metadata
 */
export interface TraceContext {
    traceId: string;
    parentServiceId?: string;
    depth: number;
    startTime: number;
    serviceName: string;
}
export interface ITraceLogger {
    info(message: string, data?: Record<string, unknown>): void;
    warn(message: string, data?: Record<string, unknown>): void;
    error(message: string, data?: Record<string, unknown>): void;
    debug(message: string, data?: Record<string, unknown>): void;
}
/**
 * Trace logger for structured logging
 */
export declare const TraceLogger: Readonly<{
    /**
     * Create a new trace logger instance
     */
    create(traceId: string, serviceName: string): ITraceLogger;
}>;
/**
 * Request Tracing Middleware
 * Enables request tracking across microservices for debugging and observability
 */
export declare function RequestTracingMiddlewareFactory(): MNextFunction;
export declare const RequestTracingMiddleware: MNextFunction;
export declare const middleware: (serviceName: string, enabled?: boolean, samplingRate?: number) => ((req: IRequest, res: IResponse, next: NextFunction) => void | Promise<void>);
export default RequestTracingMiddleware;
//# sourceMappingURL=RequestTracingMiddleware.d.ts.map