不支持用于Azure Web应用程序自动缩放的AppInsights自定义指标

时间:2019-06-05 10:39:31

标签: azure azure-application-insights autoscaling azure-webapps

我一直在按照本教程按自定义指标(https://docs.microsoft.com/en-us/azure/azure-monitor/platform/autoscale-custom-metric)自动缩放Web应用程序,不幸的是,Azure一直告诉我,已部署的Web应用程序不支持我的自定义指标。谁能帮助我,并指出为什么我的Web应用程序无法按自定义指标进行缩放。如果需要,我位于奥地利,正在将Web应用程序部署到西欧。

谢谢!

资源'/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/components/AppInsightsTestApp201不支持指标'NumOfRequests'

{  
   "authorization":{  
      "action":"microsoft.insights/autoscalesettings/write",
      "scope":"/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/autoscalesettings/dtc-serviceplan-low-prod-webwts-Autoscale-468"
   },
   "caller":"robi-91@hotmail.com",
   "channels":"Operation",  
   "correlationId":"79d4a60d-f03b-4e3e-b556-8326f202086c",
   "description":"",
   "eventDataId":"c157fde0-301d-475c-bda6-cdb5a52420ed",
   "eventName":{  
      "value":"EndRequest",
      "localizedValue":"End request"
   },
   "category":{  
      "value":"Administrative",
      "localizedValue":"Administrative"
   },
   "eventTimestamp":"2019-06-05T07:12:12.5615148Z",
   "id":"/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/autoscalesettings/dtc-serviceplan-low-prod-webwts-Autoscale-468/events/c157fde0-301d-475c-bda6-cdb5a52420ed/ticks/636953155325615148",
   "level":"Error",
   "operationId":"79d4a60d-f03b-4e3e-b556-8326f202086c",
   "operationName":{  
      "value":"microsoft.insights/autoscalesettings/write",
      "localizedValue":"Update autoscale setting"
   },
   "resourceGroupName":"dtc",
   "resourceProviderName":{  
      "value":"microsoft.insights",
      "localizedValue":"Microsoft Insights"
   },
   "resourceType":{  
      "value":"microsoft.insights/autoscalesettings",
      "localizedValue":"microsoft.insights/autoscalesettings"
   },
   "resourceId":"/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/autoscalesettings/dtc-serviceplan-low-prod-webwts-Autoscale-468",
   "status":{  
      "value":"Failed",
      "localizedValue":"Failed"
   },
   "subStatus":{  
      "value":"BadRequest",
      "localizedValue":"Bad Request (HTTP Status Code: 400)"
   },
   "submissionTimestamp":"2019-06-05T07:13:48.1357184Z",
   "subscriptionId":"4c6ad49f-5448-4a16-bef1-de2342c0626e",
   "properties":{  
      "statusCode":"BadRequest",
      "serviceRequestId":"00000000-0000-0000-0000-000000000000",
      "statusMessage":"{\"code\":\"UnsupportedMetric\",\"message\":\"Metric 'NumOfRequests' is not supported for resource '/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/components/AppInsightsTestApp20190604021321'\"}"
   },
   "relatedEvents":[  

   ]
}

修改 我正在将这样的自定义指标从应用程序发送到Application Insights: Code for sending custom metrics。在Azure Web App中,我尝试像下面这样配置自动缩放: Configuring autoscaling by custom metric。从图像上可以看出,我的目标是指标名称空间“ azure.applicationinsights”,该名称空间确实包含我的自定义指标,但是保存后Azure告诉我不可能:enter image description here

1 个答案:

答案 0 :(得分:0)

我遵循了document,并且能够根据我的自定义指标启用自动缩放功能:

enter image description here

请确保在添加规则时选择正确的选项:

enter image description here

希望这会有所帮助!