Supplier event logger
components/event_logger/client.py emits supplier events to Payability’s internal
EventLogger service, so a supplier’s Entrust identity-verification lifecycle is visible in
the platform event stream that Growth & Retention, Compliance and analytics consume.
|
This is a different channel from EventBridge. EventBridge carries machine-to-machine process notifications between services; EventLogger records supplier-scoped, human-readable events against a supplier timeline. The Entrust flow writes to both, plus HubSpot. |
Contract
Built on the internal eventlogger SDK (EventLoggerClient.captureMessage), which posts to
<dsn>/capture-message.
Endpoint |
|
Instance |
|
Auth |
|
Target |
|
Message type |
|
send_entrust_status_event(…)
def send_entrust_status_event(
self,
supplier_key: str,
status: str,
workflow_run_id: str = None,
person_id: str = None,
verdict: str = None,
logger: logging.Logger = None
) -> bool
Sends "Entrust identity verification: {status}" with the correlating ids in extra:
extra key |
Value |
|---|---|
|
The lifecycle status — the same |
|
Always |
|
|
|
The Onfido run id, when known. |
|
The supplier owner, when known. |
Structured data goes in extra because the SDK’s context kwarg is not persisted by its
build_msg.
Lazy, guarded construction
The client is instantiated eagerly by the endpoint handler and the worker, but the underlying SDK client is built on first use and its outcome cached:
-
Missing
EVENT_LOGGER_URL,EVENT_LOGGER_INSTANCE_IDorEVENT_LOGGER_KEY→ a warning is logged once and emission becomes a permanent no-op for that process. Leaving the URL empty is therefore a supported way to disable emission in an environment. -
A construction failure (the SDK asserts on bad configuration) is logged, reported to Sentry, and cached as failed so it is not retried on every event.
Best effort by design
Like HubSpot, EventLogger is a downstream, non-authoritative sink.
Every send is wrapped: failures are logged, captured to Sentry, and returned as False. The
method never raises, so it can never fail Entrust session creation or the SWF aftermath task.
|
Because failures are swallowed, a missing supplier event is invisible in the underwriting data.
If the event stream looks incomplete, check Sentry for |
Callers
| Caller | Emits |
|---|---|
|
|
|
|
The worker injects it into TaskFactory as supplier_event_logger
(swf_app.py); execute_task.py builds one too, so the Entrust reprocess path can construct
the task.
Dependency
The eventlogger package is a private git dependency
(https://github.com/Payability/EventLoggerPySDK.git, see [tool.uv.sources] in
pyproject.toml), so installing requires git access — the same GIT_TOKEN as pyb-sdk.