← Graph

Domain Object Structured Logging

concept 4 connections

Callaghan's pattern for extending observability to business logic. Every domain object in the codebase responds to to_formatted_h returning a hash representation (e.g. an Invoice with id, customer, address). That hash is emitted as a structured log/event so the observability tool can search for all issues involving a specific customer or invoice id. No universal standard exists because domain objects are application-specific; Callaghan hopes OpenTelemetry will eventually address this domain in ~10 years, has explored Schema.org (too generic), and currently uses JSON Schema to validate analytics-event attributes in a central Segment-like pipeline.

category
pattern
about
Domain Object Structured Logging concept
Second half of the question addresses how to log business/domain logic.
concept Domain Object Structured Logging
related_to
Extension of structured logging to business domain objects via to_formatted_h.
concept Domain Object Structured Logging
related_to
Schema.org resource
Callaghan explored Schema.org as a shared vocabulary for domain-object attributes but found it too generic.
concept Domain Object Structured Logging
related_to
Current working solution for validating attributes of domain events in the Segment pipeline.

Provenance

Read by
3 extractions