Open zysimplelife opened 5 years ago
What would be an example resultant metric?
What would be an example resultant metric?
I have just added the expectation result in the description.
That looks like something that should be part of the metric name.
That looks like something that should be part of the metric name.
It would also be a solution. but from the answer in the issue you seems like it is not good idea to put it as part of the metric name
What's an actual example of the metric we produce for the above?
What's an actual example of the metric we produce for the above?
I don't understand the question. the current produced metric has been put in the description above, the expected result is as well.
I'm not sure if this follows all the development rules there, but here's the quick fix for that case
diff --git a/utils.go b/utils.go
index 9088e13..bfe20a5 100644
--- a/utils.go
+++ b/utils.go
@@ -33,6 +33,7 @@ func CreateResourceLabels(resourceID string) map[string]string {
labels := make(map[string]string)
resource := strings.Split(resourceID, "/")
labels["resource_group"] = resource[4]
+ labels["resource_type"] = invalidMetricChars.ReplaceAllString(resource[6], "_")
labels["resource_name"] = resource[8]
if len(resource) > 13 {
labels["sub_resource_name"] = resource[10]
@zysimplelife, as part of issue #64, resource_type
was added as a label of the new azure_resource_info
metric (follow the discussion in issue #64 to understand why it is a separate metric).
For the record, in the specific case you mentioned above, you can now do the following to apply the resource_type
label to your metric, in any PromQL query:
(bitsinpersecond_countpersecond_average * on (resource_group, resource_name) group_left(resource_type) azure_resource_info)
I think that feature would close the current issue.
I am wondering if it is possible to add "resource type" in the exposed metrics labels. for example what I have got is as follows. it shows the "resource_group" and "resource_name" but no "resource type".
Resource type might be a useful information when the user want to filter interesting metrics.
one of the resource related to above metrics in the azure is like
it would be nice to get metric like follows