Azure Monitor: Updating queries to match behavior differences after upgrading Grafana

Hi,

I used Azure Monitor to access Azure Log Analytics.
On Grafana 7.0.6, Grafana could create a time-series from the returned data.
Now I upgraded to 7.2.2 and I get the message: “could not convert frame to time series, returning raw table”.

How to reproduce:
Query an IoT hub with Grafana 7.0.6

    AzureDiagnostics
    | where $__timeFilter(TimeGenerated) 
    | where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
    | where Category == "Connections" and (OperationName == "deviceConnect" or OperationName == "deviceDisconnect")
    | extend DeviceId = tostring(parse_json(properties_s).deviceId)
    | project metric = DeviceId, state = iff(OperationName == "deviceConnect", 1, 0), TimeGenerated
    | order by metric asc, TimeGenerated

Repeat the Query for Grafana 7.2.2

Old:


New:

If I use “order by TimeGenerated asc”, Grafana can create a TimeSeries. However the order of the results is not the one I want.

Correct display of device connectivity with “discrete-plugin”:
–sorry cannot post, since I am a new member

Wrong display with “order by TimeGenerated asc”
–sorry cannot post, since I am a new member

Does someone know some keywords to enforce the old behaviour?

1 Like

Additional Screenshots, missing from above

Correct display of device connectivity with “discrete-plugin”:

Wrong display with “order by TimeGenerated asc”:

1 Like

Hi fraga1,

I had the completely same issue. I fixed it with changing the order from asc to desc

AzureDiagnostics
   | where $__timeFilter(TimeGenerated) 
   | where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
   | where Category == "Connections" and (OperationName == "deviceConnect" or OperationName == "deviceDisconnect")
   | extend DeviceId = tostring(parse_json(properties_s).deviceId)
   | project metric = DeviceId, state = iff(OperationName == "deviceConnect", 1, 0), TimeGenerated
   | order by metric desc, TimeGenerated

If this fixes your problem, please mark this as solved.

Hi there. Did you really try the query? desc fixes nothing :sweat:
It’s just “could not convert frame to time series, returning raw table”.

1 Like

On which kusto version are you?

Sadly I do not know the exact kusto version.
On the Grafana side I am using the latest Grafana plugin of the main repository. Here the link to the one before integration: “Azure Monitor”.
On the Azure side I query against a Log Analytics Workspace pay-as-you-go.


Maybe a more straightforward question.
How do I get this selection back?
In the Query Inspector (Version 7.0.6) It is called Transformer “None” and I can select results. Which are correctly translated into time serieses. As seen by Time (20).
The 7.2.2 version is doing something differently and no automatic transformation takes place. How do I enforce the old behaviour?
Another Screenshot from 7.0.6:

1 Like