Netra SDK offers a set of powerful decorators to simplify the process of instrumenting your AI applications. By adding a simple decorator to your functions or classes, you can automatically create spans, track execution, and capture valuable telemetry data without cluttering your code with manual tracing calls. Our three main decorators are:Documentation Index
Fetch the complete documentation index at: https://docs.getnetra.ai/llms.txt
Use this file to discover all available pages before exploring further.
@workflow: For high-level business transactions or main entry points.@agent: For AI agents or complex components that orchestrate multiple tasks.@task: For individual units of work or sub-processes within an agent.@span: For tracing specific operations or steps within a workflow.
@workflow
The @workflow decorator is designed to trace the entire lifecycle of a high-level operation or business workflow. It’s ideal for wrapping main functions that orchestrate multiple steps.
@agent
The @agent decorator is suited for instrumenting AI agents or classes that encapsulate a specific set of responsibilities. When applied to a class, it will automatically instrument all of its public methods.
@task
Use the @task decorator for more granular tracing of individual functions or methods that represent a single step or task within a larger workflow.
@span
Use the @span decorator for tracing specific operations or steps within a workflow.
@spandecorator. Currently, we support the following types:
Async Support
All decorators fully supportasync functions out of the box.
