Skip to content

Logging resource labels use snake_case rather than camelCase #2494

@ofrobots

Description

@ofrobots

Originally reported by @jwgoh in #2484

I tried specifying the monitored resource manually. The keys for labels seems to only take snake_case i.e. project_id and NOT camelCase projectId.

// Works
resource: {
  type: 'gce_instance',
  labels: {
    project_id: projectId,
    instance_id: instanceId,
    zone: zone,
  },
},

// Does not work. Nothing gets logged
resource: {
  type: 'gce_instance',
  labels: {
    projectId: projectId,
    instanceId: instanceId,
    zone: zone,
  },
},

I referred to the documentations here and here when specifying the key-value.

Metadata

Metadata

Labels

api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions