Creating a Query for Generative AI Metrics
By using the OCI Monitoring service, you can create custom queries and trigger alarms to monitor the OCI Generative AI dedicated AI clusters and endpoints.
- To get permission to work with the Monitoring service resources, ask an administrator to review the IAM policies in Securing Monitoring and grant you the proper access for your role.
- For permission to work with Generative AI resources, ask an administrator to give you access to Generative AI resources.
In the Monitoring service, to add Generative AI resources to queries or alarms, select the namespace,
oci_generativeai
and refer to Monitoring Query Language (MQL) Reference
for the query syntax.Use the oci monitoring metric-data summarize-metrics-data command and required parameters to query metric data:
oci monitoring metric-data summarize-metrics-data [OPTIONS]
When specifying a dimension value within the query (
--query-text
), surround it with double quotes, and escape each double quote with a backslash character (\
). Example:oci monitoring metric-data summarize-metrics-data --compartment-id <compartment_OCID> --namespace oci_computeagent --query-text "CpuUtilization[1m]{resourceId = \"<instance_OCID>\"}.max()"
For a complete list of parameters and values for CLI commands, see the Command Line Reference for Monitoring.
Use the oci monitoring alarm create command and required parameters to create an alarm:
oci monitoring alarm create --compartment-id <compartment_OCID> --destinations <file_or_text> --display-name <name> --is-enabled <true_or_false> --metric-compartment-id <compartment_OCID> --namespace <metric_namespace> --query-text <mql_expression> --severity <level>
For a complete list of parameters and values for CLI commands, see the Command Line Reference for Monitoring.
Refer to the Monitoring API for using the Monitoring service APIs.
For example, run the SummarizeMetricsDataDetails operation to query metric data and CreateAlarm to create an alarm.
For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.