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

Monitor Query readme and samples issues #20471

Closed
v-xuto opened this issue Aug 31, 2021 · 0 comments · Fixed by #20869
Closed

Monitor Query readme and samples issues #20471

v-xuto opened this issue Aug 31, 2021 · 0 comments · Fixed by #20869
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Docs Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-triage Workflow: This issue needs the team to triage. test-manual-pass

Comments

@v-xuto
Copy link
Member

v-xuto commented Aug 31, 2021

Section link:
image
image

Reason2,3:
ImportError: cannot import name 'LogsQueryRequest' from 'azure.monitor.query'
Reason4:
TypeError: query() missing 1 required keyword-only argument: 'timespan'
Reason5:
AttributeError: 'LogsBatchQueryResult' object has no attribute 'body'
Reason8:
The type of 'col' is 'str'. AttributeError: 'str' object has no attribute 'name'

Suggestion1:
Update to from datetime import timedelta, datetime
Suggestion2,3:
Update to LogsBatchQuery
Suggestion4:
Add the code timespan=(datetime(2021, 6, 2), timedelta(hours=1)),
Suggestion5:

    tables = rsp.tables
    if not tables:
        print("Something is wrong")
    else:
        for table in tables:

Suggestion6:
Update to table.columns

Section link:
image

Reason1,2:
TypeError: query() missing 1 required keyword-only argument: 'timespan'

Suggestion1: Add the code: from datetime import datetime
Suggestion2: Add the code: timespan=(datetime(2021, 5, 2), datetime(2021, 6, 2))

Section link:
image

Reason:
NameError: name 'datetime' is not defined

Suggestion:
Update to from datetime import timedelta, datetime

Section link1, link2, link3, link4,link5:
image
Reason:
The type of 'col' is 'str'. AttributeError: 'str' object has no attribute 'name'

Suggestion:
Update to table.columns

Section link1, link2:
image

Reason:
The type of 'col' is 'str'. AttributeError: 'str' object has no attribute 'name'

Suggestion:

    for col, type in zip(table.columns, table.columns_types): #LogsQueryResultColumn
        print(col + "/"+ type + " | ", end="")

Section link1, link2:
image

Reason:
TypeError: query() missing 1 required keyword-only argument: 'timespan'

Suggestion:
Add the parameter timespan=(datetime(2021, 5, 2), datetime(2021, 6, 2)) in client.querty() .

Section link:
image

Reason:
AttributeError: 'MetricAvailability' object has no attribute 'time_grain'.

Suggestion:
Update to print(availability.granularity)

@jameszliao-msft , @lmazuel , @scottaddie , @srnagar and @rakshith91 for notification.

@v-xuto v-xuto added Docs Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. test-manual-pass Monitor - Query labels Aug 31, 2021
@rakshith91 rakshith91 self-assigned this Sep 17, 2021
@rakshith91 rakshith91 added this to the [2021] October milestone Sep 17, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
@scottaddie scottaddie added Monitor Monitor, Monitor Ingestion, Monitor Query and removed Monitor - Query labels Sep 28, 2023
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. Docs Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-triage Workflow: This issue needs the team to triage. test-manual-pass
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants