1Z0-1067-25 Question 122
Single answerYour team wants to monitor CPU utilization on all Compute instances in a specific compartment. You are tasked with writing an MQL expression that groups the data by 'resourceName' (the instance name) and the 'availabilityDomain', and filters for average CPU utilization above 75% over the last 30 minutes. Which expression correctly achieves this goal?
- A
CpuUtilization[30m]{compartmentId='ocid1.compartment.oc1...'} | group_by(['resourceName','availabilityDomain']) | filter(avg() > 75)
- B
CpuUtilization[30m]{compartmentId='ocid1.compartment.oc1...'} | filter(avg() > 75).group_by(['resourceName','availabilityDomain'])
- C
CpuUtilization[30m]{compartmentId='ocid1.compartment.oc1...'} | group_by('resourceName','availabilityDomain') > 75
- D
CpuUtilization[30m]{compartmentId='ocid1.compartment.oc1...'} | group_by(['resourceName','availabilityDomain']).statistic(max) > 75
Show answer and explanation
Correct answer: A
Explanation
MQL uses a pipeline syntax with '|' operators to chain operations. In this scenario, you query the CpuUtilization metric for a 30-minute window within the specified compartment, group the results by both 'resourceName' and 'availabilityDomain', and then apply a filter to include only those data points where the average CPU utilization exceeds 75%. For more details, consult the Oracle Cloud Infrastructure Monitoring documentation on Metric Query Language (MQL) for best practices on syntax, grouping, and filtering.
- A. Correct.
Correct. The expression filters and then groups CPU utilization metrics over 30 minutes for the specified compartment, ensuring that only data points with average CPU usage above 75% are returned. The pipe-symbol ('|') is the correct delimiter for sequential operations in MQL. 'group_by(['resourceName','availabilityDomain'])' properly segments the data, and 'filter(avg() > 75)' ensures only metrics exceeding 75% are included.
- B. Incorrect.
Incorrect. While it looks plausible, the filter is applied before the group_by clause in the query chain. Typically, you apply group_by to aggregate the data first, then apply the filter condition on that aggregate. This option may not provide the desired segmentation by instance and domain before filtering.
- C. Incorrect.
Incorrect. The expression includes 'group_by('resourceName','availabilityDomain') > 75' without an explicit filter function. The comparison operator '>' immediately after group_by is invalid MQL syntax and does not properly filter by the average CPU utilization.
- D. Incorrect.
Incorrect. This expression uses 'statistic(max)' and directly applies the comparison '> 75' without a filter function, which is not the correct pattern. Also, a maximum statistic does not match the requirement to filter based on the average usage exceeding 75%.