Statistics apigee统计收集器/自定义报告不工作

Statistics apigee统计收集器/自定义报告不工作,statistics,report,analytics,apigee,Statistics,Report,Analytics,Apigee,我一直在使用Statistics Collector生成自定义报告 我的设想 我有一个名为ICCustomer的集合的BaaS DB,该集合几乎没有名称/值对 我创建了一个代理客户以显示特定的CustomerResource名称-specificcust,具体取决于唯一的客户id 对于特定的客户,我提取了变量并分配了变量策略,这很好 现在,为了获得定制报告,我再次添加了一个提取变量策略来从JSON路径提取cust_id,然后添加和统计收集器策略来获取统计数据 然后,我从Analytics创建了一

我一直在使用Statistics Collector生成自定义报告

我的设想

我有一个名为ICCustomer的集合的BaaS DB,该集合几乎没有名称/值对

我创建了一个代理客户以显示特定的CustomerResource名称-specificcust,具体取决于唯一的客户id

对于特定的客户,我提取了变量并分配了变量策略,这很好

现在,为了获得定制报告,我再次添加了一个提取变量策略来从JSON路径提取cust_id,然后添加和统计收集器策略来获取统计数据

然后,我从Analytics创建了一个新报告并保存了它。但不会生成报告。我得到的只是没有身份证报告

我哪里出错了

代理端点代码

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
    <Description/>
<PreFlow name="PreFlow">
    <Request/>
    <Response/>
</PreFlow>
<Flows>
    <Flow name="specficcust">
        <Description/>
        <Request/>
        <Response/>
        <Condition>(proxy.pathsuffix MatchesPath &quot;/{cust_id}&quot;) and (request.verb = &quot;GET&quot;)</Condition>
    </Flow>
</Flows>
<PostFlow name="PostFlow">
    <Request/>
    <Response/>
</PostFlow>
<HTTPProxyConnection>
    <BasePath>/icustomer</BasePath>
    <VirtualHost>default</VirtualHost>
    <VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="default">
    <TargetEndpoint>default</TargetEndpoint>
</RouteRule>
 </ProxyEndpoint>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<Description/>
<PreFlow name="PreFlow">
    <Request/>
    <Response/>
</PreFlow>
<Flows>
    <Flow name="specficcust">
        <Description/>
        <Request>
            <Step>
                <FaultRules/>
                <Name>Extract-Variables-1</Name>
            </Step>
            <Step>
                <FaultRules/>
                <Name>Assign-Message-1</Name>
            </Step>
        </Request>
        <Condition>(proxy.pathsuffix MatchesPath &quot;/{cust_id}&quot;) and (request.verb = &quot;GET&quot;)</Condition>
        <Response/>
    </Flow>
</Flows>
<PostFlow name="PostFlow">
    <Response>
        <Step>
            <FaultRules/>
            <Name>Extracting-for-Stats</Name>
        </Step>
        <Step>
            <FaultRules/>
            <Name>Statistics-Collector-1</Name>
        </Step>
    </Response>
    <Request/>
</PostFlow>
<HTTPTargetConnection>
    <URL>https://api.usergrid.com/siddharth1/sandbox/icustomer</URL>
</HTTPTargetConnection>
</TargetEndpoint>
目标端点代码

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
    <Description/>
<PreFlow name="PreFlow">
    <Request/>
    <Response/>
</PreFlow>
<Flows>
    <Flow name="specficcust">
        <Description/>
        <Request/>
        <Response/>
        <Condition>(proxy.pathsuffix MatchesPath &quot;/{cust_id}&quot;) and (request.verb = &quot;GET&quot;)</Condition>
    </Flow>
</Flows>
<PostFlow name="PostFlow">
    <Request/>
    <Response/>
</PostFlow>
<HTTPProxyConnection>
    <BasePath>/icustomer</BasePath>
    <VirtualHost>default</VirtualHost>
    <VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="default">
    <TargetEndpoint>default</TargetEndpoint>
</RouteRule>
 </ProxyEndpoint>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<Description/>
<PreFlow name="PreFlow">
    <Request/>
    <Response/>
</PreFlow>
<Flows>
    <Flow name="specficcust">
        <Description/>
        <Request>
            <Step>
                <FaultRules/>
                <Name>Extract-Variables-1</Name>
            </Step>
            <Step>
                <FaultRules/>
                <Name>Assign-Message-1</Name>
            </Step>
        </Request>
        <Condition>(proxy.pathsuffix MatchesPath &quot;/{cust_id}&quot;) and (request.verb = &quot;GET&quot;)</Condition>
        <Response/>
    </Flow>
</Flows>
<PostFlow name="PostFlow">
    <Response>
        <Step>
            <FaultRules/>
            <Name>Extracting-for-Stats</Name>
        </Step>
        <Step>
            <FaultRules/>
            <Name>Statistics-Collector-1</Name>
        </Step>
    </Response>
    <Request/>
</PostFlow>
<HTTPTargetConnection>
    <URL>https://api.usergrid.com/siddharth1/sandbox/icustomer</URL>
</HTTPTargetConnection>
</TargetEndpoint>
提取Stats代码-

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true"     name="Extracting-for-Stats">
<DisplayName>Extracting for Stats</DisplayName>
<FaultRules/>
<Properties/>
 <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<JSONPayload>
    <Variable name="customer_id">
        <JSONPath>$.entities[0].cust_id</JSONPath>
    </Variable>
</JSONPayload>
<Source clearPayload="false">response</Source>
<VariablePrefix>apigee</VariablePrefix>

</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="test_cust_id" ref="customer_id" type="STRING">NO_ID</Statistic>
</Statistics>
</StatisticsCollector>

ExtractVariables指定apigee的VariablePrefix。我希望提取的字段可以从apigee.customer\u id访问,而不仅仅是customer\u id,这将在StatisticsCollector检查中返回null。我想这就是为什么您会获得默认的NO\u ID。

我已经尝试了apigee.customer\u ID,但我在自定义报告中仍然会获得默认的NO\u ID。我甚至只尝试了customer_id,它在定制报告中没有设置。我已经注释掉了VariablePrefix,并且报告可以正常工作。我正在收到报告,但在10份报告中,如果您致电https://api.usergrid.com/siddharth1/sandbox/icustomer 如果由于任何原因失败,您将跳转到FaultRules,而不是继续PostFlow,并且您将永远无法达到StatisticsCollector策略。您可以在代理和目标故障规则中附加StatisticCollector策略,以确保它总是被命中(如果您愿意)。