Argus
SDK Setup

Python SDK

Install and configure the Argus Python SDK.

Installation

pip install argus-sdk

Quick 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

OptionTypeDefaultDescription
api_keystrRequiredYour Argus API key
endpointstrhttps://api.tryargus.cloudArgus API endpoint
intervalint60Collection interval in seconds
collect_dockerboolTrueCollect Docker metrics
collect_processesboolTrueCollect process metrics

On this page