Skip to content

Metrics fail to be reported with INVALID_ARGUMENT error #2420

@flovouin

Description

@flovouin

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

N/A, I don't understand why this would be required for all bug reports.

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://github.com/googleapis/nodejs-spanner

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Use version 8.2.1, and run the Node.js client within a Cloud Run container (although other execution environments may be affected as well).

A clear and concise description of what the bug is, and what you expected to happen.

When running version 8.2.1 within Cloud Run, I'm getting the following errors :

ERROR: Send TimeSeries failed: 3 INVALID_ARGUMENT: Field resource.labels.project_id had an invalid value of "{{projectId}}": if present, must be the project number or ID in the request name.

Also, both this and the previous (IAM permission-related) error [1] are logged every minute, which generates a lot of useless logs.

[1] When upgrading to the new version of the client, it tries to automatically send the new metrics. Although the Spanner IAM roles are supposed to add the relevant permission, the new monitoring permission must be defined at the project level.
When assigning Spanner roles at the database-level, the monitoring permission is ineffective.
I understand that the Node.js client is not responsible for this permission-related issue. However its default behavior is a problem and generates too many logs in a case that should probably be the default for users (i.e. the client not having the new required permission by default).

This is the second issue (#2373) I post about this feature. Can it be more thoroughly tested, or made opt-in in the mean time?
cc @surbhigarg92

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

I expect a new feature to work, and not to log so many errors when it doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: spannerIssues related to the googleapis/nodejs-spanner API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions