Application Insights, can't group by JSON object

Hello,

I have recently started using the Azure monitor plugin for application Insights (and it’s awesome!) however a key feature for me is being able to group by a field within a JSON object. Hard to explain so let me give an example…

Within Application Insights under my performance counters table there’s a ‘customDimensions’ column where the values are JSON objects. Within this JSON object, one value is ‘Docker Host’. Within Grafana I create a graph and edit it’s metrics to look for the performance counters table and select ‘processor CPU percentage’. This all works, I now want to ‘Group By’ my ‘Docker Host’ value. I can select ‘customDimensions/Docker host’ from the drop down but only to receive an error. In the top right of my graph a red explanation mark shows, the error within has no details under ‘Panel Description’ and this as the response:
{
“error”: {
“message”: “Unexpected error occurred”,
“code”: “InternalServerFault”
}
}

Is this a known bug or am I doing something wrong? Any help is appreciated.

Thank you for your time,
Connor

Hi,

I haven’t used the Azure monitor plugin for application Insights. But to ease investigation it would be valuable if you could have a look in the Grafana server log when above error happens and include that information here, if any.

Based on that information I may be able to help you.

Thanks in advance

Marcus

Hi Marcus,

Thanks for your reply, here is the relevant lines in the log file. I have replaced my Application Id with zero’s and I’ve had to place the full log onto two messages due to their being links and I’m a new user:

t=2017-12-22T13:49:54+0000 lvl=info msg=Requesting logger=data-proxy-log url=“https:api.applicationinsights.io/beta/apps/00000000-0000-0000-0000-000000000000/metrics/performanceCounters/processorCpuPercentage?timespan=2017-12-21T13:49:54Z/2017-12-22T13:49:54Z&aggregation=avg&segment=customDimensions/Docker%20host&interval=PT2M”

t=2017-12-22T13:49:54+0000 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/appinsights/beta/apps/00000000-0000-0000-0000-000000000000/metrics/performanceCounters/processorCpuPercentage status=500 remote_addr=[::1] time_ms=243 size=78 referer=“http://localhost:4000/dashboard/db/athens-ai?panelId=1&fullscreen&edit&orgId=1&tab=metrics

t=2017-12-22T13:49:54+0000 lvl=info msg=Requesting logger=data-proxy-log url=“https://api.applicationinsights.io/beta/apps/00000000-0000-0000-0000-000000000000/metrics/performanceCounters/processorCpuPercentage?timespan=2017-12-21T13:49:54Z/2017-12-22T13:49:54Z&aggregation=avg&segment=customDimensions/Docker%20host&interval=PT2M

t=2017-12-22T13:49:55+0000 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/appinsights/beta/apps/00000000-0000-0000-0000-000000000000/metrics/performanceCounters/processorCpuPercentage status=500 remote_addr=[::1] time_ms=313 size=78 referer=“http://localhost:4000/dashboard/db/athens-ai?panelId=1&fullscreen&edit&orgId=1&tab=metrics

Thanks,
Connor