Open MontyCarter opened 3 years ago
https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/blob/42e7e58efdb937e8477f827d3fba022212335dbc/stackdriver.go#L325
This code works when a GKE cluster is zonally deployed, but is incorrect when run against a regional cluster. With a regional cluster, the Location should be the region name, not the underlying zone name.
This needs to use metadataapi.InstanceAttributeValue("cluster-location") (similar to here: https://github.com/knative/pkg/blob/7d1b0f19ef717da9e0df0ce1e35e1ca81627445f/metrics/gcp_metadata.go#L44)
metadataapi.InstanceAttributeValue("cluster-location")
You are probably right. Using the region in regional clusters would match what GKE does for container/pod/cluster metrics.
https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/blob/42e7e58efdb937e8477f827d3fba022212335dbc/stackdriver.go#L325
This code works when a GKE cluster is zonally deployed, but is incorrect when run against a regional cluster. With a regional cluster, the Location should be the region name, not the underlying zone name.
This needs to use
metadataapi.InstanceAttributeValue("cluster-location")
(similar to here: https://github.com/knative/pkg/blob/7d1b0f19ef717da9e0df0ce1e35e1ca81627445f/metrics/gcp_metadata.go#L44)