Skip to main content
Version: devel View Markdown

Telemetry

New to the SDK? Getting started shows how to connect and use it.

Telemetry​

One workspace's telemetry, read from the data plane.

Collections

NameTypeExampleDescription
telemetry.pipeline_runsPipelineRunstelemetry.pipeline_runs.list()The dlt pipeline runs telemetry recorded here.

Telemetry.status()​

status() -> TelemetryStatus

Return when a pipeline run in this workspace was last recorded or updated.

If that is older than the window you read, empty results may mean telemetry is behind rather than that nothing ran.

Returns: TelemetryStatus — The status; awaitable in async mode.

Raises

ExceptionWhen
DataplaneTokenRejectedThe data plane rejected the token the platform issued for it.
NotAuthorizedThe caller lacks the access this call needs; message says why.
ScopeMissingReached without a workspace in scope.

Telemetry.pipelines()​

pipelines(
*,
pipeline_name: str | None = None,
latest_status: PipelineRunStatus | None = None,
destination: str | None = None,
since: datetime | None = None,
until: datetime | None = None,
limit: int | None = None,
offset: int = 0,
) -> Iterable[PipelineActivity] | AsyncIterable[PipelineActivity]

Yield one row per pipeline that ran in the window.

The window holds the pipeline runs whose start falls in [since, until).

Arguments

NameTypeDescription
pipeline_namestr | NoneNarrow to one pipeline.
latest_statusPipelineRunStatus | NoneNarrow to pipelines whose most recent run ended this way. Only SUCCEEDED and FAILED are filterable.
destinationstr | NoneNarrow to pipelines most recently writing here.
sincedatetime | NoneStart of the window, zone-aware. Defaults to seven days before until.
untildatetime | NoneEnd of the window, zone-aware. Defaults to now.
limitint | NoneReturn at most this many. None walks to the end, or to row 10,100, past which the platform does not page.
offsetintSkip this many, server-side.

Returns: Iterable[PipelineActivity] | AsyncIterable[PipelineActivity] — An iterable of per-pipeline activity; async-iterable in async mode.

Raises

ExceptionWhen
BadRequestThe request was rejected as invalid; message, code and fields say why.
DataplaneTokenRejectedThe data plane rejected the token the platform issued for it.
NotAuthorizedThe caller lacks the access this call needs; message says why.
ScopeMissingReached without a workspace in scope.
ValueErrorA status the platform cannot filter on, a naive since or until, or a negative limit or offset.

Telemetry.datasets()​

datasets(
*,
dataset_name: str | None = None,
latest_status: PipelineRunStatus | None = None,
destination: str | None = None,
since: datetime | None = None,
until: datetime | None = None,
limit: int | None = None,
offset: int = 0,
) -> Iterable[DatasetActivity] | AsyncIterable[DatasetActivity]

Yield one row per dataset written to in the window.

The window holds the pipeline runs whose start falls in [since, until).

Arguments

NameTypeDescription
dataset_namestr | NoneNarrow to one dataset.
latest_statusPipelineRunStatus | NoneNarrow to datasets whose most recent run ended this way. Only SUCCEEDED and FAILED are filterable.
destinationstr | NoneNarrow to datasets most recently written here.
sincedatetime | NoneStart of the window, zone-aware. Defaults to seven days before until.
untildatetime | NoneEnd of the window, zone-aware. Defaults to now.
limitint | NoneReturn at most this many. None walks to the end, or to row 10,100, past which the platform does not page.
offsetintSkip this many, server-side.

Returns: Iterable[DatasetActivity] | AsyncIterable[DatasetActivity] — An iterable of per-dataset activity; async-iterable in async mode.

Raises

ExceptionWhen
BadRequestThe request was rejected as invalid; message, code and fields say why.
DataplaneTokenRejectedThe data plane rejected the token the platform issued for it.
NotAuthorizedThe caller lacks the access this call needs; message says why.
ScopeMissingReached without a workspace in scope.
ValueErrorA status the platform cannot filter on, a naive since or until, or a negative limit or offset.

PipelineRuns​

The dlt pipeline runs telemetry recorded for one workspace.

Every read covers a time window, which defaults to the last seven days. There is no count(); walk list().

PipelineRuns.get()​

get(*, id: str) -> PipelineRun

Return one pipeline run by id, in full.

Arguments

NameTypeDescription
idstrThe pipeline run's uuid, from PipelineRuns.list() or PipelineRunSummary.pipeline_run_id. A job run id will not do — they are different things.

Returns: PipelineRun — The pipeline run; awaitable in async mode.

Raises

ExceptionWhen
BadRequestThe request was rejected as invalid; message, code and fields say why.
DataplaneTokenRejectedThe data plane rejected the token the platform issued for it.
NotAuthorizedThe caller lacks the access this call needs; message says why.
NotFoundNo such pipeline run in this workspace.
ScopeMissingReached without a workspace in scope.

PipelineRuns.trace()​

