GooseZA
GooseZA

Reputation: 1117

Unable to set Azure Dashboard card to use "Set in Query"

I have a query to check average response times over:

  1. Last 24 hours
  2. 24-192 hours
  3. The difference between them as a percentage

let requests0to24HoursAgo = requests
    | where timestamp > ago(24h)
    | summarize last0to24HoursAverageRequestDuration=avg(duration), id=1;
let requests24to192HoursAgo = requests
    | where timestamp > ago(192h)
    | where timestamp < ago(24h)
    | summarize last24to192HoursAverageRequestDuration=avg(duration), id=1;
let diff = requests0to24HoursAgo
    | join
        requests24to192HoursAgo
        on id
    | extend Diff = (last0to24HoursAverageRequestDuration - last24to192HoursAverageRequestDuration) / last24to192HoursAverageRequestDuration * 100
    | project
        ["Average response (last 0-24 hours)"]=last0to24HoursAverageRequestDuration,
        ["Average response (last 24-192 hours)"]=last24to192HoursAverageRequestDuration,
        Diff;
diff

This works perfectly in the Logs section in Azure, but as soon as I pin the query to a dashboard, it's unable to run it with the date range "Set in query" and returns NaN for 2 of the values.

When I click "Open Editing Pane", set it to "Set in Query" and run it, it works. When I then click "Apply", it is still broken on the dashboard.

enter image description here

enter image description here

Upvotes: 2

Views: 1026

Answers (2)

johnmoarr
johnmoarr

Reputation: 522

I stumbled across the same issue when the timespan I set within the query (| where timestamp > ago(7d)) was ignored in the dashboard.

I've tested the way with the tile settings, like VenkateshDodda-MT mentioned:

  1. Open the tile settings in the dashboard (-> Configure tile settings)
  2. Tick Override the dashboard time settings at the tile level.
  3. Select a greater timespan than 24h

Although there is no Set in query option like in the query editor, it would be enough to set a timespan of 30 days in your case.

I've also successfully tested it with your query.

Upvotes: 0

VenkateshDodda
VenkateshDodda

Reputation: 5506

As per the documentation, In log analytics the default time range of 24 hours applied to all queries.

  • We have tested in our local environment, we tried overriding the time range parameter using the dashboard tile setting which didnt help the request you made looks like a feature request.
  • Would suggest you to submit a feedback forum & raise the same issue over Microsoft Q&A

Upvotes: 0

Related Questions