Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Cloudflare Agents

The Cloudflare Agents SDK (the agents package on npm) runs agents on Cloudflare Workers and Durable Objects. Its traces go to Workers Observability and to the OpenTelemetry destinations configured for the Worker; this page points one of those destinations at cetra. It is setup only: the export was not run against cetra.

Terminal window
npm install agents

@cloudflare/agents on npm is an old package, not this SDK.

In the Cloudflare dashboard, add an OTLP destination under Observability > Destinations, at the account level. Cloudflare sends traces to the /v1/traces endpoint and logs to /v1/logs. Add a header Authorization: Bearer sk-cetra-… with your cetra API key.

Then enable traces for the Worker in its wrangler.jsonc:

{
"observability": {
"traces": {
"enabled": true
}
}
}

The Worker’s wrangler config also names the destination to send to. That key is not given on this page; use the one Cloudflare’s documentation names.

  • Model calls made through the AI SDK are recorded as spans with the OpenTelemetry GenAI semantic conventions when they go through the SDK’s wrapAISDK helper.
  • The input and output messages (gen_ai.input.messages and gen_ai.output.messages) are opt-in.
  • Not run: the export is done by Cloudflare’s servers, not by the Worker’s local runtime, so no run against cetra was recorded for this page.
  • cetra’s endpoint must be reachable from the public internet, because Cloudflare sends the spans from its own servers.
  • wrangler dev does not forward spans to destinations: in local development, Cloudflare records them in its Local Explorer only.
  • Cloudflare exports OTLP/HTTP with JSON encoding only; cetra accepts JSON bodies.
  • This page was written against the SDK’s documentation in agents 0.33.0.