user31673
user31673

Reputation: 13695

Application Insights Query Issue

I want to query AI to find all trace entries where the requests table has success == false. The results should be all the trace entries that pertain to the InovationsId that had a failure. I tried this query and it is failing. Both the traces and the requests table have a customDimensions['InvocationId'] field that is the link that I want to use.

I tried these queries and I get a syntax error

    traces
    | join (requests | where success == false) on customDimensions['InvocationId']

    traces
    | join (requests | where success == false) on $left.customDimensions['InvocationId'] == 
    $right.customDimensions['InvocationId']

    traces
    | join (requests | where success == false) on traces.customDimensions['InvocationId'] == requests.customDimensions['InvocationId']

This is the query results message I get:

join: Invalid entities used as join attributes. When using equality expressions, entities should be used by specifying its source $left or $right.

Upvotes: 1

Views: 767

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29950

This is because the customDimensions['InvocationId'] is dynamic type, you should convert it to string type by using tostring() method.

Sample as below:

traces
| extend aa=tostring(customDimensions['InvocationId'])
| join (
       requests 
       | where success == false
       | extend aa=tostring(customDimensions['InvocationId'])
) on aa

Upvotes: 3

Related Questions