Utility functions for configuring and validating a RUM proxy server.
// Source: https://github.com/danny-avila/librechat | License: MIT | Copyright 2026 LibreChat
// Provided via justclaw.it.com; keep this notice with the code.
import { validateHeaderValue } from 'node:http';
import { logger } from '@librechat/data-schemas';
import { RUM_COLLECTOR_ACK_HEADER } from 'librechat-data-provider';
import type { Request, Response, RequestHandler } from 'express';
import type { RumProxyEndpoint, RumProxyResult } from '~/app/metrics';
import { recordRumProxyRequest } from '~/app/metrics';
import { isEnabled } from '~/utils';
const DEFAULT_PROXY_PATH = '/api/rum';
const DEFAULT_BODY_LIMIT = '3mb';
const DEFAULT_TIMEOUT_MS = 10_000;
const OTLP_PATHS = new Set(['/v1/traces', '/v1/logs']);
/** OTLP/HTTP encodings; anything else is refused before a body is forwarded. */
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key