简体   繁体   中英

What is iKey in traces table - KQL [ Kusto Query Language] - Application Insights - Also query Optimization of following KQL query

I was getting some exceptions around 60 exceptions when I run my .NET Core Application - of a particular type - Partner center exceptions.

I have dealt with those exceptions but now I am writing some KQL queries so that I come to know if anything goes wrong beforehand.

I want to write KQL query which in future catches exceptions from partner center but not that type of exception - so how to filter them out?

My Query looks like -

 traces 
| where customDimensions.LogLevel == "Error"
| where operation_Name == "functionName"
| where iKey != "************"

I saw this iKey - what is it? and how can I write a desired query is what I need to know.

Also: Could not find purchase charge for customer and "errorName":"RelationshipDoesNotExist" ----> this all comes in message and also customDimensions field

Can I extract this errorName and exclude these type of exceptions? Any way to do that?

For now I have used:

where message !contains_cs "Could not find purchase charge for customer"

but it has high compute price, so looking for an alternate to optimize the query.

iKey correspondents to the instrumentation key:

When you set up Application Insights monitoring for your web app, you create an Application Insights resource in Microsoft Azure. You open this resource in the Azure portal in order to see and analyze the telemetry collected from your app. The resource is identified by an instrumentation key (ikey) . When you install the Application Insights package to monitor your app, you configure it with the instrumentation key, so that it knows where to send the telemetry.

( source )

I want to write KQL query which in future catches exceptions from partner center but not that type of exception - so how to filter them out?

Exceptions are stored in the exceptions table. You can filter them based on a known property like the exception type. For example, say you want all exceptions except those of type NullReferenceException you can do something like this:

exceptions
| where ['type'] != "System.NullReferenceException"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM