Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics Advisor Readme and samples issues #15845

Closed
v-xuto opened this issue Dec 17, 2020 · 0 comments · Fixed by #15854
Closed

Metrics Advisor Readme and samples issues #15845

v-xuto opened this issue Dec 17, 2020 · 0 comments · Fixed by #15854
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Metrics Advisor Docs test-manual-pass

Comments

@v-xuto
Copy link
Member

v-xuto commented Dec 17, 2020

Section link:
Note: Other section codes in Readme examples have Question 1.
image
Reason:
1).NameError: name 'os' is not defined.
2).NameError: name 'datatime' is not defined.
3).NameError: name 'DataFeedMissingDataPointFillSettings' is not defined.

Suggestion:
1).Add code: import os
2).Add code: import datetime
3).Add code: from azure.ai.metricsadvisor.models import DataFeedMissingDataPointFillSettings
2.
Section Link:
image

Suggestion:
Remove import datetime, because not use it in this code snippet.
3.
Section link:
image
image

Reason:
if len(alerts) > 0:
TypeError: object of type 'ItemPaged' has no len().

Suggestion:
Update

for result in results:
    print("Alert id: {}".format(result.id))
    print("Create on: {}".format(result.created_on))
return results

to:

tolist = []
for result in results:
    tolist.append(result)
    print("Alert id: {}".format(result.id))
    print("Create on: {}".format(result.created_on))
return tolist

Section link:
image

Reason:
TypeError: sample_list_alerts_async() missing 1 required positional argument: 'alert_config_id'.

Suggestion:
Update to:
alerts = await sample_list_alerts_async(alert_config.id)
5.
Section link:
image

Suggestion:
Add async before "def".
6.
Section link:
image

Suggestion:
1).We should import MetricsAdvisorClient from azure.ai.metricsadvisor.aio.
Update to

    from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential
    from azure.ai.metricsadvisor.aio import MetricsAdvisorClient

2).Update to : result = await client.get_feedback(feedback_id=feedback_id)

@jongio for notification.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 17, 2020
@tzhanl tzhanl added Client This issue points to a problem in the data-plane of the library. Cognitive - Metrics Advisor Docs needs-team-triage Workflow: This issue needs the team to triage. test-manual-pass labels Dec 17, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 17, 2020
@kristapratico kristapratico self-assigned this Dec 17, 2020
@kristapratico kristapratico removed the needs-team-triage Workflow: This issue needs the team to triage. label Dec 17, 2020
@ghost ghost closed this as completed in #15854 Dec 17, 2020
ghost pushed a commit that referenced this issue Dec 17, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this issue Nov 4, 2021
[Hub Generated] Review request for Microsoft.Insights to add version stable/2021-08-01 (Azure#15845)

* Adds base for updating Microsoft.Insights from version preview/2021-02-01-preview to version 2021-08-01

* Updates readme

* Updates API version in new specs and examples

* Added new stable api version 2021-08-01 with paging support

Co-authored-by: Avi Jerafi <avjerafi@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Metrics Advisor Docs test-manual-pass
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants