Workers Observability now surfaces warning attributes on spans for non-fatal errors
Workers Observability now attaches warning attributes to spans for non-fatal telemetry issues, helping you identify instrumentation problems. When warnings occur, cloudflare.warning.type and cloudflare.warning.message attributes are set together to explain the issue, such as when span data limits are exceeded.
Workers Observability now attaches warning attributes to spans for non-fatal telemetry issues. These attributes help you identify instrumentation issues.
When a warning is present, both attributes are set together:
cloudflare.warning.type— An identifier indicating the type of warning condition.cloudflare.warning.message— A free-form, human-readable explanation of the warning condition.
For example, recording an entire webhook payload as a span attribute can exceed the span data limit:
export default {
async fetch(request, env, ctx) {
const payload = await request.text();
return ctx.tracing.enterSpan("receive-webhook", (span) => {
span.setAttribute("webhook.payload", payload);
return new Response("Accepted", { status: 202 });
});
},
};export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
const payload = await request.text();
return ctx.tracing.enterSpan("receive-webhook", (span) => {
span.setAttribute("webhook.payload", payload);
return new Response("Accepted", { status: 202 });
});
},
};
The Worker still returns 202 Accepted, but tracing drops the oversized attribute. The span includes cloudflare.warning.type set to span_data_limit_exceeded and a cloudflare.warning.message identifying the rejected attribute and its size.
For more information, refer to Warning attributes.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for Windows hotfix - trusted certificate chains
A new GA release for Windows Cloudflare One Client is available, addressing an issue with building trusted certificate chains.
Cloudflare One Client for macOS - Trusted Certificate Chain Fix
A new GA release of the macOS Cloudflare One Client is available. This hotfix addresses an issue with building trusted certificate chains.
Cloudflare One Client for Linux
A new GA release of Cloudflare One Client for Linux is now available. This hotfix addresses an issue with building trusted certificate chains.