[英]How to filter AppInsights custom metrics with REST API
我正在嘗試使用 REST API 來檢索 AppInsights 自定義指標並在查詢中使用過濾器。
創建指標的代碼:
var telemetry = new MetricTelemetry();
telemetry.Context.InstrumentationKey = instrumentationKey;
telemetry.Name = FacebookFupMetricName;
telemetry.Value = amount;
telemetry.Timestamp = DateTime.Now;
telemetry.Properties["agencyCode"] = agencyCode;
telemetry.Properties["accountCode"] = accountCode;
telemetry.Properties["category"] = category;
telemetry.Properties["action"] = action;
var client = new TelemetryClient();
client.TrackMetric(telemetry);
client.Flush();
運行此代碼時,該指標在 Azure 中創建。
現在我想使用 REST API 來檢索指標並在查詢中使用過濾器。 當我使用過濾器時
category eq 'cat001'
查詢以錯誤結束
以下維度在此指標的過濾子句中無效:類別
查詢 url 是:
https://dev.applicationinsights.io/apiexplorer/metrics?appId=<appId>&apiKey=<apiKey>&metricId=customMetrics%2FFacebookFupAction×pan=P1D&aggregation=sum&filter=category%20eq%20%27cat001%27
問題是,是否可以使用維度過濾自定義指標?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.