Custom metric for monitoring business-specific and domain-specific KPIs. CustomMetric enables creation of user-defined metrics that calculate specific values from model data using SQL-like expressions. Custom metrics extend Fiddler’s built-in monitoring capabilities to support business requirements, domain-specific quality measures, and complex performance indicators.Documentation Index
Fetch the complete documentation index at: https://handbook.fiddler.ai/llms.txt
Use this file to discover all available pages before exploring further.
Example
Custom metrics are calculated during data ingestion and monitoring cycles. Complex expressions may impact performance, so optimize for efficiency. Test expressions thoroughly before using in production alert rules.
create()
Create a new CustomMetric on the Fiddler platform. Registers this CustomMetric with the Fiddler platform. The expression must have a name, model_id, and definition specified before calling create().Returns
The same CustomMetric instance with updated server-side attributes (id, created_at, etc.).Raises
- ApiError — If there’s an error communicating with the Fiddler API.
- Conflict — If a CustomMetric with the same name already exists for this model.
delete()
Delete this CustomMetric from the Fiddler platform. Permanently removes the CustomMetric. This action cannot be undone. Any alert rules or monitors using this CustomMetric must be deleted first.Raises
- NotFound — If the CustomMetric no longer exists.
- ApiError — If there’s an error communicating with the Fiddler API.
- Conflict — If the CustomMetric is still being used by alert rules or monitors. Return type: None
classmethod from_name(name, model_id)
Retrieve a CustomMetric by name and model. Fetches a CustomMetric from the Fiddler platform using its name and associated model ID.Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | str | ✗ | None | The name of the CustomMetric to retrieve. |
model_id | `UUID | str` | ✗ | None |
Returns
The CustomMetric instance for the provided parameters.Raises
- NotFound — If no CustomMetric exists with the specified name and model.
- ApiError — If there’s an error communicating with the Fiddler API.
classmethod get(id_)
Retrieve a CustomMetric by its unique identifier. Fetches a CustomMetric from the Fiddler platform using its UUID.Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id_ | `UUID | str` | ✗ | None |
Returns
The CustomMetric instance with all its configuration and metadata.Raises
- NotFound — If no CustomMetric exists with the specified ID.
- ApiError — If there’s an error communicating with the Fiddler API.
classmethod get_organization_id()
Get the organization UUID from the global connection.Returns
Unique identifier of the organization associated with the current connection. Return type: UUIDclassmethod get_organization_name()
Get the organization name from the global connection.Returns
Name of the organization associated with the current connection. Return type: strclassmethod list(model_id)
List all CustomMetric instances for a model. Retrieves all CustomMetric instances associated with a specific model.Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model_id | `UUID | str` | ✗ | None |