rsnext/test/e2e/opentelemetry/middleware.ts
Dima Voytenko 2451af931c
OTEL: Add top span for middleware (#62421)
Without this, any spans added by the middleware implementation would be
orphaned and create extra traces.
2024-02-23 01:08:29 +00:00

15 lines
360 B
TypeScript

import type { NextRequest, NextFetchEvent } from 'next/server'
import { NextResponse } from 'next/server'
export const config: {
matcher: string[]
} = {
matcher: ['/behind-middleware', '/behind-middleware/:path*'],
}
export async function middleware(
request: NextRequest,
event?: NextFetchEvent
): Promise<Response> {
return NextResponse.next()
}