Skip to main content

Official Python SDK for Brizz platform

Project description

Brizz SDK

Python Version License

Brizz observability SDK for AI applications.

Installation

pip install brizz
# or
uv add brizz
# or
poetry add brizz

Quick Start

from brizz import Brizz

# Initialize
Brizz.initialize(
    api_key='your-brizzai-api-key',
    app_name='my-app',
)

Important: Initialize Brizz before importing any libraries you want to instrument (e.g., OpenAI). If using dotenv, use from dotenv import load_dotenv; load_dotenv() before importing brizz.

PII Masking

Automatically protects sensitive data in traces:

# Option 1: Enable default masking (simple)
Brizz.initialize(
    api_key='your-api-key',
    masking=True,  # Enables all built-in PII patterns
)

# Option 2: Custom masking configuration
from brizz import Brizz, MaskingConfig, SpanMaskingConfig, AttributesMaskingRule

Brizz.initialize(
    api_key='your-api-key',
    masking=MaskingConfig(
        span_masking=SpanMaskingConfig(
            rules=[
                AttributesMaskingRule(
                    attribute_pattern=r'gen_ai\.(prompt|completion)',
                    mode='partial',  # 'partial' or 'full'
                    patterns=[r'sk-[a-zA-Z0-9]{32}'],  # Custom regex patterns
                ),
            ],
        ),
    ),
)

Built-in patterns: emails, phone numbers, SSNs, credit cards, API keys, crypto addresses, and more. Use masking=True for defaults or MaskingConfig for custom rules.

Session Tracking

Group related operations and traces under a session context. All telemetry within the wrapped function will include the session ID:

from brizz import with_session_id, awith_session_id


async def process_user_workflow(chat_id):
    # All traces, events, and spans within this function
    # will be tagged with session-123
    response = await awith_session_id(chat_id, openai.chat.completions.create,
        model='gpt-4',
        messages=[{'role': 'user', 'content': 'Hello'}],
    )

    return response


# For synchronous functions
def sync_workflow(chat_id: str, data: dict):
    # Process data with session context
    return with_session_id(chat_id, processed_data, data)

Event Examples

from brizz import emit_event

emit_event('user.signup', {'user_id': '123', 'plan': 'pro'})
emit_event('user.payment', {'amount': 99, 'currency': 'USD'})

Deployment Environment

Optionally specify the deployment environment for better filtering and organization:

Brizz.initialize(
    api_key='your-api-key',
    app_name='my-app',
    environment='production',  # Optional: 'dev', 'staging', 'production', etc.
)

Environment Variables

BRIZZ_API_KEY=your-api-key                  # Required
BRIZZ_BASE_URL=https://telemetry.brizz.dev  # Optional
BRIZZ_APP_NAME=my-app                       # Optional
BRIZZ_ENVIRONMENT=production                # Optional: deployment environment (dev, staging, production)

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

brizz-0.1.4.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

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

brizz-0.1.4-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

Details for the file brizz-0.1.4.tar.gz.

File metadata

  • Download URL: brizz-0.1.4.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for brizz-0.1.4.tar.gz
Algorithm Hash digest
SHA256 db4bac40a64bdcf111af1afe6fb40c5a5dda3cab37138cc4bed919a0c96008f5
MD5 fd2ba01eda5a754d48e886b4cc1c4327
BLAKE2b-256 4c892bf2447e969561bc583bd871702d8d35951d27664816b4437e349c08e5b9

See more details on using hashes here.

File details

Details for the file brizz-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: brizz-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for brizz-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7b8ac76683630e8a8cbea498be300697d8f9760ad9f8718ccc16b62a540a8f02
MD5 39fee778c5fce7a3c70a95bd225b5653
BLAKE2b-256 aefde645d7c853f70a14cf4a206f8b13e828a0e75bc037aff357b86227b9b625

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