When I try to join on one of the customDimensions fields, I get a syntax error: "join attributes may be only column entity or equality expressions". I am able to join on non-custom columns such as name or timestamp.
Sample code:
let ExperimentLaunchedEvents = customEvents | where name=="ExperimentLaunched" and timestamp > now(-30d);
let ExperimentTerminatedEvents = customEvents | where name=="ExperimentTerminated" and timestamp > now(-30d);
ExperimentLaunchedEvents
| project name, timestamp, experimentId=customDimensions.ExperimentId
| join kind=leftanti (ExperimentTerminatedEvents
| project name, timestamp, experimentId=customDimensions.ExperimentId) on tostring(experimentId)
If joining on customDimensions columns is not supported, is there any way to achieve selecting launched experiments that haven't been terminated? Thanks!
In the Azure Portal, navigate to the Application Insights resource, and click Log Analytics. Log queries help you to fully leverage the value of the data collected in Azure Monitor Logs. Query your custom events by entering “customEvents” in the prompt and click Run.
In Application Insights, a custom event is a data point that you can display in Metrics Explorer as an aggregated count and in Diagnostic Search as individual occurrences. (It isn't related to MVC or other framework "events.") Insert TrackEvent calls in your code to count various events.
Application Insights telemetry model defines a way to correlate telemetry to the operation of which it's a part. For example, a request can make a SQL Database calls and recorded diagnostics info. You can set the correlation context for those telemetry items that tie it back to the request telemetry.
As mentioned by John in the comments When using custom dimensions for any operations you need to convert it to a type that can be used by the query engine. In this case I use tostring(), but you can also use other functions like toint().
I also extend a column type so it can be reused in clauses like join or where without having to use the long hand over and over again.
ExperimentLaunchedEvents
| extend experimentId=tostring(customDimensions.ExperimentId)
| project name, timestamp, experimentId
| join kind=leftanti (ExperimentTerminatedEvents
| extend experimentId=tostring(customDimensions.ExperimentId)
| project name, timestamp, experimentId)
on experimentId
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With