Hi Team,
We are relying on the apigee metrics api to get the metrics data from apigee and display on our portal. One of the usecase we have is to show the error rate by API, and we have some APIs with variable path. Example: GET '/v1/report/5345632'
Expectation would be to report the error rate for all the get v1 report calls under one bucket, but by default apigee will report them as different api calls due to variable report id in the path.
To overcome this issue, we have started using DataCapture policy to report these calls with one generic api path. And the policy code is shared below. This was working fine but recently we started seeing that most of the times, the custom dimension captured is reported as '(not set)'.
<DataCapture name="DataCapturePolicy" continueOnError="false" enabled="true">
<DisplayName>DataCapturePolicy</DisplayName>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<Capture>
<Collect ref="current.flow.name"/>
<DataCollector>dc_proxy_path_collector</DataCollector>
</Capture>
</DataCapture>
And the flow name is set as below:
<Flow name="v1/report/{reportId}">
<Description>Get Job Status</Description>
<Request>
<Step>
<Name>DataCapturePolicy</Name>
</Step>
</Request>
<Response/>
<Condition>(proxy.pathsuffix MatchesPath "/v1/report/*") and (request.verb = "GET")</Condition>
</Flow>
Is this the right approach to handle this kind of usecase, if yes, can you suggest what might be going wrong.
We are using Apigee X.
Thanks in Advance!