Tuesday, September 3, 2019

Azure @ Enterprise - Querying entire Application Insights columns for something

Problem

We are about to debug somebody's else application. The original developers are not there. Nobody there to give details about how the logging is implemented except they say AppInsight is integrated. We are in trouble. We have an error / informal message from the application but don't know where to start with. Yes, this is a situation in the enterprise world.
In such conditions, it is time waste if we query the Application Insights item types one by one. It is like searching for a needle in the Haystack. Technically, it is searching for entire sources and all the columns inside.

If we are from the SQL background there is a tendency that we think in SQL and convert to AppInsight's query language currently called KQL (Kusto Query Language). Since SQL don't have a feature to search all the tables & columns of a database with one query, we never think there will be an option in KQL to do so.

Solution - Search entire AppInsight

But there is an easier way in KQL. Below is the query which searches entire Application Insights and all the columns.

union *
| where * contains "exception"

Hope the query is self explainable. It is simply the magic of *

Happy debugging.

No comments: