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.1.0.tar.gz (3.9 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.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bookable_event_logger-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 c81f06ddd4ac98fd934c2cdb89296d5016742c7056a5d6d7006965830cfd3e40
MD5 098770db2806bf1fe17fed958de95f20
BLAKE2b-256 f27566defa14fc885b94976f35e11ee631711e3cc2274874f33920cf09fd96a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bookable_event_logger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f511047cbe396f7f97c62e9b17f6aba8df541597cddea645e307769f9b8c0fc2
MD5 e58e985c9922ae6d7b7e31c7f4494e17
BLAKE2b-256 c5b0ba39e4c999e6e9b624713763e883a41e9a9702f314805b75cdc1896bc53e

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