Calculate metrics based on APIM API prodcut

Venkatesh Korrapati 20 Reputation points
2025-01-31T19:00:18.49+00:00

Hi Team,

While creating shared dashboard for each API in APIM. I see issues with product based grouping.
To calculate health(uptime, error rate) , Performance metrics (response time, latency ) and Success/failures rate percentage metrics for each API in APIM .

using re-emit policy I am unable to fetch above metrics. Could you please suggest how to achieve this using product Id based filtering.

Thanks

Venkat

Contact:+1(913-951-6781).

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,455 questions
Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,285 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Madugula Jahnavi 0 Reputation points Microsoft Vendor
    2025-02-06T13:58:09.31+00:00

    Hello @Venkatesh Korrapati,
    Thank you for reaching out to Microsoft Q&A!

    To calculate or send custom metrics to app insight loggers, there is no policy called re-emit available in APIM policy references as you also mentioned. There is an existed policy called emit-metric policy which sends custom metrics to application insights or azure monitor and the policy format you used is accurate. So now, adding an emit-policy in the global APIM should work but here there are some other conditions you need to check.

    Firstly, check if the logger diagnostics has been enabled to "True" to receive the API logs based on the given filtering.

    And also, there are some limitations when sending metrics through emit policy like You can configure a maximum of 10 custom dimensions per policy.

    Reference MS Doc for all the limitations: https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-app-insights?tabs=rest#limits-for-custom-metrics Check here and validate your metrics accordingly.

    Also, make sure that you set "with dimensions" field under linked Application insights >> Usage and estimation costs >> custom metrics (preview) >> select "with dimensions" and click on ok. It should be enabled before sending metric dimensions as shown below.

    custommetrics

    Mentioning above, you can also refer this https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-app-insights?tabs=rest#emit-custom-metrics MS Doc on how to integrate the API with Application insights clearly.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.