Output Metric

The Output Metric action creates a new monitoring datum that is observable by metrics observers.

Parameters

Name Default value Explanation
resourceId ID the resource id that each monitoring datum should carry. Use the reserved string ID to let the platform automatically set the id of the resource the datum is about. E.g.: when groupingClass is VM, ID will be substituted with the id of the vm each aggregated monitoring datum is about.
metric the name of the metric generated by the action.
value METRIC the value that each monitoring datum should carry. Use the reserved string METRIC to let the platform automatically set either the raw value (in case no aggregation is specified) or the aggregated value.

Please notice that all the parameters with a default value could be omitted when registering the rule.

Examples

<monitoringRules
    xmlns="http://www.modaclouds.eu/xsd/1.0/monitoring_rules_schema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.modaclouds.eu/xsd/1.0/monitoring_rules_schema">
    <monitoringRule timeWindow="30" timeStep="30" id="cpuRule">
        <monitoredTargets>
            <monitoredTarget class="VM" type="Frontend" />
        </monitoredTargets>
        <collectedMetric metricName="CpuUtilization">
            <parameter name="samplingProbability">1</parameter>
            <parameter name="samplingTime">10</parameter>
        </collectedMetric>
        <metricAggregation aggregateFunction="Average"
            groupingClass="CloudProvider" />
        <actions>
            <action name="OutputMetric">
                <parameter name="metric">FrontendCPUUtilization</parameter>
            </action>
        </actions>
    </monitoringRule>
    <monitoringRule timeWindow="30" timeStep="30" id="respTimeRule">
        <monitoredTargets>
            <monitoredTarget class="Method" type="answerQuestions" />
            <monitoredTarget class="Method" type="saveAnswers" />
            <monitoredTarget class="Method" type="register" />
        </monitoredTargets>
        <collectedMetric metricName="ResponseTime">
            <parameter name="samplingProbability">1</parameter>
        </collectedMetric>
        <metricAggregation aggregateFunction="Average"/>
        <actions>
            <action name="OutputMetric">
                <parameter name="metric">AverageRespTime</parameter>
                <parameter name="resourceId">AllMyFrontendMethods</parameter>
            </action>
        </actions>
    </monitoringRule>
    <monitoringRule timeWindow="30" timeStep="30" id="respTimeRule2">
        <monitoredTargets>
            <monitoredTarget class="Method" type="answerQuestions" />
            <monitoredTarget class="Method" type="saveAnswers" />
            <monitoredTarget class="Method" type="register" />
        </monitoredTargets>
        <collectedMetric metricName="ResponseTime">
            <parameter name="samplingProbability">1</parameter>
        </collectedMetric>
        <actions>
            <action name="OutputMetric">
                <parameter name="metric">RespTime</parameter>
            </action>
        </actions>
    </monitoringRule>
</monitoringRules>

Note that the second rule does not specify any grouping class for the aggregation, therefore the aggregated monitoring datum will have the resource id that must be specified with the resourceId parameter. In the first case the resourceId of the aggregated monitoring data will be automatically set with the cloud provider id, which is the selected grouping class. In the third case, no aggregation is specified, every incoming monitoring datum will be sent to any attached observer without any aggregation.