Class CustomMetric.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • query

        public CustomMetric.Builder query​(String query)
        The Monitoring Query Language (MQL) expression to evaluate for the alarm.

        The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval: 1m-60m (also 1h). You can optionally specify dimensions and grouping functions. Supported grouping functions: grouping(), groupBy().

        Example of threshold alarm:

        -----

        CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.groupBy(availabilityDomain).percentile(0.9) > 85

        -----

        Parameters:
        query - the value to set
        Returns:
        this builder
      • namespace

        public CustomMetric.Builder namespace​(String namespace)
        The namespace for the query.
        Parameters:
        namespace - the value to set
        Returns:
        this builder
      • resourceGroup

        public CustomMetric.Builder resourceGroup​(String resourceGroup)
        The resource group for the query.
        Parameters:
        resourceGroup - the value to set
        Returns:
        this builder
      • metricCompartmentId

        public CustomMetric.Builder metricCompartmentId​(String metricCompartmentId)
        The OCID of the compartment containing the metrics.
        Parameters:
        metricCompartmentId - the value to set
        Returns:
        this builder