Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

alert samples tests failures #43

Closed
alexander-fenster opened this issue May 5, 2018 · 7 comments · May be fixed by qsays/gvisor#1
Closed

alert samples tests failures #43

alexander-fenster opened this issue May 5, 2018 · 7 comments · May be fixed by qsays/gvisor#1
Assignees
Labels
api: monitoring Issues related to the googleapis/nodejs-monitoring API. nightly-failure 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@alexander-fenster
Copy link
Contributor

The following two samples tests fail in master:

✖ alerts › before Rejected promise returned by test
✖ alerts › after Rejected promise returned by test

Please investigate and fix.

cc: @crwilcox

jmdobry added a commit that referenced this issue May 7, 2018
Makes alert tests more stable and adds a list alert sample.
@ghost ghost added the cla: yes This human has signed the Contributor License Agreement. label May 7, 2018
jmdobry added a commit that referenced this issue May 7, 2018
Makes alert tests more stable and adds a list alert sample.
@jmdobry jmdobry closed this as completed in 35d1a4f May 7, 2018
@ghost ghost removed the cla: yes This human has signed the Contributor License Agreement. label May 7, 2018
@alexander-fenster
Copy link
Contributor Author

They still fail :(

  2 tests failed

  alerts › before

  /var/monitoring/node_modules/grpc/src/common.js:87

  Rejected promise returned by test. Reason:

  Error {
    code: 3,
    details: 'Field alert_policy.conditions[0].condition_absent.filter had an invalid value of "metric.type = "cloudfunctions.googleapis.com/function/execution_count"": must specify a restriction on "resource.type" in the filter; see "https://cloud.google.com/monitoring/api/resources" for a list of available resource types.',
    metadata: Metadata {
      _internal_repr: {},
    },
    message: '3 INVALID_ARGUMENT: Field alert_policy.conditions[0].condition_absent.filter had an invalid value of "metric.type = "cloudfunctions.googleapis.com/function/execution_count"": must specify a restriction on "resource.type" in the filter; see "https://cloud.google.com/monitoring/api/resources" for a list of available resource types.',
  }

  Object.exports.createStatusError (/var/monitoring/node_modules/grpc/src/common.js:87:15)
  Object.onReceiveStatus (/var/monitoring/node_modules/grpc/src/client_interceptors.js:1214:28)
  InterceptingListener._callNext (/var/monitoring/node_modules/grpc/src/client_interceptors.js:590:42)
  InterceptingListener.onReceiveStatus (/var/monitoring/node_modules/grpc/src/client_interceptors.js:640:8)
  callback (/var/monitoring/node_modules/grpc/src/client_interceptors.js:867:24)



  alerts › after

  /var/monitoring/node_modules/grpc/src/common.js:87

  Rejected promise returned by test. Reason:

  Error {
    code: 3,
    details: 'Request was missing field name.',
    metadata: Metadata {
      _internal_repr: {},
    },
    note: 'Exception occurred in retry method that was not classified as transient',
    message: '3 INVALID_ARGUMENT: Request was missing field name.',
  }

  Object.exports.createStatusError (/var/monitoring/node_modules/grpc/src/common.js:87:15)
  Object.onReceiveStatus (/var/monitoring/node_modules/grpc/src/client_interceptors.js:1214:28)
  InterceptingListener._callNext (/var/monitoring/node_modules/grpc/src/client_interceptors.js:590:42)
  InterceptingListener.onReceiveStatus (/var/monitoring/node_modules/grpc/src/client_interceptors.js:640:8)
  callback (/var/monitoring/node_modules/grpc/src/client_interceptors.js:867:24)

@jmdobry
Copy link
Contributor

jmdobry commented May 7, 2018

What project are the tests using, perhaps it needs to enable the Cloud Functions API?

@alexander-fenster
Copy link
Contributor Author

All tests in CI use google-cloud-node project (id long-door-651). Is there any special setup that needs to be done for these two tests?

@jmdobry
Copy link
Contributor

jmdobry commented May 7, 2018

Can you try this?

(you may need to set GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS env vars)

cd nodejs-monitoring/samples
node metrics.js list google-cloud-node | grep function

and print the output?

@jmdobry
Copy link
Contributor

jmdobry commented May 7, 2018

The output I see for the nodejs-docs-samples project is:

$ node metrics list nodejs-docs-samples | grep function
projects/nodejs-docs-samples/metricDescriptors/cloudfunctions.googleapis.com/function/execution_count
projects/nodejs-docs-samples/metricDescriptors/cloudfunctions.googleapis.com/function/execution_times
projects/nodejs-docs-samples/metricDescriptors/cloudfunctions.googleapis.com/function/network_egress
projects/nodejs-docs-samples/metricDescriptors/cloudfunctions.googleapis.com/function/user_memory_bytes

@alexander-fenster
Copy link
Contributor Author

You're right, it does not work for me (I get the same result: the alert tests fail and the other tests pass).

ERROR: { Error: 7 PERMISSION_DENIED: User is not authorized to access the project monitoring records: Permission denied.
    at Object.exports.createStatusError (/usr/local/google/home/fenster/nodejs-packages/nodejs-monitoring/node_modules/grpc/src/common.js:87:15)
    at Object.onReceiveStatus (/usr/local/google/home/fenster/nodejs-packages/nodejs-monitoring/node_modules/grpc/src/client_interceptors.js:1214:28)
    at InterceptingListener._callNext (/usr/local/google/home/fenster/nodejs-packages/nodejs-monitoring/node_modules/grpc/src/client_interceptors.js:590:42)
    at InterceptingListener.onReceiveStatus (/usr/local/google/home/fenster/nodejs-packages/nodejs-monitoring/node_modules/grpc/src/client_interceptors.js:640:8)
    at callback (/usr/local/google/home/fenster/nodejs-packages/nodejs-monitoring/node_modules/grpc/src/client_interceptors.js:867:24)
  code: 7,
  metadata: 
   Metadata {
     _internal_repr: 
      { 'google.rpc.debuginfo-bin': [Array],
        'grpc-status-details-bin': [Array] } },
  details: 'User is not authorized to access the project monitoring records: Permission denied.',
  note: 'Exception occurred in retry method that was not classified as transient' }

Do you know where in the console it should be fixed?

@jmdobry
Copy link
Contributor

jmdobry commented May 7, 2018

Try giving your service account the Monitoring Admin role

@ghost ghost added the cla: yes This human has signed the Contributor License Agreement. label May 7, 2018
@ghost ghost removed the cla: yes This human has signed the Contributor License Agreement. label May 7, 2018
@google-cloud-label-sync google-cloud-label-sync bot added the api: monitoring Issues related to the googleapis/nodejs-monitoring API. label Jan 31, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: monitoring Issues related to the googleapis/nodejs-monitoring API. nightly-failure 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants