I have setup the azure monitor plugin, with azure application insights. With this set up I can create graphs based on the metrics in application insights. In azure I can go from application insights to log analytics and do some queries, but I can’t seem to find out how I can do that in Grafana (There is no workspace for the app insights). So I can’t access my logs in application insights. Can someone help me with this?
Hi @avollering have you solved this? According to the following commit, it seems to me that the support for raw log analytics queries might have been added in Grafana 6.6
Adding to what @myeviltwinxi has replied if you intend to plot a time series graph make sure you add the following in your query:
| project Timegenerated=timestamp, problemId
As a rule of thumb, log analytics collects timestamp under the column “TimeGenerated” and application insights collects it simply as timestamp. If you want to use the inbuilt grafana filter like $__interval, you would need to rename timestamp to timegenerated otherwise you would get an error: “Data outside time range”
An example query (to plot the average duration of a request) would like as follow:
app("/subscriptions/XXX-XXXX-Subsciprtion-ID/resourceGroups/XXResourceGroupName/providers/microsoft.insights/components/XXX-App-Insight-Name").requests
| where url contains "something"
| project Timegenerated=timestamp, duration
| summarize something_avg=avg(duration) by bin(Timegenerated, $__interval)
| order by Timegenerated asc
We are running 6.6.2 and have no issues with this query