Initialization
Set up and initialize the Scale GP Tracing SDK in your Python applications.
The SGP Tracing SDK provides a convenient way to instrument your Python applications with tracing capabilities, allowing you to generate, manage, and send spans to the Scale GP platform. This enables detailed monitoring and debugging of your workflows.
Installation
First, install the scale-gp-beta
package using pip:
Initialisation
Before you can create any traces or spans, you must initialize the tracing SDK. It’s best practice to do this once at your application’s entry point.
You have two primary options for initialization:
Initialize with an SGPClient
This method gives you full control over the SGPClient
’s configuration (e.g., base_url
, timeout
).
Initialize using Environment Variables
If you have set the SGP_API_KEY
and SGP_ACCOUNT_ID
environment variables, you can omit passing a client. The SDK will automatically attempt to create a default SGPClient
for you.
Then, in your Python code:
Disabling Tracing
You can control whether tracing data is collected and exported. This is useful for development, testing, or specific environments where tracing is not desired.
Environment Variable
Programmatically
Pass the disabled=True
parameter directly to the init()
function. This will override the environment variable setting.