telemetry.ts
This file
Path
apps/sandbox/src/telemetry.ts
12 lines · 623 bytes · TypeScript
Last changed by
Merge observability into mainoscabrielbefore adoption1985111
History of this fileTake it
Merge observability into mainoscabrielbefore adoption1985111
lines 1–12why, one step back1// The sandbox's telemetry: its JSON logger and its spans, over the Worker's2// own `tracing`. The env holds no secret; a job's tokens are the secrets its3// lines must never carry, so each job runs with its own.4import { Telemetry } from "@repo/telemetry/telemetry";5import type { TelemetryOptions } from "@repo/telemetry/telemetry";6import { tracing } from "cloudflare:workers";7import type { Layer, Redacted } from "effect";89export const jobTelemetry = (10 tokens: readonly Redacted.Redacted[],11 defects: TelemetryOptions["defects"] = "whole"12): Layer.Layer<never> => Telemetry({ defects, secrets: tokens, tracing });