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.
| Name | Type | Example | Description |
|---|---|---|---|
telemetry.pipeline_runs | PipelineRuns | telemetry.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
| Exception | When |
|---|---|
DataplaneTokenRejected | The data plane rejected the token that the runtime issued for it. |
NotAuthorized | The caller lacks the access that this call needs. message says why. |
ScopeMissing | No 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
| Name | Type | Description |
|---|---|---|
pipeline_name | str | None | Only this pipeline. |
latest_status | PipelineRunStatus | None | Only pipelines whose latest pipeline run ended with this status. Only SUCCEEDED and FAILED are filterable. |
destination | str | None | Only pipelines whose latest pipeline run wrote to this destination. |
since | datetime | None | Start of the window, zone-aware. Defaults to seven days before until. |
until | datetime | None | End of the window, zone-aware. Defaults to now. |
limit | int | None | The most items to return. None returns every item up to item 10,100, where the runtime stops paging. |
offset | int | The 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
| Exception | When |
|---|---|
BadRequest | The runtime rejected the request as invalid. message, code and fields say why. |
DataplaneTokenRejected | The data plane rejected the token that the runtime issued for it. |
NotAuthorized | The caller lacks the access that this call needs. message says why. |
ScopeMissing | No workspace in scope. |
ValueError | A 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
| Name | Type | Description |
|---|---|---|
dataset_name | str | None | Only this dataset. |
latest_status | PipelineRunStatus | None | Only datasets whose latest pipeline run ended with this status. Only SUCCEEDED and FAILED are filterable. |
destination | str | None | Only datasets whose latest pipeline run wrote to this destination. |
since | datetime | None | Start of the window, zone-aware. Defaults to seven days before until. |
until | datetime | None | End of the window, zone-aware. Defaults to now. |
limit | int | None | The most items to return. None returns every item up to item 10,100, where the runtime stops paging. |
offset | int | The 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
| Exception | When |
|---|---|
BadRequest | The runtime rejected the request as invalid. message, code and fields say why. |
DataplaneTokenRejected | The data plane rejected the token that the runtime issued for it. |
NotAuthorized | The caller lacks the access that this call needs. message says why. |
ScopeMissing | No workspace in scope. |
ValueError | A 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
| Name | Type | Description |
|---|---|---|
id | str | The 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
| Exception | When |
|---|---|
BadRequest | The runtime rejected the request as invalid. message, code and fields say why. |
DataplaneTokenRejected | The data plane rejected the token that the runtime issued for it. |
NotAuthorized | The caller lacks the access that this call needs. message says why. |
NotFound | The pipeline run does not exist in this workspace. |
ScopeMissing | No workspace in scope. |
PipelineRuns.trace()
trace(*, id: str) -> PipelineRunTrace
Read the dlt trace of one pipeline run, without reading the pipeline run.
Arguments
| Name | Type | Description |
|---|---|---|
id | str | The UUID of the pipeline run. |
Returns: PipelineRunTrace — The trace. Async mode returns an awaitable.
Raises
| Exception | When |
|---|---|
BadRequest | The runtime rejected the request as invalid. message, code and fields say why. |
NotFound | The pipeline run does not exist or has no stored trace. A pipeline run that the runtime never linked to a job run has none. |
ScopeMissing | No 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
| Name | Type | Description |
|---|---|---|
job_run_id | str | None | Only the pipeline runs of this job run. |
pipeline_name | str | None | Only this pipeline. |
status | PipelineRunStatus | None | Only pipeline runs with this status. Only SUCCEEDED and FAILED are filterable. |
dataset | str | None | Only pipeline runs that wrote to this dataset. |
destination | str | None | Only pipeline runs that wrote to this destination. |
empty_only | bool | None | True for succeeded pipeline runs that extracted nothing to load. False for every other pipeline run, failed ones included. None for both. |
since | datetime | None | Start of the window, zone-aware. Defaults to seven days before until. |
until | datetime | None | End of the window, zone-aware. Defaults to now. |
limit | int | None | The most items to return. None returns every item up to item 10,100, where the runtime stops paging. |
offset | int | The 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
| Exception | When |
|---|---|
BadRequest | The runtime rejected the request as invalid. message, code and fields say why. |
DataplaneTokenRejected | The data plane rejected the token that the runtime issued for it. |
NotAuthorized | The caller lacks the access that this call needs. message says why. |
ScopeMissing | No workspace in scope. |
ValueError | A 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
| Name | Type | Description |
|---|---|---|
id | str | ID of the pipeline run; not a job run ID. |
pipeline_name | str | Name of the dlt pipeline. |
status | PipelineRunStatus | failed when any step raised, otherwise succeeded. |
dataset_name | str | None | Dataset the run loaded into, from its load step; None when the run did not reach load. |
destination_name | str | None | Destination the run loaded to, from its load step; None when the run did not reach load. |
started_at | datetime | None | Start of the run from the dlt trace, UTC. |
finished_at | datetime | None | End of the run from the dlt trace, UTC. |
duration_ms | int | None | finished_at − started_at in milliseconds. |
total_rows_extracted | int | Rows written by the extract step. |
total_rows_loaded | int | Rows 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_loaded | int | Bytes 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_step | str | None | First step that raised, for example extract, normalize or load. |
error_message | str | None | Exception message of that step. |
has_schema_migration | bool | None | True when the load step created or changed user tables (_dlt_* tables are ignored). |
dlt_version | str | None | dlt version that ran the pipeline, from the trace's execution context. |
tables | tuple[PipelineTable, ...] | The tables it wrote, with rows per table. Empty on a listed row — only PipelineRuns.get() reads them. |
load_packages | tuple[LoadPackage, ...] | The packages it produced. Empty on a listed row, for the same reason. |
failed | bool | Whether 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
| Exception | When |
|---|---|
NotFound | The runtime stored no trace. A pipeline run that the runtime never linked to a job run has none. |
ScopeMissing | No workspace in scope. |
DatasetActivity
What landed in one dataset over a window.
Attributes
| Name | Type | Description |
|---|---|---|
dataset_name | str | Name of the dataset, across destinations. |
distinct_pipeline_count | int | Number of distinct pipelines that ran into this dataset in the range. |
total_pipeline_run_count | int | Pipeline runs in the range. |
succeeded_pipeline_run_count | int | Pipeline runs in the range with status succeeded. |
failed_pipeline_run_count | int | How many did not succeed. The SDK derives it, as for a pipeline. |
success_ratio | float | Succeeded ÷ total, from 0 to 1. |
total_rows_loaded | int | Sum of normalized rows over succeeded runs in the time range. |
total_bytes_loaded | int | Sum of normalized bytes (size of the normalized files) over succeeded runs in the time range. |
schema_migration_count | int | Runs in the range with has_schema_migration. |
average_duration_ms | int | None | Mean duration_ms in the range, rounded; None when no run has a duration. |
latest_status | str | None | Status of the most recent pipeline run in the time range. |
latest_pipeline_run_at | datetime | None | When the most recent pipeline run in the time range started. |
latest_pipeline_name | str | None | Pipeline of the most recent pipeline run in the time range. |
latest_destination_name | str | None | Destination 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
| Name | Type | Description |
|---|---|---|
load_id | str | dlt load id of the package. |
schema_name | str | None | dlt schema the package was created with. |
load_status | str | None | State dlt reported for the package; loaded means fully loaded. |
job_count | int | Number of jobs in the package. |
failed_job_count | int | Jobs that failed. |
total_rows_loaded | int | Rows 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_loaded | int | Bytes 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_pending | bool | Whether it is still waiting to be loaded. |
has_schema_migration | bool | Whether its load changed the schema of the destination. |
completed_at | datetime | None | When dlt completed the package, UTC; None while not completed. |
PipelineActivity
The activity of one pipeline over a window.
Attributes
| Name | Type | Description |
|---|---|---|
pipeline_name | str | Name of the dlt pipeline. |
total_pipeline_run_count | int | Pipeline runs in the range. |
succeeded_pipeline_run_count | int | Pipeline runs in the range with status succeeded. |
failed_pipeline_run_count | int | How many did not succeed. The SDK derives it, because the runtime reports the successes and the total. |
success_ratio | float | Succeeded ÷ total, from 0 to 1. |
total_rows_extracted | int | Sum of extracted rows over all runs in the range. |
total_rows_loaded | int | Sum of normalized rows over succeeded runs in the time range. |
total_bytes_loaded | int | Sum of normalized bytes (size of the normalized files) over succeeded runs in the time range. |
average_duration_ms | int | None | Mean duration_ms in the range, rounded; None when no run has a duration. |
total_duration_ms | int | Sum of duration_ms over the runs in the range. |
latest_status | str | None | Status of the most recent pipeline run in the time range. |
latest_pipeline_run_at | datetime | None | When the most recent pipeline run in the time range started. |
latest_dataset_name | str | None | Dataset of the most recent pipeline run in the time range. |
latest_destination_name | str | None | Destination of the most recent pipeline run in the time range. |
latest_source_names | tuple[str, ...] | Sources read by the most recent pipeline run in the time range. |
PipelineRunTrace
The dlt trace that one pipeline run produced.
Attributes
| Name | Type | Description |
|---|---|---|
pipeline_run_id | str | The pipeline run it belongs to. |
trace | Mapping[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
| Name | Type | Description |
|---|---|---|
table_name | str | Name of the table. |
schema_name | str | The schema of the table. |
rows_extracted | int | None | Rows the extract step wrote for this table; None when not extracted. |
rows_loaded | int | None | Rows 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_loaded | int | None | Bytes 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_state | str | None | completed or failed; None when the table was not loaded. |
write_disposition | str | None | From the resource hints; None when the extract step reported none. |
TelemetryStatus
How current the telemetry of the runtime is for one workspace.
Attributes
| Name | Type | Description |
|---|---|---|
updated_at | datetime | None | When 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
| Member | Value | Description |
|---|---|---|
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. |