Skip to content

Monitor Query readme and samples issues #20471

@v-xuto

Description

@v-xuto

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.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.DocsMonitorMonitor, Monitor Ingestion, Monitor Queryneeds-team-triageWorkflow: This issue needs the team to triage.test-manual-pass

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions