Azure / azure-libraries-for-java

Azure Management Libraries for Java
https://docs.microsoft.com/en-us/java/azure/
MIT License
94 stars 98 forks source link

For HDInsights Service, REST API call does not return any time series values when `$filter` param on combination of dimensions are specified in the query. #668

Open gangadharaswamy opened 5 years ago

gangadharaswamy commented 5 years ago

Using REST API call of Metrics - List, for Azure HDInsights service does not return any time series values when $filter parameter on dimensions is specified in the query.

Query Parameters:

resourceUri: subscriptions/1248268d-051f-432a-8e63-e83a9d36e776/resourceGroups/gangadhartestapp/providers/Microsoft.HDInsight/clusters/kafkaclustergs
api-version: 2018-01-01
metricnames: GatewayRequests,CategorizedGatewayRequests
interval: PT1M //or P1D etc.
timespan: 2018-11-28T12:00:00Z/2018-11-30T12:00:00Z  //or any other timespan
$filter: ClusterDnsName eq '*' and HttpStatus eq '*'

Response Body:

{
  "cost": 0,
  "timespan": "2018-11-28T12:00:00Z/2018-11-30T12:00:00Z",
  "interval": "P1D",
  "value": [
    {
      "id": "/subscriptions/1248268d-051f-432a-8e63-e83a9d36e776/resourceGroups/gangadhartestapp/providers/Microsoft.HDInsight/clusters/kafkaclustergs/providers/Microsoft.Insights/metrics/GatewayRequests",
      "type": "Microsoft.Insights/metrics",
      "name": {
        "value": "GatewayRequests",
        "localizedValue": "Gateway Requests"
      },
      "unit": "Count",
      "timeseries": []
    },
    {
      "id": "/subscriptions/1248268d-051f-432a-8e63-e83a9d36e776/resourceGroups/gangadhartestapp/providers/Microsoft.HDInsight/clusters/kafkaclustergs/providers/Microsoft.Insights/metrics/CategorizedGatewayRequests",
      "type": "Microsoft.Insights/metrics",
      "name": {
        "value": "CategorizedGatewayRequests",
        "localizedValue": "Categorized Gateway Requests"
      },
      "unit": "Count",
      "timeseries": []
    }
  ],
  "namespace": "Microsoft.HDInsight/clusters",
  "resourceregion": "westus2"
}

If the $filter parameter is not specified or any one dimension is specified, the query returns time series values. But when combination of dimensions are specified ($filter: ClusterDnsName eq '' and HttpStatus eq ''), the query doesn't return any time series values. The $filter param is required to retrieve metric dimensions ClusterDnsName, HttpStatus.

Let us know if further information is required to investigate this.

anirudhcavale commented 5 years ago

@gangadharaswamy the REST API does not support wildcarding multiple dimensions (dim eq '*'). Only one dimension may be wildcarded, all other dimensions must either be filtered to specific values, or not filtered at all.

gangadharaswamy commented 5 years ago

@anirudhcavale Thanks for the response.

akodali18 commented 5 years ago

For the benefit of the community - @anirudhcavale confirmed that ClusterDnsName should ideally not be emitted by Azure. If in case you are using this metric in your filter and not retrieving any metrics, please ignore this metric from your filter. This dimension always has a value equal to the Azure resource Id. A similar issue can be seen with "FileShare" dimension for FileServices resources - https://github.com/Azure/azure-libraries-for-java/issues/747

I will leave this issue open to be resolved once the above dimensions are stopped from being emitted in their corresponding metric definitions.

ghost commented 5 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @djlan

yaohaizh commented 5 years ago

This is not a SDK issue but REST calling. Need service team to handle.

idear1203 commented 5 years ago

@yaohaizh Could you please give more details about requirements on service team? What should we do for this GitHub issues?

yaohaizh commented 5 years ago

@idear1203 with $filter parameter, the time series values is not returned.

Please make sure this is design behavior or should be fixed on the service side. Similar issue: https://github.com/Azure/azure-libraries-for-java/issues/747 that need fix.

aim-for-better commented 4 years ago

@gangadharaswamy @akodali18 Could you please provide the entire URL of the request you sent? This is very important because from the limit information you provided I can't find the related API.

Here you just provided the query parameter and response body, I can't find the entire URL of the request.

akodali18 commented 4 years ago

@aim-for-better : Here is the REST API we used - https://docs.microsoft.com/en-us/rest/api/monitor/metrics/list

We just call this API with the query parameters in issue description. Let us know if you need more info.

aim-for-better commented 4 years ago

This is not SDK issue. I will try to find the correct team and report the issue.

aim-for-better commented 4 years ago

@yaohaizh @akodali18 This API https://docs.microsoft.com/en-us/rest/api/monitor/metrics/list is provided by Insights team. Now transfer it to Insights team to ask for help investigate who returns the response. I don't know which team provided the response.

And this issue is not HDInsight SDK's issue.