trace(*, id: str) -> PipelineRunTrace

Read one pipeline run's dlt trace, without reading the run itself.

Arguments

NameTypeDescription
idstrThe pipeline run's uuid.

Returns: PipelineRunTrace — The trace; awaitable in async mode.

Raises

ExceptionWhen
BadRequestThe request was rejected as invalid; message, code and fields say why.
NotFoundNo such pipeline run, or it has no stored trace. One the platform never linked to a job run has none.
ScopeMissingReached without a workspace in scope.

PipelineRuns.list()​

list(
*,
job_run_id: str | None = None,
pipeline_name: str | None = None,
status: PipelineRunStatus | None = None,
dataset: str | None = None,
destination: str | None = None,
empty_only: bool | None = None,
since: datetime | None = None,
until: datetime | None = None,
limit: int | None = None,
offset: int = 0,
) -> Iterable[PipelineRun] | AsyncIterable[PipelineRun]

Yield pipeline runs in the window, newest first.

The window holds the pipeline runs whose start falls in [since, until).

Arguments

NameTypeDescription
job_run_idstr | NoneNarrow to the pipelines one job run executed.
pipeline_namestr | NoneNarrow to one pipeline.
statusPipelineRunStatus | NoneNarrow to one outcome. Only SUCCEEDED and FAILED are filterable.
datasetstr | NoneNarrow to runs that wrote to one dataset.
destinationstr | NoneNarrow to runs that wrote to one destination.
empty_onlybool | NoneTrue for succeeded runs that extracted nothing to load. False for every other run, failed ones included. None for both.
sincedatetime | NoneStart of the window, zone-aware. Defaults to seven days before until.
untildatetime | NoneEnd of the window, zone-aware. Defaults to now.
limitint | NoneReturn at most this many. None walks to the end, or to row 10,100, past which the platform does not page.
offsetintSkip this many, server-side.

Returns: Iterable[PipelineRun] | AsyncIterable[PipelineRun] — An iterable of pipeline runs; async-iterable in async mode.

Raises

ExceptionWhen
BadRequestThe request was rejected as invalid; message, code and fields say why.
DataplaneTokenRejectedThe data plane rejected the token the platform issued for it.
NotAuthorizedThe caller lacks the access this call needs; message says why.
ScopeMissingReached without a workspace in scope.
ValueErrorA status the platform cannot filter on, a naive since or until, or a negative limit or offset.

PipelineRun​

One dlt pipeline run, as telemetry recorded it.

A job run executes whatever pipelines its job calls, so one run can produce several of these. Addressed by its own uuid, which is not a job run id. Get one from PipelineRuns.list() or PipelineRunSummary.pipeline_run_id.

Attributes

NameTypeDescription
idstrID of the pipeline run; not a job run ID.
pipeline_namestrName of the dlt pipeline.
statusPipelineRunStatusfailed when any step raised, otherwise succeeded.
dataset_namestr | NoneDataset the run loaded into, from its load step; None when the run did not reach load.
destination_namestr | NoneDestination the run loaded to, from its load step; None when the run did not reach load.
started_atdatetime | NoneStart of the run from the dlt trace, UTC.
finished_atdatetime | NoneEnd of the run from the dlt trace, UTC.
duration_msint | Nonefinished_at − started_at in milliseconds.
total_rows_extractedintRows written by the extract step.
total_rows_loadedintRows that dlt prepared for loading in this run (normalized rows). dlt does not report per-row load counts, so this is set even when loading failed.
total_bytes_loadedintBytes that dlt prepared for loading in this run (size of the normalized files). dlt does not report per-row load counts, so this is set even when loading failed.
error_stepstr | NoneFirst step that raised, for example extract, normalize or load.
error_messagestr | NoneException message of that step.
has_schema_migrationbool | NoneTrue when the load step created or changed user tables (_dlt_* tables are ignored).
dlt_versionstr | Nonedlt version that ran the pipeline, from the trace's execution context.
tablestuple[PipelineTable, ...]The tables it wrote, with rows per table. Empty on a listed row — only PipelineRuns.get() reads them.
load_packagestuple[LoadPackage, ...]The packages it produced. Empty on a listed row, for the same reason.
failedboolWhether this pipeline run ended on an error.

PipelineRun.trace()​

trace() -> PipelineRunTrace

Read the dlt trace this pipeline run produced.

Returns: PipelineRunTrace — The trace; awaitable in async mode.

Raises

ExceptionWhen
NotFoundNo trace was stored. A pipeline run the platform never linked to a job run has none.
ScopeMissingReached without a workspace in scope.

DatasetActivity​

What landed in one dataset over a window.

Attributes

