Last updated
Copyright © 2023 Arize AI, Inc
Last updated
Use custom metrics to define a metric specific to your business use case or to your model. By using a programmatic API, you can automate the process of creating a custom metric, updating that metric, and creating monitors on that metric.
Learn more about .
For a brief overview of GraphQL itself, please consult our .
Creating a custom metric directly:
A more repeatable way to do this is to use query parameters:
Note that error messages work the same in GraphQL as in the UI. For example, if my metric was this: SELECT COUNT(income) FROM model
, I would get this error message in both the UI and the API:
However, due to the ability to use auto complete and the model schema panel in the UI, we do encourage using the UI to create an initial custom metric before attempting to create one directly using the GraphQL API.
You can query for custom metrics associated with a model like this:
If you know the id of your custom metric - you can also query for it directly:
To create a custom metric monitor - first get the custom metric id. This can come from the result of the createCustomMetricMutation
above, or it can come from the URL of the custom metric:
app.arize.com/organizations/:org_id/spaces/:space_id/models/:model_id/custom_metrics/:custom_metric_id/
Then, use the createPerformanceMonitorMutation
to create the monitor:
In order to update a custom metric, use the updateCustomMetricMutation
. Follow an example .
Users can monitor a custom metric using the performance monitor type. Follow an example .
To learn more about performance monitors - refer to our .
Create Custom Metrics With GraphQL
Update Custom Metrics With GraphQL
Learn how to query, create, and update custom metrics programmatically