Gain deep visibility into your workflows with tracing.
name
: A descriptive name for the operation.input
& output
: Data flowing into and out of the operation.trace_id
: The identifier of the overall workflow this span belongs to.parent_id
: The identifier of the span that directly invoked this operation, allowing us to build a nested hierarchy.start_time
& end_time
: Timestamps for the duration of the operation.metadata
: Arbitrary key-value pairs for additional context or custom annotations.status
: Indicates if the span completed successfully or with an error.type
: Optionally give the span a type, to better filtering and visualizationtrace_id
among spans, with the root span providing the top-level details for the workflow.scale-gp-beta
package, which runs exclusively on the V5 API.SGPClient
.
It’s best practice to do this once at your application’s entry point.
It is not strictly required to call tracing.init()
, the SDK will attempt to create a default client using default ENV variables, if not set we log a warning and will not send tracing data.
SGPClient
for all data export requests. This means you can leverage existing client configurations, such as base_url
or timeout
settings, by passing a pre-configured client to tracing.init()
.
with
statements). This ensures that spans are automatically started, ended, and errors are captured, simplifying your instrumentation.
tracing.create_trace()
as a context manager to define a new end-to-end workflow. This automatically creates the root span for your trace.
create_trace
block, use tracing.create_span()
as a context manager. These spans will automatically inherit the trace_id
from the current trace and will be nested under the currently active span (or the root span if no other span is active).