Skip to main content

models

Strongly-typed Pydantic models for Datadog log telemetry events.

Each class maps to one event value emitted via telemetry_logger. Pass an instance directly to telemetry_logger.info(); the DatadogLogsHandler serialises it automatically via model_dump_json(by_alias=True).

Classes

AlgorithmProgressEvent

class AlgorithmProgressEvent(**data: Any):

Emitted at algorithm lifecycle boundaries (run/epoch start and end).

Fired automatically by AlgorithmProgress for every algorithm via the BaseAlgorithmHook infrastructure — individual algorithm classes do not need any changes.

step is one of "run_start", "run_end", "epoch_start", or "epoch_end".

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static algorithm_name : str
  • static current_epoch : int | None
  • static datetime : str
  • static max_epochs : int | None
  • static model_config
  • static step : str
  • static step_info : str | None
  • static task_context : str

BatchProgressEvent

class BatchProgressEvent(**data: Any):

Emitted by the orchestrator at the start of each protocol batch.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static batch_number : int
  • static model_config
  • static protocol_name : str

DatasetConnectedEvent

class DatasetConnectedEvent(**data: Any):

Emitted once per datasource when a pod successfully connects it.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static connection_datetime : str
  • static dataset_name : str
  • static datasource_type : str
  • static model_config

EHRQueryCompleteEvent

class EHRQueryCompleteEvent(**data: Any):

Emitted after an EHR patient query batch completes.

Fires once per protocol batch in EHR-enabled algorithms. Provides visibility into the per-batch EHR query phase, which is otherwise the longest silent stretch during task execution.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static config_type : str
  • static model_config
  • static patients_queried : int
  • static records_found : int

EHRScreeningBatchEvent

class EHRScreeningBatchEvent(**data: Any):

Emitted after each EHR screening page is queried and eligibility-matched.

Fires at the end of trial eligibility matching, after all eligible patients have been identified and before the CSV is output.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static model_config
  • static page_eligible : int
  • static page_number : int
  • static page_size : int
  • static project_id : str | None
  • static task_id : str
  • static total_eligible : int

EHRSessionInitialisedEvent

class EHRSessionInitialisedEvent(**data: Any):

Emitted after a NextGen or FHIR R4 EHR session is set up.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static config_type : str
  • static model_config

EHRTokenRefreshedEvent

class EHRTokenRefreshedEvent(**data: Any):

Emitted after a FHIR client access token is refreshed.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static config_type : str
  • static model_config

FileMultiSeriesReducedEvent

class FileMultiSeriesReducedEvent(**data: Any):

Emitted when multiple series match filters and are reduced to one.

Provides context on the reduction so that future capabilities can be built to handle multi-series output (e.g. returning multiple rows per file).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static datasource_type : str
  • static file_name : str
  • static laterality : str
  • static model_config
  • static rows_after : int
  • static rows_before : int
  • static series_protocol : str

FileMultiSeriesSkippedEvent

class FileMultiSeriesSkippedEvent(**data: Any):

Emitted when a file is skipped due to unresolvable multi-series ambiguity.

Supplements the generic task_skip_file telemetry with structured context that will inform future multi-series handling capabilities.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static datasource_type : str
  • static file_name : str
  • static laterality_configured : str | None
  • static model_config
  • static series_count : int
  • static series_protocol_configured : str | None

FilteringCompleteEvent

class FilteringCompleteEvent(**data: Any):

Emitted after RecordFilterAlgorithm.setup_run() finishes selecting files.

Fires once per task, before the first batch begins. Provides visibility into how many files were considered and how many passed the filter criteria.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static files_selected : int
  • static model_config
  • static total_files : int

GroupingSummaryEvent

class GroupingSummaryEvent(**data: Any):

Aggregate Datadog event for grouping-aware batching behaviour.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static batch_size : int | None
  • static cached_files : int | None
  • static group_count : int | None
  • static include_non_new_group_files : bool | None
  • static maybe_final : bool | None
  • static model_config
  • static oversized_cohort_size : int | None
  • static selected_files : int | None
  • static step : str

MissingColumnEvent

class MissingColumnEvent(**data: Any):

Emitted when a required column is absent from a file (e.g. DICOM pixel data).

file_name is passed through PII redaction before logging because file names in medical imaging datasets may encode patient identifiers. column_name is a static code constant (e.g. "Pixel Data") and carries no PII.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static column_name : str
  • static file_name : str
  • static model_config

PatientEligibilityEvent

class PatientEligibilityEvent(**data: Any):

Emitted by the orchestrator after eligible patient counts are calculated.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static datasource : str
  • static datetime : str
  • static eligible_count : int
  • static model_config
  • static project_id : str

SchemaGenerationEndEvent

class SchemaGenerationEndEvent(**data: Any):

