Skip to content
Permalink
Browse files
fix(logging): allow nil or custom zones in resource detection (#3997)
  • Loading branch information
0xSage committed May 3, 2021
1 parent dcfadaf commit aded90b92de3fa3bed079af1aa4879d00572e8ae
Showing 1 changed file with 5 additions and 1 deletion.
@@ -404,7 +404,11 @@ func monitoredResource(parent string) *mrpb.MonitoredResource {
}

func regionFromZone(zone string) string {
return zone[:strings.LastIndex(zone, "-")]
cutoff := strings.LastIndex(zone, "-")
if cutoff > 0 {
return zone[:cutoff]
}
return zone
}

func globalResource(projectID string) *mrpb.MonitoredResource {

0 comments on commit aded90b

Please sign in to comment.