SDK Setup
Python SDK
Install and configure the Argus Python SDK.
Installation
pip install argus-sdkQuick Start
from argus import ArgusClient
client = ArgusClient(
api_key="your-api-key",
endpoint="https://api.tryargus.cloud"
)
# Start automatic metric collection
client.start()Sending Custom Metrics
client.ingest({
"host": "web-server-01",
"metrics": {
"cpu_percent": 42.5,
"memory_percent": 68.2,
"disk_percent": 55.0
},
"tags": {
"environment": "production",
"service": "api"
}
})Webhook Handler
The Python SDK includes a webhook handler for receiving events from Argus:
FastAPI
from argus.webhook import create_handler
handler = create_handler(
secret="your-webhook-secret",
tools={
"restart_service": restart_service_fn,
"scale_up": scale_up_fn,
}
)
# Mount in your FastAPI app
app.include_router(handler)Flask
from argus.webhook import create_flask_handler
blueprint = create_flask_handler(
secret="your-webhook-secret",
tools={
"restart_service": restart_service_fn,
}
)
app.register_blueprint(blueprint, url_prefix="/argus")Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
api_key | str | Required | Your Argus API key |
endpoint | str | https://api.tryargus.cloud | Argus API endpoint |
interval | int | 60 | Collection interval in seconds |
collect_docker | bool | True | Collect Docker metrics |
collect_processes | bool | True | Collect process metrics |