Decorator for tracking traces.This decorator wraps functions to automatically create and manage Trace
objects for tracking trace operations, including inputs, outputs, and metadata.
The decorated function must be called within a @trace or @span decorated context.