-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
-
Is this a client library issue or a product issue?
This is a client library issue. -
Did someone already solve this?
No, it's not even documented. -
Do you have a support contract?
Support case: 62404497
If the support paths suggested above still do not result in a resolution, please provide the following details.
Environment details
- OS: macOS 15.6.1
- Node.js version: v22.18.0
- npm version: 10.9.3
@google-cloud/loggingversion: 11.2.0
Steps to reproduce
- Create an example bucket in your GCP project and fill it with logs
- Get it's path and set it as a
resourceNames
const { Logging } = require("@google-cloud/logging");
const logging = new Logging();
let [entries] = await logging.getEntries({
resourceNames: ["projects/gcp-project-id-example/locations/europe-west2/buckets/example-bucket/views/_AllLogs"]
});
- You should be getting results. Instead you get 0 entries.
Why
Because your library is enforcing resourceNames at these lines, If I comment them out, I am able to get results.
Reason for it: those lines add an additional projects/gcp-project-id-example in the entry which somehow confuses the API.
Here an example console.log before calling the API:
console.log("getEntries ==> ", reqOpts, gaxOptions);
Result of the log:
getEntries ==> {
resourceNames: [
'projects/gcp-project-id-example/locations/europe-west2/buckets/example-bucket/views/_AllLogs',
'projects/gcp-project-id-example'
]
} { autoPaginate: undefined }