Emitted when the Prefect schema worker finishes generating a schema.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static dataset_id : str
  • static datetime : str
  • static model_config

SchemaGenerationStartEvent

class SchemaGenerationStartEvent(**data: Any):

Emitted when the Prefect schema worker begins generating a schema.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static dataset_id : str
  • static datetime : str
  • static model_config

SchemaInitiationSource

class SchemaInitiationSource(*args, **kwds):

Source that triggered schema generation.

Inherits from str so values serialise directly as JSON strings.

Variables

  • static PREFECT_SCHEMA_WORKER

SchemaUploadSuccessEvent

class SchemaUploadSuccessEvent(**data: Any):

Emitted after a full schema is successfully uploaded to the Hub.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static dataset_id : str
  • static datetime : str
  • static model_config
  • static number_of_records : int

TaskAcceptedByPodEvent

class TaskAcceptedByPodEvent(**data: Any):

Emitted by the modeller when a pod accepts a task request.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static app_version : str
  • static datetime : str
  • static model_config
  • static pod_identifier : str
  • static task_id : str

TaskAcceptedEvent

class TaskAcceptedEvent(**data: Any):

Emitted by the worker when it accepts and begins a task.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static app_version : str
  • static datasource_type : str
  • static datetime : str
  • static model_config
  • static modeller_username : str
  • static pod_name : str
  • static task_id : str

TaskCompleteEvent

class TaskCompleteEvent(**data: Any):

Emitted by the worker when a task finishes successfully.

Symmetric counterpart to TaskAcceptedEvent — together they bracket the full task execution window in Datadog logs.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static datetime : str
  • static model_config
  • static modeller_username : str
  • static pod_name : str
  • static task_id : str

TaskCompleteTimeoutEvent

class TaskCompleteTimeoutEvent(**data: Any):

Emitted when the worker times out waiting for TASK_COMPLETE from the modeller.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static datetime : str
  • static model_config
  • static modeller_username : str
  • static pod_name : str
  • static task_id : str

TaskErrorEvent

class TaskErrorEvent(**data: Any):

Emitted by the worker when an unhandled exception aborts a task.

stacktrace_frames contains only the frame strings from traceback.format_tb() — the exception message and .args are deliberately excluded to avoid leaking PII (patient names, IDs, etc. that may appear in exception messages).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static error_type : str
  • static model_config
  • static modeller_username : str
  • static pod_name : str
  • static stacktrace_frames : str
  • static task_id : str

TelemetryEventName

class TelemetryEventName(*args, **kwds):

Canonical names for all Datadog telemetry events.

Inherits from str so values serialise directly as JSON strings.

Variables

  • static ALGORITHM_PROGRESS
  • static BATCH_PROGRESS
  • static DATASET_CONNECTED
  • static EHR_QUERY_COMPLETE
  • static EHR_SCREENING_BATCH
  • static EHR_SESSION_INITIALISED
  • static EHR_TOKEN_REFRESHED
  • static FILE_MULTI_SERIES_REDUCED
  • static FILE_MULTI_SERIES_SKIPPED
  • static FILTERING_COMPLETE
  • static GROUPING_SUMMARY
  • static MISSING_COLUMN
  • static PATIENT_ELIGIBILITY
  • static SCHEMA_GENERATION_END
  • static SCHEMA_GENERATION_START
  • static SCHEMA_UPLOAD_SUCCESS
  • static TASK_ACCEPTED
  • static TASK_ACCEPTED_BY_POD
  • static TASK_COMPLETE
  • static TASK_COMPLETE_TIMEOUT
  • static TASK_ERROR
  • static TRIAL_FILTER_SUMMARY
  • static WORKER_STARTUP_PHASE

TrialFilterSummaryEvent

class TrialFilterSummaryEvent(**data: Any):

Aggregate Datadog event for trial filter outcomes within a batch.

rows_missing counts rows with missing inputs required by the filter. It is not mutually exclusive with rows_matched or rows_failed.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static filter_name : str
  • static matching_column_count : int | None
  • static missing_columns : list[str] | None
  • static model_config
  • static rows_failed : int
  • static rows_matched : int
  • static rows_missing : int
  • static step : str

WorkerStartupPhaseEvent

class WorkerStartupPhaseEvent(**data: Any):

Emitted after each phase of worker startup, with how long that phase took.

Together these bracket the window between the worker reporting "Configuring task" and its first exchange with the modeller — protocol deserialisation and model download, protocol pickling, spawning the child interpreter, child setup, and algorithm initialisation. That window is otherwise silent, and a message arriving from the modeller during it is only tolerated for handler_register_grace_period seconds, so the split between these phases is what decides whether a task starts or stalls.

process is "parent" (the pod) or "child" (the spawned worker).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static duration_seconds : float
  • static model_config
  • static phase : str
  • static pod_name : str | None
  • static process : str
  • static task_id : str