Closed bulkware closed 5 years ago
Hi @bulkware
I'm sorry if I induced you in error, this is the complete signature of metrics.list
:
list(resource_uri, timespan=None, interval=None, metricnames=None, aggregation=None, top=None, orderby=None, filter=None, result_type=None, metricnamespace=None, custom_headers=None, raw=False, **operation_config)
filter
is NOT deprecated, my point was that the sample you talked about was made before aggregation
or interval
where parameters, and then at this point you needed to create a complete string manually with join
to get any results. I didn't mean that filter
itself was deprecated, but mostly the usage of filter
in the sample you mentioned was. Sorry again for the miscommunication.
I do not know how to get a list of cloud/roleInstance. @tjprescott would you happen to know?
I don't. You would need to reach out the Monitor team.
How can I reach the Monitor team?
Hi @bulkware, I asked @anirudhcavale from the monitor team and he told me you must pass result_type="Metadata"
to get what you want.
Ok. This is handy for limiting data =)
I still don't know what is the correct way to get a list of cloud_roleInstances. I assume it's perfectly valid to list cloud_roleInstances using the metrics list method, filter using "cloud/roleInstance eq '*' and result_type="Metadata"? I cannot get a list of these instances by any other way.
And I still don't know how can I get a list of cloud_roleNames or filter using them. I don't know if this is even possible right now.
@bulkware that's correct. The intended way to get a list of cloud_roleinstances values (or any dimension's values) is to call the list metrics API with result_type = Metadata. Is cloud_roleNames a dimension on the particular App Insights metric? If it is, then you can run the same API call with the dimension = * as well. If its not then its not data the metric allows to be split or filtered on.
Ok, so now I have a list of instances using the metric-queries.
I also checked the output of "az monitor metrics list-definitions --resource ***" and found out that the "cloud_roleName" is in fact a dimension in some of the metrics. It was not set as a dimension for all the metrics, so that was the first thing that lead me astray. Now that I found out the metrics that support it and how to filter using them I have what I need.
Thank all for your support, you've been very helpful =)
Hi all.
I know there's an API limit to the amount of datapoints I request when calling metrics.list
.
Does anyone know the exact number or where's it documented?
Hello,
I am unable to use "cloud_roleName" as a parameter while retrieving metrics from resource: https://github.com/Azure/azure-sdk-for-python/issues/6103
And the "Application Insights SDK for Python" seems to be only for sending telemetry and not for retrieving metrics. So I tried the same thing using the Azure CLI client and did not succeed in that either: https://github.com/Azure/azure-cli/issues/9934
But I found out that I could use the "role_instanceName" as a filter option for both the Azure CLI and the "Azure SDK for Python":
Some time ago I got the answer that the filter option seems to be deprecated: https://github.com/Azure/azure-sdk-for-python/issues/5243
So now I don't know if I should use the filter option or not. It does seem to work in this case, but not as I intended in the first place. Should I use it or not?
Second question is, how can I get a list of these "cloud_roleInstances" because the only way I can do this is by making a query for metrics with the filter option as "cloud/roleInstance eq '*'"?