@zephyrcloud/telemetry-edge
v0.1.1
Published
Edge-safe telemetry helpers and semantic conventions for Zephyr
Readme
@zephyrcloud/telemetry-edge
Edge-safe telemetry helpers and semantic conventions for Zephyr runtimes (Cloudflare Workers, Fastly, Akamai, Netlify, Lambda@Edge).
This package intentionally excludes Node SDKs and any Node-only APIs. It focuses on helpers, propagation, and semantic conventions.
Installation
pnpm add @zephyrcloud/telemetry-edgeUsage
Trace propagation headers
import { getTraceHeaders } from "@zephyrcloud/telemetry-edge";
const headers = getTraceHeaders();
await fetch("https://example.com/api", {
headers: { ...headers, "Content-Type": "application/json" },
});Helpers + semantic conventions
import {
withSpan,
addSpanAttributes,
ATTR_ZEPHYR_REQUEST_ID,
} from "@zephyrcloud/telemetry-edge";
const result = await withSpan(tracer, "handle-request", async () => {
addSpanAttributes({ [ATTR_ZEPHYR_REQUEST_ID]: requestId });
return doWork();
});