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

Metadata is returned as 'None' when querying metrics with filter parameter #21281

Closed
kshilovskiy opened this issue Oct 15, 2021 · 5 comments · Fixed by #21513
Closed

Metadata is returned as 'None' when querying metrics with filter parameter #21281

kshilovskiy opened this issue Oct 15, 2021 · 5 comments · Fixed by #21513
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Monitor Monitor, Monitor Ingestion, Monitor Query question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@kshilovskiy
Copy link

  • Package Name: azure-monitor-query
  • Package Version: 1.0.0
  • Operating System: Mac OS 11.4
  • Python Version: 3.9.7

Describe the bug
I am trying to get the eventhub namespace metrics split by the eventhub name. Therefore I am using * as the filter value: entityname eq '*'.
The returned data is indeed split by the entity name. However there is no metadata provided. So I am not able to understand
what entities the values belong too.

To Reproduce
I am using this code:

metrics_uri = os.environ['METRICS_RESOURCE_URI']

response = client.query_resource(
    metrics_uri,
    metric_names=["IncomingMessages"],
    timespan=timedelta(days=1),
    granularity=timedelta(hours=24),
    filter="entityname eq '*'",
    aggregation='Total'
)

for metric in response.metrics:
    print(metric.name + ' -- ' + metric.display_description)
    for time_series_element in metric.timeseries:
        print(f"Metadata {time_series_element.metadata_values}")
        for metric_value in time_series_element.data:
            print(f"{metric_value.timestamp} -- {metric_value.total}")

METRICS_RESOURCE_URI is the the eventhub namespace.

Expected behavior
Metadata is returned and contains the name of the event hub.

Screenshots
Here is the output from the above code

image

Additional context
The metadata is returned correctly with Azure CLI

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 15, 2021
@mccoyp
Copy link
Member

mccoyp commented Oct 18, 2021

Hi @kshilovskiy, thank you for opening an issue! I'll tag the appropriate folks so we can take a look at this as soon as possible.

@mccoyp mccoyp added Client This issue points to a problem in the data-plane of the library. Monitor - Query and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Oct 18, 2021
@rakshith91
Copy link
Contributor

Hi @kshilovskiy, Thanks for reporting the issue - it will be fixed in this PR #21513 and will be released in the upcoming release next week.

@rakshith91 rakshith91 reopened this Nov 3, 2021
@rakshith91 rakshith91 added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Nov 3, 2021
@ghost
Copy link

ghost commented Nov 3, 2021

Hi @kshilovskiy. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@rakshith91
Copy link
Contributor

rakshith91 commented Nov 3, 2021

@kshilovskiy The issue is addressed and will be pushed to release early next week. Thanks a lot for reporting this

@ghost
Copy link

ghost commented Nov 10, 2021

Hi @kshilovskiy, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

@ghost ghost closed this as completed Nov 10, 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
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. customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Monitor Monitor, Monitor Ingestion, Monitor Query question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants