Azure / Azure/azure-rest-api-specs

Metrics query working on SDK 5.01 now fails wit 6.0

Open
#23,669 8 comments 0 reactions 0 assignees View on GitHub
customer-reported Mgmt Monitor needs-team-attention question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

- **Package Name**: python-azure-mgmt-monitor
- **Package Version**: 6.0
- **Operating System**:
- **Python Version**: 3.8.10

**Describe the bug**
python queries worked as expected - Using notebook with Databricks, azsdk-python-azure-mgmt-monitor/5.0.1 Python/3.8.10 (Linux-5.4.0-1100-azure-x86_64-with-glibc2.29)

query fails with http 400 bad request error - Using notebook with Databricks, "userAgent": azsdk-python-azure-mgmt-monitor/6.0.0 Python/3.8.10 (Linux-5.4.0-1100-azure-x86_64-with-glibc2.29)

**To Reproduce**
see URLS below

**Expected behavior**
metric data returned.

**Additional context**
Bad one:
"PreciseTimeStamp": 2023-03-21T04:00:57.0483802Z,
"TaskName": HttpIncomingRequestEndWithClientFailure,
"operationName": GET/SUBSCRIPTIONS/RESOURCEGROUPS/PROVIDERS/MICROSOFT.ANALYSISSERVICES/SERVERS/PROVIDERS/MICROSOFT.INSIGHTS/METRICS,
"apiVersion": 2021-05-01,
"httpMethod": GET,
"httpStatusCode": 400,
"targetUri": [https://management.azure.com:443/subscriptions/subid/resourceGroups/RG/providers/Microsoft.AnalysisServices/servers/servername/providers/providers/Microsoft.Insights/metrics?timespan=2023-03-20%2f2023-03-21&interval=PT1M&metricnames=qpu_metric%2cmemory_metric%2cMemoryLimitHard%2cQueryPoolJobQueueLength&aggregation=Average&api-version=2021-05-01]
"targetResourceProvider": MICROSOFT.INSIGHTS,
"targetResourceType": METRICS,
"userAgent": azsdk-python-azure-mgmt-monitor/6.0.0 Python/3.8.10 (Linux-5.4.0-1100-azure-x86_64-with-glibc2.29)

 
Good one: 
"PreciseTimeStamp": 2023-03-20T04:00:46.8433581Z,
"TaskName": HttpIncomingRequestEndWithSuccess,
"operationName": GET/SUBSCRIPTIONS/RESOURCEGROUPS/PROVIDERS/MICROSOFT.ANALYSISSERVICES/SERVERS/PROVIDERS/MICROSOFT.INSIGHTS/METRICS,
"apiVersion": 2018-01-01,
"httpMethod": GET,
"httpStatusCode": 200,
"targetUri": https://management.azure.com:443/subscriptions/subid/resourceGroups/RG/providers/Microsoft.AnalysisServices/servers/servername/providers/Microsoft.Insights/metrics?timespan=2023-03-19%2f2023-03-20&interval=PT1M&metricnames=qpu_metric%2cmemory_metric%2cMemoryLimitHard%2cQueryPoolJobQueueLength&aggregation=Average&api-version=2018-01-01,
"targetResourceProvider": MICROSOFT.INSIGHTS,
"targetResourceType": METRICS,
"userAgent": azsdk-python-azure-mgmt-monitor/5.0.1 Python/3.8.10 (Linux-5.4.0-1100-azure-x86_64-with-glibc2.29)

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by comparing the 5.0.1 and 6.0 request URLs and the Azure Monitor metrics API specifications, then reproduce the Databricks query against version 6.0. Done means identifying and correcting the specification or generated request that causes the 400 response, with a regression test showing metric data is returned.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.