Next.js API route for retrieving Prometheus-formatted metrics from the Sophra system
GET
function is the primary exported component of this route. It’s an asynchronous function that handles HTTP GET requests and returns a Promise<NextResponse>
.
_req: NextRequest
: The incoming request object (unused in this implementation)Promise<NextResponse>
serviceManager
to access the metrics service.getMetrics()
method.Data Flow
Optimization Strategies
async/await
for non-blocking executionRuntime Options
runtime = "nodejs"
: Specifies the Next.js runtime for this API routeserviceManager