I have been following the instructions on https://cloud.google.com/profiler/docs/profiling-nodejs#gke to use the gcloud profiler for my nodejs application:
I added RUN npm install @google-cloud/profiler
to my dockerfile.
And I added
require('@google-cloud/profiler').start({
serviceContext: {
service: 'your-service',
version: '1.0.1',
},
});
to my app.js file.
I then ran the container on a GKE cluster and got the following error:
@google-cloud/profiler Failed to create profile, waiting 8.6s to try again: Error: generic::permission_denied
By my understanding of the documentation I do not need explicit authentication or permissions to create profiles when running the code from within a gcloud hosted instance.
The error itself isn't very helpful and I am a bit out of my depth here.
I already tried if creating the cluster with --(autoprovisioning-)scopes "https://www.googleapis.com/auth/cloud-platform"
might do the trick, but had no luck either.
Any ideas what might be the issue here?