0
votes

I'm trying to render a line chart using the values collected from a custom metric in Azure Application Insights. Here is my query:

customMetrics
| where name == "MyCustomMetric"
| extend MyMetric = todouble((value / 1000))
| project MyMetric

Unfortunately, when I click the "Chart" option in the results pane I get the following message: "Failed to create visualization: The Line can't be created as you are missing a column of one of the following types: Int32, Int64 Single or Double".

If I call gettype() on MyMetric, it shows the type is "real". If I don't perform the division operation on the value, the chart renders fine. How can I render the computed value as a line chart?

1

1 Answers

2
votes

My guess is that you'd also need to project timestamp:

| project timestamp, MyMetric

Without that there is no X-axis to chart against.

You can also use aggregations with timestamp, if any. For instance, you can average metric each minute:

| summarize avg(MyMetric) by bin(timestamp, 1h)
| render timechart