Why do Webservice calls such as getMetricData and getLiveMetricData not return a data point for each 15 second time period when querying data for an EP Agent?

Document ID : KB000045315
Last Modified Date : 14/02/2018
Show Technical Document Details


     The Introscope Webservice API provides a framework for polling metrics, metric data, and alert data outside of Introscope UIs.



     Why do Webservice calls such as getMetricData and getLiveMetricData not return a data point for each 15 second time period when querying data for an EPAgent?



     Occurs in APM version 10.0 and higher.



     This behavior occurrs due to a design change in APM 10.0 and higher versions. Prior to APM 10.0, a defect was discovered with the Web Service API in which any average based metrics (Average Response Time, etc) returned inconsistent averages for the getMetricData and getLiveMetricData calls. To address this issue, Product Management decided to change the Webservice API so that only metric values reported by the API are those directly reported by the agent. This means, in cases such as the EPAgent where new data points are only received once every X minutes where X is the frequency the plugin runs on the EPAgent, by design we would only expect a single data point every time the plugin runs.

To illustrate this behavior, consider an EP Agent in which the agent plugins run every 5 minutes. Below is a sample getMetricData query against this EP Agent...

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://metricsdata.webservicesimpl.server.introscope.wily.com">
      <met:getMetricData soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <agentRegex xsi:type="xsd:string">(.*)EPAgentTest</agentRegex>
         <metricRegex xsi:type="xsd:string">Disk\|_Total:Free Megabytes</metricRegex>
         <startTime xsi:type="xsd:dateTime">2016-07-21T09:50:00-05:00</startTime>
         <endTime xsi:type="xsd:dateTime">2016-07-21T09:55:00-05:00</endTime>
         <dataFrequency xsi:type="xsd:int">15</dataFrequency>

The request above should return all datapoints for the Free Megabytes metric from the EPAgentTest agent. Since this EP Agent runs on a 5 minute interval, we would expect a new metric value to have occurred once during this interval. (Due to EP Agent design, this one value is repeated when viewed in the Introscope Investigator). Below is sample result....

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ns1:getMetricDataResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://metricsdata.webservicesimpl.server.introscope.wily.com">
         <getMetricDataReturn soapenc:arrayType="ns2:TimesliceGroupedMetricData[4]" xsi:type="soapenc:Array" xmlns:ns2="urn:ca.wily.introscope.webservices" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
            <getMetricDataReturn href="#id0"/>
            <getMetricDataReturn href="#id1"/>
            <getMetricDataReturn href="#id2"/>
            <getMetricDataReturn href="#id3"/>
   ..... (One id for every 15 seconds of data)
   <getMetricDataReturn href="#id19"/>
Below follows the data returned. Most data points (19/20) will return no data as no new data points were returned by the EP Agent at this time. "id0" is shown with other results omitted for this example. "id20" is the generated data point created by the EP Agent and returned by the Webservice API. 

  <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:TimesliceGroupedMetricData" xmlns:ns6="urn:ca.wily.introscope.webservices" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
         <metricData soapenc:arrayType="ns6:MetricData[1]" xsi:type="soapenc:Array">
            <metricData xsi:type="ns6:MetricData" xsi:nil="true"/>
         <timesliceEndTime xsi:type="xsd:dateTime">2016-07-21T14:50:00.000Z</timesliceEndTime>
         <timesliceStartTime xsi:type="xsd:dateTime">2016-07-21T14:50:15.000Z</timesliceStartTime>
      <multiRef id="id20" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:MetricData" xmlns:ns7="urn:ca.wily.introscope.webservices" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
         <agentName xsi:type="xsd:string"><HostName>|<ProcessName>|EPAgentTest</agentName>
         <metricName xsi:type="xsd:string"><Metric Path>Total:Free Megabytes.value</metricName>
         <metricType xsi:type="xsd:int">257</metricType>
         <metricValue xsi:type="xsd:string">21171</metricValue>

Additional Information:
    For more information on the Introscope Webservices API, please see: https://docops.ca.com/ca-apm/10/en/integrating/api-reference-guide/ca-introscope-web-services-api-reference .As always, please contact CA Technologies Support if you have further questions.