Files
hatchet/frontend/docs/pages/sdks/python/feature-clients/metrics.mdx
Matt Kaye c8f56e0872 Feat: Python SDK Documentation, Part I (#1567)
* feat: initial mkdocs setup

* chore: lock

* fix: config + start getting docs working

* fix: remove lots more redundant :type docs, update config more

* feat: split up clients

* feat: add pydoclint

* fix: rm defaults from docstrings

* fix: pydoclint errors

* feat: run pydoclint in ci

* fix: lint on 3.13

* debug: try explicit config path

* fix: ignore venv

* feat: index, styling

* fix: rm footer

* fix: more style tweaks

* feat: generated docs

* fix: refactor a bit

* fix: regen

* Revert "fix: regen"

This reverts commit 7f66adc77840ad96d0eafe55c8dd467f71eb50fb.

* feat: improve prompting

* feat: add docs, modify theme config to enable toc for docs

* fix: lint

* fix: lint

* feat: regenerate

* feat: bs4 for html parsing

* feat: preview correctly

* fix: exclude site subdir from all the linters

* refactor: break up script into components

* feat: remove a bunch more stuff from the html

* feat: prettier, enable toc

* fix: enable tocs in more places + sort properly

* fix: code blocks, ordering

* fix: ordering

* feat: finish up feature clients

* fix: rm unused deps

* fix: routing + property tags + sidebar

* fix: hatchet client + formatting

* fix: allow selecting single set of files

* fix: lint

* rm: cruft

* fix: naming

* fix: runs client attrs

* fix: rm cruft page

* feat: internal linking + top level description

* [Python]: Fixing some more issues (#1573)

* fix: pass priority through from the task

* fix: improve eof handling slightly

* chore: version

* fix: improve eof handling

* fix: send prio from durable

* fix: naming

* cleanup: use a variable

* chore: version

* feat: comment explaining page depth thing

* chore: bump ver

* feat: standalone docs

* fix: prompting + heading levels
2025-04-18 15:34:07 -04:00

109 lines
4.9 KiB
Plaintext

# Metrics Client
Bases: `BaseRestClient`
The metrics client is a client for reading metrics out of Hatchet's metrics API.
Methods:
| Name | Description |
| -------------------------- | ------------------------------------------------------------------------- |
| `aio_get_queue_metrics` | Retrieve queue metrics for a set of workflow ids and additional metadata. |
| `aio_get_task_metrics` | Retrieve queue metrics |
| `aio_get_workflow_metrics` | Retrieve workflow metrics for a given workflow ID. |
| `get_queue_metrics` | Retrieve queue metrics for a set of workflow ids and additional metadata. |
| `get_task_metrics` | Retrieve queue metrics |
| `get_workflow_metrics` | Retrieve workflow metrics for a given workflow ID. |
### Functions
#### `aio_get_queue_metrics`
Retrieve queue metrics for a set of workflow ids and additional metadata.
Parameters:
| Name | Type | Description | Default |
| --------------------- | --------------------------------- | ----------------------------------------------- | ------- |
| `workflow_ids` | `list[str] \| None` | A list of workflow IDs to retrieve metrics for. | `None` |
| `additional_metadata` | `JSONSerializableMapping \| None` | Additional metadata to filter the metrics by. | `None` |
Returns:
| Type | Description |
| -------------------- | ------------------------------------------------ |
| `TenantQueueMetrics` | Workflow metrics for the specified workflow IDs. |
#### `aio_get_task_metrics`
Retrieve queue metrics
Returns:
| Type | Description |
| --------------------------- | ------------------------------------- |
| `TenantStepRunQueueMetrics` | Step run queue metrics for the tenant |
#### `aio_get_workflow_metrics`
Retrieve workflow metrics for a given workflow ID.
Parameters:
| Name | Type | Description | Default |
| ------------- | --------------------------- | ----------------------------------------------- | ---------- |
| `workflow_id` | `str` | The ID of the workflow to retrieve metrics for. | _required_ |
| `status` | `WorkflowRunStatus \| None` | The status of the workflow run to filter by. | `None` |
| `group_key` | `str \| None` | The key to group the metrics by. | `None` |
Returns:
| Type | Description |
| ----------------- | ----------------------------------------------- |
| `WorkflowMetrics` | Workflow metrics for the specified workflow ID. |
#### `get_queue_metrics`
Retrieve queue metrics for a set of workflow ids and additional metadata.
Parameters:
| Name | Type | Description | Default |
| --------------------- | --------------------------------- | ----------------------------------------------- | ------- |
| `workflow_ids` | `list[str] \| None` | A list of workflow IDs to retrieve metrics for. | `None` |
| `additional_metadata` | `JSONSerializableMapping \| None` | Additional metadata to filter the metrics by. | `None` |
Returns:
| Type | Description |
| -------------------- | ------------------------------------------------ |
| `TenantQueueMetrics` | Workflow metrics for the specified workflow IDs. |
#### `get_task_metrics`
Retrieve queue metrics
Returns:
| Type | Description |
| --------------------------- | ------------------------------------- |
| `TenantStepRunQueueMetrics` | Step run queue metrics for the tenant |
#### `get_workflow_metrics`
Retrieve workflow metrics for a given workflow ID.
Parameters:
| Name | Type | Description | Default |
| ------------- | --------------------------- | ----------------------------------------------- | ---------- |
| `workflow_id` | `str` | The ID of the workflow to retrieve metrics for. | _required_ |
| `status` | `WorkflowRunStatus \| None` | The status of the workflow run to filter by. | `None` |
| `group_key` | `str \| None` | The key to group the metrics by. | `None` |
Returns:
| Type | Description |
| ----------------- | ----------------------------------------------- |
| `WorkflowMetrics` | Workflow metrics for the specified workflow ID. |