Search code examples
azure-application-insightsazure-monitorazure-monitor-workbooks

Get exception details from a Azure Monitor Workbook


In application insights I can click on an exception and find nicely formatted information about it if I click on it.
This could look like this:

enter image description here

I would like to archive the same in an Azure Workbook. Here I can display all my exceptions with the KQL Term "Exceptions".
With the column settings I was hoping to be able to create a link to the Application insights page that shows me the same result like in the picture above.
I use this configuration:

enter image description here

Now I have a link, but when I click it there is just an empty pane:

enter image description here

Is there anything I misunderstand?
How do I need to configure my column settings to get a direct link to the Exception details like in clicking on the same item in Application Insights?


Solution

  • While not super obvious, the info bubble for the link settings shows:

    column is expected to be an itemId

    The value in the column is expected to be an itemId of an exception telemetry item.

    So as long as your query returns the itemId field, you can map that in the column settings:

    item id settings

    (also, iirc, if the query returns a timestamp column, the details view will try to narrow down its search to just use a range around that time instead of trying to query a larger amount of time to find an item with that id)

    Edit to add: if you are using thee Log Analytics based schema, AppExceptions the field is there but missing from documentation and the schema, there is an _ItemId field that is this field. I'm working with the App Insights/ Log Analytics teams to get this properly documented there.

    Also, even if you're using the log analytics based app insights, you can also always query through the "app insights" resource and use the app insights schema the "old" way as well. (unless you're doing something specific in log analytics that the AI based way doesn't have?)

    example:

    • left is query against app insights schema, with exceptions table and itemId column
    • right is query against logs schema, with AppExceptions table and _ItemId field, returning the same exact item by that id value. you can seee that the _ItemId field shows red squiggles like it isn't valid, but that is incorrect, you'll get the right row if you run the query.

    screenshot showing same query 2 ways