@vfarcic/dot-ai
Version:
AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance
28 lines • 1.03 kB
TypeScript
/**
* HTTP Server Tracing Module
*
* Provides manual SERVER span creation for incoming HTTP requests.
* Follows OpenTelemetry HTTP semantic conventions.
*/
import { Span } from '@opentelemetry/api';
import { IncomingMessage, ServerResponse } from 'node:http';
/**
* Create and manage HTTP SERVER span for incoming request
*
* Returns a function to end the span with response status code
*/
export declare function createHttpServerSpan(req: IncomingMessage): {
span: Span;
endSpan: (statusCode: number) => void;
};
/**
* Wrap HTTP request handler with tracing
*
* This is a higher-order function that wraps an existing HTTP request handler
* with automatic SERVER span creation and management.
*
* @param handler - Original HTTP request handler
* @returns Wrapped handler with tracing
*/
export declare function withHttpServerTracing(handler: (req: IncomingMessage, res: ServerResponse) => Promise<void>): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
//# sourceMappingURL=http-tracing.d.ts.map