Skip to content

Commit

Permalink
Re-enable workload metrics integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Jan 11, 2022
1 parent 0a1405b commit 162bd01
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 29 deletions.
5 changes: 5 additions & 0 deletions exporter/collector/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Additionally, the previous exporter had a hardcoded list of known metric domains
where this "prefix" would not be used. The new exporter allows full configuration
of this list via the `metric.known_domains` property.

The previous exporter would by default only call CreateMetricDescriptor for metrics with domain
`custom.googleapis.com` or `external.googleapis.com`. The new exporter will try to call
CreateMetricDescriptor regardless of domain, unless `metric.skip_create_descriptor` or
`metric.create_service_timeseries` are true.

Additionally, the DisplayName for a metric used to be exactly the
`{metric_name}`. Now, the metric name is chosen as the full-path after the
domain name of the metric type. E.g. if a metric called
Expand Down
2 changes: 1 addition & 1 deletion exporter/collector/internal/integrationtest/testcases.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ var (
Name: "GKE Workload Metrics",
OTLPInputFixturePath: "testdata/fixtures/workload_metrics.json",
ExpectFixturePath: "testdata/fixtures/workload_metrics_expect.json",
Skip: true,
Configure: func(cfg *collector.Config) {
cfg.MetricConfig.Prefix = "workload.googleapis.com/"
cfg.MetricConfig.SkipCreateMetricDescriptor = true
},
},
{
Expand Down
12 changes: 9 additions & 3 deletions exporter/collector/testdata/fixtures/workload_metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"resource":{
"attributes":[
{
"key":"cloud.zone",
"key":"cloud.availability_zone",
"value":{
"stringValue":"us-central1-c"
}
},
{
"key":"container.name",
"key":"k8s.container.name",
"value":{
"stringValue":"rabbitmq"
}
},
{
"key":"host.name",
"key":"k8s.node.name",
"value":{
"stringValue":"10.92.5.2"
}
Expand Down Expand Up @@ -50,6 +50,12 @@
"value":{
"stringValue":"rabbitmq-server-0"
}
},
{
"key":"cloud.platform",
"value":{
"stringValue":"gcp_kubernetes_engine"
}
}
]
},
Expand Down
65 changes: 40 additions & 25 deletions exporter/collector/testdata/fixtures/workload_metrics_expect.json
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,8 @@
"doubleValue": 192868352
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -1409,7 +1410,8 @@
"doubleValue": 10141614080
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -1622,7 +1624,8 @@
"doubleValue": 687194767
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -1652,7 +1655,8 @@
"doubleValue": 2000000000
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -1742,7 +1746,8 @@
"doubleValue": 60
}
}
]
],
"unit": "s"
},
{
"metric": {
Expand Down Expand Up @@ -1772,7 +1777,8 @@
"doubleValue": 3625.239
}
}
]
],
"unit": "s"
},
{
"metric": {
Expand Down Expand Up @@ -2573,7 +2579,8 @@
"doubleValue": 0
}
}
]
],
"unit": "s"
},
{
"metric": {
Expand Down Expand Up @@ -2784,7 +2791,8 @@
"doubleValue": 2927472
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -2844,7 +2852,8 @@
"doubleValue": 2772
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -2964,7 +2973,8 @@
"doubleValue": 2772
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -2994,7 +3004,8 @@
"doubleValue": 0
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -3024,7 +3035,8 @@
"doubleValue": 2772
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -3084,7 +3096,8 @@
"doubleValue": 0
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -3462,7 +3475,8 @@
"doubleValue": 114277
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -3496,7 +3510,8 @@
"int64Value": "10"
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -3529,7 +3544,8 @@
"doubleValue": 1486743
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -3562,7 +3578,8 @@
"int64Value": "10"
}
}
]
],
"unit": "By"
},
{
"metric": {
Expand Down Expand Up @@ -3595,7 +3612,8 @@
"doubleValue": 1.297912543
}
}
]
],
"unit": "s"
},
{
"metric": {
Expand Down Expand Up @@ -3628,7 +3646,8 @@
"int64Value": "10"
}
}
]
],
"unit": "s"
},
{
"metric": {
Expand Down Expand Up @@ -6307,11 +6326,7 @@
}
}
]
}
]
},
{
"timeSeries": [
},
{
"metric": {
"type": "workload.googleapis.com/erlang_vm_msacc_emulator_seconds_total",
Expand Down Expand Up @@ -6452,7 +6467,7 @@
},
{
"name": "googlecloudmonitoring/point_count",
"val": "200",
"val": "203",
"labels": {
"status": "OK"
}
Expand Down

0 comments on commit 162bd01

Please sign in to comment.