Skip to main content

vibex.sh Python SDK - Fail-safe logging handler for vibex.sh

Project description

Vibex Python SDK

Fail-safe logging handler for sending logs to vibex.sh.

Features

  • Fail-Safe: Silently disables if configuration is missing or invalid
  • Kill Switch: Permanently disables on 401/403 errors (expired/invalid tokens)
  • Easy Integration: Drop-in Python logging handler
  • Zero Dependencies (except requests)

Installation

pip install vibex-sh

Quick Start

  1. Set environment variables:
export VIBEX_TOKEN=vb_live_your_token_here
export VIBEX_SESSION_ID=my-production-app
  1. Use in your Python application:
import logging
from vibex_sh import VibexHandler

# Get your logger
logger = logging.getLogger('my_app')

# Add Vibex handler
vibex_handler = VibexHandler()
logger.addHandler(vibex_handler)

# Use normally
logger.info('Application started')
logger.warning('High memory usage', extra={'memory': 85})
logger.error('Failed to connect', exc_info=True)

Configuration

The SDK reads configuration from environment variables:

  • VIBEX_TOKEN (required): Your Vibex API token
  • VIBEX_SESSION_ID (required): Your session ID
  • VIBEX_API_URL (optional): API endpoint (default: https://vibex.sh/api/v1/ingest)

Fail-Safe Behavior

The SDK is designed to be fail-safe:

  1. Missing Config: If VIBEX_TOKEN or VIBEX_SESSION_ID is missing, the handler silently disables itself
  2. Invalid Token: On 401/403 responses, the handler permanently disables for the process lifetime
  3. Network Errors: All network errors are silently handled - your application continues normally
  4. Rate Limits: On 429 (rate limit), logs are dropped but the handler remains enabled

Advanced Usage

Direct Client Usage

from vibex_sh import VibexClient, VibexConfig

config = VibexConfig()
client = VibexClient(config)

# Send custom log
client.send_log('json', {'cpu': 45, 'memory': 78})

Check if Enabled

handler = VibexHandler()
if handler.is_enabled():
    logger.info('Vibex is active')
else:
    logger.info('Vibex is disabled (missing config or expired token)')

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

vibex_sh-0.1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

vibex_sh-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file vibex_sh-0.1.1.tar.gz.

File metadata

  • Download URL: vibex_sh-0.1.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for vibex_sh-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78ca1495b06f78665217a99d98ea8d9f9f0f32bb4fde99710541d87e33fda6b5
MD5 28b76c434a6f7f6bfedda9cae8b0883e
BLAKE2b-256 19cefa5c53c58b64eccebba4ecac090e1b3549edc2b689f99a948ec6f5ba717f

See more details on using hashes here.

File details

Details for the file vibex_sh-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vibex_sh-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for vibex_sh-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c453b5396fca08dd65f223aba8087faa73c197dafa29570c3074f5397c93e9a6
MD5 aeff4c340d1f9f42f10674ce644f24d6
BLAKE2b-256 e9a224781f1148ac102bf93b6c3e96bacbaed34d1a1c5f72d10a2fe779c5eed8

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