import { asyncBlock } from './tracing.js';
export default class AKOpenTelemetryHttpRequestSpan {
    async handle(ctx, next) {
        const name = `${ctx.request.method()} ${ctx.request.url(true)}`;
        return asyncBlock(name, async (span) => {
            span.setAttributes({
                'op': 'http.server',
                'sentry.op': 'http.server',
            });
            await next();
            const traceId = span.spanContext().traceId;
            ctx.response.header('x-trace-id', traceId);
        });
    }
}
//# sourceMappingURL=opentelemetry_http_request_span_middleware.js.map