Production observability for your applications
Project description
Toolscope Python SDK
Production observability and telemetry collection SDK for python applications and Wikimedia Toolforge tools.
Installation
You can install the Toolscope SDK from PyPI:
pip install toolscope-obs
Or install with optional requests instrumentation support:
pip install "toolscope-obs[requests]"
Quick Start
Initialize the SDK at the entry point of your application:
import toolscope
import logging
# Initialize the SDK
toolscope.init(
api_key="ts_live_your_api_key",
backend_url="http://localhost:3000/api" # Optional: defaults to production api
)
# Start logging
logging.info("Application started")
Job and Metric Monitoring
Isolate specific runs, jobs, or requests in your application using the job context manager:
with toolscope.job("generate_image") as run_id:
# All print outputs, logs, requests, and unhandled errors
# inside this block are automatically tagged with the job's run_id.
print("Beginning image rendering task...")
# Track custom metrics
toolscope.metric("GPU_temp_c", 65.5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toolscope_obs-0.1.0.tar.gz.
File metadata
- Download URL: toolscope_obs-0.1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c6872e7c2af3a6afc944843e237e69552c4a8db2023311cbd268fba8be42972
|
|
| MD5 |
3c93a85c06048f294ffcf16fdc4ae042
|
|
| BLAKE2b-256 |
1cef7ab7c959a4d969fee93bf6d7924e773ed3f7a63f760cae90e9f26031ba08
|
File details
Details for the file toolscope_obs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: toolscope_obs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
701a9bcc49d2150fb4fcd7e738b6bfdd37cfad8eddeae64bcf95a9ebaa725eeb
|
|
| MD5 |
791a324e8b0257b55ce0d890e3bf24f1
|
|
| BLAKE2b-256 |
9556a394861bf727344f4fc29b787a9ee1c0ab45eb0fd3e081e146b840467a27
|