0

I have a job running hourly (at slightly different times) and logging metrics into Application Insights.

I want to trigger an alert based on the metrics from the latest job run.

let metrics = customMetrics | where ... | extend run = bin(timestamp, 1m);
let latestRun = metrics | top 1 by run desc;
metrics | join latestRun on run

Looking at metrics I can see this query should be returning 8 results. But it returns only the first of them. Why?

Iain
  • 1,797
  • 1
  • 20
  • 38

1 Answers1

0

Surprisingly, this is by design - the query language does not use inner joins by default, instead it uses "innerunique" joins.

Switching to join kind=inner fixed my original query.

Iain
  • 1,797
  • 1
  • 20
  • 38