nat.plugins.data_flywheel.observability.processor.dfw_record_processor#

Attributes#

Classes#

DFWToDictProcessor

Processor that converts a Data Flywheel record to a dictionary.

SpanToDFWRecordProcessor

Processor that converts a Span to a Data Flywheel record.

Module Contents#

logger#
DFWRecordT#
class DFWToDictProcessor#

Bases: nat.observability.processor.processor.Processor[DFWRecordT, dict]

Processor that converts a Data Flywheel record to a dictionary.

Serializes Pydantic DFW record models to dictionaries using model_dump_json() for consistent field aliasing and proper JSON serialization.

async process(item: DFWRecordT | None) dict#

Convert a DFW record to a dictionary.

Args:

item (DFWRecordT | None): The DFW record to convert.

Returns:

dict: The converted dictionary.

class SpanToDFWRecordProcessor(client_id: str)#

Bases: nat.observability.processor.processor.Processor[nat.data_models.span.Span, DFWRecordT | None], nat.observability.mixin.type_introspection_mixin.TypeIntrospectionMixin

Processor that converts a Span to a Data Flywheel record.

Extracts trace data from spans and uses the trace adapter registry to convert it to the target DFW record format.

_client_id#
async process(item: nat.data_models.span.Span) DFWRecordT | None#

Convert a Span to a DFW record.

Args:

item (Span): The Span to convert.

Returns:

DFWRecordT | None: The converted DFW record.