ENF News Bot
Automated News Bot
- Joined
- Apr 15, 2022
- Messages
- 2,591
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:
For example, recording an entire webhook payload as a span attribute can exceed the span data limit:
The Worker still returns
For more information, refer to Warning attributes.
Continue reading...
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:
Code:
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 });
});
},
};
Code:
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.
Continue reading...