@inshorts/glint-telemetry
v0.5.2
Published
Glint build info, health, rate limit, client-error route and Sentry helpers for Next panels.
Keywords
Readme
@inshorts/glint-telemetry
Build info / health, rate limit, Sentry store reporting, browser client-error
reporter, and shared Next onRequestError for Glint panels.
Install
pnpm add @inshorts/glint-telemetry
# until published:
pnpm add @inshorts/glint-telemetry@file:../inshorts-npm-modules/glint/telemetryRequest errors (instrumentation.ts)
import { createRequestErrorHandler } from "@inshorts/glint-telemetry/requestError";
export async function register() {
// optional: warm env / note SENTRY_DSN
}
export const onRequestError = createRequestErrorHandler({
service: "inpix-panel",
});Logs one Cloud Logging JSON line to stderr and reports to Sentry when
SENTRY_DSN is set. Reads x-request-id from Next’s plain header dict (never
call .get() on it).
Health
import { healthPayload } from "@inshorts/glint-telemetry/buildInfo";
export function GET() {
return Response.json(healthPayload("inpix-panel"), {
headers: { "Cache-Control": "no-store" },
});
}Client errors
import { reportClientError } from "@inshorts/glint-telemetry/reportClientError";
// in error.tsx / global-error.tsx
reportClientError(error, "error");Related
@inshorts/glint-logger— general structured logs (info/warn/audit)@inshorts/glint-http— upstream failure curls
