add metrics to api
This commit is contained in:
@@ -4,6 +4,7 @@ import cors from '@fastify/cors';
|
||||
import type { FastifyTRPCPluginOptions } from '@trpc/server/adapters/fastify';
|
||||
import { fastifyTRPCPlugin } from '@trpc/server/adapters/fastify';
|
||||
import Fastify from 'fastify';
|
||||
import metricsPlugin from 'fastify-metrics';
|
||||
|
||||
import type { IServiceClient } from '@openpanel/db';
|
||||
import { redisPub } from '@openpanel/redis';
|
||||
@@ -33,6 +34,8 @@ const startServer = async () => {
|
||||
maxParamLength: 15_000,
|
||||
});
|
||||
|
||||
await fastify.register(metricsPlugin, { endpoint: '/metrics' });
|
||||
|
||||
fastify.register(cors, {
|
||||
origin: '*',
|
||||
credentials: true,
|
||||
|
||||
Reference in New Issue
Block a user