Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Initialize the labels map in the response. #264

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stackdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ func NewExporter(o Options) (*Exporter, error) {
}
// Populate internal resource labels for defaulting project_id, location, and
// generic resource labels of applicable monitored resources.
if res.Labels == nil {
res.Labels = make(map[string]string)
}
res.Labels[stackdriverProjectID] = o.ProjectID
res.Labels[resourcekeys.CloudKeyZone] = o.Location
res.Labels[stackdriverGenericTaskNamespace] = "default"
Expand Down