{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Analytics /
avatar image
0
Question by Siddharth Barahalikar · Apr 02, 2015 at 07:21 AM · 579 Views analyticsextractvariablescustom reports

custom reports not working.

Hi guys, I'm stuck at generating custom reports using Statistics Collector.

My scenario,

I have an BaaS DB with a collection named "icustomer" which has few name/value pair's.

I created a proxy(icustomer) to display an specific Customer(Resource name- specificcust) depending on unique "cust_id".

For Specific Customer I did "extract variable and assign variable policies" which is working fine.

Now to get custom reports I again added an Extract Variable policy to extract cust_id from JSON Path and then added and Statistic Collector policy to get stats.

Then I created an new report from Analytics and saved it. But reports aren't generated.

Where did I go wrong?

Proxy Link - http://siddharth1-test.apigee.net/icustomer

Extract Variable Policy for 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>$.cust_id</JSONPath>
        </Variable>
    </JSONPayload>
    <Source clearPayload="false">request</Source>
    <VariablePrefix>apigee</VariablePrefix>
    
</ExtractVariables>


Statistic Collector Policy

<?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>

Target Endpoint Code

<?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>
            <Response>
                <Step>
                    <FaultRules/>
                    <Name>Extracting-for-Stats</Name>
                </Step>
            </Response>
            <Response>
                <Step>
                    <FaultRules/>
                    <Name>Statistics-Collector-1</Name>
                </Step>
            </Response>
            <Condition>(proxy.pathsuffix MatchesPath "/{cust_id}") and (request.verb = "GET")</Condition>
        </Flow>
    </Flows>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <HTTPTargetConnection>
        <URL>https://api.usergrid.com/siddharth1/sandbox/icustomer</URL>
    </HTTPTargetConnection>
</TargetEndpoint>

Custom Report Screenshot

screenshot-3.jpg (50.1 kB)
Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

5 Answers

  • Sort: 
avatar image
2
Best Answer

Answer by seshi · Apr 02, 2015 at 09:25 AM

Hi @Barahalikar Siddharth

With the provided information it is seems that one of the following reasons are responsible for this issue: 1. In the Target Endpoint Code, there are two <Response> flow in the resource "specficcust" which shouldn't be the there, it should be like following: <Response> <Step> <FaultRules/> <Name>Extracting-for-Stats</Name> </Step> <Step> <FaultRules/> <Name>Statistics-Collector-1</Name> </Step> </Response> 2. Extracting-for-Stats policy should extract the cust_id from response object. <Source clearPayload="false">response</Source> 3. Please check your JSON path in the policy Extracting-for-Stats, it should be $.entities[0].cust_id

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Siddharth Barahalikar   · Apr 02, 2015 at 10:22 AM

Thanks for highlighting those 3 things. I made the changes but still I can't get the reports.

As in Statistic Collector Policy, I mentioned "NO_ID" which should come when an invalid "cust_id" is requested. So this is reflecting in the custom reports graphs.

<Statistics>
        <Statistic name="test_cust_id" ref="customer_id" type="STRING">NO_ID</Statistic>
    </Statistics>


screenshot-4.jpg (40.6 kB)
Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by seshi · Apr 02, 2015 at 10:31 AM

Hi @Barahalikar Siddharth

Seems like the variable customer_id is still not populated in extractVariable policy, you are getting the default value ( NO_ID ) assigned by you, If you are allowed to share the debug Trace information, Can you please post it here.

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Siddharth Barahalikar   · Apr 02, 2015 at 10:56 AM 0
Link

I have attached it please have a look. It is just for learning purpose so if needed I can even attach the whole proxy zip file.

trace-1427972009844.zip

avatar image
0

Answer by seshi · Apr 02, 2015 at 11:05 AM

In the share trace log, "Extracting-for-Stats" policy is not seen executing anywhere. Can you share the proxy and Request made by you.

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Siddharth Barahalikar   · Apr 02, 2015 at 11:12 AM 0
Link

Yeah I've seen that, don't know why its happening...BTW FYI there is an OAuth policy included which is disabled in the proxy

These are the requests,

http://siddharth1-test.apigee.net/icustomer/F7D4F6

http://siddharth1-test.apigee.net/icustomer/X4L5B2

icustomer-rev5-2015-04-02-1.zip

avatar image
0

Answer by Siddharth Barahalikar   · Apr 02, 2015 at 11:32 AM

Hi @seshi ,

I did few changes to the proxy...now both the "Extracting-for-Stats" and "statistics-collector" policies are executing and can be seen in trace. But now I'm getting "not set" in reports.

What I did was, I changed <Response> tags from "specificcust Target Endpoint" to "PostFlow Target Endpont" .

Hope this might help you debug the issue.


screenshot-5.jpg (36.8 kB)
Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unable to set a Custom Statistic variable. 1 Answer

How to use "Resource Flow" Dimension in Analytics 4 Answers

Analytics/Reports Timeout for duration longer than 1 HR 2 Answers

Statistics Collector Custom Dimension not appearing 0 Answers

Filter a custom report by Conditional Flow name 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges