Spaces:
Sleeping
Sleeping
File size: 798 Bytes
097eaf0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import type { Request, Response } from "express";
import {
getIndexInsertQueueLength,
getOMCEQueueLength,
} from "../../../services";
import { getWebhookInsertQueueLength } from "../../../services/webhook";
export async function indexQueuePrometheus(req: Request, res: Response) {
const queueLength = await getIndexInsertQueueLength();
const webhookQueueLength = await getWebhookInsertQueueLength();
const omceQueueLength = await getOMCEQueueLength();
res.setHeader("Content-Type", "text/plain");
res.send(`\
# HELP firecrawl_index_queue_length The number of items in the index insert queue
# TYPE firecrawl_index_queue_length gauge
firecrawl_index_queue_length ${queueLength}
firecrawl_webhook_queue_length ${webhookQueueLength}
firecrawl_omce_queue_length ${omceQueueLength}
`);
}
|