Skip to content

armmonitoring MetricsClient.ListAtSubscriptionScopePost report unexpected error. #21796

Open
@yummydsky

Description

@yummydsky

Bug Report

  • import path of package in question, e.g. .../services/compute/mgmt/2018-06-01/compute
    • "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
  • SDK version e.g. master, latest, 18.1.0
    • azure-sdk-for-go v65.0.0
  • output of go version
    • go1.18.4
  • What happened?
    service report Bad Request when I try to use API ListAtSubscriptionScopePost with MetricNames Network In Total and Network Out Total
POST https://management.azure.com/subscriptions/xxx-xxx-xxx-xxx/providers/Microsoft.Insights/metrics
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE: BadRequest
--------------------------------------------------------------------------------
{
  "error": {
    "additionalInfo": [
      {
        "type": "string",
        "info": "TraceId={1c5a4a31-f451-4d24-ae1a-3ac29409bb9d}"
      },
      {
        "type": "string",
        "info": "ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException"
      }
    ],
    "code": "BadRequest",
    "message": "Failed to find metric configuration for provider: microsoft.compute, resource Type: virtualmachines, metric: Network In Total, Valid metrics: Percentage CPU,Network In,Network Out,Disk Read Bytes,Disk Write Bytes,Disk Read Operations/Sec,Disk Write Operations/Sec,CPU Credits Remaining,CPU Credits Consumed,Data Disk Read Bytes/sec,Data Disk Write Bytes/sec,Data Disk Read Operations/Sec,Data Disk Write Operations/Sec,Data Disk Queue Depth,Data Disk Bandwidth Consumed Percentage,Data Disk IOPS Consumed Percentage,Data Disk Target Bandwidth,Data Disk Target IOPS,Data Disk Max Burst Bandwidth,Data Disk Max Burst IOPS,Data Disk Used Burst BPS Credits Percentage,Data Disk Used Burst IO Credits Percentage,OS Disk Read Bytes/sec,OS Disk Write Bytes/sec,OS Disk Read Operations/Sec,OS Disk Write Operations/Sec,OS Disk Queue Depth,OS Disk Bandwidth Consumed Percentage,OS Disk IOPS Consumed Percentage,OS Disk Target Bandwidth,OS Disk Target IOPS,OS Disk Max Burst Bandwidth,OS Disk Max Burst IOPS,OS Disk Used Burst BPS Credits Percentage,OS Disk Used Burst IO Credits Percentage,Premium Data Disk Cache Read Hit,Premium Data Disk Cache Read Miss,Premium OS Disk Cache Read Hit,Premium OS Disk Cache Read Miss,VM Cached Bandwidth Consumed Percentage,VM Cached IOPS Consumed Percentage,VM Uncached Bandwidth Consumed Percentage,VM Uncached IOPS Consumed Percentage,Available Memory Bytes,VmAvailabilityMetric,VM Remote Used Burst IO Credits Percentage,VM Remote Used Burst BPS Credits Percentage,VM Local Used Burst IO Credits Percentage,VM Local Used Burst BPS Credits Percentage"
  }
}
--------------------------------------------------------------------------------
  • What did you expect or want to happen?
    This API should report metrics without error like metricsClient.List did
    The following message is dump result.
{
  "cost": 8,
  "interval": "PT5M",
  "namespace": "Microsoft.Compute/virtualMachines",
  "resourceregion": "westus2",
  "timespan": "2023-10-18T05:49:34Z/2023-10-18T05:54:34Z",
  "value": [
    {
      "displayDescription": "The number of bytes received on all network interfaces by the Virtual Machine(s) (Incoming Traffic)",
      "errorCode": "Success",
      "id": "/subscriptions/xxx-xxx-xxx-xxx/resourceGroups/test-grp/providers/Microsoft.Compute/virtualMachines/test-vm-1/providers/Microsoft.Insights/metrics/Network In Total",
      "name": {
        "localizedValue": "Network In Total",
        "value": "Network In Total"
      },
      "timeseries": [
        {
          "data": [
            {
              "average": 45728.4,
              "timeStamp": "2023-10-18T05:49:00Z"
            }
          ],
          "metadatavalues": []
        }
      ],
      "type": "Microsoft.Insights/metrics",
      "unit": "Bytes"
    },
    {
      "displayDescription": "The number of bytes out on all network interfaces by the Virtual Machine(s) (Outgoing Traffic)",
      "errorCode": "Success",
      "id": "/subscriptions/xxx-xxx-xxx-xxx/resourceGroups/test-grp/providers/Microsoft.Compute/virtualMachines/test-vm-1/providers/Microsoft.Insights/metrics/Network Out Total",
      "name": {
        "localizedValue": "Network Out Total",
        "value": "Network Out Total"
      },
      "timeseries": [
        {
          "data": [
            {
              "average": 71674.6,
              "timeStamp": "2023-10-18T05:49:00Z"
            }
          ],
          "metadatavalues": []
        }
      ],
      "type": "Microsoft.Insights/metrics",
      "unit": "Bytes"
    }
  ]
}
  • How can we reproduce it?
    Call ListAtSubscriptionScopePost with metric name Network In Total and Network Out Total.
  • Anything we should know about your environment.

Metadata

Metadata

Assignees

Labels

MgmtThis issue is related to a management-plane library.MonitorMonitor, Monitor Ingestion, Monitor QueryService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions