Skip to main content
Version: devel View Markdown

Telemetry

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

Telemetry​

The telemetry of one workspace, read from the data plane.

Collections

NameTypeExampleDescription
telemetry.pipeline_runsPipelineRunstelemetry.pipeline_runs.list()The dlt pipeline runs that telemetry recorded in this workspace.

Telemetry.status()​

status() -> TelemetryStatus

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

If that time is older than the window of a read, empty results can mean that telemetry is behind, not that nothing ran.

Returns: TelemetryStatus — The status. Async mode returns an awaitable.

Raises

ExceptionWhen
DataplaneTokenRejectedThe data plane rejected the token that the runtime issued for it.
NotAuthorizedThe caller lacks the access that this call needs. message says why.
ScopeMissingNo 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 | NoneOnly this pipeline.
latest_statusPipelineRunStatus | NoneOnly pipelines whose latest pipeline run ended with this status. Only SUCCEEDED and FAILED are filterable.
destinationstr | NoneOnly pipelines whose latest pipeline run wrote to this destination.
sincedatetime | NoneStart of the window, zone-aware. Defaults to seven days before until.
untildatetime | NoneEnd of the window, zone-aware. Defaults to now.
limitint | NoneThe most items to return. None returns every item up to item 10,100, where the runtime stops paging.
offsetintThe number of items that the runtime skips first.

Returns: Iterable[PipelineActivity] | AsyncIterable[PipelineActivity] — An iterable of per-pipeline activity. Async mode returns an async iterable.

Raises

ExceptionWhen
BadRequestThe runtime rejected the request as invalid. message, code and fields say why.
DataplaneTokenRejectedThe data plane rejected the token that the runtime issued for it.
NotAuthorizedThe caller lacks the access that this call needs. message says why.
ScopeMissingNo workspace in scope.
ValueErrorA status that the runtime 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 that a pipeline run wrote to in the window.

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

Arguments

NameTypeDescription
dataset_namestr | NoneOnly this dataset.
latest_statusPipelineRunStatus | NoneOnly datasets whose latest pipeline run ended with this status. Only SUCCEEDED and FAILED are filterable.
destinationstr | NoneOnly datasets whose latest pipeline run wrote to this destination.
sincedatetime | NoneStart of the window, zone-aware. Defaults to seven days before until.
untildatetime | NoneEnd of the window, zone-aware. Defaults to now.
limitint | NoneThe most items to return. None returns every item up to item 10,100, where the runtime stops paging.
offsetintThe number of items that the runtime skips first.

Returns: Iterable[DatasetActivity] | AsyncIterable[DatasetActivity] — An iterable of per-dataset activity. Async mode returns an async iterable.

Raises

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

PipelineRuns​

The dlt pipeline runs that telemetry recorded for one workspace.

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

PipelineRuns.get()​

get(*, id: str) -> PipelineRun

Return one pipeline run by ID, in full.

Arguments

NameTypeDescription
idstrThe UUID of the pipeline run, from PipelineRuns.list() or PipelineRunSummary.pipeline_run_id. A job run ID does not work here, because it is a different ID.

Returns: PipelineRun — The pipeline run. Async mode returns an awaitable.

Raises

ExceptionWhen
BadRequestThe runtime rejected the request as invalid. message, code and fields say why.
DataplaneTokenRejectedThe data plane rejected the token that the runtime issued for it.
NotAuthorizedThe caller lacks the access that this call needs. message says why.
NotFoundThe pipeline run does not exist in this workspace.
ScopeMissingNo workspace in scope.

PipelineRuns.trace()​

trace(*, id: str) -> PipelineRunTrace

Read the dlt trace of one pipeline run, without reading the pipeline run.

Arguments

NameTypeDescription
idstrThe UUID of the pipeline run.

Returns: PipelineRunTrace — The trace. Async mode returns an awaitable.

Raises

ExceptionWhen
BadRequestThe runtime rejected the request as invalid. message, code and fields say why.
NotFoundThe pipeline run does not exist or has no stored trace. A pipeline run that the runtime never linked to a job run has none.
ScopeMissingNo 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 | NoneOnly the pipeline runs of this job run.
pipeline_namestr | NoneOnly this pipeline.
statusPipelineRunStatus | NoneOnly pipeline runs with this status. Only SUCCEEDED and FAILED are filterable.
datasetstr | NoneOnly pipeline runs that wrote to this dataset.
destinationstr | NoneOnly pipeline runs that wrote to this destination.
empty_onlybool | NoneTrue for succeeded pipeline runs that extracted nothing to load. False for every other pipeline 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 | NoneThe most items to return. None returns every item up to item 10,100, where the runtime stops paging.
offsetintThe number of items that the runtime skips first.

Returns: Iterable[PipelineRun] | AsyncIterable[PipelineRun] — An iterable of pipeline runs. Async mode returns an async iterable.

Raises

ExceptionWhen
BadRequestThe runtime rejected the request as invalid. message, code and fields say why.
DataplaneTokenRejectedThe data plane rejected the token that the runtime issued for it.
NotAuthorizedThe caller lacks the access that this call needs. message says why.
ScopeMissingNo workspace in scope.
ValueErrorA status that the runtime 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 runs every pipeline that its job calls, so one job run can produce several of these. A pipeline run has its own UUID, which is not a job run ID. PipelineRuns.list() and PipelineRunSummary.pipeline_run_id give one.

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 that this pipeline run produced.

Returns: PipelineRunTrace — The trace. Async mode returns an awaitable.

Raises

ExceptionWhen
NotFoundThe runtime stored no trace. A pipeline run that the runtime never linked to a job run has none.
ScopeMissingNo 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 succeed. The SDK derives it, 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 that a pipeline run produced.

A pipeline run loads in packages, so a partial failure appears 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 its load changed the schema of the destination.
completed_atdatetime | NoneWhen dlt completed the package, UTC; None while not completed.

PipelineActivity​

The activity of one pipeline 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 succeed. The SDK derives it, because the runtime 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 that 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 of a failed step. The runtime stores it verbatim and declares no shape for it, so the SDK leaves it opaque.

PipelineTable​

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

Attributes

NameTypeDescription
table_namestrName of the table.
schema_namestrThe schema of the table.
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), once its load job completed. dlt does not report per-row load counts; None when the load job failed or never ran.
bytes_loadedint | NoneBytes that dlt prepared for loading for this table (size of the normalized files), once its load job completed. None when the load job failed or never ran.
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 telemetry of the runtime 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 runtime records a pipeline run after dlt reports that it finished, so only SUCCEEDED and FAILED occur. UNKNOWN covers values added later.

Members

MemberValueDescription
SUCCEEDED'succeeded'No dlt step raised an exception. A load job can still fail with this status.
FAILED'failed'Stopped on an error. error_step says where.
UNKNOWN'unknown'A status that 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.