From 425a91d41565c247448c3e63042b3ab142b38094 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 4 Nov 2020 10:20:43 -0800 Subject: [PATCH 1/5] add more samples --- .../metricsadvisor/_metrics_advisor_client.py | 54 +++++ .../aio/_metrics_advisor_client_async.py | 60 ++++- .../azure-ai-metricsadvisor/samples/README.md | 3 + .../sample_alert_configuration_async.py | 2 +- .../sample_detection_configuration_async.py | 2 +- .../async_samples/sample_incidents_async.py | 31 ++- .../async_samples/sample_queries_async.py | 206 ++++++++++++++++++ .../samples/sample_alert_configuration.py | 2 +- .../samples/sample_incidents.py | 13 +- .../samples/sample_queries.py | 189 ++++++++++++++++ 10 files changed, 533 insertions(+), 29 deletions(-) create mode 100644 sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py create mode 100644 sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py index e3879b775dec..87c09c0a3f11 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py @@ -275,6 +275,15 @@ def list_metric_enriched_series_data( :return: Pageable of MetricEnrichedSeriesData :rtype: ~azure.core.paging.ItemPaged[~azure.ai.metricsadvisor.models.MetricEnrichedSeriesData] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_queries.py + :start-after: [START list_metric_enriched_series_data] + :end-before: [END list_metric_enriched_series_data] + :language: python + :dedent: 4 + :caption: Query metric enriched series data. """ series_list = [ @@ -487,6 +496,15 @@ def list_dimension_values( :return: Dimension values of anomalies. :rtype: ~azure.core.paging.ItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_queries.py + :start-after: [START list_dimension_values] + :end-before: [END list_dimension_values] + :language: python + :dedent: 4 + :caption: Query dimension values. """ skip = kwargs.pop('skip', None) @@ -646,6 +664,15 @@ def list_metric_dimension_values(self, metric_id, dimension_name, **kwargs): :return: Dimension from certain metric. :rtype: ~azure.core.paging.ItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_queries.py + :start-after: [START list_metric_dimension_values] + :end-before: [END list_metric_dimension_values] + :language: python + :dedent: 4 + :caption: Query metric dimension values. """ skip = kwargs.pop('skip', None) @@ -683,6 +710,15 @@ def list_metrics_series_data(self, :return: Time series data from metric. :rtype: ~azure.core.paging.ItemPaged[~azure.ai.metricsadvisor.models.MetricSeriesData] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_queries.py + :start-after: [START list_metrics_series_data] + :end-before: [END list_metrics_series_data] + :language: python + :dedent: 4 + :caption: Query metrics series data. """ converted_start_time = convert_datetime(start_time) @@ -719,6 +755,15 @@ def list_metric_series_definitions(self, metric_id, active_since, **kwargs): :return: Series (dimension combinations) from metric. :rtype: ~azure.core.paging.ItemPaged[~azure.ai.metricsadvisor.models.MetricSeriesDefinition] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_queries.py + :start-after: [START list_metric_series_definitions] + :end-before: [END list_metric_series_definitions] + :language: python + :dedent: 4 + :caption: Query metric series definitions. """ skip = kwargs.pop('skip', None) @@ -749,6 +794,15 @@ def list_metric_enrichment_status(self, metric_id, start_time, end_time, **kwarg :return: Anomaly detection status. :rtype: ~azure.core.paging.ItemPaged[~azure.ai.metricsadvisor.models.EnrichmentStatus] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_queries.py + :start-after: [START list_metric_enrichment_status] + :end-before: [END list_metric_enrichment_status] + :language: python + :dedent: 4 + :caption: Query metric enrichment status. """ skip = kwargs.pop('skip', None) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py index 7008c64afbdd..c037498ebf2e 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py @@ -243,7 +243,7 @@ def list_incident_root_causes(self, detection_configuration_id, incident_id, **k .. admonition:: Example: - .. literalinclude:: ../samples/sample_incidents_async.py + .. literalinclude:: ../samples/async_samples/sample_incidents_async.py :start-after: [START list_incident_root_cause_async] :end-before: [END list_incident_root_cause_async] :language: python @@ -279,6 +279,15 @@ def list_metric_enriched_series_data( :return: Pageable of MetricEnrichedSeriesData :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.metricsadvisor.models.MetricEnrichedSeriesData] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_queries_async.py + :start-after: [START list_metric_enriched_series_data_async] + :end-before: [END list_metric_enriched_series_data_async] + :language: python + :dedent: 4 + :caption: Query metric enriched series data. """ series_list = [ @@ -493,6 +502,15 @@ def list_dimension_values( :return: Dimension values of anomalies. :rtype: ~azure.core.async_paging.AsyncItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_queries_async.py + :start-after: [START list_dimension_values_async] + :end-before: [END list_dimension_values_async] + :language: python + :dedent: 4 + :caption: Query dimension values. """ skip = kwargs.pop('skip', None) @@ -567,7 +585,7 @@ def list_incidents( .. admonition:: Example: - .. literalinclude:: ../samples/sample_incidents_async.py + .. literalinclude:: ../samples/async_samples/sample_incidents_async.py :start-after: [START list_incidents_for_alert_async] :end-before: [END list_incidents_for_alert_async] :language: python @@ -597,7 +615,7 @@ def list_incidents( .. admonition:: Example: - .. literalinclude:: ../samples/sample_incidents_async.py + .. literalinclude:: ../samples/async_samples/sample_incidents_async.py :start-after: [START list_incidents_for_detection_configuration_async] :end-before: [END list_incidents_for_detection_configuration_async] :language: python @@ -656,6 +674,15 @@ def list_metric_dimension_values(self, metric_id, dimension_name, **kwargs): :return: Dimension from certain metric. :rtype: ~azure.core.async_paging.AsyncItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_queries_async.py + :start-after: [START list_metric_dimension_values_async] + :end-before: [END list_metric_dimension_values_async] + :language: python + :dedent: 4 + :caption: Query metric dimension values. """ skip = kwargs.pop('skip', None) @@ -693,6 +720,15 @@ def list_metrics_series_data( :return: Time series data from metric. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.metricsadvisor.models.MetricSeriesData] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_queries_async.py + :start-after: [START list_metrics_series_data_async] + :end-before: [END list_metrics_series_data_async] + :language: python + :dedent: 4 + :caption: Query metrics series data. """ converted_start_time = convert_datetime(start_time) @@ -729,6 +765,15 @@ def list_metric_series_definitions(self, metric_id, active_since, **kwargs): :return: Series (dimension combinations) from metric. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.metricsadvisor.models.MetricSeriesDefinition] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_queries_async.py + :start-after: [START list_metric_series_definitions_async] + :end-before: [END list_metric_series_definitions_async] + :language: python + :dedent: 4 + :caption: Query metric series definitions. """ skip = kwargs.pop('skip', None) @@ -764,6 +809,15 @@ def list_metric_enrichment_status(self, :return: Anomaly detection status. :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.metricsadvisor.models.EnrichmentStatus] :raises ~azure.core.exceptions.HttpResponseError: + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_queries_async.py + :start-after: [START list_metric_enrichment_status_async] + :end-before: [END list_metric_enrichment_status_async] + :language: python + :dedent: 4 + :caption: Query metric enrichment status. """ skip = kwargs.pop('skip', None) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md index fb362d9621b9..b592a352afff 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md @@ -22,6 +22,7 @@ The async versions of the samples require Python 3.5 or later. |[sample_anomaly_alert_configuration.py][sample_anomaly_alert_configuration] and [sample_anomaly_alert_configuration_async.py][sample_anomaly_alert_configuration_async]|Create, list, get, update, and delete anomaly alert configurations. Also list alerts and anomalies for a specific alert configuration.| |[sample_hooks.py][sample_hooks] and [sample_hooks_async.py][sample_hooks_async]|Create, list, get, update, and delete notification hooks| |[sample_feedback.py][sample_feedback] and [sample_feedback_async.py][sample_feedback_async]|Add, get, and list feedback for the anomaly detection result| +|[sample_queries.py][sample_queries] and [sample_queries_async.py][sample_queries_async]|Query dimentions/data/status/etc.| ## Prerequisites @@ -70,3 +71,5 @@ what you can do with the Azure Metrics Advisor client library. [sample_hooks_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_hooks_async.py [sample_feedback]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_feedback.py [sample_feedback_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_feedback_async.py +[sample_queries]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py +[sample_queries_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py index 5c8a9139f826..0a8972ea34ff 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_alert_configuration_async.py @@ -51,7 +51,7 @@ async def sample_create_alert_config_async(): MetricsAdvisorKeyCredential(subscription_key, api_key)) async with client: - alert_config = await client.create_anomaly_alert_configuration( + alert_config = await client.create_alert_configuration( name="my alert config", description="alert config description", cross_metrics_operator="AND", diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py index 15ed0a47e410..d5c55f2b8eda 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_detection_configuration_async.py @@ -75,7 +75,7 @@ async def sample_create_detection_config_async(): ) async with client: - detection_config = await client.create_metric_anomaly_detection_configuration( + detection_config = await client.create_detection_configuration( name="my_detection_config", metric_id=metric_id, description="anomaly detection config for metric", diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py index 2801b341d122..f3574d7d7b57 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py @@ -19,18 +19,17 @@ 1) METRICS_ADVISOR_ENDPOINT - the endpoint of your Azure Metrics Advisor service 2) METRICS_ADVISOR_SUBSCRIPTION_KEY - Metrics Advisor service subscription key 3) METRICS_ADVISOR_API_KEY - Metrics Advisor service API key - 4) METRICS_ADVISOR_METRIC_ID - the ID of an metric from an existing data feed - 5) METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration - 6) METRICS_ADVISOR_ALERT_CONFIGURATION_ID - the ID of an alert configuration - 7) METRICS_ADVISOR_INCIDENT_ID - the ID of an incident - 8) METRICS_ADVISOR_ALERT_ID - the ID of an alert + 4) METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration + 5) METRICS_ADVISOR_ALERT_CONFIGURATION_ID - the ID of an alert configuration + 6) METRICS_ADVISOR_INCIDENT_ID - the ID of an incident + 7) METRICS_ADVISOR_ALERT_ID - the ID of an alert """ import os import asyncio -def sample_list_incidents_for_detection_configuration(): +async def sample_list_incidents_for_detection_configuration_async(): # [START list_incidents_for_detection_configuration_async] import datetime from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential @@ -44,12 +43,12 @@ def sample_list_incidents_for_detection_configuration(): client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) async with client: - results = client.list_incidents_for_detection_configuration( + results = client.list_incidents( detection_configuration_id=anomaly_detection_configuration_id, start_time=datetime.datetime(2020, 1, 1), end_time=datetime.datetime(2020, 9, 9), ) - for result in results: + async for result in results: print("Metric id: {}".format(result.metric_id)) print("Incident ID: {}".format(result.id)) print("Severity: {}".format(result.severity)) @@ -57,7 +56,7 @@ def sample_list_incidents_for_detection_configuration(): # [END list_incidents_for_detection_configuration_async] -def sample_list_incident_root_cause(): +async def sample_list_incident_root_cause_async(): # [START list_incident_root_cause_async] from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential from azure.ai.metricsadvisor.aio import MetricsAdvisorClient @@ -75,13 +74,13 @@ def sample_list_incident_root_cause(): detection_configuration_id=anomaly_detection_configuration_id, incident_id=incident_id, ) - for result in results: + async for result in results: print("Score: {}".format(result.score)) print("Description: {}".format(result.description)) # [END list_incident_root_cause_async] -def sample_list_incidents_for_alert(): +async def sample_list_incidents_for_alert_async(): # [START list_incidents_for_alert_async] from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential from azure.ai.metricsadvisor.aio import MetricsAdvisorClient @@ -95,11 +94,11 @@ def sample_list_incidents_for_alert(): client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) async with client: - results = client.list_incidents_for_alert( + results = client.list_incidents( alert_configuration_id=alert_configuration_id, alert_id=alert_id, ) - for result in results: + async for result in results: print("Metric id: {}".format(result.metric_id)) print("Incident ID: {}".format(result.id)) print("Severity: {}".format(result.severity)) @@ -110,11 +109,11 @@ def sample_list_incidents_for_alert(): async def main(): print("---List incidents for detection configuration...") - sample_list_incidents_for_detection_configuration() + await sample_list_incidents_for_detection_configuration_async() print("---List root causes...") - sample_list_incident_root_cause() + await sample_list_incident_root_cause_async() print("---List incidents for alert configuration...") - sample_list_incidents_for_alert() + await sample_list_incidents_for_alert_async() if __name__ == '__main__': loop = asyncio.get_event_loop() diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py new file mode 100644 index 000000000000..f9fd6d9f244c --- /dev/null +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_queries_async.py + +DESCRIPTION: + This sample demonstrates how to query + - metric enriched series data + - dimension values + - metric dimension values + - metrics series data + - metric series definitions + - metric enrichment status + +USAGE: + python sample_queries_async.py + + Set the environment variables with your own values before running the sample: + 1) METRICS_ADVISOR_ENDPOINT - the endpoint of your Azure Metrics Advisor service + 2) METRICS_ADVISOR_SUBSCRIPTION_KEY - Metrics Advisor service subscription key + 3) METRICS_ADVISOR_API_KEY - Metrics Advisor service API key + 4) METRICS_ADVISOR_DETECTION_CONFIGURATION_ID - the ID of an existing detection configuration + 5) METRICS_ADVISOR_METRIC_ID - the ID of an metric from an existing data feed +""" + +import os +import asyncio + +async def sample_list_metric_enriched_series_data_async(): + # [START list_metric_enriched_series_data_async] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential + from azure.ai.metricsadvisor.aio import MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") + series_identity = {"city": "Los Angeles"} + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + async with client: + results = client.list_metric_enriched_series_data( + detection_configuration_id=detection_configuration_id, + start_time=datetime.datetime(2020, 9, 1), + end_time=datetime.datetime(2020, 11, 1), + series=[series_identity] + ) + async for result in results: + print(str(result)) + + # [END list_metric_enriched_series_data_async] + +async def sample_list_dimension_values_async(): + # [START list_dimension_values_async] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential + from azure.ai.metricsadvisor.aio import MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") + dimension_name = "city" + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + async with client: + results = client.list_dimension_values( + detection_configuration_id=detection_configuration_id, + dimension_name=dimension_name, + start_time=datetime.datetime(2020, 1, 1), + end_time=datetime.datetime(2020, 10, 21), + ) + async for result in results: + print(str(result)) + + # [END list_dimension_values_async] + +async def sample_list_metric_dimension_values_async(): + # [START list_metric_dimension_values_async] + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential + from azure.ai.metricsadvisor.aio import MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + dimension_name = "city" + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + async with client: + results = client.list_metric_dimension_values( + metric_id=metric_id, + dimension_name=dimension_name, + ) + async for result in results: + print(str(result)) + + # [END list_metric_dimension_values_async] + +async def sample_list_metrics_series_data_async(): + # [START list_metrics_series_data_async] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential + from azure.ai.metricsadvisor.aio import MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + async with client: + results = client.list_metrics_series_data( + metric_id=metric_id, + start_time=datetime.datetime(2020, 1, 1), + end_time=datetime.datetime(2020, 10, 21), + series_to_filter=[ + {"city": "Los Angeles", "category": "Homemade"} + ] + ) + async for result in results: + print(str(result)) + + # [END list_metrics_series_data_async] + +async def sample_list_metric_series_definitions_async(): + # [START list_metric_series_definitions_async] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential + from azure.ai.metricsadvisor.aio import MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + async with client: + results = client.list_metric_series_definitions( + metric_id=metric_id, + active_since=datetime.datetime(2020, 1, 1), + ) + async for result in results: + print(str(result)) + + # [END list_metric_series_definitions_async] + +async def sample_list_metric_enrichment_status_async(): + # [START list_metric_enrichment_status_async] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential + from azure.ai.metricsadvisor.aio import MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + async with client: + results = client.list_metric_enrichment_status( + metric_id=metric_id, + start_time=datetime.datetime(2020, 1, 1), + end_time=datetime.datetime(2020, 10, 21), + ) + async for result in results: + print(str(result)) + + # [END list_metric_enrichment_status_async] + +async def main(): + print("---List metric enriched series data...") + await sample_list_metric_enriched_series_data_async() + print("---List dimention values...") + await sample_list_dimension_values_async() + print("---List metric dimention values...") + await sample_list_metric_dimension_values_async() + print("---List metric series data...") + await sample_list_metrics_series_data_async() + print("---List metric series definitions...") + await sample_list_metric_series_definitions_async() + print("---List metric enrichment status...") + await sample_list_metric_enrichment_status_async() + +if __name__ == '__main__': + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_alert_configuration.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_alert_configuration.py index 91fcd8690fc7..bd07926632f6 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_alert_configuration.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_alert_configuration.py @@ -298,7 +298,7 @@ def sample_delete_alert_config(alert_config_id): print("\n---List anomaly alert configurations...") sample_list_alert_configs() print("\n---Query anomaly detection results...") - alerts = sample_list_alerts_for_alert_config(alert_config.id) + alerts = sample_list_alerts(alert_config.id) if len(alerts) > 0: print("\n---Query anomalies using alert id...") alert_id = alerts[0].id diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py index 8f27001decdc..c0f798f4b7f1 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py @@ -19,11 +19,10 @@ 1) METRICS_ADVISOR_ENDPOINT - the endpoint of your Azure Metrics Advisor service 2) METRICS_ADVISOR_SUBSCRIPTION_KEY - Metrics Advisor service subscription key 3) METRICS_ADVISOR_API_KEY - Metrics Advisor service API key - 4) METRICS_ADVISOR_METRIC_ID - the ID of an metric from an existing data feed - 5) METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration - 6) METRICS_ADVISOR_ALERT_CONFIGURATION_ID - the ID of an alert configuration - 7) METRICS_ADVISOR_INCIDENT_ID - the ID of an incident - 8) METRICS_ADVISOR_ALERT_ID - the ID of an alert + 4) METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration + 5) METRICS_ADVISOR_ALERT_CONFIGURATION_ID - the ID of an alert configuration + 6) METRICS_ADVISOR_INCIDENT_ID - the ID of an incident + 7) METRICS_ADVISOR_ALERT_ID - the ID of an alert """ import os @@ -41,7 +40,7 @@ def sample_list_incidents_for_detection_configuration(): client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) - results = client.list_incidents_for_detection_configuration( + results = client.list_incidents( detection_configuration_id=anomaly_detection_configuration_id, start_time=datetime.datetime(2020, 1, 1), end_time=datetime.datetime(2020, 9, 9), @@ -88,7 +87,7 @@ def sample_list_incidents_for_alert(): client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) - results = client.list_incidents_for_alert( + results = client.list_incidents( alert_configuration_id=alert_configuration_id, alert_id=alert_id, ) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py new file mode 100644 index 000000000000..15257e82ab33 --- /dev/null +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: sample_queries.py + +DESCRIPTION: + This sample demonstrates how to query + - metric enriched series data + - dimension values + - metric dimension values + - metrics series data + - metric series definitions + - metric enrichment status + +USAGE: + python sample_queries.py + + Set the environment variables with your own values before running the sample: + 1) METRICS_ADVISOR_ENDPOINT - the endpoint of your Azure Metrics Advisor service + 2) METRICS_ADVISOR_SUBSCRIPTION_KEY - Metrics Advisor service subscription key + 3) METRICS_ADVISOR_API_KEY - Metrics Advisor service API key + 4) METRICS_ADVISOR_DETECTION_CONFIGURATION_ID - the ID of an existing detection configuration + 5) METRICS_ADVISOR_METRIC_ID - the ID of an metric from an existing data feed +""" + +import os + +def sample_list_metric_enriched_series_data(): + # [START list_metric_enriched_series_data] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") + series_identity = {"city": "Los Angeles"} + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + results = client.list_metric_enriched_series_data( + detection_configuration_id=detection_configuration_id, + start_time=datetime.datetime(2020, 9, 1), + end_time=datetime.datetime(2020, 11, 1), + series=[series_identity] + ) + for result in results: + print(str(result)) + + # [END list_metric_enriched_series_data] + +def sample_list_dimension_values(): + # [START list_dimension_values] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") + dimension_name = "city" + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + results = client.list_dimension_values( + detection_configuration_id=detection_configuration_id, + dimension_name=dimension_name, + start_time=datetime.datetime(2020, 1, 1), + end_time=datetime.datetime(2020, 10, 21), + ) + for result in results: + print(str(result)) + + # [END list_dimension_values] + +def sample_list_metric_dimension_values(): + # [START list_metric_dimension_values] + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + dimension_name = "city" + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + results = client.list_metric_dimension_values( + metric_id=metric_id, + dimension_name=dimension_name, + ) + for result in results: + print(str(result)) + + # [END list_metric_dimension_values] + +def sample_list_metrics_series_data(): + # [START list_metrics_series_data] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + results = client.list_metrics_series_data( + metric_id=metric_id, + start_time=datetime.datetime(2020, 1, 1), + end_time=datetime.datetime(2020, 10, 21), + series_to_filter=[ + {"city": "Los Angeles", "category": "Homemade"} + ] + ) + for result in results: + print(str(result)) + + # [END list_metrics_series_data] + +def sample_list_metric_series_definitions(): + # [START list_metric_series_definitions] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + results = client.list_metric_series_definitions( + metric_id=metric_id, + active_since=datetime.datetime(2020, 1, 1), + ) + for result in results: + print(str(result)) + + # [END list_metric_series_definitions] + +def sample_list_metric_enrichment_status(): + # [START list_metric_enrichment_status] + import datetime + from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient + + service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") + subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") + api_key = os.getenv("METRICS_ADVISOR_API_KEY") + metric_id = os.getenv("METRICS_ADVISOR_METRIC_ID") + + client = MetricsAdvisorClient(service_endpoint, + MetricsAdvisorKeyCredential(subscription_key, api_key)) + + results = client.list_metric_enrichment_status( + metric_id=metric_id, + start_time=datetime.datetime(2020, 1, 1), + end_time=datetime.datetime(2020, 10, 21), + ) + for result in results: + print(str(result)) + + # [END list_metric_enrichment_status] + +if __name__ == '__main__': + print("---List metric enriched series data...") + sample_list_metric_enriched_series_data() + print("---List dimention values...") + sample_list_dimension_values() + print("---List metric dimention values...") + sample_list_metric_dimension_values() + print("---List metric series data...") + sample_list_metrics_series_data() + print("---List metric series definitions...") + sample_list_metric_series_definitions() + print("---List metric enrichment status...") + sample_list_metric_enrichment_status() From 69759d63220860fbe90eb43df8ca95e501af2940 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 4 Nov 2020 10:59:15 -0800 Subject: [PATCH 2/5] Update sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md Co-authored-by: Krista Pratico --- sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md index b592a352afff..7ccbdd4ee6f5 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/README.md @@ -22,7 +22,7 @@ The async versions of the samples require Python 3.5 or later. |[sample_anomaly_alert_configuration.py][sample_anomaly_alert_configuration] and [sample_anomaly_alert_configuration_async.py][sample_anomaly_alert_configuration_async]|Create, list, get, update, and delete anomaly alert configurations. Also list alerts and anomalies for a specific alert configuration.| |[sample_hooks.py][sample_hooks] and [sample_hooks_async.py][sample_hooks_async]|Create, list, get, update, and delete notification hooks| |[sample_feedback.py][sample_feedback] and [sample_feedback_async.py][sample_feedback_async]|Add, get, and list feedback for the anomaly detection result| -|[sample_queries.py][sample_queries] and [sample_queries_async.py][sample_queries_async]|Query dimentions/data/status/etc.| +|[sample_queries.py][sample_queries] and [sample_queries_async.py][sample_queries_async]|Query dimensions/data/status/etc.| ## Prerequisites From b01db2f98c205a5c9af8ba34e9b69467c9ee4436 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 4 Nov 2020 11:01:54 -0800 Subject: [PATCH 3/5] Update sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py Co-authored-by: Krista Pratico --- .../samples/async_samples/sample_queries_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py index f9fd6d9f244c..151af85e9bcc 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py @@ -190,7 +190,7 @@ async def sample_list_metric_enrichment_status_async(): async def main(): print("---List metric enriched series data...") await sample_list_metric_enriched_series_data_async() - print("---List dimention values...") + print("---List dimension values...") await sample_list_dimension_values_async() print("---List metric dimention values...") await sample_list_metric_dimension_values_async() From ed787f46ede376751e5b3573888d687a45ff4218 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 4 Nov 2020 11:02:17 -0800 Subject: [PATCH 4/5] Update sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py Co-authored-by: Krista Pratico --- .../samples/async_samples/sample_queries_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py index 151af85e9bcc..3b6a2e7d9b69 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_queries_async.py @@ -192,7 +192,7 @@ async def main(): await sample_list_metric_enriched_series_data_async() print("---List dimension values...") await sample_list_dimension_values_async() - print("---List metric dimention values...") + print("---List metric dimension values...") await sample_list_metric_dimension_values_async() print("---List metric series data...") await sample_list_metrics_series_data_async() From b94958869327bd28b3966e589de77fcd884060ba Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 4 Nov 2020 11:07:09 -0800 Subject: [PATCH 5/5] update --- .../samples/async_samples/sample_incidents_async.py | 10 +++++----- .../samples/sample_incidents.py | 10 +++++----- .../azure-ai-metricsadvisor/samples/sample_queries.py | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py index f3574d7d7b57..f9038d01ac54 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/async_samples/sample_incidents_async.py @@ -19,7 +19,7 @@ 1) METRICS_ADVISOR_ENDPOINT - the endpoint of your Azure Metrics Advisor service 2) METRICS_ADVISOR_SUBSCRIPTION_KEY - Metrics Advisor service subscription key 3) METRICS_ADVISOR_API_KEY - Metrics Advisor service API key - 4) METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration + 4) METRICS_ADVISOR_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration 5) METRICS_ADVISOR_ALERT_CONFIGURATION_ID - the ID of an alert configuration 6) METRICS_ADVISOR_INCIDENT_ID - the ID of an incident 7) METRICS_ADVISOR_ALERT_ID - the ID of an alert @@ -38,13 +38,13 @@ async def sample_list_incidents_for_detection_configuration_async(): service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") api_key = os.getenv("METRICS_ADVISOR_API_KEY") - anomaly_detection_configuration_id = os.getenv("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) async with client: results = client.list_incidents( - detection_configuration_id=anomaly_detection_configuration_id, + detection_configuration_id=detection_configuration_id, start_time=datetime.datetime(2020, 1, 1), end_time=datetime.datetime(2020, 9, 9), ) @@ -64,14 +64,14 @@ async def sample_list_incident_root_cause_async(): service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") api_key = os.getenv("METRICS_ADVISOR_API_KEY") - anomaly_detection_configuration_id = os.getenv("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") incident_id = os.getenv("METRICS_ADVISOR_INCIDENT_ID") client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) async with client: results = client.list_incident_root_causes( - detection_configuration_id=anomaly_detection_configuration_id, + detection_configuration_id=detection_configuration_id, incident_id=incident_id, ) async for result in results: diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py index c0f798f4b7f1..4d8acfcee94b 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_incidents.py @@ -19,7 +19,7 @@ 1) METRICS_ADVISOR_ENDPOINT - the endpoint of your Azure Metrics Advisor service 2) METRICS_ADVISOR_SUBSCRIPTION_KEY - Metrics Advisor service subscription key 3) METRICS_ADVISOR_API_KEY - Metrics Advisor service API key - 4) METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration + 4) METRICS_ADVISOR_DETECTION_CONFIGURATION_ID - the ID of an anomaly detection configuration 5) METRICS_ADVISOR_ALERT_CONFIGURATION_ID - the ID of an alert configuration 6) METRICS_ADVISOR_INCIDENT_ID - the ID of an incident 7) METRICS_ADVISOR_ALERT_ID - the ID of an alert @@ -36,12 +36,12 @@ def sample_list_incidents_for_detection_configuration(): service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") api_key = os.getenv("METRICS_ADVISOR_API_KEY") - anomaly_detection_configuration_id = os.getenv("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) results = client.list_incidents( - detection_configuration_id=anomaly_detection_configuration_id, + detection_configuration_id=detection_configuration_id, start_time=datetime.datetime(2020, 1, 1), end_time=datetime.datetime(2020, 9, 9), ) @@ -60,13 +60,13 @@ def sample_list_incident_root_cause(): service_endpoint = os.getenv("METRICS_ADVISOR_ENDPOINT") subscription_key = os.getenv("METRICS_ADVISOR_SUBSCRIPTION_KEY") api_key = os.getenv("METRICS_ADVISOR_API_KEY") - anomaly_detection_configuration_id = os.getenv("METRICS_ADVISOR_ANOMALY_DETECTION_CONFIGURATION_ID") + detection_configuration_id = os.getenv("METRICS_ADVISOR_DETECTION_CONFIGURATION_ID") incident_id = os.getenv("METRICS_ADVISOR_INCIDENT_ID") client = MetricsAdvisorClient(service_endpoint, MetricsAdvisorKeyCredential(subscription_key, api_key)) results = client.list_incident_root_causes( - detection_configuration_id=anomaly_detection_configuration_id, + detection_configuration_id=detection_configuration_id, incident_id=incident_id, ) for result in results: diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py index 15257e82ab33..674df0b8c76f 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/samples/sample_queries.py @@ -177,9 +177,9 @@ def sample_list_metric_enrichment_status(): if __name__ == '__main__': print("---List metric enriched series data...") sample_list_metric_enriched_series_data() - print("---List dimention values...") + print("---List dimension values...") sample_list_dimension_values() - print("---List metric dimention values...") + print("---List metric dimension values...") sample_list_metric_dimension_values() print("---List metric series data...") sample_list_metrics_series_data()