UNPKG

@juspay/neurolink

Version:

The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002

26 lines (25 loc) • 1.05 kB
import { fstatSync } from "node:fs"; import { getProxyOtelLogSnapshot, isProxyOtelOnly } from "./otelLogSink.js"; import { getProxyLifecycleLoggerSnapshot } from "./proxyLifecycle.js"; /** Inspect this process, not the launcher configuration intended for its successor. */ export function getProxyProcessTelemetry() { const descriptor = (fd) => { try { return fstatSync(fd).isFile() ? "file" : "non_file"; } catch { return "unavailable"; } }; const logs = getProxyOtelLogSnapshot(); return { pid: process.pid, checkedAt: new Date().toISOString(), configuredSink: isProxyOtelOnly() ? "otel" : "file", lifecycleSink: getProxyLifecycleLoggerSnapshot().sink ?? "unavailable", otelInitialized: logs.initialized, stdio: { stdout: descriptor(1), stderr: descriptor(2) }, exportDropped: logs.queues.reduce((n, q) => n + q.dropped, 0), exportUnconfirmed: logs.queues.reduce((n, q) => n + q.exportUnconfirmed, 0), }; }