VMSS with service fabric cluster autoscale

只谈情不闲聊 提交于 2019-12-01 11:11:06

Service Fabric does support AutoScale it's just not very well documented. Here is a basic documentation - https://azure.microsoft.com/en-us/documentation/articles/service-fabric-cluster-scale-up-down/ which uses "XmlCfg" element to configure counters. However there is a way to do it via JSON as well which is more readable. Here is a snippet of a "settings" block from "IaaSDiagnostics" extension.

Note the inclusion of "PerformanceCounters" and "Metrics" elements under "DiagnosticMonitorConfiguration".

{
  "name": "Windows_VMDiagnosticsVmExt",
  "properties": {
    "type": "IaaSDiagnostics",
    "autoUpgradeMinorVersion": true,
    "protectedSettings": {
      "storageAccountName": "[variables('applicationDiagnosticsStorageAccountName')]",
      "storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('applicationDiagnosticsStorageAccountName')),'2016-01-01').keys[0].value]",
      "storageAccountEndPoint": "https://core.windows.net/"
    },
    "publisher": "Microsoft.Azure.Diagnostics",
    "settings": {
      "WadCfg": {
        "DiagnosticMonitorConfiguration": {
          "overallQuotaInMB": "50000",
          "PerformanceCounters": {
            "PerformanceCounterConfiguration": [
              {
                "annotation": [],
                "scheduledTransferPeriod": "PT1M",
                "counterSpecifier": "\\Processor(_Total)\\% Processor Time",
                "sampleRate": "PT1M"
              },
              {
                "annotation": [],
                "scheduledTransferPeriod": "PT1M",
                "counterSpecifier": "\\Memory\\% Committed Bytes in Use",
                "sampleRate": "PT1M"
              }
            ]
          },
          "Metrics": {
            "resourceId": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', variables('defaultVMNodeTypeName'))]",
            "MetricAggregation": [
              { "scheduledTransferPeriod": "PT1H" },
              { "scheduledTransferPeriod": "PT1M" }
            ]
          },
          "EtwProviders": {
            "EtwEventSourceProviderConfiguration": [
              {
                "provider": "Microsoft-ServiceFabric-Actors",
                "scheduledTransferKeywordFilter": "1",
                "scheduledTransferPeriod": "PT5M",
                "DefaultEvents": {
                  "eventDestination": "ServiceFabricReliableActorEventTable"
                }
              },
              {
                "provider": "Microsoft-ServiceFabric-Services",
                "scheduledTransferPeriod": "PT5M",
                "DefaultEvents": {
                  "eventDestination": "ServiceFabricReliableServiceEventTable"
                }
              }
            ],
            "EtwManifestProviderConfiguration": [
              {
                "provider": "cbd93bc2-71e5-4566-b3a7-595d8eeca6e8",
                "scheduledTransferLogLevelFilter": "Information",
                "scheduledTransferKeywordFilter": "4611686018427387904",
                "scheduledTransferPeriod": "PT5M",
                "DefaultEvents": {
                  "eventDestination": "ServiceFabricSystemEventTable"
                }
              }
            ]
          }
        }
      },
      "StorageAccount": "[variables('applicationDiagnosticsStorageAccountName')]"
    },
    "typeHandlerVersion": "1.5"
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!