Skip to content

getApplicationDefault is undefined.  #121

Description

@neoadventist

running the create_custom_metric on line https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/monitoring/create_custom_metric.js#L218

the object google.auth looks like

{ Compute: [Function], JWT: [Function], OAuth2: [Function] }

no getApplicationDefault function

I'm supplying a project id, is there something i'm doing wrong here?

Thanks.

Activity

  1. neoadventist commented on Jun 8, 2016

    @neoadventist
    Author

    trying to use this with stackdriver.

  2. jmdobry commented on Jun 8, 2016

    @jmdobry
    Member

    Can you post your error? And did you set the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS environment variables? See https://github.com/GoogleCloudPlatform/nodejs-docs-samples#prerequisites

  3. neoadventist commented on Jun 8, 2016

    @neoadventist
    Author

    @jmdobry yeah got it working now. I did not have the GOOGLE_APPLICATION_CREDENTIALS env set. now i'm trying to get the custom metric to be visible on a dashboard. Do you know where I can go to for that?

  4. jmdobry commented on Jun 8, 2016

    @jmdobry
    Member

    Have you looked through https://app.google.stackdriver.com/ for your custom metric? You might have to write some data to the custom metric before it will show up. You also might have to create a new dashboard or alert targeting the metric. @waprin probably knows more.

  5. self-assigned this
    on Jun 8, 2016
  6. neoadventist commented on Jun 8, 2016

    @neoadventist
    Author

    There are a thousand sub-menus, but I can't find the metric when I try to add a graph.
    gcloud_custom_metrics

  7. waprin commented on Jun 8, 2016

    @waprin
    Contributor

    You should see "Custom Metrics" as an option under "Resource Type". If you don't, you probably haven't successfully created any custom metric descriptors.

  8. neoadventist commented on Jun 8, 2016

    @neoadventist
    Author

    @waprin any documentation to show me on how to do that?

  9. neoadventist commented on Jun 8, 2016

    @neoadventist
    Author

    so I can successfully create it under the code but not see it in the UI until i make a descriptor?

  10. waprin commented on Jun 8, 2016

    @waprin
    Contributor

    You are creating a metric descriptor, you create metrics when you actually write values to it. As soon as you create it you should be able to see it, one guess at your problem is by default the sample code deletes the metric descriptor after creating it. This was in the interest of keeping projects cleaned up, check to make sure you've commented that part out.

  11. waprin commented on Jun 8, 2016

    @waprin
    Contributor

    Unfortunately I agree the docs no the UI are a bit sparse, working on improving that now but nothing's ready yet.

  12. 17 remaining items

  13. added a commit that references this issue on Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions