We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.

SDK ReferencePython SDKFeature ClientsMetrics

Metrics Client

Bases: BaseRestClient

The metrics client is a client for reading metrics out of Hatchet’s metrics API.

Methods:

NameDescription
aio_get_queue_metricsRetrieve queue metrics for a set of workflow ids and additional metadata.
aio_get_task_metricsRetrieve queue metrics
aio_get_workflow_metricsRetrieve workflow metrics for a given workflow ID.
get_queue_metricsRetrieve queue metrics for a set of workflow ids and additional metadata.
get_task_metricsRetrieve queue metrics
get_workflow_metricsRetrieve 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:

NameTypeDescriptionDefault
workflow_idslist[str] | NoneA list of workflow IDs to retrieve metrics for.None
additional_metadataJSONSerializableMapping | NoneAdditional metadata to filter the metrics by.None

Returns:

TypeDescription
TenantQueueMetricsWorkflow metrics for the specified workflow IDs.

aio_get_task_metrics

Retrieve queue metrics

Returns:

TypeDescription
TenantStepRunQueueMetricsStep run queue metrics for the tenant

aio_get_workflow_metrics

Retrieve workflow metrics for a given workflow ID.

Parameters:

NameTypeDescriptionDefault
workflow_idstrThe ID of the workflow to retrieve metrics for.required
statusWorkflowRunStatus | NoneThe status of the workflow run to filter by.None
group_keystr | NoneThe key to group the metrics by.None

Returns:

TypeDescription
WorkflowMetricsWorkflow metrics for the specified workflow ID.

get_queue_metrics

Retrieve queue metrics for a set of workflow ids and additional metadata.

Parameters:

NameTypeDescriptionDefault
workflow_idslist[str] | NoneA list of workflow IDs to retrieve metrics for.None
additional_metadataJSONSerializableMapping | NoneAdditional metadata to filter the metrics by.None

Returns:

TypeDescription
TenantQueueMetricsWorkflow metrics for the specified workflow IDs.

get_task_metrics

Retrieve queue metrics

Returns:

TypeDescription
TenantStepRunQueueMetricsStep run queue metrics for the tenant

get_workflow_metrics

Retrieve workflow metrics for a given workflow ID.

Parameters:

NameTypeDescriptionDefault
workflow_idstrThe ID of the workflow to retrieve metrics for.required
statusWorkflowRunStatus | NoneThe status of the workflow run to filter by.None
group_keystr | NoneThe key to group the metrics by.None

Returns:

TypeDescription
WorkflowMetricsWorkflow metrics for the specified workflow ID.