-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
issue-21715 fetching metric values with composite(all) dimension keys #21716
issue-21715 fetching metric values with composite(all) dimension keys #21716
Conversation
@altuner @codeboten - Could you help review the changes ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left small comments
27d8235
to
8e443b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…siteKey struct" This reverts commit 8e443b8.
@altuner @codeboten - I'm planning to push this change for the next release. Requesting to review and provide the feedback so it does not miss the window. :-) |
@rajim17 please fix the breaking test |
1e86add
to
7034dcb
Compare
Integration_test on rabbitmqreceiver was failing. I triggered the build process with dummy commit message and tests are running. I will check once build is complete. |
@altuner - All tests are passed. |
@codeboten - Could you help reviewing the PR ? |
@altuner We are waiting for this fix. Could you merge this pull request or is there anything still pending? |
@codeboten - Could you help merging this PR ? It is already approved by code owner @altuner . |
@codeboten Could you take another look at this PR :) |
Description:
If metric has multiple dimensions, metricValues are fetched by single dimension instead of combining all dimensions. With single dimension metric value is average value of other dimensions.
In below example without all dimensions in the filter, 'metadata_nodepool' provides average value of 2 'metadata_node' datapoints. But cannot combine dimensions of metadata_node under 'metadata_nodepool' dimensions.
With all Dimensions applied:
Here each datapoint provides all related dimension values. With this information, it is easy to apply multiple filters.
In Azuremonitor receiver, getResourceMetricsValuesRequestOptions func, single dimension key alone provided. Instead all possible dimension keys for the metric have to be given.
Solution:
with metricresource definitions, Generate hash string with all dimensions and store the metrics based on hash instead of single dimension + timegrain filter.
Sample MetricClient REST Request with all dimensions in filter:
https://management.azure.com/subscriptions/test/resourceGroups/aks-dev2-blue/providers/Microsoft.ContainerService/managedClusters/aks-dev2-blue/providers/Microsoft.Insights/metrics?timespan=2023-04-29T02:20:00Z/2023-05-04T04:20:00Z&interval=PT1H&api-version=2018-01-01&metricnamespace=Microsoft.ContainerService/managedClusters&metricnames=node_cpu_usage_millicores&$filter=nodepool eq '*' and node eq '*'
Fixes #21715
Testing: Testdata with multiple dimensions are working.
Documentation: