- TypeScript
- Python
observe(options, fn, …args)
Wrap a function to create a span. Automatically captures inputs, outputs, and errors.Returns:
Promise<ReturnType<F>>Behavior:- If one non-Map object argument, records that object as input; otherwise records array
- Maps converted to entries, circular references become
"[Circular reference]" - Exceptions recorded via
recordExceptionand re-thrown - Anonymous function name becomes
""ifnamenot provided - Works with both sync and async functions
observeDecorator(config)
Class method decorator version ofobserve.observe options. Config can be an object or a function (thisArg, ...args) => config for per-call configuration.Returns: Method decorator