Issue with DEVELOPER PORTAL 5.2 and Metric data
search cancel

Issue with DEVELOPER PORTAL 5.2 and Metric data

book

Article ID: 271496

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

When we run portal metrics for papi , https://apim-ssg.<tenant_domain>:9443/developer/analytics/metrics/v1/_query , we get some random app Id in the response and when we search the appId in portal papi it's blank 

Verified the missing name POST to 
https://apim-ssg.<tenant_domain>:9443/tenant502/analytics/metrics/v1/_query

Body:
{
    "metrics": {
        "type": "hits",
        "aggregation": "count"
    },
    "timeRange": {
        "type": "interval",
        "interval": "2023-08-03T18:01:00/2023-08-03T23:59:59",
        "aggregation": "day"
    },
    "groupBy": [
        {
            "type": "default",
            "dimension": "orgId"
        },
        {
            "dimension": "appId",
            "type": "default"
        }
    ]
}

Responses 
{
            "appName": "",
            "appId": "c62c1ca5-473b-4481-a782-46ccc0fd5983",
            "orgName": "<OrganizationName>",
            "orgId": "e844fa27-6313-4202-a84b-23da99ad1e2d",
            "count": 24,
            "buckets": [
                {
                    "date": "2023-08-03T00:00:00.000Z",
                    "count": 24
                }
            ]
        }



Environment

Release : 5.2

Cause

The template being used for Portal was older version 4.5.  It was used to keep the custom changes for i.e cache 

  • Standard Policy Template Fragment - OAuth 2

The 4.5 version sets apiKeyRecord.id to context variable portal.analytics.application.uuid. In 4.5 this was not a problem because they matched, but new in release this does not match.  Applications now support multiple keys 

The section in red was added creating a new variable for appUuid   portal.analytics.application.uuid

 

Resolution

Need to use the newer Standard Policy Template Fragment - OAuth 2, then make the 2 custom changes to it 

Also if customization was done in any of the following fragments the same procedure should be followed 

What Fragment are you using to enable Portal Analytics:

  • Standard Policy Template Fragment - API Key
  • Standard Policy Template Fragment - OAuth 2
  • Standard Policy Template Fragment - NoAuth
  • Custom