Skip to main content
Version: 1.30.0 (latest)

dlt.common.metrics

aggregate_job_metrics

def aggregate_job_metrics(
job_metrics: Mapping[TJobKey, DataWriterMetrics],
key: Callable[[TJobKey], str]) -> Dict[str, DataWriterMetrics]

View source on GitHub

Sum writer metrics grouped by key, independent of input order.

StepMetrics Objects

class StepMetrics(TypedDict)

View source on GitHub

Metrics for particular package processed in particular pipeline step

started_at

Start of package processing

finished_at

End of package processing

TDataLocation Objects

class TDataLocation(TypedDict)

View source on GitHub

A logical data source or target: a dataset of tables, an API of endpoints, a bucket of files.

One entry per location. What a resource touched inside it is listed by the kind-specific subclass. Only facts that some locations genuinely lack are not required, so a row keeps the same shape whatever it describes.

kind

Location type: dataset, sql_database, filesystem, rest_api, or a custom value.

resource_name

Resource that read from or wrote to this location, authoritative when metrics are collected.

location

Non-secret scope of the location, e.g. postgresql://example.com:5432, s3://bucket.

The key is absent when the location has no public address, for example a reverse ETL sink.

version

Version of the location's contents as a whole.

TDatasetDataLocation Objects

class TDatasetDataLocation(TDataLocation)

View source on GitHub

A dlt dataset: one or more schemas, holding tables, in a destination.

schemas

Schemas grouping the tables, each carrying its own version hash.

tables

Tables touched, as plain names - dlt qualifies tables by dataset, not by schema.

destination_fingerprint

Identifies destinations whose location is not public, ie. motherduck. May be empty.

casefold

Name of the casefolding function the destination applies: upper, lower or str.

case_sensitive

Whether the destination generates case sensitive identifiers, as adjusted at runtime.

dataset_name

Logical dataset name as configured by the user, e.g. My_DataSet. Absent for sinks.

physical_dataset_name

Normalized name as it exists in the store, e.g. my_data_set. Absent for sinks.

data_location_version

def data_location_version(schemas: Sequence[TSchemaReference]) -> str

View source on GitHub

Hashes the version hashes of schemas into a single version of the location contents.

ExtractMetrics Objects

class ExtractMetrics(StepMetrics)

View source on GitHub

job_metrics

Metrics collected per job id during writing of job file

table_metrics

Job metrics aggregated by table

resource_metrics

Job metrics aggregated by resource

dag

A resource dag where elements of the list are graph edges

hints

Hints passed to the resources

inputs

Locations read from, one entry per (resource, location)

NormalizeMetrics Objects

class NormalizeMetrics(StepMetrics)

View source on GitHub

job_metrics

Metrics collected per job id during writing of job file

table_metrics

Job metrics aggregated by table

LoadMetrics Objects

class LoadMetrics(StepMetrics)

View source on GitHub

dataset_name

Physical dataset name, normalized as it exists in the destination

outputs

Locations written to, one entry per (resource, location)

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.