---
title: Telemetry
description: Telemetry in the dltHub Runtime Python SDK (dlthub_sdk)
keywords: [dlthub, runtime, python sdk, dlthub_sdk, api]
---
# Telemetry

<!-- generated from dlthub-client 0.33.1, do not edit -->

New to the SDK? [Getting started](getting-started.md) shows how to connect and use it.

## `Telemetry` {#telemetry}

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

**[Collections](getting-started.md#collections-and-attributes)**

| Name | Type | Example | Description |
| --- | --- | --- | --- |
| `telemetry.pipeline_runs` | <code><a href="#pipelineruns">PipelineRuns</a></code> | `telemetry.pipeline_runs.list()` | The dlt pipeline runs that telemetry recorded in this workspace. |

### `Telemetry.status()` {#telemetry-status}

```python
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:** <code><a href="#telemetrystatus">TelemetryStatus</a></code> — The status. Async mode returns an awaitable.

**Raises**

| Exception | When |
| --- | --- |
| [`DataplaneTokenRejected`](errors.md#dataplanetokenrejected) | The data plane rejected the token that the runtime issued for it. |
| [`NotAuthorized`](errors.md#notauthorized) | The caller lacks the access that this call needs. `message` says why. |
| [`ScopeMissing`](errors.md#scopemissing) | No workspace in scope. |

### `Telemetry.pipelines()` {#telemetry-pipelines}

```python
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` | <code>str &#124; None</code> | Only this pipeline. |
| `latest_status` | <code><a href="#pipelinerunstatus">PipelineRunStatus</a> &#124; None</code> | Only pipelines whose latest pipeline run ended with this status. Only `SUCCEEDED` and `FAILED` are filterable. |
| `destination` | <code>str &#124; None</code> | Only pipelines whose latest pipeline run wrote to this destination. |
| `since` | <code>datetime &#124; None</code> | Start of the window, zone-aware. Defaults to seven days before `until`. |
| `until` | <code>datetime &#124; None</code> | End of the window, zone-aware. Defaults to now. |
| `limit` | <code>int &#124; None</code> | The most items to return. `None` returns every item up to item 10,100, where the runtime stops paging. |
| `offset` | <code>int</code> | The number of items that the runtime skips first. |

**Returns:** <code>Iterable[<a href="#pipelineactivity">PipelineActivity</a>] &#124; AsyncIterable[<a href="#pipelineactivity">PipelineActivity</a>]</code> — An iterable of per-pipeline activity. Async mode returns an async iterable.

**Raises**

| Exception | When |
| --- | --- |
| [`BadRequest`](errors.md#badrequest) | The runtime rejected the request as invalid. `message`, `code` and `fields` say why. |
| [`DataplaneTokenRejected`](errors.md#dataplanetokenrejected) | The data plane rejected the token that the runtime issued for it. |
| [`NotAuthorized`](errors.md#notauthorized) | The caller lacks the access that this call needs. `message` says why. |
| [`ScopeMissing`](errors.md#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()` {#telemetry-datasets}

```python
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` | <code>str &#124; None</code> | Only this dataset. |
| `latest_status` | <code><a href="#pipelinerunstatus">PipelineRunStatus</a> &#124; None</code> | Only datasets whose latest pipeline run ended with this status. Only `SUCCEEDED` and `FAILED` are filterable. |
| `destination` | <code>str &#124; None</code> | Only datasets whose latest pipeline run wrote to this destination. |
| `since` | <code>datetime &#124; None</code> | Start of the window, zone-aware. Defaults to seven days before `until`. |
| `until` | <code>datetime &#124; None</code> | End of the window, zone-aware. Defaults to now. |
| `limit` | <code>int &#124; None</code> | The most items to return. `None` returns every item up to item 10,100, where the runtime stops paging. |
| `offset` | <code>int</code> | The number of items that the runtime skips first. |

**Returns:** <code>Iterable[<a href="#datasetactivity">DatasetActivity</a>] &#124; AsyncIterable[<a href="#datasetactivity">DatasetActivity</a>]</code> — An iterable of per-dataset activity. Async mode returns an async iterable.

**Raises**

| Exception | When |
| --- | --- |
| [`BadRequest`](errors.md#badrequest) | The runtime rejected the request as invalid. `message`, `code` and `fields` say why. |
| [`DataplaneTokenRejected`](errors.md#dataplanetokenrejected) | The data plane rejected the token that the runtime issued for it. |
| [`NotAuthorized`](errors.md#notauthorized) | The caller lacks the access that this call needs. `message` says why. |
| [`ScopeMissing`](errors.md#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` {#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()` {#pipelineruns-get}

```python
get(*, id: str) -> PipelineRun
```

Return one pipeline run by ID, in full.

**Arguments**

| Name | Type | Description |
| --- | --- | --- |
| `id` | <code>str</code> | The UUID of the pipeline run, from [`PipelineRuns.list()`](#pipelineruns-list) or [`PipelineRunSummary.pipeline_run_id`](job-runs.md#pipelinerunsummary). A job run ID does not work here, because it is a different ID. |

**Returns:** <code><a href="#pipelinerun">PipelineRun</a></code> — The pipeline run. Async mode returns an awaitable.

**Raises**

| Exception | When |
| --- | --- |
| [`BadRequest`](errors.md#badrequest) | The runtime rejected the request as invalid. `message`, `code` and `fields` say why. |
| [`DataplaneTokenRejected`](errors.md#dataplanetokenrejected) | The data plane rejected the token that the runtime issued for it. |
| [`NotAuthorized`](errors.md#notauthorized) | The caller lacks the access that this call needs. `message` says why. |
| [`NotFound`](errors.md#notfound) | The pipeline run does not exist in this workspace. |
| [`ScopeMissing`](errors.md#scopemissing) | No workspace in scope. |

### `PipelineRuns.trace()` {#pipelineruns-trace}

```python
trace(*, id: str) -> PipelineRunTrace
```

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

**Arguments**

| Name | Type | Description |
| --- | --- | --- |
| `id` | <code>str</code> | The UUID of the pipeline run. |

**Returns:** <code><a href="#pipelineruntrace">PipelineRunTrace</a></code> — The trace. Async mode returns an awaitable.

**Raises**

| Exception | When |
| --- | --- |
| [`BadRequest`](errors.md#badrequest) | The runtime rejected the request as invalid. `message`, `code` and `fields` say why. |
| [`NotFound`](errors.md#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`](errors.md#scopemissing) | No workspace in scope. |

### `PipelineRuns.list()` {#pipelineruns-list}

```python
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` | <code>str &#124; None</code> | Only the pipeline runs of this job run. |
| `pipeline_name` | <code>str &#124; None</code> | Only this pipeline. |
| `status` | <code><a href="#pipelinerunstatus">PipelineRunStatus</a> &#124; None</code> | Only pipeline runs with this status. Only `SUCCEEDED` and `FAILED` are filterable. |
| `dataset` | <code>str &#124; None</code> | Only pipeline runs that wrote to this dataset. |
| `destination` | <code>str &#124; None</code> | Only pipeline runs that wrote to this destination. |
| `empty_only` | <code>bool &#124; None</code> | True for succeeded pipeline runs that extracted nothing to load. False for every other pipeline run, failed ones included. `None` for both. |
| `since` | <code>datetime &#124; None</code> | Start of the window, zone-aware. Defaults to seven days before `until`. |
| `until` | <code>datetime &#124; None</code> | End of the window, zone-aware. Defaults to now. |
| `limit` | <code>int &#124; None</code> | The most items to return. `None` returns every item up to item 10,100, where the runtime stops paging. |
| `offset` | <code>int</code> | The number of items that the runtime skips first. |

**Returns:** <code>Iterable[<a href="#pipelinerun">PipelineRun</a>] &#124; AsyncIterable[<a href="#pipelinerun">PipelineRun</a>]</code> — An iterable of pipeline runs. Async mode returns an async iterable.

**Raises**

| Exception | When |
| --- | --- |
| [`BadRequest`](errors.md#badrequest) | The runtime rejected the request as invalid. `message`, `code` and `fields` say why. |
| [`DataplaneTokenRejected`](errors.md#dataplanetokenrejected) | The data plane rejected the token that the runtime issued for it. |
| [`NotAuthorized`](errors.md#notauthorized) | The caller lacks the access that this call needs. `message` says why. |
| [`ScopeMissing`](errors.md#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` {#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()`](#pipelineruns-list) and [`PipelineRunSummary.pipeline_run_id`](job-runs.md#pipelinerunsummary)
give one.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `id` | <code>str</code> | ID of the pipeline run; not a job run ID. |
| `pipeline_name` | <code>str</code> | Name of the dlt pipeline. |
| `status` | <code><a href="#pipelinerunstatus">PipelineRunStatus</a></code> | `failed` when any step raised, otherwise `succeeded`. |
| `dataset_name` | <code>str &#124; None</code> | Dataset the run loaded into, from its load step; `None` when the run did not reach load. |
| `destination_name` | <code>str &#124; None</code> | Destination the run loaded to, from its load step; `None` when the run did not reach load. |
| `started_at` | <code>datetime &#124; None</code> | Start of the run from the dlt trace, UTC. |
| `finished_at` | <code>datetime &#124; None</code> | End of the run from the dlt trace, UTC. |
| `duration_ms` | <code>int &#124; None</code> | `finished_at` − `started_at` in milliseconds. |
| `total_rows_extracted` | <code>int</code> | Rows written by the extract step. |
| `total_rows_loaded` | <code>int</code> | 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` | <code>int</code> | 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` | <code>str &#124; None</code> | First step that raised, for example `extract`, `normalize` or `load`. |
| `error_message` | <code>str &#124; None</code> | Exception message of that step. |
| `has_schema_migration` | <code>bool &#124; None</code> | True when the load step created or changed user tables (`_dlt_*` tables are ignored). |
| `dlt_version` | <code>str &#124; None</code> | dlt version that ran the pipeline, from the trace's execution context. |
| `tables` | <code>tuple[<a href="#pipelinetable">PipelineTable</a>, ...]</code> | The tables it wrote, with rows per table. Empty on a listed row — only [`PipelineRuns.get()`](#pipelineruns-get) reads them. |
| `load_packages` | <code>tuple[<a href="#loadpackage">LoadPackage</a>, ...]</code> | The packages it produced. Empty on a listed row, for the same reason. |
| `failed` | <code>bool</code> | Whether this pipeline run ended on an error. |

### `PipelineRun.trace()` {#pipelinerun-trace}

```python
trace() -> PipelineRunTrace
```

Read the dlt trace that this pipeline run produced.

**Returns:** <code><a href="#pipelineruntrace">PipelineRunTrace</a></code> — The trace. Async mode returns an awaitable.

**Raises**

| Exception | When |
| --- | --- |
| [`NotFound`](errors.md#notfound) | The runtime stored no trace. A pipeline run that the runtime never linked to a job run has none. |
| [`ScopeMissing`](errors.md#scopemissing) | No workspace in scope. |

## `DatasetActivity` {#datasetactivity}

What landed in one dataset over a window.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `dataset_name` | <code>str</code> | Name of the dataset, across destinations. |
| `distinct_pipeline_count` | <code>int</code> | Number of distinct pipelines that ran into this dataset in the range. |
| `total_pipeline_run_count` | <code>int</code> | Pipeline runs in the range. |
| `succeeded_pipeline_run_count` | <code>int</code> | Pipeline runs in the range with status `succeeded`. |
| `failed_pipeline_run_count` | <code>int</code> | How many did not succeed. The SDK derives it, as for a pipeline. |
| `success_ratio` | <code>float</code> | Succeeded ÷ total, from 0 to 1. |
| `total_rows_loaded` | <code>int</code> | Sum of normalized rows over succeeded runs in the time range. |
| `total_bytes_loaded` | <code>int</code> | Sum of normalized bytes (size of the normalized files) over succeeded runs in the time range. |
| `schema_migration_count` | <code>int</code> | Runs in the range with `has_schema_migration`. |
| `average_duration_ms` | <code>int &#124; None</code> | Mean `duration_ms` in the range, rounded; `None` when no run has a duration. |
| `latest_status` | <code>str &#124; None</code> | Status of the most recent pipeline run in the time range. |
| `latest_pipeline_run_at` | <code>datetime &#124; None</code> | When the most recent pipeline run in the time range started. |
| `latest_pipeline_name` | <code>str &#124; None</code> | Pipeline of the most recent pipeline run in the time range. |
| `latest_destination_name` | <code>str &#124; None</code> | Destination of the most recent pipeline run in the time range. |

## `LoadPackage` {#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` | <code>str</code> | dlt load id of the package. |
| `schema_name` | <code>str &#124; None</code> | dlt schema the package was created with. |
| `load_status` | <code>str &#124; None</code> | State dlt reported for the package; `loaded` means fully loaded. |
| `job_count` | <code>int</code> | Number of jobs in the package. |
| `failed_job_count` | <code>int</code> | Jobs that failed. |
| `total_rows_loaded` | <code>int</code> | 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` | <code>int</code> | 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` | <code>bool</code> | Whether it is still waiting to be loaded. |
| `has_schema_migration` | <code>bool</code> | Whether its load changed the schema of the destination. |
| `completed_at` | <code>datetime &#124; None</code> | When dlt completed the package, UTC; `None` while not completed. |

## `PipelineActivity` {#pipelineactivity}

The activity of one pipeline over a window.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `pipeline_name` | <code>str</code> | Name of the dlt pipeline. |
| `total_pipeline_run_count` | <code>int</code> | Pipeline runs in the range. |
| `succeeded_pipeline_run_count` | <code>int</code> | Pipeline runs in the range with status `succeeded`. |
| `failed_pipeline_run_count` | <code>int</code> | How many did not succeed. The SDK derives it, because the runtime reports the successes and the total. |
| `success_ratio` | <code>float</code> | Succeeded ÷ total, from 0 to 1. |
| `total_rows_extracted` | <code>int</code> | Sum of extracted rows over all runs in the range. |
| `total_rows_loaded` | <code>int</code> | Sum of normalized rows over succeeded runs in the time range. |
| `total_bytes_loaded` | <code>int</code> | Sum of normalized bytes (size of the normalized files) over succeeded runs in the time range. |
| `average_duration_ms` | <code>int &#124; None</code> | Mean `duration_ms` in the range, rounded; `None` when no run has a duration. |
| `total_duration_ms` | <code>int</code> | Sum of `duration_ms` over the runs in the range. |
| `latest_status` | <code>str &#124; None</code> | Status of the most recent pipeline run in the time range. |
| `latest_pipeline_run_at` | <code>datetime &#124; None</code> | When the most recent pipeline run in the time range started. |
| `latest_dataset_name` | <code>str &#124; None</code> | Dataset of the most recent pipeline run in the time range. |
| `latest_destination_name` | <code>str &#124; None</code> | Destination of the most recent pipeline run in the time range. |
| `latest_source_names` | <code>tuple[str, ...]</code> | Sources read by the most recent pipeline run in the time range. |

## `PipelineRunTrace` {#pipelineruntrace}

The dlt trace that one pipeline run produced.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `pipeline_run_id` | <code>str</code> | The pipeline run it belongs to. |
| `trace` | <code>Mapping[str, Any]</code> | 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` {#pipelinetable}

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

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `table_name` | <code>str</code> | Name of the table. |
| `schema_name` | <code>str</code> | The schema of the table. |
| `rows_extracted` | <code>int &#124; None</code> | Rows the extract step wrote for this table; `None` when not extracted. |
| `rows_loaded` | <code>int &#124; None</code> | 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` | <code>int &#124; None</code> | 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` | <code>str &#124; None</code> | `completed` or `failed`; `None` when the table was not loaded. |
| `write_disposition` | <code>str &#124; None</code> | From the resource hints; `None` when the extract step reported none. |

## `TelemetryStatus` {#telemetrystatus}

How current the telemetry of the runtime is for one workspace.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `updated_at` | <code>datetime &#124; None</code> | 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` {#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. |
