@drej/otel
v0.2.8
Published
OpenTelemetry hooks adapter for [drej](https://drej.dev). Emits distributed traces for sandbox lifecycle events — sandbox creation, exec calls, and checkpoints.
Readme
@drej/otel
OpenTelemetry hooks adapter for drej. Emits distributed traces for sandbox lifecycle events — sandbox creation, exec calls, and checkpoints.
bun add @drej/otelUsage
import { otelHooks } from "@drej/otel";
const sb = await client.sandbox({
image: "ubuntu:22.04",
resources: { cpu: "500m", memory: "512Mi" },
hooks: otelHooks(tracer),
});Emitted spans
| Span | Emitted on |
| -------------------- | --------------------------- |
| sandbox.run | Sandbox created → closed |
| sandbox.exec | Each sb.exec() call |
| sandbox.checkpoint | Each sb.checkpoint() call |
Custom span options
otelHooks(tracer, {
attributes: { "deployment.env": "production" },
});License
Apache 2.0
