Skip to main content

Internal Pub/Sub → BigQuery event logger for Bookable services (Python)

Project description

bookable-event-logger (Python)

Internal Python SDK for publishing Bookable events to Pub/Sub, following the shared Event Logging Contract.

Installation

From this repo root:

cd python
pip install -e .

Usage

from bookable_event_logger import init_event_logger, get_event_logger

# during startup
init_event_logger()  # uses env vars

# later in code
logger = get_event_logger()

logger.info(
    event_type="email.sync.batch.started",
    correlation_id="req-123",
    data={"accounts_total": 12, "sync_type": "cron"},
    actor={"kind": "internal_service", "source": "scheduler"},
)

logger.log(
    "warning",
    event_type="email.sync.batch.slow",
    correlation_id="req-123",
    data={"duration_ms": 120000},
)

Environment variables

  • LOG_GCP_PROJECT
  • LOG_TOPIC (default: events)
  • LOG_ENVIRONMENT
  • LOG_SERVICE_NAME
  • LOG_GCP_CREDENTIALS (path to service account JSON for local/dev)

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

bookable_event_logger-0.2.0.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.

bookable_event_logger-0.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file bookable_event_logger-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for bookable_event_logger-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a90b599c7b3a7eb438b80af1916d4e0cea024c6c7cbfd9cc36a0d6a513f6aec4
MD5 1e7dd391b86955b0eb39d0ea2882633a
BLAKE2b-256 f1503c1bee5d27d564bbaaf134c74d70286b3261a0f4297ae01c3030912e7ef9

See more details on using hashes here.

File details

Details for the file bookable_event_logger-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bookable_event_logger-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6dae60034592e41a45c7329aa3da667b1587f12e984cbdea5f91017fc049cbc
MD5 a94db383c93294aaa2ad9db53228ec07
BLAKE2b-256 152e3ad0c5eb219269f80a2f95487a967981ed8c32393eaac2efd81f1bb3f679

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