-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloud logging example is misleading where labels.instance_id has to be STRING #1238
Comments
Can you show the code you're using? The code from the readme works for me. Also, which version of gcloud-node are you running? |
We use: resource = {
type: 'gce_instance',
labels: {
instance_id: instance_id,
zone: zone
}
};
log.write([ logEntry ], function (err, apiResponse) {
if (err) {
logger.error(err);
}
}); |
https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/LogEntry also this say labels are string? labels map (key: string, value: string) |
I was able to reproduce. Thanks for catching this. Any chance you'd be willing to send a PR with the fix for the docs? |
sure, will do |
Fixed by #1241 |
The doc says string for instance_id
var resource = {
type: 'gce_instance',
labels: {
zone: 'global',
instance_id: 3
}
};
yet in practice, you will hit the following if you pass an int. ugh...
{ [ApiError: Invalid value at 'entries[0].resource.labels[0].value' (TYPE_STRING), 1]
errors: undefined,
code: 400,
response: undefined,
message: 'Invalid value at 'entries[0].resource.labels[0].value' (TYPE_STRING), 1' }
The text was updated successfully, but these errors were encountered: