Skip to main content

Alertiqo SDK for Python error tracking

Project description

Alertiqo Python SDK

Error tracking SDK for Python applications.

Installation

pip install alertiqo

Usage

Basic Setup

from alertiqo import Alertiqo

alertiqo = Alertiqo(
    api_key="your-api-key",
    endpoint="https://alertiqo.hamizi.net",
    environment="production",
    release="1.0.0",
)

alertiqo.init()

Capture Exceptions

try:
    raise ValueError("Something went wrong")
except Exception as e:
    alertiqo.capture_exception(e)

Capture Messages

alertiqo.capture_message("User completed checkout", level="info")

Add Breadcrumbs

alertiqo.add_breadcrumb(
    message="User clicked button",
    category="user-action",
    level="info",
    data={"button_id": "submit-btn"}
)

Set User Context

alertiqo.set_user(
    user_id="12345",
    email="user@example.com",
    username="johndoe"
)

Set Tags

alertiqo.set_tag("page", "checkout")
alertiqo.set_tags({
    "feature": "payments",
    "version": "2.1.0"
})

Flask Integration

from flask import Flask
from alertiqo import Alertiqo, alertiqo_middleware

app = Flask(__name__)

alertiqo = Alertiqo(
    api_key="your-api-key",
    endpoint="https://alertiqo.hamizi.net",
)
alertiqo.init()

# Add middleware
app.wsgi_app = alertiqo_middleware(alertiqo)(app.wsgi_app)

Django Integration

# settings.py
ALERTIQO_API_KEY = "your-api-key"
ALERTIQO_ENDPOINT = "https://alertiqo.hamizi.net"

# In your app's apps.py or __init__.py
from alertiqo import Alertiqo

alertiqo = Alertiqo(
    api_key=settings.ALERTIQO_API_KEY,
    endpoint=settings.ALERTIQO_ENDPOINT,
)
alertiqo.init()

API

Alertiqo(config)

Creates a new Alertiqo instance.

Config Options:

  • api_key (required): Your API key
  • endpoint (required): Backend endpoint URL
  • environment: Environment name (default: PYTHON_ENV or 'production')
  • release: Release version
  • tags: Default tags for all errors
  • capture_unhandled: Auto-capture uncaught exceptions (default: True)
  • before_send: Callback to modify/filter errors before sending

Methods

  • init(): Initialize error handlers
  • capture_exception(error, additional_data=None): Capture an exception
  • capture_message(message, level="info"): Capture a message
  • add_breadcrumb(message, category, level, data): Add a breadcrumb
  • set_user(user_id, email, username): Set user context
  • set_tag(key, value): Set a single tag
  • set_tags(tags): Set multiple tags

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alertiqo-1.0.3.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alertiqo-1.0.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file alertiqo-1.0.3.tar.gz.

File metadata

  • Download URL: alertiqo-1.0.3.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for alertiqo-1.0.3.tar.gz
Algorithm Hash digest
SHA256 199628918ae5ed559be87fc23daa821152c415b3833aaf981d7c02feac737341
MD5 47dc10ff7ed40b66f0d5d6946cac7ef4
BLAKE2b-256 8203a8fa26068b66308c1783f4b0e4e5849e3c6d577ce055fbe91d5c4f8e2248

See more details on using hashes here.

File details

Details for the file alertiqo-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: alertiqo-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for alertiqo-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b2a852a0309bd7f046281a04761dcd79c49875ce063a9499ea344f516c921aaf
MD5 ee8a0b8af6aff502c8eb3c02abcd4665
BLAKE2b-256 e1834d449fc57b88a20d3b77626f29b65746f40f4082a6bcbd3e67d1c0f6407c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page