mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
CloudMonitoring: Improve parsing of GCM labels (#69800)
Update parsing of GCM labels - Include parsing of metadata labels
This commit is contained in:
parent
8aae6b679a
commit
9fc1de62d5
@ -13,6 +13,9 @@
|
||||
{
|
||||
"key": "metric.response_code_class",
|
||||
"valueType": "INT64"
|
||||
},
|
||||
{
|
||||
"key": "metadata.app"
|
||||
}
|
||||
],
|
||||
"pointDescriptors": [
|
||||
@ -37,6 +40,9 @@
|
||||
},
|
||||
{
|
||||
"int64Value": "200"
|
||||
},
|
||||
{
|
||||
"stringValue": "test-app"
|
||||
}
|
||||
],
|
||||
"pointData": [
|
||||
|
@ -110,6 +110,7 @@ func TestTimeSeriesQuery(t *testing.T) {
|
||||
labels, ok := custom["labels"].(gdata.Labels)
|
||||
require.True(t, ok)
|
||||
assert.Equal(t, "6724404429462225363", labels["resource.label.instance_id"])
|
||||
assert.Equal(t, "test-app", labels["metadata.label.app"])
|
||||
})
|
||||
|
||||
t.Run("includes time interval", func(t *testing.T) {
|
||||
|
@ -208,7 +208,7 @@ func (ts timeSeriesData) getLabels(labelDescriptors []LabelDescriptor) (data.Lab
|
||||
seriesLabels[key] = labelValue.StringValue
|
||||
}
|
||||
|
||||
if strings.Contains(key, "metric.label") || strings.Contains(key, "resource.label") {
|
||||
if strings.Contains(key, "metric.label") || strings.Contains(key, "resource.label") || strings.Contains(key, "metadata.label") {
|
||||
defaultMetricName += seriesLabels[key] + " "
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user