mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-02 01:02:05 +08:00
2234859440
* perf: reduce trace span and metrics * perf: add process memory metrics * fix: translations
25 lines
547 B
TypeScript
25 lines
547 B
TypeScript
import {
|
|
configureMetricsFromEnv,
|
|
disposeMetrics as disposeOtelMetrics,
|
|
getMeter
|
|
} from '@fastgpt-sdk/otel/metrics';
|
|
import { env } from '../../env';
|
|
import { startRuntimeMetrics, stopRuntimeMetrics } from './runtime';
|
|
|
|
export async function configureMetrics() {
|
|
await configureMetricsFromEnv({
|
|
env,
|
|
defaultServiceName: 'fastgpt-client',
|
|
defaultMeterName: 'fastgpt-client'
|
|
});
|
|
|
|
startRuntimeMetrics();
|
|
}
|
|
|
|
export async function disposeMetrics() {
|
|
stopRuntimeMetrics();
|
|
await disposeOtelMetrics();
|
|
}
|
|
|
|
export { getMeter };
|