Rendering Azure Log Analytics make-series in Grafana

An example of make-series

For reference, here’s a small query using make-series and how it’s rendered in the Azure Portal:

ContainerLog
| make-series Count=count() on TimeGenerated from ago(1d) to now() step 5m

Transforming make-series data

Lucklily, we can use our Kusto-foo to transform the data from make-series to be in a format Grafana can handle.

// Expand all data into individual rows
| mv-expand Series, TimeGenerated
// Map each column from the "dynamic" type back into the type we expect
| extend Series=todecimal(Series), TimeGenerated=todatetime(TimeGenerated)
ContainerLog
| make-series Series=count() on TimeGenerated from $__timeFrom() to $__timeTo() step $__interval
| mv-expand Series, TimeGenerated
| extend Series=todecimal(Series), TimeGenerated=todatetime(TimeGenerated)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adriaan Knapen

Adriaan Knapen

Founder at Unveiler.io / ClaimR.tools — DevOps Consultant at Eficode — Living in Helsinki