Skip to main content

Observe API

Use Observe.observe() to create spans for custom agent orchestration: planning, tool execution, policy checks, handoffs, retrieval, and other work that provider SDKs do not expose.

Wrap A Function

Wrap a tool call
The wrapped function preserves the original return behavior for sync functions, promises, and async iterables. Errors are recorded on the span and then rethrown.

Observe Options

Avoid Sensitive Metadata

Set ignoreInput or ignoreOutput when wrapper metadata should avoid recording argument counts or output type.
Ignore input and output metadata
Beacon compatibility attributes should still be chosen carefully. Do not place raw secrets, credentials, or high-risk prompt content in custom attributes.

Common Beacon Actions

Use Beacon compatibility attributes when a custom step should normalize into a known event category.
Wrap an MCP tool call
See the SDK reference for the full attribute list.