统计信息收集器策略 - 无法添加自定义维度

时间:2014-04-23 06:37:51

标签: apigee

我无法使用下面提到的统计信息收集器和提取变量策略在自定义报告中添加自定义维度。

我已经按照教程和文档中给出的所有步骤进行了操作,但仍然被卡住了。

提取可变政策

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <ExtractVariables async="false" continueOnError="false" enabled="true" name="Extract-   Variables-1">
 <DisplayName>Extract Variables 1</DisplayName>
 <FaultRules/>
 <Properties/>
 <Source clearPayload="false">response</Source>
 <VariablePrefix></VariablePrefix>
 <XMLPayload stopPayloadProcessing="false">
    <Namespaces>
     <Namespace prefix="yweather">http://xml.weather.yahoo.com/ns/rss/1.0</Namespace>
   </Namespaces>
    <Variable name="weather.location" type="string">
        <XPath>/rss/channel/link</XPath>
    </Variable>
    <Variable name="weather.condition" type="string">
        <XPath>/rss/channel/item/yweather:condition/@text</XPath>
    </Variable>
  <Variable name="weather.forecast_today" type="string">
        <XPath>/rss/channel/item/yweather:forecast[1]/@text</XPath>
    </Variable>
    <Variable name="weather.forecast_tommorow" type="string">
        <XPath>/rss/channel/item/yweather:forecast[2]/@text</XPath>
    </Variable>
</XMLPayload>
</ExtractVariables>

统计收集政策

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StatisticsCollector async="false" continueOnError="false" enabled="true" name="Statistics-Collector-1">
<DisplayName>Statistics Collector 1</DisplayName>
<FaultRules/>
 <Properties/>
<Statistics>
    <Statistic name="location" ref="weather.location" type="string">Earth</Statistic>
    <Statistic name="condition" ref="weather.condition" type="string">Sunny</Statistic>
    <Statistic name="forecast_today" ref="weather.forecast_today" type="string">Rainy</Statistic>
    <Statistic name="forecast_tomorrow" ref="weather.forecast_tomorrow" type="string">Balmy</Statistic>
</Statistics>
</StatisticsCollector>

1 个答案:

答案 0 :(得分:0)

您的政策看起来很正常(例如,您似乎尚未修改http://apigee.com/docs/analytics-services/content/analyze-api-message-content-using-custom-analytics中的示例),因此问题可能在于您的政策附件,或者更有可能是您的部署。确保您的代理部署在预期的环境中。使用API​​执行此操作非常有用: curl -u email:password https://api.enterprise.apigee.com/v1/o/ {org_name} / apis / {api_name} / deployments

如果您的API代理已正确部署,请发布您的ProxyEndpoint配置,以及您要发送给API代理的请求,我们将从那里接收。