NameTypeDescription
dataset_namestrName of the dataset, across destinations.
distinct_pipeline_countintNumber of distinct pipelines that ran into this dataset in the range.
total_pipeline_run_countintPipeline runs in the range.
succeeded_pipeline_run_countintPipeline runs in the range with status succeeded.
failed_pipeline_run_countintHow many did not. Derived, as for a pipeline.
success_ratiofloatSucceeded ÷ total, from 0 to 1.
total_rows_loadedintSum of normalized rows over succeeded runs in the time range.
total_bytes_loadedintSum of normalized bytes (size of the normalized files) over succeeded runs in the time range.
schema_migration_countintRuns in the range with has_schema_migration.
average_duration_msint | NoneMean duration_ms in the range, rounded; None when no run has a duration.
latest_statusstr | NoneStatus of the most recent pipeline run in the time range.
latest_pipeline_run_atdatetime | NoneWhen the most recent pipeline run in the time range started.
latest_pipeline_namestr | NonePipeline of the most recent pipeline run in the time range.
latest_destination_namestr | NoneDestination of the most recent pipeline run in the time range.

LoadPackage​

One load package a pipeline run produced.

A run loads in packages, so a partial failure shows up here as some packages complete and others not.

Attributes

NameTypeDescription
load_idstrdlt load id of the package.
schema_namestr | Nonedlt schema the package was created with.
load_statusstr | NoneState dlt reported for the package; loaded means fully loaded.
job_countintNumber of jobs in the package.
failed_job_countintJobs that failed.
total_rows_loadedintRows that dlt prepared for loading in this package (normalized rows, or extracted rows when normalize reported none). dlt does not report per-row load counts, so this is set even when loading failed.
total_bytes_loadedintBytes that dlt prepared for loading in this package (size of the normalized files, or of the extracted files when normalize reported none). dlt does not report per-row load counts, so this is set even when loading failed.
is_pendingboolWhether it is still waiting to be loaded.
has_schema_migrationboolWhether loading it changed the destination's schema.
completed_atdatetime | NoneWhen dlt completed the package, UTC; None while not completed.

PipelineActivity​

How one pipeline has been doing over a window.

Attributes

NameTypeDescription
pipeline_namestrName of the dlt pipeline.
total_pipeline_run_countintPipeline runs in the range.
succeeded_pipeline_run_countintPipeline runs in the range with status succeeded.
failed_pipeline_run_countintHow many did not. Derived, since the platform reports the successes and the total.
success_ratiofloatSucceeded ÷ total, from 0 to 1.
total_rows_extractedintSum of extracted rows over all runs in the range.
total_rows_loadedintSum of normalized rows over succeeded runs in the time range.
total_bytes_loadedintSum of normalized bytes (size of the normalized files) over succeeded runs in the time range.
average_duration_msint | NoneMean duration_ms in the range, rounded; None when no run has a duration.
total_duration_msintSum of duration_ms over the runs in the range.
latest_statusstr | NoneStatus of the most recent pipeline run in the time range.
latest_pipeline_run_atdatetime | NoneWhen the most recent pipeline run in the time range started.
latest_dataset_namestr | NoneDataset of the most recent pipeline run in the time range.
latest_destination_namestr | NoneDestination of the most recent pipeline run in the time range.
latest_source_namestuple[str, ...]Sources read by the most recent pipeline run in the time range.

PipelineRunTrace​

The dlt trace one pipeline run produced.

Attributes

NameTypeDescription
pipeline_run_idstrThe pipeline run it belongs to.
traceMapping[str, Any]The trace exactly as dlt wrote it — per-step timings, the resolved config, and the exception when a step raised. Left opaque: the platform stores and returns it verbatim and declares no shape for it, as with the definitions Jobs.deploy_manifest accepts.

PipelineTable​

One table a pipeline run wrote, and what reached it.

Attributes

NameTypeDescription
table_namestrName of the table.
schema_namestrThe schema it sits in.
rows_extractedint | NoneRows the extract step wrote for this table; None when not extracted.
rows_loadedint | NoneRows that dlt prepared for loading for this table (normalized rows). dlt does not report per-row load counts, so this is set even when loading failed.
bytes_loadedint | NoneBytes that dlt prepared for loading for this table (size of the normalized files). dlt does not report per-row load counts, so this is set even when loading failed.
load_job_statestr | Nonecompleted or failed; None when the table was not loaded.
write_dispositionstr | NoneFrom the resource hints; None when the extract step reported none.

TelemetryStatus​

How current the platform's telemetry is for one workspace.

Attributes

NameTypeDescription
updated_atdatetime | NoneWhen a pipeline run in the workspace was last recorded or updated; None when there are none. If it is older than the time range you read, empty results may mean telemetry is behind rather than that nothing ran.

PipelineRunStatus​

What became of one dlt pipeline run.

The platform records a run once dlt reports it finished, so only SUCCEEDED and FAILED occur; UNKNOWN covers values added later.

Members

MemberValueDescription
SUCCEEDED'succeeded'No dlt step raised an exception; some load jobs may still have failed.
FAILED'failed'Stopped on an error. error_step says where.
UNKNOWN'unknown'A status this SDK version does not know.

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.