I have a proxy where i would like to collect statistics based on the start/end date params of the api. For example if startDate=2019-01-03 and endDate=2019-03-02 then i would like to collect statistics like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <StatisticsCollector async="false" continueOnError="false" enabled="true" name="collect-statistics-request"> <DisplayName>Collect Statistics Request</DisplayName> <Statistics> <Statistic name="myname" ref="varname" type="String"/> .. .. </Statistics> </StatisticsCollector>
where i need to collect N <Statistic> entries but N is variable. I don't think the policy supports something like this. I've tried to do it another way where i have another proxy that collects statistics and i can call it from my current proxy and pass in the name of the statistic ..however that would mean that that proxy would have to be in a product that is then assigned to my developer's app.
Is there another way to achieve this?
How dynamic is your list?
If you're expecting a subset of a known set of variables to go to analytics, then you may be able to configure the statistics collector with the full list of statistics and it will use the non-null variables
in my case i don't know since what i'm trying to collect is the 'months' of the date range being passed into the proxy. For example if a client is calling my api with the params start_date=2019-01-01&end_date=2019-06-15
then i would like to collect statistics with the following statistics:
012019
020019
032019
042019
052019
062019
Basically i want to collect the 'months' of the duration.
What if you store it as a dimension against monthstart and monthend, then have a traffic metric against these dimensions?